2
* CORBA C language mapping tests
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
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.
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.
18
* Author: Phil Dawes <philipd@users.sourceforge.net>
21
#pragma prefix "orbit"
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;
37
// Forward declarations
38
interface BasicServer;
40
interface StructServer;
41
interface SequenceServer;
42
interface UnionServer;
43
interface ArrayServer;
48
interface DerivedServer;
49
interface TransientObj;
50
interface ContextServer;
51
interface DeadReferenceObj;
52
interface PingPongServer;
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 ();
73
interface DeadReferenceObj {
77
interface TransientObj {
81
struct FixedLengthStruct {
85
struct VariableLengthStruct {
94
struct CompoundStruct {
95
VariableLengthStruct a;
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;
110
struct StructWithSequenceInIt {
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);
130
exception SimpleException {
133
exception TestException {
140
typedef long LongArray[2];
141
typedef string StrArray[2];
142
typedef string StrArrayMultiDimensional[2][3][5];
143
typedef VariableLengthStruct VariableLengthStructArray[2];
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);
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);
163
void testLargeStringSeq (in StrSeq seq);
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 ();
180
interface BaseServer {
181
long opPolymorphic();
182
attribute string attribPolymorphic;
185
// diamond of death, + an additional single inheritance level
186
interface B1 : BaseServer{};
187
interface B2 : BaseServer{};
188
interface C1 : B1,B2 {};
190
interface DerivedServer : C1 {};
192
union FixedLengthUnion switch (char) {
197
case 'e': FixedLengthStruct v;
200
union VariableLengthUnion switch (long) {
206
case 5: VariableLengthStruct a;
208
case 7: FixedLengthUnion c;
212
union EnumUnion switch (enum Colour { red, green, blue }) {
214
case blue: boolean y;
217
union BooleanUnion switch(boolean) {
218
case 0: VariableLengthStruct x;
222
typedef string StrArray2[20];
224
union ArrayUnion switch(unsigned short) {
225
case 22: StrArray2 d;
228
typedef sequence <VariableLengthUnion> unionSeq;
230
interface UnionServer {
231
FixedLengthUnion opFixed (in FixedLengthUnion inArg,
232
inout FixedLengthUnion inoutArg,
233
out FixedLengthUnion outArg);
235
VariableLengthUnion opVariable (in VariableLengthUnion inArg,
236
inout VariableLengthUnion inoutArg,
237
out VariableLengthUnion outArg);
239
EnumUnion opMisc (in unionSeq inSeq,
240
in BooleanUnion inArg,
241
out ArrayUnion outArg);
244
interface AnyServer {
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);
252
interface ContextServer {
253
Object opWithContext(in Object inArg, inout Object inoutArg, out Object outArg)
254
context ("foo", "bar");
257
interface PingPongServer {
258
oneway void opSleep (in string large_string);
259
oneway void opOneWay (in long l);
260
long pingPong (in PingPongServer replyTo,
262
void set (in PingPongServer reg,
264
Object get (in string name);