2 //=============================================================================
6 * This IDL description is used to test all the parameter passing modes (in,
7 * inout, out, and return) for a number of IDL data types. The goal is to
8 * verify the correctness of the generated stubs and skeletons, and the
9 * the marshaling engine of TAO.
11 * @author Aniruddha Gokhale
13 //=============================================================================
17 #include
"tao/AnyTypeCode/AnySeq.pidl"
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 CORBA
::ShortSeq test_short_sequence
(in CORBA
::ShortSeq s1
,
107 inout CORBA
::ShortSeq s2
,
108 out CORBA
::ShortSeq s3
);
110 typedef sequence
<short,32> Bounded_Short_Seq
;
111 Bounded_Short_Seq test_bounded_short_sequence
(in Bounded_Short_Seq s1
,
112 inout Bounded_Short_Seq s2
,
113 out Bounded_Short_Seq s3
);
115 CORBA
::LongSeq test_long_sequence
(in CORBA
::LongSeq s1
,
116 inout CORBA
::LongSeq s2
,
117 out CORBA
::LongSeq s3
);
119 typedef sequence
<long,32> Bounded_Long_Seq
;
120 Bounded_Long_Seq test_bounded_long_sequence
(in Bounded_Long_Seq s1
,
121 inout Bounded_Long_Seq s2
,
122 out Bounded_Long_Seq s3
);
124 CORBA
::StringSeq test_strseq
(in CORBA
::StringSeq s1
,
125 inout CORBA
::StringSeq s2
,
126 out CORBA
::StringSeq s3
);
128 typedef sequence
<string,32> Bounded_StrSeq
;
129 Bounded_StrSeq test_bounded_strseq
(in Bounded_StrSeq s1
,
130 inout Bounded_StrSeq s2
,
131 out Bounded_StrSeq s3
);
133 CORBA
::WStringSeq test_wstrseq
(in CORBA
::WStringSeq ws1
,
134 inout CORBA
::WStringSeq ws2
,
135 out CORBA
::WStringSeq ws3
);
137 typedef sequence
<wstring
,32> Bounded_WStrSeq
;
138 Bounded_WStrSeq test_bounded_wstrseq
(in Bounded_WStrSeq ws1
,
139 inout Bounded_WStrSeq ws2
,
140 out Bounded_WStrSeq ws3
);
142 typedef sequence
<Fixed_Struct
> StructSeq
;
143 StructSeq test_struct_sequence
(in StructSeq s1
,
147 typedef sequence
<Fixed_Struct
,32> Bounded_StructSeq
;
148 Bounded_StructSeq test_bounded_struct_sequence
(in Bounded_StructSeq s1
,
149 inout Bounded_StructSeq s2
,
150 out Bounded_StructSeq s3
);
152 typedef sequence
<Coffee
> Coffee_Mix
;
153 Coffee_Mix test_coffe_mix
(in Coffee_Mix s1
,
157 typedef sequence
<Coffee
,32> Bounded_Coffee_Mix
;
158 Bounded_Coffee_Mix test_bounded_coffe_mix
(in Bounded_Coffee_Mix s1
,
159 inout Bounded_Coffee_Mix s2
,
160 out Bounded_Coffee_Mix s3
);
162 CORBA
::AnySeq test_anyseq
(in CORBA
::AnySeq s1
,
163 inout CORBA
::AnySeq s2
,
164 out CORBA
::AnySeq s3
);
166 /* typedef sequence<any, 32> Bounded_AnySeq;
167 Bounded_AnySeq test_bounded_anyseq (in Bounded_AnySeq s1,
168 inout Bounded_AnySeq s2,
169 out Bounded_AnySeq s3);
172 typedef string DUMMY
;
173 // variable structures
181 CORBA
::StringSeq seq
;
184 Var_Struct test_var_struct
(in Var_Struct s1
,
188 // nested structs (We reuse the var_struct defn above to make a very
189 // complicated nested structure)
195 Nested_Struct test_nested_struct
(in Nested_Struct s1
,
196 inout Nested_Struct s2
,
197 out Nested_Struct s3
);
200 Coffee make_coffee
(); // make a Coffee object
202 // test the parameter passing conventions for ObjRefs
203 Coffee test_objref
(in Coffee o1
, inout Coffee o2
, out Coffee o3
);
206 CORBA
::TypeCode test_typecode
(in CORBA
::TypeCode t1
,
207 inout CORBA
::TypeCode t2
,
208 out CORBA
::TypeCode t3
);
210 // Anys. We try to pump in all kinds of data types thru these Anys
211 any test_any
(in any a1
, inout any a2
, out any a3
);
218 Objref_Struct test_objref_struct
(in Objref_Struct t1
,
219 inout Objref_Struct t2
,
220 out Objref_Struct t3
);
221 // test structures that contain object references.
224 const unsigned long DIM1
= 10;
225 typedef long Fixed_Array
[DIM1
];
227 Fixed_Array test_fixed_array
(in Fixed_Array l1
,
228 inout Fixed_Array l2
,
232 const unsigned long DIM2
= 5;
233 typedef string Var_Array
[DIM2
];
235 Var_Array test_var_array
(in Var_Array v1
,
239 // Bounded and unbounced sequences of arrays.
240 typedef sequence
<Fixed_Array
> ArraySeq
;
241 ArraySeq test_array_sequence
(in ArraySeq s1
,
245 typedef sequence
<Fixed_Array
, 32> Bounded_ArraySeq
;
246 Bounded_ArraySeq test_bounded_array_sequence
(in Bounded_ArraySeq s1
,
247 inout Bounded_ArraySeq s2
,
248 out Bounded_ArraySeq s3
);
250 // Just to test report a problem
255 // To test what happens when an unexpected exception is thrown.
258 unsigned long test_exception
(in unsigned long s1
,
259 inout
unsigned long s2
,
260 out unsigned long s3
)
263 typedef short short_array
[32];
265 union Big_Union
switch (short)
268 Fixed_Array the_array
;
270 Coffee the_interface
;
274 short_array another_array
;
278 CORBA
::ShortSeq the_sequence
;
288 Var_Struct the_var_struct
;
290 Fixed_Struct the_fixed_struct
;
292 // Other_Union the_union;
295 Big_Union test_big_union
(in Big_Union u1
,
299 enum Small_Union_Switch
{ A_LONG
, A_SHORT
};
300 union Small_Union
switch (Small_Union_Switch
)
307 Small_Union test_small_union
(in Small_Union u1
,
308 inout Small_Union u2
,
311 // The following two structs are used to help compose
312 // a complex Any for the test function below.
315 string level5_string
;
322 string level9_string
;
324 boolean level9_boolean
;
329 any test_complex_any
(in any ca1
,
333 // Recursive structs. Contains a sequence of itself.
334 struct Recursive_Struct
;
335 typedef sequence
<Recursive_Struct
> RecStructSeq
;
337 struct Recursive_Struct
341 RecStructSeq children
;
344 Recursive_Struct test_recursive_struct
(in Recursive_Struct rs1
,
345 inout Recursive_Struct rs2
,
346 out Recursive_Struct rs3
);
348 // Recursive unions. We have one recursive union nested in a different
350 union nested_rec_union
;
351 typedef sequence
<nested_rec_union
> NestedSeq
;
353 union nested_rec_union
switch (short)
356 case 1: NestedSeq nested_rec_member
;
359 union Recursive_Union
;
360 typedef sequence
<Recursive_Union
> RecUnionSeq
;
362 union Recursive_Union
switch (short)
364 case 0: RecUnionSeq rec_member
;
365 case 1: nested_rec_union nested_member
;
368 Recursive_Union test_recursive_union
(in Recursive_Union ru1
,
369 inout Recursive_Union ru2
,
370 out Recursive_Union ru3
);
372 // multidimensional arrays (fixed). The following will give rise to a 3
373 // dimensional array. The following will define a 3-dimensional array of size
374 // DIM1 X DIM2 X DIM3
375 const unsigned long DIM3
= 3;
377 typedef Fixed_Array Multdim_Array
[DIM2
][DIM3
];
379 Multdim_Array test_multdim_array
(in Multdim_Array m1
,
380 inout Multdim_Array m2
,
381 out Multdim_Array m3
);
383 // sequence of typecodes
384 // typedef sequence<TypeCode> TypeCodeSeq;
385 // TypeCodeSeq test_tcseq (in TypeCodeSeq t1, inout TypeCodeSeq t2, out TypeCodeSeq t3);
388 // Shutdown the server: this is useful to check for memory leaks,
389 // performance results and in general to verify that orderly
390 // shutdown is possible.
392 // test simple objects
393 // Object test_object (in Object o1, inout Object o2, out Object o3);