~ubuntu-branches/ubuntu/natty/orbit2/natty

« back to all changes in this revision

Viewing changes to test/everything/everything.idl

  • Committer: Bazaar Package Importer
  • Author(s): Chris Waters
  • Date: 2002-03-25 17:24:03 UTC
  • Revision ID: james.westby@ubuntu.com-20020325172403-8lexv63608acfqgt
Tags: upstream-2.3.107
ImportĀ upstreamĀ versionĀ 2.3.107

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * CORBA C language mapping tests
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify it
 
5
 * under the terms of the GNU General Public License as published by the
 
6
 * Free Software Foundation; either version 2, or (at your option) any
 
7
 * later version.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software Foundation,
 
16
 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
17
 *
 
18
 * Author: Phil Dawes <philipd@users.sourceforge.net>
 
19
 */
 
20
 
 
21
#pragma prefix "orbit"
 
22
 
 
23
module test {
 
24
        const char CONST_CHAR = 't';
 
25
        const short CONST_SHORT = 0x1234;
 
26
        const long CONST_LONG = 0x12345678;
 
27
        const long long CONST_LONG_LONG = 0x12345678;
 
28
        const string CONST_STRING = "ConstString";
 
29
        const float CONST_FLOAT = 1234.56;
 
30
        const double CONST_DOUBLE = 1234.5678;
 
31
        const long double CONST_LONG_DOUBLE = 1234.567891;
 
32
        const boolean CONST_BOOLEAN = TRUE;
 
33
        enum Soup { veggie, chicken, tomato, oxtail }; 
 
34
        const Soup FAVORITE_SOUP = veggie; 
 
35
        const Soup HORRIBLE_SOUP = oxtail; 
 
36
 
 
37
        // Forward declarations
 
38
        interface BasicServer;
 
39
  
 
40
        interface StructServer;
 
41
        interface SequenceServer;
 
42
        interface UnionServer;
 
43
        interface ArrayServer;
 
44
        interface AnyServer;
 
45
        interface BaseServer;
 
46
        interface B1;
 
47
        interface B2;
 
48
        interface DerivedServer;
 
49
        interface TransientObj;
 
50
        interface ContextServer;
 
51
        interface DeadReferenceObj;
 
52
        interface PingPongServer;
 
53
 
 
54
        interface TestFactory {
 
55
                BasicServer getBasicServer();
 
56
                StructServer getStructServer();
 
57
                string getStructServerIOR();
 
58
                SequenceServer getSequenceServer();
 
59
                UnionServer getUnionServer();
 
60
                ArrayServer getArrayServer();
 
61
                AnyServer getAnyServer();
 
62
                ContextServer getContextServer();
 
63
                oneway void segv (in string when);
 
64
                BaseServer getBaseServer();
 
65
                DerivedServer getDerivedServer();
 
66
                BaseServer getDerivedServerAsBaseServer();
 
67
                B2 getDerivedServerAsB2();
 
68
                TransientObj createTransientObj();
 
69
                DeadReferenceObj createDeadReferenceObj();
 
70
                PingPongServer createPingPongServer ();
 
71
        };
 
72
 
 
73
        interface DeadReferenceObj {
 
74
                void test ();
 
75
        };
 
76
 
 
77
        interface TransientObj {
 
78
                void remove();
 
79
        };
 
80
 
 
81
        struct FixedLengthStruct {
 
82
                short a;
 
83
        };
 
84
  
 
85
        struct VariableLengthStruct {
 
86
                string a;
 
87
        };
 
88
 
 
89
        struct StructAny {
 
90
                string a;
 
91
                any    b;
 
92
        };
 
93
 
 
94
        struct CompoundStruct {
 
95
                VariableLengthStruct a;
 
96
        };
 
97
 
 
98
        struct ObjectStruct {
 
99
                DerivedServer serv;
 
100
        };
 
101
 
 
102
        typedef sequence<string> StrSeq;
 
103
        typedef sequence<string> AnotherStrSeq;
 
104
        typedef sequence<CompoundStruct,2> BoundedStructSeq;
 
105
        typedef sequence<long,2> BoundedLongSeq;
 
106
        typedef sequence<long> LongSeq;
 
107
        typedef sequence<StrSeq> StrSeqSeq;
 
108
        typedef sequence<any> AnySeq;
 
109
 
 
110
        struct StructWithSequenceInIt {
 
111
                StrSeqSeq theSeq;
 
112
        };
 
113
 
 
114
 
 
115
        interface SequenceServer {
 
116
                StrSeq opStrSeq(in StrSeq inArg, inout StrSeq inoutArg, out StrSeq outArg);
 
117
                BoundedStructSeq opBoundedStructSeq(in BoundedStructSeq inArg,
 
118
                                                    inout BoundedStructSeq inoutArg,
 
119
                                                    out BoundedStructSeq outArg);
 
120
        };
 
121
  
 
122
        enum AnEnum { 
 
123
                ENUM_IN,
 
124
                ENUM_INOUT_IN,
 
125
                ENUM_INOUT_OUT,
 
126
                ENUM_OUT,
 
127
                ENUM_RETN
 
128
        };
 
129
 
 
130
        exception SimpleException {
 
131
        };
 
132
  
 
133
        exception TestException {
 
134
          string reason;
 
135
          long number;
 
136
          LongSeq aseq;
 
137
          TestFactory factory;
 
138
        };
 
139
 
 
140
        typedef long LongArray[2];
 
141
        typedef string StrArray[2];
 
142
        typedef string StrArrayMultiDimensional[2][3][5];
 
143
        typedef VariableLengthStruct VariableLengthStructArray[2];
 
144
 
 
145
        interface ArrayServer {
 
146
                LongArray opLongArray(in LongArray inArg, inout LongArray inoutArg, out LongArray outArg);
 
147
                StrArray opStrArray(in StrArray inArg, inout StrArray inoutArg, out StrArray outArg);
 
148
        };
 
149
  
 
150
        interface BasicServer {
 
151
                attribute string foo;
 
152
                readonly attribute long bah;
 
153
                string opString(in string inArg, inout string inoutArg, out string outArg);
 
154
                long opLong(in long inArg, inout long inoutArg, out long outArg);
 
155
                long long opLongLong(in long long inArg, inout long long inoutArg, out long long outArg);
 
156
                float opFloat (in float inArg, inout float inoutArg, out float outArg);
 
157
                double opDouble (in double inArg, inout double inoutArg, out double outArg);
 
158
                long double opLongDouble (in long double inArg, inout long double inoutArg, out long double outArg);
 
159
                AnEnum opEnum(in AnEnum inArg, inout AnEnum inoutArg, out AnEnum outArg);
 
160
                void opException() raises(TestException);
 
161
                oneway void opOneWay(in string inArg);
 
162
                void noImplement ();
 
163
                void testLargeStringSeq (in StrSeq seq);
 
164
        };
 
165
 
 
166
        interface StructServer : BasicServer {
 
167
                FixedLengthStruct opFixed       (in FixedLengthStruct       inArg, 
 
168
                                                 inout FixedLengthStruct    inoutArg,
 
169
                                                 out FixedLengthStruct      outArg);
 
170
                VariableLengthStruct opVariable (in VariableLengthStruct    inArg, 
 
171
                                                 inout VariableLengthStruct inoutArg,
 
172
                                                 out VariableLengthStruct   outArg);
 
173
                CompoundStruct opCompound       (in CompoundStruct          inArg, 
 
174
                                                 inout CompoundStruct       inoutArg,
 
175
                                                 out CompoundStruct         outArg);
 
176
                oneway void    opObjectStruct   (in ObjectStruct            inArg);
 
177
                StructAny opStructAny           ();
 
178
        };
 
179
 
 
180
        interface BaseServer {
 
181
                long opPolymorphic();
 
182
                attribute string attribPolymorphic;
 
183
        };
 
184
 
 
185
        // diamond of death, + an additional single inheritance level
 
186
        interface B1 : BaseServer{};
 
187
        interface B2 : BaseServer{};
 
188
        interface C1 : B1,B2 {};
 
189
 
 
190
        interface DerivedServer : C1 {};
 
191
 
 
192
        union FixedLengthUnion switch (char) {
 
193
        case 'a': long x;
 
194
        case 'b': char y;
 
195
        case 'c': 
 
196
        case 'd': boolean z;
 
197
        case 'e': FixedLengthStruct v;
 
198
        };
 
199
 
 
200
        union VariableLengthUnion switch (long) {
 
201
        case 1: long x;
 
202
        default: long w;
 
203
        case 2: string y;
 
204
        case 3: 
 
205
        case 4: boolean z;
 
206
        case 5: VariableLengthStruct a;
 
207
        case 6: StrSeq b;
 
208
        case 7: FixedLengthUnion c;
 
209
        case 8: StrArray d;
 
210
        };
 
211
 
 
212
        union EnumUnion switch (enum Colour { red, green, blue }) {
 
213
        case red: long x;
 
214
        case blue: boolean y;
 
215
        };
 
216
 
 
217
        union BooleanUnion switch(boolean) {
 
218
        case 0: VariableLengthStruct x;
 
219
        case 1: string y;
 
220
        };
 
221
 
 
222
        typedef string StrArray2[20];
 
223
 
 
224
        union ArrayUnion switch(unsigned short) {
 
225
        case 22: StrArray2 d;
 
226
        };
 
227
 
 
228
        typedef sequence <VariableLengthUnion> unionSeq;
 
229
 
 
230
        interface UnionServer {
 
231
                FixedLengthUnion opFixed (in FixedLengthUnion    inArg, 
 
232
                                          inout FixedLengthUnion inoutArg,
 
233
                                          out FixedLengthUnion   outArg);
 
234
 
 
235
                VariableLengthUnion opVariable (in VariableLengthUnion    inArg, 
 
236
                                                inout VariableLengthUnion inoutArg,
 
237
                                                out VariableLengthUnion   outArg);
 
238
 
 
239
                EnumUnion opMisc (in unionSeq     inSeq,
 
240
                                  in BooleanUnion inArg,
 
241
                                  out ArrayUnion  outArg);
 
242
        };
 
243
 
 
244
        interface AnyServer {
 
245
                any opAnyStrSeq();
 
246
                any opAnyLong(in any inArg, inout any inoutArg, out any outArg);
 
247
                any opAnyString(in any inArg, inout any inoutArg, out any outArg);
 
248
                any opAnyStruct(in any inArg, inout any inoutArg, out any outArg);
 
249
                TypeCode opTypeCode(in TypeCode inArg, inout TypeCode inoutArg, out TypeCode outArg);
 
250
        };
 
251
 
 
252
        interface ContextServer {
 
253
                Object opWithContext(in Object inArg, inout Object inoutArg, out Object outArg)
 
254
                        context ("foo", "bar");
 
255
        };
 
256
 
 
257
        interface PingPongServer {
 
258
                oneway void opSleep  (in string large_string);
 
259
                oneway void opOneWay (in long l);
 
260
                long        pingPong (in PingPongServer replyTo,
 
261
                                      in long idx);
 
262
                void        set      (in PingPongServer reg,
 
263
                                      in string         name);
 
264
                Object      get      (in string         name);
 
265
        };
 
266
};
 
267