File: OptionalTest.ice

package info (click to toggle)
zeroc-ice 3.7.10-3.1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 75,696 kB
  • sloc: cpp: 356,894; java: 226,081; cs: 98,312; javascript: 35,027; python: 28,716; objc: 27,050; php: 7,526; ruby: 7,190; yacc: 2,949; ansic: 2,469; xml: 1,589; lex: 1,241; makefile: 472; sh: 52
file content (327 lines) | stat: -rw-r--r-- 9,656 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//

#pragma once

[["cpp:include:list", "suppress-warning:deprecated"]]

["objc:prefix:TestOptional"]
module Test
{

class OneOptional
{
    optional(1) int a;
}

enum MyEnum
{
    MyEnumMember
}

struct SmallStruct
{
    byte m;
}

struct FixedStruct
{
    int m;
}

struct VarStruct
{
    string m;
}

["cpp:class"] struct ClassVarStruct
{
    int a;
}

sequence<byte> ByteSeq;
sequence<bool> BoolSeq;
sequence<short> ShortSeq;
sequence<int> IntSeq;
sequence<long> LongSeq;
sequence<float> FloatSeq;
sequence<double> DoubleSeq;
sequence<string> StringSeq;
sequence<MyEnum> MyEnumSeq;
sequence<SmallStruct> SmallStructSeq;
["cpp:type:std::list< ::Test::SmallStruct>"] sequence<SmallStruct> SmallStructList;
sequence<FixedStruct> FixedStructSeq;
["cpp:type:std::list< ::Test::FixedStruct>"] sequence<FixedStruct> FixedStructList;
sequence<VarStruct> VarStructSeq;
sequence<OneOptional> OneOptionalSeq;
sequence<OneOptional*> OneOptionalPrxSeq;

sequence<byte> Serializable;

dictionary<int, int> IntIntDict;
dictionary<string, int> StringIntDict;
dictionary<int, MyEnum> IntEnumDict;
dictionary<int, FixedStruct> IntFixedStructDict;
dictionary<int, VarStruct> IntVarStructDict;
dictionary<int, OneOptional> IntOneOptionalDict;
dictionary<int, OneOptional*> IntOneOptionalPrxDict;

class MultiOptional
{
    optional(1) byte a;
    optional(2) bool  b;
    optional(3) short c;
    optional(4) int d;
    optional(5) long e;
    optional(6) float f;
    optional(7) double g;
    optional(8) string h;
    optional(9) MyEnum i;
    optional(10) MultiOptional* j;
    optional(11) MultiOptional k;
    optional(12) ByteSeq bs;
    optional(13) StringSeq ss;
    optional(14) IntIntDict iid;
    optional(15) StringIntDict sid;
    optional(16) FixedStruct fs;
    optional(17) VarStruct vs;

    optional(18) ShortSeq shs;
    optional(19) MyEnumSeq es;
    optional(20) FixedStructSeq fss;
    optional(21) VarStructSeq vss;
    optional(22) OneOptionalSeq oos;
    optional(23) OneOptionalPrxSeq oops;

    optional(24) IntEnumDict ied;
    optional(25) IntFixedStructDict ifsd;
    optional(26) IntVarStructDict ivsd;
    optional(27) IntOneOptionalDict iood;
    optional(28) IntOneOptionalPrxDict ioopd;

    optional(29) BoolSeq bos;

    optional(30) Serializable ser;
}

class A
{
    int requiredA = 0;
    optional(500) int mc;
    optional(50) int mb;
    optional(1) int ma;
}

["preserve-slice"]
class B extends A
{
    int requiredB = 0;
    optional(10) int md;
}

class C extends B
{
    string ss;
    optional(890) string ms;
}

class WD
{
    optional(1) int a = 5;
    optional(2) string s = "test";
}

exception OptionalException
{
    bool req = false;
    optional(1) int a = 5;
    optional(2) string b;
    optional(50) OneOptional o;
}

exception DerivedException extends OptionalException
{
    string d1 = "d1";
    optional(600) string ss = "test";
    optional(601) OneOptional o2;
    string d2 = "d2";
}

exception RequiredException extends OptionalException
{
    string ss = "test";
    OneOptional o2;
}

class OptionalWithCustom
{
    optional(1) SmallStructList l;
    ["protected"] optional(2) SmallStructList lp;
    optional(3) ClassVarStruct s;
}

class E
{
    A ae;
}

class F extends E
{
    optional(1) A af;
}

class G1
{
    string a;
}

class G2
{
    long a;
}

class G
{
    optional(1) G1 gg1Opt;
    G2 gg2;
    optional(0) G2 gg2Opt;
    G1 gg1;
}

class Recursive;
sequence<Recursive> RecursiveSeq;

class Recursive
{
    optional(0) RecursiveSeq value;
}

interface Initial
{
    void shutdown();

    Object pingPong(Object o);

    void opOptionalException(optional(1) int a, optional(2) string b, optional(3) OneOptional o)
        throws OptionalException;

    void opDerivedException(optional(1) int a, optional(2) string b, optional(3) OneOptional o)
        throws OptionalException;

    void opRequiredException(optional(1) int a, optional(2) string b, optional(3) OneOptional o)
        throws OptionalException;

    optional(1) byte opByte(optional(2) byte p1, out optional(3) byte p3);

    optional(1) bool opBool(optional(2) bool p1, out optional(3) bool p3);

    optional(1) short opShort(optional(2) short p1, out optional(3) short p3);

    optional(1) int opInt(optional(2) int p1, out optional(3) int p3);

    optional(3) long opLong(optional(1) long p1, out optional(2) long p3);

    optional(1) float opFloat(optional(2) float p1, out optional(3) float p3);

    optional(1) double opDouble(optional(2) double p1, out optional(3) double p3);

    optional(1) string opString(optional(2) string p1, out optional(3) string p3);

    optional(1) MyEnum opMyEnum(optional(2) MyEnum p1, out optional(3) MyEnum p3);

    optional(1) SmallStruct opSmallStruct(optional(2) SmallStruct p1, out optional(3) SmallStruct p3);

    optional(1) FixedStruct opFixedStruct(optional(2) FixedStruct p1, out optional(3) FixedStruct p3);

    optional(1) VarStruct opVarStruct(optional(2) VarStruct p1, out optional(3) VarStruct p3);

    optional(1) OneOptional opOneOptional(optional(2) OneOptional p1, out optional(3) OneOptional p3);

    optional(1) OneOptional* opOneOptionalProxy(optional(2) OneOptional* p1, out optional(3) OneOptional* p3);

    // Custom mapping operations
    ["cpp:array"] optional(1) ByteSeq opByteSeq(["cpp:array"] optional(2) ByteSeq p1,
                                                out ["cpp:array"] optional(3) ByteSeq p3);

    ["cpp:array"] optional(1) BoolSeq opBoolSeq(["cpp:array"] optional(2) BoolSeq p1,
                                                out ["cpp:array"] optional(3) BoolSeq p3);

    ["cpp:array"] optional(1) ShortSeq opShortSeq(["cpp:array"] optional(2) ShortSeq p1,
                                                  out ["cpp:array"] optional(3) ShortSeq p3);

    ["cpp:range:array"] optional(1) IntSeq opIntSeq(["cpp:range:array"] optional(2) IntSeq p1,
                                                    out ["cpp:range:array"] optional(3) IntSeq p3);

    ["cpp:range:array"] optional(1) LongSeq opLongSeq(["cpp:range:array"] optional(2) LongSeq p1,
                                                      out ["cpp:range:array"] optional(3) LongSeq p3);

    ["cpp:range:array"] optional(1) FloatSeq opFloatSeq(["cpp:range:array"] optional(2) FloatSeq p1,
                                                        out ["cpp:range:array"] optional(3) FloatSeq p3);

    ["cpp:range:array"] optional(1) DoubleSeq opDoubleSeq(["cpp:range:array"] optional(2) DoubleSeq p1,
                                                          out ["cpp:range:array"] optional(3) DoubleSeq p3);

    ["cpp:range"] optional(1) StringSeq opStringSeq(["cpp:range"] optional(2) StringSeq p1,
                                                    out ["cpp:range"] optional(3) StringSeq p3);

    ["cpp:array"] optional(1) SmallStructSeq opSmallStructSeq(["cpp:array"] optional(2) SmallStructSeq p1,
                                                              out ["cpp:array"] optional(3) SmallStructSeq p3);

    ["cpp:array"] optional(1) SmallStructList opSmallStructList(["cpp:array"] optional(2) SmallStructList p1,
                                                                out ["cpp:array"] optional(3) SmallStructList p3);

    ["cpp:array"] optional(1) FixedStructSeq opFixedStructSeq(["cpp:array"] optional(2) FixedStructSeq p1,
                                                              out ["cpp:array"] optional(3) FixedStructSeq p3);

    ["cpp:array"] optional(1) FixedStructList opFixedStructList(["cpp:array"] optional(2) FixedStructList p1,
                                                                out ["cpp:array"] optional(3) FixedStructList p3);

    ["cpp:range"] optional(1) VarStructSeq opVarStructSeq(["cpp:range"] optional(2) VarStructSeq p1,
                                                          out ["cpp:range"] optional(3) VarStructSeq p3);

    optional(1) Serializable opSerializable(optional(2) Serializable p1, out optional(3) Serializable p3);

    optional(1) IntIntDict opIntIntDict(optional(2) IntIntDict p1, out optional(3) IntIntDict p3);

    optional(1) StringIntDict opStringIntDict(optional(2) StringIntDict p1, out optional(3) StringIntDict p3);

    optional(1) IntOneOptionalDict opIntOneOptionalDict(optional(2) IntOneOptionalDict p1, out optional(3) IntOneOptionalDict p3);

    void opClassAndUnknownOptional(A p);

    void sendOptionalClass(bool req, optional(1) OneOptional o);

    void returnOptionalClass(bool req, out optional(1) OneOptional o);

    G opG(G g);

    void opVoid();

    ["marshaled-result"] optional(1) SmallStruct opMStruct1();
    ["marshaled-result"] optional(1) SmallStruct opMStruct2(optional(2) SmallStruct p1,
                                                            out optional(3)SmallStruct p2);

    ["marshaled-result"] optional(1) StringSeq opMSeq1();
    ["marshaled-result"] optional(1) StringSeq opMSeq2(optional(2) StringSeq p1,
                                                       out optional(3) StringSeq p2);

    ["marshaled-result"] optional(1) StringIntDict opMDict1();
    ["marshaled-result"] optional(1) StringIntDict opMDict2(optional(2) StringIntDict p1,
                                                            out optional(3) StringIntDict p2);

    ["marshaled-result"] optional(1) G opMG1();
    ["marshaled-result"] optional(1) G opMG2(optional(2) G p1, out optional(3) G p2);

    bool supportsRequiredParams();

    bool supportsJavaSerializable();

    bool supportsCsharpSerializable();

    bool supportsCppStringView();

    bool supportsNullOptional();
}

}