aaronp-zomg 1.0.2.20080827232412

Sign up to get free protection for your applications and to get access to all the features.
Files changed (236) hide show
  1. data/History.txt +25 -0
  2. data/Manifest.txt +238 -0
  3. data/README.txt +59 -0
  4. data/Rakefile +43 -0
  5. data/bin/omfg +56 -0
  6. data/lib/scanner.rex +169 -0
  7. data/lib/yacc.y +861 -0
  8. data/lib/zomg.rb +22 -0
  9. data/lib/zomg/idl.rb +14 -0
  10. data/lib/zomg/idl/nodes/attribute.rb +15 -0
  11. data/lib/zomg/idl/nodes/binary.rb +19 -0
  12. data/lib/zomg/idl/nodes/constant.rb +15 -0
  13. data/lib/zomg/idl/nodes/interface.rb +13 -0
  14. data/lib/zomg/idl/nodes/interface_header.rb +14 -0
  15. data/lib/zomg/idl/nodes/member.rb +14 -0
  16. data/lib/zomg/idl/nodes/node.rb +54 -0
  17. data/lib/zomg/idl/nodes/operation.rb +17 -0
  18. data/lib/zomg/idl/nodes/parameter.rb +18 -0
  19. data/lib/zomg/idl/nodes/typedef.rb +13 -0
  20. data/lib/zomg/idl/nodes/union.rb +14 -0
  21. data/lib/zomg/idl/parser.rb +54 -0
  22. data/lib/zomg/idl/visitable.rb +15 -0
  23. data/lib/zomg/idl/visitors/duhr.rb +24 -0
  24. data/lib/zomg/idl/visitors/ruby_sexp.rb +204 -0
  25. data/lib/zomg/idl/visitors/sexp.rb +274 -0
  26. data/lib/zomg/version.rb +3 -0
  27. data/test/assets/array/array1.idl +60 -0
  28. data/test/assets/array/array2.idl +38 -0
  29. data/test/assets/array/array3.idl +8 -0
  30. data/test/assets/array/array4.idl +7 -0
  31. data/test/assets/array/array5.idl +80 -0
  32. data/test/assets/attribute/grid_0attribs_2methods.idl +16 -0
  33. data/test/assets/attribute/grid_1ROattribs_1attribs_0methods.idl +19 -0
  34. data/test/assets/attribute/grid_1ROattribs_1attribs_1methods.idl +19 -0
  35. data/test/assets/attribute/grid_1ROattribs_1attribs_2methods.idl +17 -0
  36. data/test/assets/attribute/grid_1ROattribs_1methods.idl +16 -0
  37. data/test/assets/attribute/grid_1ROattribs_2methods.idl +16 -0
  38. data/test/assets/attribute/grid_1attribs_1methods.idl +17 -0
  39. data/test/assets/attribute/grid_1attribs_2methods.idl +17 -0
  40. data/test/assets/attribute/grid_2ROattribs_0methods.idl +16 -0
  41. data/test/assets/attribute/grid_2ROattribs_1methods.idl +16 -0
  42. data/test/assets/attribute/grid_2ROattribs_2methods.idl +16 -0
  43. data/test/assets/attribute/grid_2attribs_0methods.idl +19 -0
  44. data/test/assets/attribute/grid_2attribs_1methods.idl +19 -0
  45. data/test/assets/attribute/grid_2attribs_2methods.idl +19 -0
  46. data/test/assets/comment/c_style_comments.idl +63 -0
  47. data/test/assets/comment/comment1.idl +57 -0
  48. data/test/assets/comment/cpp_style_comments.idl +168 -0
  49. data/test/assets/comment/shortform.idl +0 -0
  50. data/test/assets/complex/TestCodeSets.idl +10 -0
  51. data/test/assets/complex/TestIntfContext.idl +13 -0
  52. data/test/assets/complex/TestIntfLongLong.idl +51 -0
  53. data/test/assets/complex/TestIntfWChar.idl +52 -0
  54. data/test/assets/complex/any1.idl +22 -0
  55. data/test/assets/complex/complex1.idl +495 -0
  56. data/test/assets/complex/complex2.idl +730 -0
  57. data/test/assets/complex/complex3.idl +181 -0
  58. data/test/assets/complex/complex4.idl +181 -0
  59. data/test/assets/complex/interop_wchar.idl +60 -0
  60. data/test/assets/constant/constant1.idl +37 -0
  61. data/test/assets/constant/constant2.idl +29 -0
  62. data/test/assets/constant/constant3.idl +50 -0
  63. data/test/assets/constant/constant4.idl +21 -0
  64. data/test/assets/constant/constant5.idl +65 -0
  65. data/test/assets/constant/constant6.idl +144 -0
  66. data/test/assets/constant/constant7.idl +30 -0
  67. data/test/assets/enum/enum1.idl +13 -0
  68. data/test/assets/exception/TestIntfExceptions.idl +69 -0
  69. data/test/assets/exception/TestIntfExceptionsExt_2_0.idl +34 -0
  70. data/test/assets/exception/TestIntfExceptionsExt_2_3.idl +24 -0
  71. data/test/assets/exception/ex1.idl +6 -0
  72. data/test/assets/exception/ex2.idl +18 -0
  73. data/test/assets/exception/ex3.idl +10 -0
  74. data/test/assets/exception/ex4.idl +20 -0
  75. data/test/assets/exception/sc.idl +0 -0
  76. data/test/assets/exception/simple1.idl +18 -0
  77. data/test/assets/exception/simple2.idl +25 -0
  78. data/test/assets/factory/factory1.idl +77 -0
  79. data/test/assets/factory/objref.idl +25 -0
  80. data/test/assets/forward/forward.idl +15 -0
  81. data/test/assets/forward/forward1.idl +13 -0
  82. data/test/assets/forward/fwd_incl1.idl +6 -0
  83. data/test/assets/forward/fwd_incl2.idl +7 -0
  84. data/test/assets/include/a.idl +23 -0
  85. data/test/assets/include/b.idl +16 -0
  86. data/test/assets/include/employee.idl +12 -0
  87. data/test/assets/include/include1.idl +10 -0
  88. data/test/assets/include/include2.idl +5 -0
  89. data/test/assets/include/manager.idl +10 -0
  90. data/test/assets/include/pragma.idl +41 -0
  91. data/test/assets/include/rookie.idl +13 -0
  92. data/test/assets/include/rookiemanager.idl +15 -0
  93. data/test/assets/include/sample.idl +58 -0
  94. data/test/assets/include/sample_incl.idl +406 -0
  95. data/test/assets/inherit/IDL1.idl +18 -0
  96. data/test/assets/inherit/IDL2.idl +18 -0
  97. data/test/assets/inherit/IDL3.idl +18 -0
  98. data/test/assets/inherit/IDL4.idl +17 -0
  99. data/test/assets/inherit/diamond_inheritance.idl +31 -0
  100. data/test/assets/inherit/inherit.idl +27 -0
  101. data/test/assets/limit/longidentifiers.idl +25 -0
  102. data/test/assets/limit/namelens.idl +26 -0
  103. data/test/assets/limit/tpztest.idl +21 -0
  104. data/test/assets/module/module1.idl +29 -0
  105. data/test/assets/module/module2.idl +34 -0
  106. data/test/assets/module/module3.idl +20 -0
  107. data/test/assets/module/module4.idl +15 -0
  108. data/test/assets/nested/nested1.idl +5 -0
  109. data/test/assets/nested/nested2.idl +11 -0
  110. data/test/assets/operations/Benchmark.idl +331 -0
  111. data/test/assets/operations/CCS.idl +82 -0
  112. data/test/assets/operations/TestIntf.idl +40 -0
  113. data/test/assets/operations/TestIntfBasic.idl +653 -0
  114. data/test/assets/operations/atomic.idl +40 -0
  115. data/test/assets/operations/dif2.idl +48 -0
  116. data/test/assets/operations/interface1.idl +16 -0
  117. data/test/assets/operations/parameters.idl +111 -0
  118. data/test/assets/operations/perf.idl +84 -0
  119. data/test/assets/operations/timer.idl +104 -0
  120. data/test/assets/preprocess/base_for_diamond_inheritance_with_macros.idl +17 -0
  121. data/test/assets/preprocess/basic_macro_marshalling.idl +54 -0
  122. data/test/assets/preprocess/diamond_inheritance_with_macros.idl +74 -0
  123. data/test/assets/preprocess/macro1.idl +52 -0
  124. data/test/assets/preprocess/preprocess1.idl +246 -0
  125. data/test/assets/preprocess/preprocess2.idl +3 -0
  126. data/test/assets/recursion/loop.idl +28 -0
  127. data/test/assets/recursion/recursion1.idl +47 -0
  128. data/test/assets/recursion/recursion2.idl +74 -0
  129. data/test/assets/scenarios/filestat.idl +69 -0
  130. data/test/assets/scenarios/gateway.idl +176 -0
  131. data/test/assets/scenarios/library.idl +20 -0
  132. data/test/assets/scenarios/phone.idl +24 -0
  133. data/test/assets/scenarios/ticketservice.idl +118 -0
  134. data/test/assets/scope/scope01.idl +58 -0
  135. data/test/assets/scope/scope02.idl +25 -0
  136. data/test/assets/scope/scope03.idl +22 -0
  137. data/test/assets/scope/scope04.idl +27 -0
  138. data/test/assets/scope/scope05.idl +30 -0
  139. data/test/assets/scope/scope06.idl +51 -0
  140. data/test/assets/scope/scope07.idl +20 -0
  141. data/test/assets/scope/scope08.idl +88 -0
  142. data/test/assets/scope/scope09.idl +21 -0
  143. data/test/assets/scope/scope10.idl +95 -0
  144. data/test/assets/scope/scope11.idl +62 -0
  145. data/test/assets/scope/scope12.idl +117 -0
  146. data/test/assets/scope/scope13.idl +117 -0
  147. data/test/assets/scope/scope14.idl +117 -0
  148. data/test/assets/scope/scope15.idl +117 -0
  149. data/test/assets/scope/scope16.idl +117 -0
  150. data/test/assets/scope/scope17.idl +117 -0
  151. data/test/assets/scope/scope18.idl +117 -0
  152. data/test/assets/scope/scope19.idl +117 -0
  153. data/test/assets/scope/scope20.idl +215 -0
  154. data/test/assets/scope/scope21.idl +215 -0
  155. data/test/assets/scope/scope22.idl +205 -0
  156. data/test/assets/scope/scope23.idl +261 -0
  157. data/test/assets/scope/scope24.idl +376 -0
  158. data/test/assets/scope/scope25.idl +266 -0
  159. data/test/assets/scope/scope26.idl +180 -0
  160. data/test/assets/scope/scope27.idl +184 -0
  161. data/test/assets/scope/scope28.idl +182 -0
  162. data/test/assets/scope/scope29.idl +182 -0
  163. data/test/assets/scope/scope30.idl +40 -0
  164. data/test/assets/scope/scope31.idl +33 -0
  165. data/test/assets/scope/scope32.idl +37 -0
  166. data/test/assets/scope/scope33.idl +50 -0
  167. data/test/assets/scope/scope34.idl +97 -0
  168. data/test/assets/scope/scope35.idl +72 -0
  169. data/test/assets/scope/scope36.idl +167 -0
  170. data/test/assets/scope/scope37.idl +57 -0
  171. data/test/assets/scope/scope38.idl +38 -0
  172. data/test/assets/scope/scope39.idl +38 -0
  173. data/test/assets/scope/scope40.idl +38 -0
  174. data/test/assets/scope/scope41.idl +24 -0
  175. data/test/assets/scope/scope42.idl +64 -0
  176. data/test/assets/scope/scope43.idl +66 -0
  177. data/test/assets/scope/scope44.idl +52 -0
  178. data/test/assets/sequence/sequence1.idl +24 -0
  179. data/test/assets/sequence/sequence2.idl +9 -0
  180. data/test/assets/simple/basictypes1.idl +80 -0
  181. data/test/assets/simple/basictypes2.idl +197 -0
  182. data/test/assets/simple/basictypes3.idl +23 -0
  183. data/test/assets/simple/basictypes4.idl +73 -0
  184. data/test/assets/simple/basictypes5.idl +29 -0
  185. data/test/assets/simple/basictypes6.idl +63 -0
  186. data/test/assets/simple/simple1.idl +45 -0
  187. data/test/assets/simple/simple2.idl +61 -0
  188. data/test/assets/simple/simple3.idl +36 -0
  189. data/test/assets/string/string1.idl +11 -0
  190. data/test/assets/string/string2.idl +29 -0
  191. data/test/assets/struct/struct1.idl +20 -0
  192. data/test/assets/struct/struct2.idl +21 -0
  193. data/test/assets/struct/struct3.idl +42 -0
  194. data/test/assets/struct/struct4.idl +57 -0
  195. data/test/assets/struct/struct5.idl +71 -0
  196. data/test/assets/typecode/orb.idl +0 -0
  197. data/test/assets/typecode/pseudo.idl +25 -0
  198. data/test/assets/typedef/shorthand_typedef_struct_insideIF.idl +17 -0
  199. data/test/assets/typedef/shorthand_typedef_struct_insideIF_noMO.idl +16 -0
  200. data/test/assets/typedef/shorthand_typedef_struct_insideMO.idl +17 -0
  201. data/test/assets/typedef/shorthand_typedef_struct_outsideMO.idl +17 -0
  202. data/test/assets/typedef/typedef1.idl +8 -0
  203. data/test/assets/typedef/typedef2.idl +22 -0
  204. data/test/assets/typedef/typedef_struct_insideIF.idl +18 -0
  205. data/test/assets/typedef/typedef_struct_insideMO.idl +18 -0
  206. data/test/assets/typedef/typedef_struct_outsideMO.idl +18 -0
  207. data/test/assets/union/union1.idl +31 -0
  208. data/test/assets/union/union2.idl +22 -0
  209. data/test/assets/union/union3.idl +26 -0
  210. data/test/conversions/test_attribute.rb +46 -0
  211. data/test/conversions/test_enum.rb +25 -0
  212. data/test/conversions/test_exception.rb +24 -0
  213. data/test/conversions/test_forward_declaration.rb +22 -0
  214. data/test/conversions/test_interface.rb +30 -0
  215. data/test/conversions/test_module.rb +24 -0
  216. data/test/conversions/test_struct.rb +25 -0
  217. data/test/conversions/test_typedef.rb +22 -0
  218. data/test/conversions/test_union.rb +27 -0
  219. data/test/conversions/test_value_box_dcl.rb +22 -0
  220. data/test/helper.rb +23 -0
  221. data/test/simple/test_basictypes1.rb +87 -0
  222. data/test/simple/test_basictypes2.rb +18 -0
  223. data/test/simple/test_basictypes3.rb +32 -0
  224. data/test/simple/test_basictypes4.rb +25 -0
  225. data/test/simple/test_basictypes5.rb +17 -0
  226. data/test/simple/test_basictypes6.rb +19 -0
  227. data/test/simple/test_simple1.rb +40 -0
  228. data/test/simple/test_simple2.rb +48 -0
  229. data/test/simple/test_simple3.rb +20 -0
  230. data/test/test_array.rb +22 -0
  231. data/test/test_assets.rb +33 -0
  232. data/test/test_complex.rb +17 -0
  233. data/test/test_node.rb +16 -0
  234. data/test/test_parser.rb +17 -0
  235. data/test/test_scanner.rb +234 -0
  236. metadata +334 -0
@@ -0,0 +1,40 @@
1
+ module Atomic {
2
+ const short SS = 1;
3
+ const long LL = 1;
4
+ const unsigned short US = 1;
5
+ const unsigned long UL = 1;
6
+ const float FF = 1.1;
7
+ const double DD = 1.2;
8
+ const char CC = 'a';
9
+ const boolean BB = TRUE;
10
+
11
+ interface test {
12
+ short ShortOperation(in short a,
13
+ inout short b,
14
+ out short c);
15
+ long LongOperation(in long a,
16
+ inout long b,
17
+ out long c);
18
+ unsigned short UShortOperation(in unsigned short a,
19
+ inout unsigned short b,
20
+ out unsigned short c);
21
+ unsigned long ULongOperation(in unsigned long a,
22
+ inout unsigned long b,
23
+ out unsigned long c);
24
+ float FloatOperation(in float a,
25
+ inout float b,
26
+ out float c);
27
+ double DoubleOperation(in double a,
28
+ inout double b,
29
+ out double c);
30
+ boolean BooleanOperation(in boolean a,
31
+ inout boolean b,
32
+ out boolean c);
33
+ char CharOperation(in char a,
34
+ inout char b,
35
+ out char c);
36
+ octet OctetOperation(in octet a,
37
+ inout octet b,
38
+ out octet c);
39
+ };
40
+ };
@@ -0,0 +1,48 @@
1
+ /* A test interface for DIF1 */
2
+
3
+ interface ex1
4
+ {
5
+ void op0();
6
+ float op1(in float f, out double d, inout long l);
7
+ double op2(in double d, out long l, inout short s);
8
+ long op3(in long l, out short s, inout unsigned long ul);
9
+ short op4(in short s, out unsigned long ul, inout unsigned short us);
10
+ unsigned long op5(inout unsigned long ul, in unsigned short us, out char c, in boolean b);
11
+ unsigned short op6(out unsigned short us, inout char c);
12
+ };
13
+
14
+ //interface ex3;
15
+
16
+ interface ex2 : ex1
17
+ {
18
+ // operations continued from ex1
19
+ char op7(in char c, out boolean b, inout octet o);
20
+ boolean op8(out boolean b, in octet o);
21
+ octet op9(inout octet o, out string s, in string <10> ls, inout long l);
22
+ string op10(in string s, out string <10> ls);
23
+ string <10> op11(inout string <10> ls, out long l);
24
+ long op12(in long l);
25
+ // ex3 op13(Environment *ev);
26
+ };
27
+
28
+ interface ex3 : ex1
29
+ {
30
+ // attributes
31
+ readonly attribute float float_attribute;
32
+ attribute double double_attribute;
33
+ readonly attribute long long_attribute;
34
+ attribute short short_attribute;
35
+ readonly attribute unsigned long unsigned_long_attribute;
36
+
37
+ };
38
+
39
+ interface ex4 : ex2, ex3
40
+ {
41
+ attribute unsigned short unsigned_short_attribute;
42
+ readonly attribute char char_attribute;
43
+ attribute boolean boolean_attribute;
44
+ readonly attribute octet octet_attribute;
45
+ attribute string string_attribute;
46
+ readonly attribute string <10> limited_string_attribute;
47
+ // readonly attribute ex4 an_object_attribute;
48
+ };
@@ -0,0 +1,16 @@
1
+ typedef sequence <long, 10> long10;
2
+
3
+ interface math {
4
+ short addshort(in short a, in short b);
5
+ short subshort(in short a, in short b);
6
+ short multshort(in short a, in short b);
7
+ long addlong(in long a, in long b);
8
+ long sublong(in long a, in long b);
9
+ long multlong(in long a, in long b);
10
+ long addlonglist(in long10 a);
11
+ long multlonglist(in long10 a);
12
+ };
13
+
14
+ interface a {
15
+ char op(in string <100> s);
16
+ };
@@ -0,0 +1,111 @@
1
+ enum Enumeration {ONE, TWO};
2
+
3
+ struct FStruct {
4
+ short a;
5
+ };
6
+
7
+ struct VStruct {
8
+ string a;
9
+ };
10
+
11
+ union FUnion switch (long) {
12
+ case 1: long x;
13
+ default: char z;
14
+ };
15
+
16
+ union VUnion switch (long) {
17
+ case 1: string a;
18
+ default: char z;
19
+ };
20
+
21
+ typedef long FArray[10];
22
+ typedef string VArray[10];
23
+
24
+ typedef sequence<long,10> BFSequence;
25
+ typedef sequence<long> UFSequence;
26
+
27
+ typedef sequence<string,10> BVSequence;
28
+ typedef sequence<string> UVSequence;
29
+
30
+ interface intf {
31
+ short ShortOperation(in short a,
32
+ inout short b,
33
+ out short c);
34
+ long LongOperation(in long a,
35
+ inout long b,
36
+ out long c);
37
+ long long LongLongOperation(in long long a,
38
+ inout long long b,
39
+ out long long c);
40
+ unsigned short UShortOperation(in unsigned short a,
41
+ inout unsigned short b,
42
+ out unsigned short c);
43
+ unsigned long ULongOperation(in unsigned long a,
44
+ inout unsigned long b,
45
+ out unsigned long c);
46
+ unsigned long long ULongLongOperation(in unsigned long long a,
47
+ inout unsigned long long b,
48
+ out unsigned long long c);
49
+ float FloatOperation(in float a,
50
+ inout float b,
51
+ out float c);
52
+ double DoubleOperation(in double a,
53
+ inout double b,
54
+ out double c);
55
+ boolean BooleanOperation(in boolean a,
56
+ inout boolean b,
57
+ out boolean c);
58
+ char CharOperation(in char a,
59
+ inout char b,
60
+ out char c);
61
+ octet OctetOperation(in octet a,
62
+ inout octet b,
63
+ out octet c);
64
+ Enumeration EnumOperation(in Enumeration a,
65
+ inout Enumeration b,
66
+ out Enumeration c);
67
+ intf ObjectRefOperation(in intf a,
68
+ inout intf b,
69
+ out intf c);
70
+ FStruct FixedStructOperation(in FStruct a,
71
+ inout FStruct b,
72
+ out FStruct c);
73
+ VStruct VarStructOperation(in VStruct a,
74
+ inout VStruct b,
75
+ out VStruct c);
76
+ FUnion FixedUnionOperation(in FUnion a,
77
+ inout FUnion b,
78
+ out FUnion c);
79
+ VUnion VarUnionOperation(in VUnion a,
80
+ inout VUnion b,
81
+ out VUnion c);
82
+ string StringOperation(in string a,
83
+ inout string b,
84
+ out string c);
85
+ string<20> BoundStringOperation(in string<20> a,
86
+ inout string<20> b,
87
+ out string<20> c);
88
+ BFSequence BoundedFixedSequenceOperation(in BFSequence a,
89
+ inout BFSequence b,
90
+ out BFSequence c);
91
+ BVSequence BoundedVarSequenceOperation(in BVSequence a,
92
+ inout BVSequence b,
93
+ out BVSequence c);
94
+ UFSequence FixedSequenceOperation(in UFSequence a,
95
+ inout UFSequence b,
96
+ out UFSequence c);
97
+ UVSequence VarSequenceOperation(in UVSequence a,
98
+ inout UVSequence b,
99
+ out UVSequence c);
100
+ FArray FixedArrayOperation(in FArray a,
101
+ inout FArray b,
102
+ out FArray c);
103
+ VArray VarArrayOperation(in VArray a,
104
+ inout VArray b,
105
+ out VArray c);
106
+ };
107
+
108
+
109
+
110
+
111
+
@@ -0,0 +1,84 @@
1
+ // Comments : IDLs to do performance testing of oneway and req/reply
2
+ // interfaces These tests also include arguments of
3
+ // various types
4
+ //****************************************************************************
5
+
6
+ #ifndef _perf_idl_
7
+ #define _perf_idl_
8
+
9
+ typedef sequence<short> shortSeq;
10
+ typedef sequence<long> longSeq;
11
+ typedef sequence<float> floatSeq;
12
+ typedef sequence<double> doubleSeq;
13
+ typedef sequence<string> stringSeq;
14
+ typedef sequence<char> charSeq;
15
+
16
+ struct PerfStruct {
17
+ short shortVal;
18
+ long longVal;
19
+ float floatVal;
20
+ double doubleVal;
21
+ char charVal;
22
+ string stringVal;
23
+ };
24
+
25
+ typedef sequence<PerfStruct> structSeq;
26
+ typedef PerfStruct structArray[100];
27
+
28
+ interface TestOneway
29
+ {
30
+ oneway void test_no_param();
31
+
32
+ oneway void test_prim_args(in short shortVal, in long longVal,
33
+ in float floatVal, in double doubleVal,
34
+ in char charVal, in string stringVal);
35
+
36
+ oneway void test_struct(in PerfStruct structVal);
37
+
38
+ oneway void test_prim_seq(in shortSeq shortVal, in longSeq longVal,
39
+ in floatSeq floatVal, in doubleSeq doubleVal,
40
+ in charSeq charVal, in stringSeq stringVal);
41
+
42
+ oneway void test_struct_seq(in structSeq structVal);
43
+
44
+ oneway void test_struct_array(in structArray arrayVal);
45
+ };
46
+
47
+ interface TestReqReply
48
+ {
49
+ long test_prim_args(in short shortVal, in long longVal,
50
+ in float floatVal, in double doubleVal,
51
+ in char charVal, in string stringVal,
52
+ inout short inoutShort, inout long inoutLong,
53
+ inout float inoutFloat, inout double inoutDouble,
54
+ inout char inoutChar, inout string inoutString,
55
+ out short outShort, out long outLong,
56
+ out float outFloat, out double outDouble,
57
+ out char outChar, out string outString);
58
+
59
+
60
+ long test_struct_args(in PerfStruct structVal,
61
+ inout PerfStruct inoutStruct,
62
+ out PerfStruct outStruct);
63
+
64
+ long test_prim_seq(in shortSeq shortVal, in longSeq longVal,
65
+ in floatSeq floatVal, in doubleSeq doubleVal,
66
+ in charSeq charVal, in stringSeq stringVal,
67
+ inout shortSeq inoutShort, inout longSeq inoutLong,
68
+ inout floatSeq inoutFloat, inout doubleSeq inoutDouble,
69
+ inout charSeq inoutChar, inout stringSeq inoutString,
70
+ out shortSeq outShort, out longSeq outLong,
71
+ out floatSeq outFloat, out doubleSeq outDouble,
72
+ out charSeq outChar, out stringSeq outString);
73
+
74
+ long test_struct_seq(in structSeq structVal,
75
+ inout structSeq inoutStruct,
76
+ out structSeq outStruct);
77
+
78
+ long test_struct_array(in structArray structVal,
79
+ inout structArray inoutStruct,
80
+ out structArray outStruct);
81
+ };
82
+
83
+
84
+ #endif
@@ -0,0 +1,104 @@
1
+ // Description : Orbix's Performance IDL
2
+ //
3
+ //
4
+ // The original form of this timer benchmark came from:
5
+ //
6
+ // Prasad Mokkapati
7
+ // Post Modern Computing
8
+ // 1897 Landing Drive
9
+ // Mountain View
10
+ // Ca - 94043
11
+ //
12
+ // email: prasad@promoco.com
13
+ //
14
+ //
15
+ // to whom all credit is ascribed.
16
+ //
17
+ // This code is reproduced with permission from Post Modern Computing.
18
+ //
19
+
20
+
21
+ #ifndef _perf_idl_
22
+ #define _perf_idl_
23
+
24
+ // IDLs to do performance testing of oneway and req/reply interfaces
25
+ // These tests also include arguments of various types
26
+
27
+
28
+
29
+ typedef sequence<short> shortSeq;
30
+ typedef sequence<long> longSeq;
31
+ typedef sequence<float> floatSeq;
32
+ typedef sequence<double> doubleSeq;
33
+ typedef sequence<string> stringSeq;
34
+ typedef sequence<char> charSeq;
35
+
36
+ struct PerfStruct {
37
+ short shortVal;
38
+ long longVal;
39
+ float floatVal;
40
+ double doubleVal;
41
+ char charVal;
42
+ string stringVal;
43
+ };
44
+
45
+ typedef sequence<PerfStruct> structSeq;
46
+ typedef PerfStruct structArray[100];
47
+
48
+ interface TestOneway
49
+ {
50
+ oneway void test_no_param();
51
+
52
+ oneway void test_prim_args(in short shortVal, in long longVal,
53
+ in float floatVal, in double doubleVal,
54
+ in char charVal, in string stringVal);
55
+
56
+ oneway void test_struct(in PerfStruct structVal);
57
+
58
+ oneway void test_prim_seq(in shortSeq shortVal, in longSeq longVal,
59
+ in floatSeq floatVal, in doubleSeq doubleVal,
60
+ in charSeq charVal, in stringSeq stringVal);
61
+
62
+ oneway void test_struct_seq(in structSeq structVal);
63
+
64
+ oneway void test_struct_array(in structArray arrayVal);
65
+ };
66
+
67
+ interface TestReqReply
68
+ {
69
+ long test_prim_args(in short shortVal, in long longVal,
70
+ in float floatVal, in double doubleVal,
71
+ in char charVal, in string stringVal,
72
+ inout short inoutShort, inout long inoutLong,
73
+ inout float inoutFloat, inout double inoutDouble,
74
+ inout char inoutChar, inout string inoutString,
75
+ out short outShort, out long outLong,
76
+ out float outFloat, out double outDouble,
77
+ out char outChar, out string outString);
78
+
79
+
80
+ long test_struct_args(in PerfStruct structVal,
81
+ inout PerfStruct inoutStruct,
82
+ out PerfStruct outStruct);
83
+
84
+ long test_prim_seq(in shortSeq shortVal, in longSeq longVal,
85
+ in floatSeq floatVal, in doubleSeq doubleVal,
86
+ in charSeq charVal, in stringSeq stringVal,
87
+ inout shortSeq inoutShort, inout longSeq inoutLong,
88
+ inout floatSeq inoutFloat, inout doubleSeq inoutDouble,
89
+ inout charSeq inoutChar, inout stringSeq inoutString,
90
+ out shortSeq outShort, out longSeq outLong,
91
+ out floatSeq outFloat, out doubleSeq outDouble,
92
+ out charSeq outChar, out stringSeq outString);
93
+
94
+ long test_struct_seq(in structSeq structVal,
95
+ inout structSeq inoutStruct,
96
+ out structSeq outStruct);
97
+
98
+ long test_struct_array(in structArray structVal,
99
+ inout structArray inoutStruct,
100
+ out structArray outStruct);
101
+ };
102
+
103
+
104
+ #endif
@@ -0,0 +1,17 @@
1
+
2
+ struct mystruct
3
+ {
4
+ short x;
5
+ long y;
6
+ string z;
7
+ };
8
+
9
+ typedef mystruct struct_long_form;
10
+
11
+
12
+ typedef struct mystruct1
13
+ {
14
+ short x;
15
+ long y;
16
+ string z;
17
+ } struct_short_form;
@@ -0,0 +1,54 @@
1
+ // TEST basic marshaling tests for all IDL primitive types, modes
2
+ //
3
+ // This test omits constructed types (struct, union, enum, sequence, and
4
+ // array types), and only tests very simple user defined exceptions.
5
+ //
6
+ // Values returned are well defined functions of the input values:
7
+ //
8
+ // * For numeric types (octet, short, long, longlong, float, double,
9
+ // longdouble, and unsigned variants) the value is cubed.
10
+ // * For Boolean, it's the negation.
11
+ // * For Any, TypeCode, Principal, Object, char and wchar,
12
+ // string and wstring, it's the input value.
13
+ //
14
+ // The "return" and "out" parameter is the function of the "in" parameter;
15
+ // the "inout" parameter is the function of its original value.
16
+ //
17
+
18
+ #define DECL_TEST(type) \
19
+ type test_ ## type ( in type a1, out type a2, inout type a3)
20
+
21
+ #pragma prefix "Eng.SUN.COM" // only for Sun-defined interfaces
22
+
23
+ interface test1 {
24
+ void test_void ();
25
+
26
+ typedef unsigned short ushort;
27
+ typedef unsigned long ulong;
28
+
29
+ DECL_TEST (short);
30
+ DECL_TEST (long);
31
+ DECL_TEST (ushort);
32
+ DECL_TEST (ulong);
33
+ DECL_TEST (float);
34
+ DECL_TEST (double);
35
+ DECL_TEST (boolean);
36
+ DECL_TEST (char);
37
+ DECL_TEST (octet);
38
+ DECL_TEST (string); // unbounded string
39
+ DECL_TEST (Object);
40
+ // All cases, "case_num" in the exception is the same as the 'in' param
41
+ // * negative or zero, throws x1
42
+ // * positive even cases, throws x2 with obj = null objref
43
+ // * positive odd cases, throws x2 with obj = target objref
44
+ //
45
+ exception x1 { long case_num; };
46
+ exception x2 { Object obj; long value;};
47
+ void test_throw (in long case_num) raises (x1, x2);
48
+
49
+ //
50
+ // Aid for test cleanup in case server's not told to quit after
51
+ // being idle for some time period
52
+ //
53
+ oneway void please_exit ();
54
+ };