Interstage Application Server アプリケーション作成ガイド (CORBAサービス編) |
目次
索引
![]() ![]() |
第3章 アプリケーションの開発(C言語) | > 3.2 クライアントアプリケーションのプログラミング(動的起動インタフェース) |
CORBA_Object_create_request()により、リクエストオブジェクトを作成します。リクエストオブジェクトに対して、サーバオブジェクトのオブジェクトリファレンス、NVListオブジェクトリファレンス、後述するNamedValueと呼ぶサーバの処理結果を格納する領域を指定します。結果として、リクエストオブジェクトのオブジェクトリファレンスが返されます。
CORBA_NamedValue result; /* 復帰 */ result.argument._type = TC_ODdemo_calculator_result; /* 復帰パラメタの型 */ result.len = sizeof( ODdemo_calculator_result ); /* 復帰パラメタの長さ */ result.argument._value = NULL; /*リクエストオブジェクトの生成 */ CORBA_Object_create_request( obj, /* サーバアプリケーションのオブジェクトリファレンス */ CORBA_OBJECT_NIL, /* context */ "calculate", /* メソッド名 */ arg_list, /* 入力パラメタ */ &result, /* 復帰値 */ &request, CORBA_OUT_LIST_MEMORY, &env );
NamedValueは、サーバの処理結果を格納するための領域であり、以下のように定義されています。
IDLファイルの定義例を以下に示します。
module CORBA { struct NamedValue { identifier name; /* パラメタの名前 */ any argument; /* パラメタの値 */ long len; /* パラメタの長さ */ Flags arg_modes; /* パラメタの引き渡し方法(in,out, inout) */ }; };
C言語でのNamedValueの定義を以下に示します。
struct CORBA_NamedValue { CORBA_identifier name; /* パラメタの名前 */ CORBA_any argument; /* パラメタの値 */ CORBA_long len; /* パラメタの長さ */ CORBA_Flags arg_modes; /* パラメタの引き渡し方法(in,out,inout) */ };
目次
索引
![]() ![]() |