Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / tests / IDL_Test / including.idl
blob01bebec9d5dcbd65cde53264955782e5b01e7af7
2 //=============================================================================
3 /**
4 * @file including.idl
6 * This file contains examples of IDL code that has
7 * caused problems in the past for the TAO IDL
8 * compiler. This test is to make sure the problems
9 * stay fixed.
12 * @author Jeff Parsons <parsons@cs.wustl.edu> and TAO users.
14 //=============================================================================
16 #ifndef IDL_TEST_INCLUDING_IDL
17 #define IDL_TEST_INCLUDING_IDL
19 #include "included.idl"
21 enum choice
23 dog
26 union myUnion switch (choice)
28 // Typedef is in included file
29 case dog: Aok::Seq1Type cat;
32 // Enum discriminator is in included file
33 union Bog switch (Agog)
35 case Agog1: long bog1;
36 case Agog2: long bog2;
37 case Agog3: long bog3;
40 // We had a name clash with Me and ME, but the
41 // rule that requires type defined in a scope
42 // which is defined in an interface to be
43 // added to the referenced types in the interface's
44 // scope doesn't apply here, because Me is not
45 // defined in the struct, only referenced.
46 interface iface
48 enum postal
50 ME,
51 TAO_FE // FE is #defined on HP-UX 10.20, so I prefix it with TAO
54 struct using_incl
56 Aok::Me field1;
60 module VT_Test
62 typedef sequence<VT_Def::VT> VTSeq;
65 // References to A::MyStructA from included.idl get the
66 // forward declaration from lookup, and we were
67 // getting empty typename generation in various places,
68 // before overriding the visit methods for forward
69 // declared structs and unions in the relevant visitors.
70 module A
72 const long smth = 6;
75 exception MyException
77 A::MyStructA exField;
80 struct TestStr
82 A::MyStructA field;
85 union TestUn switch (long)
87 case 0: A::MyStructA value1;
88 case 1: string value2;
91 interface MyInt
93 A::MyStructA op (in A::MyStructA ab);
96 // A different enum with the same enum values is
97 // defined in the base interface in the same scope
98 // in another IDL file included by this one. The
99 // construction is legal and should be accepted.
100 module RootModule
102 module SUBMODULE1
104 interface ChildIF : ParentIF
106 enum DifferentMode
108 NORMAL,
109 FAULTY,
110 UNKNOWN
116 interface AAA;
118 interface B
120 typedef AAA::my_long_type my_b_long;
123 #endif /* IDL_TEST_INCLUDING_IDL */