Merge pull request #2303 from jwillemsen/jwi-803
[ACE_TAO.git] / TAO / tests / Any / Recursive / Test.idl
blob80cb296dd2f8b1c20f065db3c90e4a38d239e6f0
2 #include "tao/OctetSeq.pidl"
3 #include "tao/StringSeq.pidl"
5 /// Put the interfaces in a module, to avoid global namespace pollution
6 module Test
8 exception Recursive_Type_In_Any_Test_Failed {};
9 exception Demarshaling_From_Any_Failed {};
11 struct RecursiveStruct;
12 typedef sequence<RecursiveStruct> RecursiveStructSeq;
14 struct RecursiveStruct
16 RecursiveStructSeq recursive_structs;
17 long i;
18 RecursiveStructSeq recursive_structs_second;
21 struct NestedRecursiveStruct;
22 typedef sequence<NestedRecursiveStruct> NestedRecursiveStructSeq;
24 struct NestedRecursiveStruct
26 struct InnerStruct
28 NestedRecursiveStructSeq recursive_structs;
29 } ins;
30 long i;
33 // --------------------------
35 union RecursiveUnion;
36 typedef sequence<RecursiveUnion> RecursiveUnionSeq;
38 union RecursiveUnion switch (short)
40 case 0:
41 RecursiveUnionSeq recursive_unions;
42 case 1:
43 short a;
44 case 2:
45 RecursiveUnionSeq recursive_unions_second;
46 default:
47 long i;
50 union RecursiveUnion2;
51 typedef sequence<RecursiveUnion2> RecursiveUnionSeq2;
53 union RecursiveUnion2 switch (short)
55 case 0:
56 struct Innerstruct3a
58 RecursiveUnionSeq2 recursive_unions;
59 } insb;
60 case 1:
61 short a;
62 case 2:
63 struct Innerstruct3b
65 RecursiveUnionSeq2 recursive_unions_second;
66 } insa;
67 default:
68 long i;
71 struct RecursiveStruct3;
72 typedef sequence<RecursiveStruct3> RecursiveStructSeq3;
74 union RecursiveUnion3 switch(short)
76 case 0: short a;
77 case 1: RecursiveStructSeq3 b;
78 case 2: RecursiveStructSeq3 c;
80 struct RecursiveStruct3
82 RecursiveUnion3 uni;
85 union RecursiveUnionNoDefault;
86 typedef sequence<RecursiveUnionNoDefault> RecursiveUnionSeqNoDefault;
88 union RecursiveUnionNoDefault switch (short)
90 case 0:
91 RecursiveUnionSeqNoDefault recursive_unions;
92 case 1:
93 short a;
94 case 2:
95 RecursiveUnionSeqNoDefault recursive_unions_second;
98 // --------------------------
100 // --------------------------
102 enum VSort {
103 UNKNOWN_TYPE,
104 RECURSIVE_TYPE,
105 LONG_STYPE,
106 BOOL_STYPE
109 union VSortRecursiveUnion;
110 typedef sequence<VSortRecursiveUnion> VSortRecursiveUnionSeq;
111 union VSortRecursiveUnion switch (VSort)
113 case RECURSIVE_TYPE:
114 VSortRecursiveUnionSeq recursive_unions;
115 case LONG_STYPE:
116 long i;
119 // --------------------------
121 union EnumUnion switch (VSort)
123 case BOOL_STYPE:
124 boolean a;
125 case LONG_STYPE:
126 long i;
129 // --------------------------
131 valuetype IndirectlyRecursiveValuetype;
132 typedef sequence<IndirectlyRecursiveValuetype>
133 IndirectlyRecursiveValuetypeSeq;
135 valuetype IndirectlyRecursiveValuetype
137 public IndirectlyRecursiveValuetypeSeq recursive_valuetypes;
140 // --------------------------
142 valuetype DirectlyRecursiveValuetype
144 public DirectlyRecursiveValuetype recursive_valuetype;
145 public DirectlyRecursiveValuetype recursive_valuetype_second;
148 // --------------------------
150 enum PositionEnum { unknownpos };
152 struct Position {
153 PositionEnum type;
155 typedef CORBA::OctetSeq OctetSeq;
157 enum ValueSort {
158 POSITION_TYPE,
159 OCTET_SEQ_TYPE
162 union NonRecursiveUnionWithEnum switch (ValueSort) {
163 case POSITION_TYPE:
164 Position position_val;
165 case OCTET_SEQ_TYPE:
166 OctetSeq octet_seq_val;
169 // --------------------------
171 enum ValueSort2 {
172 SYMBOL_TYPE2
175 struct Symbol2 {
176 string name;
179 union NonRecursiveUnionWithStringStruct switch (ValueSort2) {
180 case SYMBOL_TYPE2:
181 Symbol2 symbol_val;
184 /// Simple test interface.
185 interface Hello
187 /// Return the any provided as the "in" argument.
188 any get_any (in any the_any);
190 /// Shutdown the server ORB.
191 oneway void shutdown ();
194 valuetype Recursive2;
195 typedef sequence<Recursive2> Recursive2Seq2;
197 valuetype Recursive2
199 public struct Innerstruct3a
201 Recursive2Seq2 recursive_unions;
202 } insa;
203 public short a;
204 public struct Innerstruct3b
206 Recursive2Seq2 recursive_second;
207 } insb;
210 valuetype Recursive3;
211 typedef sequence<Recursive3> RecursiveSeq3;
213 valuetype Recursive3
215 public RecursiveSeq3 seq1;
216 public short a;
217 public RecursiveSeq3 seq2;