2 //=============================================================================
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
12 * @author Aniruddha Gokhale Jeff Parsons
14 //=============================================================================
26 attribute Desc description
; // provides us the coffee object type
29 //typedef sequence<Coffee> ObjSeq;
33 // Add exceptions to each
36 short test_short
(in short s1
,
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
);
48 string test_unbounded_string
(in string s1
,
53 typedef string<128> short_string
;
54 short_string test_bounded_string
(in short_string s1
,
55 inout short_string s2
,
59 wstring test_unbounded_wstring
(in wstring ws1
,
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)
81 Fixed_Struct test_fixed_struct
(in Fixed_Struct s1
,
82 inout Fixed_Struct s2
,
85 // = Sequences of long, strings, Var_Struct and Object
101 typedef sequence
<Step
> PathSpec
;
103 PathSpec test_unbounded_struct_sequence
(in PathSpec s1
,
106 typedef sequence
<short> Short_Seq
;
108 Short_Seq test_short_sequence
(in Short_Seq s1
,
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
,
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
,
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
,
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
,
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
,
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
,
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
191 Var_Struct test_var_struct
(in Var_Struct s1
,
195 // nested structs (We reuse the var_struct defn above to make a very
196 // complicated nested structure)
202 Nested_Struct test_nested_struct
(in Nested_Struct s1
,
203 inout Nested_Struct s2
,
204 out Nested_Struct s3
);
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
);
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
);
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.
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
,
239 const unsigned long DIM2
= 5;
240 typedef string Var_Array
[DIM2
];
242 Var_Array test_var_array
(in Var_Array v1
,
246 // Bounded and unbounced sequences of arrays.
247 typedef sequence
<Fixed_Array
> ArraySeq
;
248 ArraySeq test_array_sequence
(in ArraySeq s1
,
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
262 // To test what happens when an unexpected exception is thrown.
265 unsigned long test_exception
(in unsigned long s1
,
266 inout
unsigned long s2
,
267 out unsigned long s3
)
270 typedef short short32
[32];
271 union Big_Union
switch (short)
274 Fixed_Array the_array
;
276 Coffee the_interface
;
280 short32 another_array
;
284 Short_Seq the_sequence
;
294 Var_Struct the_var_struct
;
296 Fixed_Struct the_fixed_struct
;
298 // Other_Union the_union;
301 Big_Union test_big_union
(in Big_Union u1
,
305 enum Small_Union_Switch
{ A_LONG
, A_SHORT
};
306 union Small_Union
switch (Small_Union_Switch
)
313 Small_Union test_small_union
(in Small_Union u1
,
314 inout Small_Union u2
,
317 // The following two structs are used to help compose
318 // a complex Any for the test function below.
321 string level5_string
;
328 string level9_string
;
330 boolean level9_boolean
;
335 any test_complex_any
(in any ca1
,
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
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
360 union nested_rec_union
;
361 typedef sequence
<nested_rec_union
> Nested_Rec_Seq
;
363 union nested_rec_union
switch (short)
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);