//============================================================================= /** * @file typedef.idl * * $Id$ * * This file contains examples of IDL code that has * caused problems in the past for the TAO IDL * compiler. This test is to make sure the problems * stay fixed. * * * @author Jeff Parsons and TAO users. */ //============================================================================= // Must keep unaliasing until all levels of typedef // are removed. // This is also a test of arrays of arrays. Once // upon a time, the generated CDR operators of such // animals wouldn't compile on all platforms. typedef char TAO_A5[5]; typedef TAO_A5 TAO_C5; typedef TAO_C5 TAO_G5; typedef TAO_G5 TAO_J5; typedef TAO_J5 TAO_M5[5]; typedef TAO_M5 TAO_R5; typedef TAO_R5 TAO_V5; typedef TAO_V5 TAO_Z5[5]; // Need to make sure that the arg traits specializations for each // typedef has a unique #ifndef guard. module TestModule { typedef string<32> typedef_1; typedef string<32> typedef_2; interface TestInterface { void set_typedef_1 (in TestModule::typedef_1 typ1); void set_typedef_2 (in TestModule::typedef_2 typ2); }; }; // Caught failure of arg traits generation for the 2nd typedef. module bug_2124 { typedef string<10> MyString; typedef MyString OtherString; interface Foo { void op1 (in MyString s); void op2 (in OtherString s); }; }; // Caught a case where the #ifdef guards were different, but the // generated string typename was the same. module bug_2122 { module One { typedef string<40> MyString; interface Whatever { void someOp (in MyString s); }; }; module Two { typedef string<100> MyString; // Same name, different size! interface WhoCares { void someOp (in MyString s); }; }; module Three { typedef string<100> MyString; // Same name, same size! interface WhoCares { void someOp (in MyString s); }; }; }; // An anonymous string of the same bound will be found in // another IDL file not included in this one (anonymous.idl). // The typecode for the anonymous string should not give us // 'already found' link errors. module First { typedef string<32> FirstString; }; // The anonymous base type is shared by these typedefs, but it // must be destroyed only once. module CommaList { typedef sequence Dubble, Dubbel, Toil, Trouble; };