/* $Id: Data.idl 1206 2006-05-31 07:11:53Z rvosa $ IDL file used by the base2.t tests for COPE. Copyright 1998 Giles Atkinson See the file "COPYING" in the distribution for licensing and (total lack of) warranties. */ #pragma prefix "cope" module Outside { struct Structure { string <10> name; char other[10]; }; interface Swapper { void swapit(inout Structure stuff); }; }; module Data { enum Discriminator { D_LONG, D_STRING, D_STRUCT, D_OBJ, D_T2, D_NAME, D_ID }; union TestUnion switch (Discriminator) { case D_LONG: long long_case; case D_STRING: string string_case; case D_STRUCT: Outside::Structure struct_case; case D_T2: default: case D_OBJ: Outside::Swapper obj_case; }; // Test recursive sequences: the first one from CORBA 2.2. struct RecStruct { string name; sequence children; }; struct Nested { short val0; struct Nested1 { string val1; struct Nested2 { long val2; struct Nested3 { string val3; sequence list; } n3; } n2; } n1; }; union RecUnion switch (char) { case 'a': short short_case; case 'b': struct StC { boolean flag; sequence list; } struct_case; case 'c': StC array_case[2]; }; struct MutualRec { long value1; struct MR2 { string value2; sequence seq2; } primer1; sequence seq1; }; interface Anything; interface Testem { /* Return an object reference for Any tests */ Anything test_any(); /* Test marshalling of TestUnion */ Discriminator setit(in TestUnion val); TestUnion getit(inout Discriminator what); /* Test marshalling of RecStruct */ exception NotFamily {}; exception NameUsed { string why; RecStruct all; }; short birth(in string parent, in string child) raises (NotFamily, NameUsed); long multiple_birth(in RecStruct family) raises (NotFamily, NameUsed); RecStruct family(in string whose) raises(NotFamily); /* Simpler tests of more elaborate recursive data. */ string concat(in Nested nest); boolean andem(in RecUnion un); long addem(in MutualRec mr); }; /* Test of Any type are in a separate interface. */ interface Anything { struct NamedVal { string name; any stuff; }; typedef sequence Stuff; void one_thing(inout any thing); Stuff summary(in any thing); }; }; /* This is not used in code. * It is to test idl2perl's output for top-level items. */ const string Mary = "Queen of Scots";