source: SimpleSample/trunk/SimpleSampleOpaqueRPC/SimpleSample.cdl@ 34

Last change on this file since 34 was 34, checked in by okuma-top, 12 years ago

totally brush up

File size: 2.8 KB
Line 
1/*
2 * Simple な Sample (OpaqueRPC 版)
3 * sSocketClientOpener
4 * +---------------------------------------+
5 * |cOpener |eOpener
6 * +-------------+ +-------------+ +-------------+ | +-------------+
7 * | | | | | | V | |
8 * | tTask | sTaskBody | tTaskMain | sTaskBody | tSimple | sSample | tSample |
9 * | Task |-----------| TaskMain |-----------|> Simple |==========|> Sample |
10 * | |cTask eBody| |cBody eBody| |cCall eEnt| |
11 * | |Body | | | | | |
12 * +-------------+ +-------------+ +-------------+ +-------------+
13 *
14 * * SimpleSample/SimpleSample.cdl を参照
15 * * rSimple, rSample リージョンに分割し、それぞれを linkunit (リンク単位) とした
16 * * リージョン間には、OpaqueRPCPlugin で OpaqueRPC Channel を挿入する
17 * * TaskMain はチャンネルオープン後、 tSimple を呼び出す
18 */
19
20
21// cygwin 用の簡易な型定義
22import( <cygwin_kernel.cdl> );
23 // TECS 対応 TOPPERS/ASP ならば import( <kernel.cdl> ); でよい
24
25import( <tSysLog.cdl> );
26import( <rpc.cdl> );
27import( <tSocketChannel.cdl> );
28
29// シグニチャ sSample
30signature sSample {
31 ER sayHello( [in]int32_t times );
32 ER howAreYou( [out,string(len)]char_t *buf, [in]int32_t len );
33};
34
35// セルタイプ tSample
36celltype tSample {
37 entry sSample eEnt;
38};
39
40// セルタイプ tSimple
41celltype tSimple {
42 call sSample cCall;
43 entry sTaskBody eBody;
44};
45
46// セルタイプ tTaskMain (クライアント側チャンネルをオープンするために用いる)
47celltype tTaskMain {
48 entry sTaskBody eBody;
49 call sTaskBody cBody;
50 call sSocketClientOpener cOpener;
51};
52
53[linkunit]
54region rSample {
55 // セル SysLog
56 cell tSysLog SysLog {
57 };
58 // セル Kernel
59 cell tKernel Kernel {
60 };
61 // セル Sample
62 cell tSample Sample {
63 };
64};
65
66[linkunit,
67 to_through( rSample, OpaqueRPCPlugin,
68 "PPAllocatorSize=1024,"
69 "clientChannelCell= 'ClientChannel', " // クライアント側チャンネルセル名
70 // このオプションでは、複数結合に対応できない
71 // 複数結合に対応するには、複数結合可能なオプション指定とするか、SharedOpaqueRPCPlugin を用いる
72 // 複数結合可能なオプション指定例は test/opaqueRPC 下にサンプルコードがある
73)]
74region rSimple {
75 // セル SysLog
76 cell tSysLog SysLog {
77 };
78 // セル Simple
79 cell tSimple Simple {
80 cCall = rSample::Sample.eEnt;
81 };
82 // セル TaskMain
83 cell tTaskMain TaskMain {
84 cBody = Simple.eBody;
85 cOpener = ClientChannel.eOpener;
86 };
87 // セル Task
88 cell tTask Task {
89 cBody = TaskMain.eBody; // TaskMain に変更
90 priority = 11;
91 stackSize = 1024;
92 taskAttribute = C_EXP( "TA_ACT" );
93 };
94};
Note: See TracBrowser for help on using the repository browser.