summaryrefslogtreecommitdiff
path: root/csharp/test/Ice/optional/TestAMDI.cs
blob: 00046e657da4f46d588dfccbbabb8b12041578b4 (plain)
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
// **********************************************************************
//
// Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

using System;
using System.Collections.Generic;

public class InitialI : Test.Initial
{
    public override void shutdown_async(Test.AMD_Initial_shutdown cb, Ice.Current current)
    {
        current.adapter.getCommunicator().shutdown();
        cb.ice_response();
    }

    public override void pingPong_async(Test.AMD_Initial_pingPong cb, Ice.Object obj, Ice.Current current)
    {
        cb.ice_response(obj);
    }

    public override void opOptionalException_async(Test.AMD_Initial_opOptionalException cb, Ice.Optional<int> a,
                                                   Ice.Optional<string> b, Ice.Optional<Test.OneOptional> o,
                                                   Ice.Current current)
    {
        cb.ice_exception(new Test.OptionalException(false, a, b, o));
    }

    public override void opDerivedException_async(Test.AMD_Initial_opDerivedException cb, Ice.Optional<int> a,
                                                  Ice.Optional<string> b, Ice.Optional<Test.OneOptional> o,
                                                  Ice.Current current)
    {
        cb.ice_exception(new Test.DerivedException(false, a, b, o, b, o));
    }

    public override void opRequiredException_async(Test.AMD_Initial_opRequiredException cb, Ice.Optional<int> a,
                                                   Ice.Optional<string> b, Ice.Optional<Test.OneOptional> o,
                                                   Ice.Current current)
    {
        Test.RequiredException e = new Test.RequiredException();
        e.a = a;
        e.b = b;
        e.o = o;
        if(b.HasValue)
        {
            e.ss = b.Value;
        }
        if(o.HasValue)
        {
            e.o2 = o.Value;
        }
        cb.ice_exception(e);
    }

    public override void opByte_async(Test.AMD_Initial_opByte cb, Ice.Optional<byte> p1, Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opBool_async(Test.AMD_Initial_opBool cb, Ice.Optional<bool> p1, Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opShort_async(Test.AMD_Initial_opShort cb, Ice.Optional<short> p1, Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opInt_async(Test.AMD_Initial_opInt cb, Ice.Optional<int> p1, Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opLong_async(Test.AMD_Initial_opLong cb, Ice.Optional<long> p1, Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opFloat_async(Test.AMD_Initial_opFloat cb, Ice.Optional<float> p1, Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opDouble_async(Test.AMD_Initial_opDouble cb, Ice.Optional<double> p1, Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opString_async(Test.AMD_Initial_opString cb, Ice.Optional<string> p1, Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opMyEnum_async(Test.AMD_Initial_opMyEnum cb, Ice.Optional<Test.MyEnum> p1, Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opSmallStruct_async(Test.AMD_Initial_opSmallStruct cb, Ice.Optional<Test.SmallStruct> p1,
                                             Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opFixedStruct_async(Test.AMD_Initial_opFixedStruct cb, Ice.Optional<Test.FixedStruct> p1,
                                             Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opVarStruct_async(Test.AMD_Initial_opVarStruct cb, Ice.Optional<Test.VarStruct> p1,
                                           Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opOneOptional_async(Test.AMD_Initial_opOneOptional cb, Ice.Optional<Test.OneOptional> p1,
                                             Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opOneOptionalProxy_async(Test.AMD_Initial_opOneOptionalProxy cb,
                                                  Ice.Optional<Test.OneOptionalPrx> p1,
                                                  Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opByteSeq_async(Test.AMD_Initial_opByteSeq cb, Ice.Optional<byte[]> p1, Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opBoolSeq_async(Test.AMD_Initial_opBoolSeq cb, Ice.Optional<bool[]> p1, Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opShortSeq_async(Test.AMD_Initial_opShortSeq cb, Ice.Optional<short[]> p1, Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opIntSeq_async(Test.AMD_Initial_opIntSeq cb, Ice.Optional<int[]> p1, Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opLongSeq_async(Test.AMD_Initial_opLongSeq cb, Ice.Optional<long[]> p1, Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opFloatSeq_async(Test.AMD_Initial_opFloatSeq cb, Ice.Optional<float[]> p1, Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opDoubleSeq_async(Test.AMD_Initial_opDoubleSeq cb, Ice.Optional<double[]> p1,
                                           Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opStringSeq_async(Test.AMD_Initial_opStringSeq cb, Ice.Optional<string[]> p1,
                                           Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opSmallStructSeq_async(Test.AMD_Initial_opSmallStructSeq cb,
                                                Ice.Optional<Test.SmallStruct[]> p1,
                                                Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opSmallStructList_async(Test.AMD_Initial_opSmallStructList cb,
                                                 Ice.Optional<List<Test.SmallStruct>> p1,
                                                 Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opFixedStructSeq_async(Test.AMD_Initial_opFixedStructSeq cb,
                                                Ice.Optional<Test.FixedStruct[]> p1,
                                                Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opFixedStructList_async(Test.AMD_Initial_opFixedStructList cb,
                                                 Ice.Optional<LinkedList<Test.FixedStruct>> p1,
                                                 Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opVarStructSeq_async(Test.AMD_Initial_opVarStructSeq cb, Ice.Optional<Test.VarStruct[]> p1,
                                              Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

#if COMPACT || SILVERLIGHT
    public override void opSerializable_async(Test.AMD_Initial_opSerializable cb,
                                              Ice.Optional<byte[]> p1,
                                              Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }
#else
    public override void opSerializable_async(Test.AMD_Initial_opSerializable cb,
                                              Ice.Optional<Test.SerializableClass> p1,
                                              Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }
#endif

    public override void opIntIntDict_async(Test.AMD_Initial_opIntIntDict cb, Ice.Optional<Dictionary<int, int>> p1,
                                            Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opStringIntDict_async(Test.AMD_Initial_opStringIntDict cb,
                                               Ice.Optional<Dictionary<string, int>> p1,
                                               Ice.Current current)
    {
        cb.ice_response(p1, p1);
    }

    public override void opClassAndUnknownOptional_async(Test.AMD_Initial_opClassAndUnknownOptional cb, Test.A p,
                                                         Ice.Current current)
    {
        cb.ice_response();
    }

    public override void sendOptionalClass_async(Test.AMD_Initial_sendOptionalClass cb, bool req,
                                                 Ice.Optional<Test.OneOptional> o, Ice.Current current)
    {
        cb.ice_response();
    }

    public override void returnOptionalClass_async(Test.AMD_Initial_returnOptionalClass cb, bool req,
                                                   Ice.Current current)
    {
        cb.ice_response(new Test.OneOptional(53));
    }
    
    public override void opG_async(Test.AMD_Initial_opG cb, Test.G g, Ice.Current current)
    {
        cb.ice_response(g);
    }

    public override void supportsRequiredParams_async(Test.AMD_Initial_supportsRequiredParams cb, Ice.Current current)
    {
        cb.ice_response(false);
    }

    public override void supportsJavaSerializable_async(Test.AMD_Initial_supportsJavaSerializable cb,
                                                        Ice.Current current)
    {
        cb.ice_response(false);
    }

    public override void supportsCsharpSerializable_async(Test.AMD_Initial_supportsCsharpSerializable cb,
                                                          Ice.Current current)
    {
#if COMPACT || SILVERLIGHT
        cb.ice_response(false);
#else
        cb.ice_response(true);
#endif
    }

    public override void supportsCppStringView_async(Test.AMD_Initial_supportsCppStringView cb,
                                                     Ice.Current current)
    {
        cb.ice_response(false);
    }
}