Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tests / IDL_Test / array.idl
blob61b217bc768c644d696f5c9fc46634c3bf39811e
2 //=============================================================================
3 /**
4 * @file array.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 //=============================================================================
17 // Multidimensional arrays - constant vigilance.
18 typedef short TwoDArray[64][63];
20 typedef short ThreeDArray[64][63][62];
22 typedef short FourDArray[64][63][62][61];
24 // This problem is a combination of two others
25 // that have long been fixed, but you never know...
27 typedef long inside_array[5];
29 struct wrap
31 inside_array member;
34 typedef wrap outside_array[10];
35 typedef octet oa1[22];
36 typedef octet oa2[22];
38 // Test generation of Arg_Traits specialization for identical
39 // arrays.
40 interface array_args
42 void all_arrays (in oa1 arg1,
43 in oa2 arg2);
46 // This should generate unique _var and _forany types, but
47 // also generate TAO_String_Manager as the element type for both.
48 module string_array
50 typedef string ArrayOfString[15];
51 typedef string MyString;
52 typedef MyString ArrayOfMyString[15];
55 // Checks code generation for arrays and typedefs of arrays
56 // when they are not declared globally or inside a module.
57 interface testdata
59 typedef char Arraychar[2];
60 typedef Arraychar ArrayDeChar;
62 struct struct2
64 Arraychar field_1;
65 ArrayDeChar field_2;
68 typedef sequence<Arraychar> ArraycharList;
69 typedef sequence<Arraychar,10> BdArraycharList;
71 typedef sequence<ArrayDeChar> ArrayDeCharList;
72 typedef sequence<ArrayDeChar,10> BdArrayDeCharList;
75 // Tests for explicit conversion of slice pointer to the
76 // corresponding forany class before using CDR or Any
77 // operators. This is required because myvec2_slice and
78 // myvec3_slice are the same type, so implicit conversion
79 // from myvec2_slice (in the case below) could go to
80 // myvec2_forany or myvec3_forany.
81 module arraytest
83 typedef string myvec2[2];
84 typedef string myvec3[3];
86 interface MyTest
88 void test_method (out myvec2 mystring);
92 // Caught the has_constructor() flag not being passed from the
93 // element type to the array in the AST.
94 module bug_2126
96 union FirstUnion switch (boolean)
98 case TRUE: long first_union_foo;
99 case FALSE: long first_union_bar;
102 typedef FirstUnion FirstUnionArray[2];
104 struct MyStruct
106 FirstUnionArray my_struct_foo;
109 union SecondUnion switch (boolean)
111 case TRUE: MyStruct second_union_struct_member;
112 case FALSE: long wibble;
115 typedef FirstUnion BdFirstUnionArray[2];
117 struct BdMyStruct
119 BdFirstUnionArray my_struct_foo;
122 union BdSecondUnion switch (boolean)
124 case TRUE: BdMyStruct second_union_struct_member;
125 case FALSE: long wibble;
129 typedef long B41[2][3];
130 typedef long B42[2];
131 typedef long B43[4];
133 union B85 switch (long) {
134 case 1: B42 b_85_1;
135 case 2: B43 b_85_2;
136 case 3: B41 b_85_3;