Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / performance-tests / Anyop / test.idl
blobe75b3fcc79f77b80def49d5282139d86943da8cb
2 //=============================================================================
3 /**
4 * @file test.idl
6 * The basis for this file is the IDL file in TAO/tests/Param_Test
7 * but modified slightly for testing the performance of Any
8 * insertion and extraction operators. Not every IDL type in this
9 * file is tested yet.
12 * @author Aniruddha Gokhale Jeff Parsons
14 //=============================================================================
17 #include <orb.idl>
19 interface Coffee
21 struct Desc
23 string name;
26 attribute Desc description; // provides us the coffee object type
29 //typedef sequence<Coffee> ObjSeq;
31 interface Param_Test
33 // Add exceptions to each
35 // primitive types
36 short test_short (in short s1,
37 inout short s2,
38 out short s3);
40 // NOTE: use unsigned long long instead of long long, because
41 // unsigned long long has much better support on platforms that
42 // do not have a native 64 bit int type.
43 unsigned long long test_ulonglong (in unsigned long long s1,
44 inout unsigned long long s2,
45 out unsigned long long s3);
47 // strings unbounded
48 string test_unbounded_string (in string s1,
49 inout string s2,
50 out string s3);
52 // strings bounded
53 typedef string<128> short_string;
54 short_string test_bounded_string (in short_string s1,
55 inout short_string s2,
56 out short_string s3);
58 // wstrings unbounded
59 wstring test_unbounded_wstring (in wstring ws1,
60 inout wstring ws2,
61 out wstring ws3);
63 // wstrings bounded
64 typedef wstring<128> short_wstring;
65 short_wstring test_bounded_wstring (in short_wstring ws1,
66 inout short_wstring ws2,
67 out short_wstring ws3);
69 // structures (fixed size)
70 struct Fixed_Struct
72 long l;
73 char c;
74 short s;
75 octet o;
76 float f;
77 boolean b;
78 double d;
81 Fixed_Struct test_fixed_struct (in Fixed_Struct s1,
82 inout Fixed_Struct s2,
83 out Fixed_Struct s3);
85 // = Sequences of long, strings, Var_Struct and Object
86 // references...
89 struct NameComponent
91 string id;
92 string kind;
95 struct Step
97 NameComponent name;
98 boolean process;
101 typedef sequence<Step> PathSpec;
103 PathSpec test_unbounded_struct_sequence (in PathSpec s1,
104 inout PathSpec s2,
105 out PathSpec s3);
106 typedef sequence<short> Short_Seq;
108 Short_Seq test_short_sequence (in Short_Seq s1,
109 inout Short_Seq s2,
110 out Short_Seq s3);
112 typedef sequence<short,32> Bounded_Short_Seq;
113 Bounded_Short_Seq test_bounded_short_sequence (in Bounded_Short_Seq s1,
114 inout Bounded_Short_Seq s2,
115 out Bounded_Short_Seq s3);
117 typedef sequence<long> Long_Seq;
118 Long_Seq test_long_sequence (in Long_Seq s1,
119 inout Long_Seq s2,
120 out Long_Seq s3);
122 typedef sequence<long,32> Bounded_Long_Seq;
123 Bounded_Long_Seq test_bounded_long_sequence (in Bounded_Long_Seq s1,
124 inout Bounded_Long_Seq s2,
125 out Bounded_Long_Seq s3);
127 typedef sequence<string> StrSeq;
128 StrSeq test_strseq (in StrSeq s1,
129 inout StrSeq s2,
130 out StrSeq s3);
132 typedef sequence<string,32> Bounded_StrSeq;
133 Bounded_StrSeq test_bounded_strseq (in Bounded_StrSeq s1,
134 inout Bounded_StrSeq s2,
135 out Bounded_StrSeq s3);
137 typedef sequence<wstring> WStrSeq;
138 WStrSeq test_wstrseq (in WStrSeq ws1,
139 inout WStrSeq ws2,
140 out WStrSeq ws3);
142 typedef sequence<wstring,32> Bounded_WStrSeq;
143 Bounded_WStrSeq test_bounded_wstrseq (in Bounded_WStrSeq ws1,
144 inout Bounded_WStrSeq ws2,
145 out Bounded_WStrSeq ws3);
147 typedef sequence<Fixed_Struct> StructSeq;
148 StructSeq test_struct_sequence (in StructSeq s1,
149 inout StructSeq s2,
150 out StructSeq s3);
152 typedef sequence<Fixed_Struct,32> Bounded_StructSeq;
153 Bounded_StructSeq test_bounded_struct_sequence (in Bounded_StructSeq s1,
154 inout Bounded_StructSeq s2,
155 out Bounded_StructSeq s3);
157 typedef sequence<Coffee> Coffee_Mix;
158 Coffee_Mix test_coffe_mix (in Coffee_Mix s1,
159 inout Coffee_Mix s2,
160 out Coffee_Mix s3);
162 typedef sequence<Coffee,32> Bounded_Coffee_Mix;
163 Bounded_Coffee_Mix test_bounded_coffe_mix (in Bounded_Coffee_Mix s1,
164 inout Bounded_Coffee_Mix s2,
165 out Bounded_Coffee_Mix s3);
168 typedef sequence<any> AnySeq;
169 AnySeq test_anyseq (in AnySeq s1,
170 inout AnySeq s2,
171 out AnySeq s3);
173 /* typedef sequence<any, 32> Bounded_AnySeq;
174 Bounded_AnySeq test_bounded_anyseq (in Bounded_AnySeq s1,
175 inout Bounded_AnySeq s2,
176 out Bounded_AnySeq s3);
179 typedef string DUMMY;
180 // variable structures
181 struct Var_Struct
183 double dbl;
184 DUMMY dummy1;
185 boolean boole;
186 DUMMY dummy2;
187 short shrt;
188 StrSeq seq;
191 Var_Struct test_var_struct (in Var_Struct s1,
192 inout Var_Struct s2,
193 out Var_Struct s3);
195 // nested structs (We reuse the var_struct defn above to make a very
196 // complicated nested structure)
197 struct Nested_Struct
199 Var_Struct vs;
202 Nested_Struct test_nested_struct (in Nested_Struct s1,
203 inout Nested_Struct s2,
204 out Nested_Struct s3);
206 // object references
207 Coffee make_coffee (); // make a Coffee object
209 // test the parameter passing conventions for ObjRefs
210 Coffee test_objref (in Coffee o1, inout Coffee o2, out Coffee o3);
212 // test typecodes
213 CORBA::TypeCode test_typecode (in CORBA::TypeCode t1,
214 inout CORBA::TypeCode t2,
215 out CORBA::TypeCode t3);
217 // Anys. We try to pump in all kinds of data types thru these Anys
218 any test_any (in any a1, inout any a2, out any a3);
220 struct Objref_Struct
222 long x;
223 Coffee y;
225 Objref_Struct test_objref_struct (in Objref_Struct t1,
226 inout Objref_Struct t2,
227 out Objref_Struct t3);
228 // test structures that contain object references.
230 // arrays (fixed)
231 const unsigned long DIM1 = 10;
232 typedef long Fixed_Array [DIM1];
234 Fixed_Array test_fixed_array (in Fixed_Array l1,
235 inout Fixed_Array l2,
236 out Fixed_Array l3);
238 // arrays (variable)
239 const unsigned long DIM2 = 5;
240 typedef string Var_Array [DIM2];
242 Var_Array test_var_array (in Var_Array v1,
243 inout Var_Array v2,
244 out Var_Array v3);
246 // Bounded and unbounced sequences of arrays.
247 typedef sequence<Fixed_Array> ArraySeq;
248 ArraySeq test_array_sequence (in ArraySeq s1,
249 inout ArraySeq s2,
250 out ArraySeq s3);
252 typedef sequence<Fixed_Array, 32> Bounded_ArraySeq;
253 Bounded_ArraySeq test_bounded_array_sequence (in Bounded_ArraySeq s1,
254 inout Bounded_ArraySeq s2,
255 out Bounded_ArraySeq s3);
257 // Just to test report a problem
258 exception Ooops {
259 string reason;
260 unsigned long input;
262 // To test what happens when an unexpected exception is thrown.
263 exception BadBoy {
265 unsigned long test_exception (in unsigned long s1,
266 inout unsigned long s2,
267 out unsigned long s3)
268 raises (Ooops);
270 typedef short short32[32];
271 union Big_Union switch (short)
273 case 0:
274 Fixed_Array the_array;
275 case 1:
276 Coffee the_interface;
277 case 2:
278 long the_long;
279 case 3:
280 short32 another_array;
281 case 4:
282 string the_string;
283 case 5:
284 Short_Seq the_sequence;
285 case 6:
286 any the_any;
287 case 7:
288 octet the_octet;
289 case 8:
290 char the_char;
291 case 9:
292 boolean the_boolean;
293 case 10:
294 Var_Struct the_var_struct;
295 case 11:
296 Fixed_Struct the_fixed_struct;
297 // case 12:
298 // Other_Union the_union;
301 Big_Union test_big_union (in Big_Union u1,
302 inout Big_Union u2,
303 out Big_Union u3);
305 enum Small_Union_Switch { A_LONG, A_SHORT };
306 union Small_Union switch (Small_Union_Switch)
308 case A_LONG:
309 long the_long;
310 case A_SHORT:
311 short the_short;
313 Small_Union test_small_union (in Small_Union u1,
314 inout Small_Union u2,
315 out Small_Union u3);
317 // The following two structs are used to help compose
318 // a complex Any for the test function below.
319 struct level4
321 string level5_string;
323 any level5_any;
326 struct level8
328 string level9_string;
330 boolean level9_boolean;
332 short level9_short;
335 any test_complex_any (in any ca1,
336 inout any ca2,
337 out any ca3);
339 // Recursive structs. Contains a sequence of itself.
340 // Use of forward due to deprecation of anonymous types
341 // Test used to use anon type to define the children value.
344 struct Recursive_Struct;
345 typedef sequence<Recursive_Struct> Recursive_Seq;
347 struct Recursive_Struct
349 long x;
351 Recursive_Seq children;
354 Recursive_Struct test_recursive_struct (in Recursive_Struct rs1,
355 inout Recursive_Struct rs2,
356 out Recursive_Struct rs3);
358 // Recursive unions. We have one recursive union nested in a different
359 // recursive union.
360 union nested_rec_union;
361 typedef sequence<nested_rec_union> Nested_Rec_Seq;
363 union nested_rec_union switch (short)
365 case 0: long value;
366 case 1: Nested_Rec_Seq nested_rec_member;
369 union Recursive_Union;
370 typedef sequence<Recursive_Union> Recursive_Union_Seq;
373 union Recursive_Union switch (short)
375 case 0: Recursive_Union_Seq rec_member;
376 case 1: nested_rec_union nested_member;
379 Recursive_Union test_recursive_union (in Recursive_Union ru1,
380 inout Recursive_Union ru2,
381 out Recursive_Union ru3);
383 // multidimensional arrays (fixed). The following will give rise to a 3
384 // dimensional array. The following will define a 3-dimensional array of size
385 // DIM1 X DIM2 X DIM3
386 const unsigned long DIM3 = 3;
388 typedef Fixed_Array Multdim_Array [DIM2][DIM3];
390 Multdim_Array test_multdim_array (in Multdim_Array m1,
391 inout Multdim_Array m2,
392 out Multdim_Array m3);
394 // sequence of typecodes
395 // typedef sequence<TypeCode> TypeCodeSeq;
396 // TypeCodeSeq test_tcseq (in TypeCodeSeq t1, inout TypeCodeSeq t2, out TypeCodeSeq t3);