/* * Simple な Sample (OpaqueRPC 版) * sSocketClientOpener * +---------------------------------------+ * |cOpener |eOpener * +-------------+ +-------------+ +-------------+ | +-------------+ * | | | | | | V | | * | tTask | sTaskBody | tTaskMain | sTaskBody | tSimple | sSample | tSample | * | Task |-----------| TaskMain |-----------|> Simple |==========|> Sample | * | |cTask eBody| |cBody eBody| |cCall eEnt| | * | |Body | | | | | | * +-------------+ +-------------+ +-------------+ +-------------+ * * * SimpleSample/SimpleSample.cdl を参照 * * rSimple, rSample リージョンに分割し、それぞれを linkunit (リンク単位) とした * * リージョン間には、OpaqueRPCPlugin で OpaqueRPC Channel を挿入する * * TaskMain はチャンネルオープン後、 tSimple を呼び出す */ // cygwin 用の簡易な型定義 import( ); // TECS 対応 TOPPERS/ASP ならば import( ); でよい import( ); import( ); import( ); // シグニチャ sSample signature sSample { ER sayHello( [in]int32_t times ); ER howAreYou( [out,string(len)]char_t *buf, [in]int32_t len ); }; // セルタイプ tSample celltype tSample { entry sSample eEnt; }; // セルタイプ tSimple celltype tSimple { call sSample cCall; entry sTaskBody eBody; }; // セルタイプ tTaskMain (クライアント側チャンネルをオープンするために用いる) celltype tTaskMain { entry sTaskBody eBody; call sTaskBody cBody; call sSocketClientOpener cOpener; }; [linkunit] region rSample { // セル SysLog cell tSysLog SysLog { }; // セル Kernel cell tKernel Kernel { }; // セル Sample cell tSample Sample { }; }; [linkunit, to_through( rSample, OpaqueRPCPlugin, "PPAllocatorSize=1024," "clientChannelCell= 'ClientChannel', " // クライアント側チャンネルセル名 // このオプションでは、複数結合に対応できない // 複数結合に対応するには、複数結合可能なオプション指定とするか、SharedOpaqueRPCPlugin を用いる // 複数結合可能なオプション指定例は test/opaqueRPC 下にサンプルコードがある )] region rSimple { // セル SysLog cell tSysLog SysLog { }; // セル Simple cell tSimple Simple { cCall = rSample::Sample.eEnt; }; // セル TaskMain cell tTaskMain TaskMain { cBody = Simple.eBody; cOpener = ClientChannel.eOpener; }; // セル Task cell tTask Task { cBody = TaskMain.eBody; // TaskMain に変更 priority = 11; stackSize = 1024; taskAttribute = C_EXP( "TA_ACT" ); }; };