summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/operations/TestI.cpp
blob: 06bc6cf176b72a9d7e812f67d09e11812cbb3b4f (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
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
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
// **********************************************************************
//
// Copyright (c) 2001
// MutableRealms, Inc.
// Huntsville, AL, USA
//
// All Rights Reserved
//
// **********************************************************************

#include <Ice/Ice.h>
#include <TestI.h>

MyDerivedClassI::MyDerivedClassI(const Ice::ObjectAdapterPtr& adapter, const std::string& identity) :
    _adapter(adapter),
    _identity(identity)
{
}

void
MyDerivedClassI::shutdown()
{
    _adapter->getCommunicator()->shutdown();
}

void
MyDerivedClassI::opVoid()
{
}

Ice::Byte
MyDerivedClassI::opByte(Ice::Byte p1,
			Ice::Byte p2,
			Ice::Byte& p3)
{
    p3 = p1 ^ p2;
    return p1;
}

bool
MyDerivedClassI::opBool(bool p1,
			bool p2,
			bool& p3)
{
    p3 = p1;
    return p2;
}

Ice::Long
MyDerivedClassI::opShortIntLong(Ice::Short p1,
				Ice::Int p2,
				Ice::Long p3,
				Ice::Short& p4,
				Ice::Int& p5,
				Ice::Long& p6)
{
    p4 = p1;
    p5 = p2;
    p6 = p3;
    return p3;
}

Ice::Double
MyDerivedClassI::opFloatDouble(Ice::Float p1,
			       Ice::Double p2,
			       Ice::Float& p3,
			       Ice::Double& p4)
{
    p3 = p1;
    p4 = p2;
    return p2;
}

std::string
MyDerivedClassI::opString(const std::string& p1,
			  const std::string& p2,
			  std::string& p3)
{
    p3 = p2 + " " + p1;
    return p1 + " " + p2;
}

std::wstring
MyDerivedClassI::opWString(const std::wstring& p1,
			   const std::wstring& p2,
			   std::wstring& p3)
{
    p3 = p2 + L" " + p1;
    return p1 + L" " + p2;
}

Test::MyEnum
MyDerivedClassI::opMyEnum(Test::MyEnum p1,
			  Test::MyEnum& p2)
{
    p2 = p1;
    return Test::enum3;
}

using namespace std;
Test::MyClassPrx
MyDerivedClassI::opMyClass(const Test::MyClassPrx& p1,
			   Test::MyClassPrx& p2, Test::MyClassPrx& p3)
{
    p2 = p1;
    p3 = Test::MyClassPrx::uncheckedCast(_adapter->createProxy("noSuchIdentity"));
    return Test::MyClassPrx::uncheckedCast(_adapter->createProxy(_identity));
}

Test::Struct
MyDerivedClassI::opStruct(const Test::Struct& p1, const ::Test::Struct& p2, ::Test::Struct& p3)
{
    p3 = p1;
    p3.s.s = "a new string";
    return p2;
}

Test::ByteS
MyDerivedClassI::opByteS(const Test::ByteS& p1,
			 const Test::ByteS& p2,
			 Test::ByteS& p3)
{
    p3.resize(p1.size());
    std::reverse_copy(p1.begin(), p1.end(), p3.begin());
    Test::ByteS r = p1;
    std::copy(p2.begin(), p2.end(), std::back_inserter(r));
    return r;
}

Test::BoolS
MyDerivedClassI::opBoolS(const Test::BoolS& p1,
			 const Test::BoolS& p2,
			 Test::BoolS& p3)
{
    p3 = p1;
    std::copy(p2.begin(), p2.end(), std::back_inserter(p3));
    Test::BoolS r;
    r.resize(p1.size());
    std::reverse_copy(p1.begin(), p1.end(), r.begin());
    return r;
}

Test::LongS
MyDerivedClassI::opShortIntLongS(const Test::ShortS& p1,
				 const Test::IntS& p2,
				 const Test::LongS& p3,
				 Test::ShortS& p4,
				 Test::IntS& p5,
				 Test::LongS& p6)
{
    p4 = p1;
    p5.resize(p2.size());
    std::reverse_copy(p2.begin(), p2.end(), p5.begin());
    p6 = p3;
    std::copy(p3.begin(), p3.end(), std::back_inserter(p6));
    return p3;
}

Test::DoubleS
MyDerivedClassI::opFloatDoubleS(const Test::FloatS& p1,
				const Test::DoubleS& p2,
				Test::FloatS& p3,
				Test::DoubleS& p4)
{
    p3 = p1;
    p4.resize(p2.size());
    std::reverse_copy(p2.begin(), p2.end(), p4.begin());
    Test::DoubleS r = p2;
    std::copy(p1.begin(), p1.end(), std::back_inserter(r));
    return r;
}

Test::StringS
MyDerivedClassI::opStringS(const Test::StringS& p1,
			   const Test::StringS& p2,
			   Test::StringS& p3)
{
    p3 = p1;
    std::copy(p2.begin(), p2.end(), std::back_inserter(p3));
    Test::StringS r;
    r.resize(p1.size());
    std::reverse_copy(p1.begin(), p1.end(), r.begin());
    return r;
}

Test::WStringS
MyDerivedClassI::opWStringS(const Test::WStringS& p1,
			    const Test::WStringS& p2,
			    Test::WStringS& p3)
{
    p3 = p1;
    std::copy(p2.begin(), p2.end(), std::back_inserter(p3));
    Test::WStringS r;
    r.resize(p1.size());
    std::reverse_copy(p1.begin(), p1.end(), r.begin());
    return r;
}

Test::ByteSS
MyDerivedClassI::opByteSS(const Test::ByteSS& p1,
			  const Test::ByteSS& p2,
			  Test::ByteSS& p3)
{
    p3.resize(p1.size());
    std::reverse_copy(p1.begin(), p1.end(), p3.begin());
    Test::ByteSS r = p1;
    std::copy(p2.begin(), p2.end(), std::back_inserter(r));
    return r;
}

Test::BoolSS
MyDerivedClassI::opBoolSS(const Test::BoolSS& p1,
			  const Test::BoolSS& p2,
			  Test::BoolSS& p3)
{
    p3 = p1;
    std::copy(p2.begin(), p2.end(), std::back_inserter(p3));
    Test::BoolSS r;
    r.resize(p1.size());
    std::reverse_copy(p1.begin(), p1.end(), r.begin());
    return r;
}

Test::LongSS
MyDerivedClassI::opShortIntLongSS(const Test::ShortSS& p1,
				  const Test::IntSS& p2,
				  const Test::LongSS& p3,
				  Test::ShortSS& p4,
				  Test::IntSS& p5,
				  Test::LongSS& p6)
{
    p4 = p1;
    p5.resize(p2.size());
    std::reverse_copy(p2.begin(), p2.end(), p5.begin());
    p6 = p3;
    std::copy(p3.begin(), p3.end(), std::back_inserter(p6));
    return p3;
}

Test::DoubleSS
MyDerivedClassI::opFloatDoubleSS(const Test::FloatSS& p1,
				 const Test::DoubleSS& p2,
				 Test::FloatSS& p3,
				 Test::DoubleSS& p4)
{
    p3 = p1;
    p4.resize(p2.size());
    std::reverse_copy(p2.begin(), p2.end(), p4.begin());
    Test::DoubleSS r = p2;
    std::copy(p2.begin(), p2.end(), std::back_inserter(r));
    return r;
}

Test::StringSS
MyDerivedClassI::opStringSS(const Test::StringSS& p1,
			    const Test::StringSS& p2,
			    Test::StringSS& p3)
{
    p3 = p1;
    std::copy(p2.begin(), p2.end(), std::back_inserter(p3));
    Test::StringSS r;
    r.resize(p2.size());
    std::reverse_copy(p2.begin(), p2.end(), r.begin());
    return r;
}

Test::WStringSS
MyDerivedClassI::opWStringSS(const Test::WStringSS& p1,
			     const Test::WStringSS& p2,
			     Test::WStringSS& p3)
{
    p3 = p1;
    std::copy(p2.begin(), p2.end(), std::back_inserter(p3));
    Test::WStringSS r;
    r.resize(p2.size());
    std::reverse_copy(p2.begin(), p2.end(), r.begin());
    return r;
}

Test::ByteBoolD
MyDerivedClassI::opByteBoolD(const Test::ByteBoolD& p1, const Test::ByteBoolD& p2,
			     Test::ByteBoolD& p3)
{
    p3 = p1;
    Test::ByteBoolD r = p1;
    std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
    return r;
}

Test::ShortIntD
MyDerivedClassI::opShortIntD(const Test::ShortIntD& p1, const Test::ShortIntD& p2,
			     Test::ShortIntD& p3)
{
    p3 = p1;
    Test::ShortIntD r = p1;
    std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
    return r;
}

Test::LongFloatD
MyDerivedClassI::opLongFloatD(const Test::LongFloatD& p1, const Test::LongFloatD& p2,
			      Test::LongFloatD& p3)
{
    p3 = p1;
    Test::LongFloatD r = p1;
    std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
    return r;
}

Test::DoubleStringD
MyDerivedClassI::opDoubleStringD(const Test::DoubleStringD& p1, const Test::DoubleStringD& p2,
				 Test::DoubleStringD& p3)
{
    p3 = p1;
    Test::DoubleStringD r = p1;
    std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
    return r;
}

Test::StringStringD
MyDerivedClassI::opStringStringD(const Test::StringStringD& p1, const Test::StringStringD& p2,
				 Test::StringStringD& p3)
{
    p3 = p1;
    Test::StringStringD r = p1;
    std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
    return r;
}

Test::WStringMyEnumD
MyDerivedClassI::opWStringMyEnumD(const Test::WStringMyEnumD& p1, const Test::WStringMyEnumD& p2,
				  Test::WStringMyEnumD& p3)
{
    p3 = p1;
    Test::WStringMyEnumD r = p1;
    std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
    return r;
}

using namespace std;

Test::MyClassStringD
MyDerivedClassI::opMyClassStringD(const Test::MyClassStringD& p1, const Test::MyClassStringD& p2,
				  Test::MyClassStringD& p3)
{
    Test::MyClassPrx p = Test::MyClassPrx::uncheckedCast(_adapter->createProxy(_identity));
    p3 = p1;
    Test::MyClassStringD r;
    std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
    return r;
}

void
MyDerivedClassI::opDerived()
{
};