1 //
2 // Copyright (c) ZeroC, Inc. All rights reserved.
3 //
4
5 #include <Ice/Ice.h>
6 #include <TestAMDI.h>
7 #include <TestHelper.h>
8 #include <functional>
9 #include <iterator>
10
11 using namespace Ice;
12 using namespace Test;
13
14 using namespace std;
15
MyDerivedClassI()16 MyDerivedClassI::MyDerivedClassI() : _opByteSOnewayCallCount(0)
17 {
18 }
19
20 bool
ice_isA(ICE_IN (string)id,const Ice::Current & current) const21 MyDerivedClassI::ice_isA(ICE_IN(string) id, const Ice::Current& current) const
22 {
23 test(current.mode == ICE_ENUM(OperationMode, Nonmutating));
24 #ifdef ICE_CPP11_MAPPING
25 return Test::MyDerivedClass::ice_isA(move(id), current);
26 #else
27 return Test::MyDerivedClass::ice_isA(id, current);
28 #endif
29 }
30
31 void
ice_ping(const Ice::Current & current) const32 MyDerivedClassI::ice_ping(const Ice::Current& current) const
33 {
34 test(current.mode == ICE_ENUM(OperationMode, Nonmutating));
35 Test::MyDerivedClass::ice_ping(current);
36
37 }
38
39 std::vector<std::string>
ice_ids(const Ice::Current & current) const40 MyDerivedClassI::ice_ids(const Ice::Current& current) const
41 {
42 test(current.mode == ICE_ENUM(OperationMode, Nonmutating));
43 return Test::MyDerivedClass::ice_ids(current);
44 }
45
46 #ifdef ICE_CPP11_MAPPING
47 std::string
48 #else
49 const std::string&
50 #endif
ice_id(const Ice::Current & current) const51 MyDerivedClassI::ice_id(const Ice::Current& current) const
52 {
53 test(current.mode == ICE_ENUM(OperationMode, Nonmutating));
54 return Test::MyDerivedClass::ice_id(current);
55 }
56
57 #ifdef ICE_CPP11_MAPPING
58
59 class Thread_opVoid : public IceUtil::Thread
60 {
61 public:
62
Thread_opVoid(function<void ()> response)63 Thread_opVoid(function<void()> response) :
64 _response(move(response))
65 {
66 }
67
run()68 virtual void run()
69 {
70 _response();
71 }
72
73 private:
74
75 function<void()> _response;
76 };
77
78 void
shutdownAsync(function<void ()> response,function<void (exception_ptr)>,const Ice::Current & current)79 MyDerivedClassI::shutdownAsync(function<void()> response,
80 function<void(exception_ptr)>,
81 const Ice::Current& current)
82 {
83 {
84 IceUtil::Mutex::Lock sync(_opVoidMutex);
85 if(_opVoidThread)
86 {
87 _opVoidThread->getThreadControl().join();
88 _opVoidThread = 0;
89 }
90 }
91
92 current.adapter->getCommunicator()->shutdown();
93 response();
94 }
95
96 void
supportsCompressAsync(std::function<void (bool)> response,std::function<void (std::exception_ptr)>,const Ice::Current &)97 MyDerivedClassI::supportsCompressAsync(std::function<void(bool)> response,
98 std::function<void(std::exception_ptr)>, const Ice::Current&)
99 {
100 #if defined(ICE_OS_UWP)
101 response(false);
102 #else
103 response(true);
104 #endif
105 }
106
107 void
opVoidAsync(function<void ()> response,function<void (exception_ptr)>,const Ice::Current & current)108 MyDerivedClassI::opVoidAsync(function<void()> response,
109 function<void(exception_ptr)>,
110 const Ice::Current& current)
111 {
112 test(current.mode == OperationMode::Normal);
113
114 IceUtil::Mutex::Lock sync(_opVoidMutex);
115 if(_opVoidThread)
116 {
117 _opVoidThread->getThreadControl().join();
118 _opVoidThread = 0;
119 }
120
121 _opVoidThread = new Thread_opVoid(response);
122 _opVoidThread->start();
123 }
124
125 void
opByteAsync(Ice::Byte p1,Ice::Byte p2,function<void (Ice::Byte,Ice::Byte)> response,function<void (exception_ptr)>,const Ice::Current &)126 MyDerivedClassI::opByteAsync(Ice::Byte p1,
127 Ice::Byte p2,
128 function<void(Ice::Byte, Ice::Byte)> response,
129 function<void(exception_ptr)>,
130 const Ice::Current&)
131 {
132 response(p1, p1 ^ p2);
133 }
134
135 void
opBoolAsync(bool p1,bool p2,function<void (bool,bool)> response,function<void (exception_ptr)>,const Ice::Current &)136 MyDerivedClassI::opBoolAsync(bool p1,
137 bool p2,
138 function<void(bool, bool)> response,
139 function<void(exception_ptr)>,
140 const Ice::Current&)
141 {
142 response(p2, p1);
143 }
144
145 void
opShortIntLongAsync(short p1,int p2,long long int p3,function<void (long long int,short,int,long long int)> response,function<void (exception_ptr)>,const Ice::Current &)146 MyDerivedClassI::opShortIntLongAsync(short p1,
147 int p2,
148 long long int p3,
149 function<void(long long int, short, int, long long int)> response,
150 function<void(exception_ptr)>,
151 const Ice::Current&)
152 {
153 response(p3, p1, p2, p3);
154 }
155
156 void
opFloatDoubleAsync(float p1,double p2,function<void (double,float,double)> response,function<void (exception_ptr)>,const Ice::Current &)157 MyDerivedClassI::opFloatDoubleAsync(float p1,
158 double p2,
159 function<void(double, float, double)> response,
160 function<void(exception_ptr)>,
161 const Ice::Current&)
162 {
163 response(p2, p1, p2);
164 }
165
166 void
opStringAsync(string p1,string p2,function<void (const string &,const string &)> response,function<void (exception_ptr)>,const Ice::Current &)167 MyDerivedClassI::opStringAsync(string p1,
168 string p2,
169 function<void(const string&, const string&)> response,
170 function<void(exception_ptr)>,
171 const Ice::Current&)
172 {
173 response(p1 + " " + p2, p2 + " " + p1);
174 }
175
176 void
opMyEnumAsync(Test::MyEnum p1,function<void (Test::MyEnum,Test::MyEnum)> response,function<void (exception_ptr)>,const Ice::Current &)177 MyDerivedClassI::opMyEnumAsync(Test::MyEnum p1,
178 function<void(Test::MyEnum, Test::MyEnum)> response,
179 function<void(exception_ptr)>,
180 const Ice::Current&)
181 {
182 response(MyEnum::enum3, p1);
183 }
184
185 void
opMyClassAsync(shared_ptr<Test::MyClassPrx> p1,function<void (const shared_ptr<Test::MyClassPrx> &,const shared_ptr<Test::MyClassPrx> &,const shared_ptr<Test::MyClassPrx> &)> response,function<void (exception_ptr)>,const Ice::Current & current)186 MyDerivedClassI::opMyClassAsync(shared_ptr<Test::MyClassPrx> p1,
187 function<void(const shared_ptr<Test::MyClassPrx>&,
188 const shared_ptr<Test::MyClassPrx>&,
189 const shared_ptr<Test::MyClassPrx>&)> response,
190 function<void(exception_ptr)>,
191 const Ice::Current& current)
192 {
193 auto p2 = p1;
194 auto p3 = uncheckedCast<Test::MyClassPrx>(current.adapter->createProxy(
195 stringToIdentity("noSuchIdentity")));
196 response(uncheckedCast<Test::MyClassPrx>(current.adapter->createProxy(current.id)), p2, p3);
197 }
198
199 void
opStructAsync(Test::Structure p1,Test::Structure p2,function<void (const Test::Structure &,const Test::Structure &)> response,function<void (exception_ptr)>,const Ice::Current &)200 MyDerivedClassI::opStructAsync(Test::Structure p1,
201 Test::Structure p2,
202 function<void(const Test::Structure&, const Test::Structure&)> response,
203 function<void(exception_ptr)>,
204 const Ice::Current&)
205 {
206 Test::Structure p3 = p1;
207 p3.s.s = "a new string";
208 response(p2, p3);
209 }
210
211 void
opByteSAsync(Test::ByteS p1,Test::ByteS p2,function<void (const Test::ByteS &,const Test::ByteS &)> response,function<void (exception_ptr)>,const Ice::Current &)212 MyDerivedClassI::opByteSAsync(Test::ByteS p1,
213 Test::ByteS p2,
214 function<void(const Test::ByteS&, const Test::ByteS&)> response,
215 function<void(exception_ptr)>,
216 const Ice::Current&)
217 {
218 Test::ByteS p3;
219 p3.resize(p1.size());
220 std::reverse_copy(p1.begin(), p1.end(), p3.begin());
221 Test::ByteS r = p1;
222 std::copy(p2.begin(), p2.end(), std::back_inserter(r));
223 response(r, p3);
224 }
225
226 void
opBoolSAsync(Test::BoolS p1,Test::BoolS p2,function<void (const Test::BoolS &,const Test::BoolS &)> response,function<void (exception_ptr)>,const Ice::Current &)227 MyDerivedClassI::opBoolSAsync(Test::BoolS p1,
228 Test::BoolS p2,
229 function<void(const Test::BoolS&, const Test::BoolS&)> response,
230 function<void(exception_ptr)>,
231 const Ice::Current&)
232 {
233 Test::BoolS p3 = p1;
234 std::copy(p2.begin(), p2.end(), std::back_inserter(p3));
235 Test::BoolS r;
236 r.resize(p1.size());
237 std::reverse_copy(p1.begin(), p1.end(), r.begin());
238 response(r, p3);
239 }
240
241 void
opShortIntLongSAsync(Test::ShortS p1,Test::IntS p2,Test::LongS p3,function<void (const Test::LongS &,const Test::ShortS &,const Test::IntS &,const Test::LongS &)> response,function<void (exception_ptr)>,const Ice::Current &)242 MyDerivedClassI::opShortIntLongSAsync(Test::ShortS p1,
243 Test::IntS p2,
244 Test::LongS p3,
245 function<void(const Test::LongS&,
246 const Test::ShortS&,
247 const Test::IntS&,
248 const Test::LongS&)> response,
249 function<void(exception_ptr)>,
250 const Ice::Current&)
251 {
252 Test::ShortS p4 = p1;
253 Test::IntS p5;
254 p5.resize(p2.size());
255 std::reverse_copy(p2.begin(), p2.end(), p5.begin());
256 Test::LongS p6 = p3;
257 std::copy(p3.begin(), p3.end(), std::back_inserter(p6));
258 response(p3, p4, p5, p6);
259 }
260
261 void
opFloatDoubleSAsync(Test::FloatS p1,Test::DoubleS p2,function<void (const Test::DoubleS &,const Test::FloatS &,const Test::DoubleS &)> response,function<void (exception_ptr)>,const Ice::Current &)262 MyDerivedClassI::opFloatDoubleSAsync(Test::FloatS p1,
263 Test::DoubleS p2,
264 function<void(const Test::DoubleS&,
265 const Test::FloatS&,
266 const Test::DoubleS&)> response,
267 function<void(exception_ptr)>,
268 const Ice::Current&)
269 {
270 Test::FloatS p3 = p1;
271 Test::DoubleS p4;
272 p4.resize(p2.size());
273 std::reverse_copy(p2.begin(), p2.end(), p4.begin());
274 Test::DoubleS r = p2;
275 std::copy(p1.begin(), p1.end(), std::back_inserter(r));
276 response(r, p3, p4);
277 }
278
279 void
opStringSAsync(Test::StringS p1,Test::StringS p2,function<void (const Test::StringS &,const Test::StringS &)> response,function<void (exception_ptr)>,const Ice::Current &)280 MyDerivedClassI::opStringSAsync(Test::StringS p1,
281 Test::StringS p2,
282 function<void(const Test::StringS&, const Test::StringS&)> response,
283 function<void(exception_ptr)>,
284 const Ice::Current&)
285 {
286 Test::StringS p3 = p1;
287 std::copy(p2.begin(), p2.end(), std::back_inserter(p3));
288 Test::StringS r;
289 r.resize(p1.size());
290 std::reverse_copy(p1.begin(), p1.end(), r.begin());
291 response(r, p3);
292 }
293
294 void
opByteSSAsync(Test::ByteSS p1,Test::ByteSS p2,function<void (const Test::ByteSS &,const Test::ByteSS &)> response,function<void (exception_ptr)>,const Ice::Current &)295 MyDerivedClassI::opByteSSAsync(Test::ByteSS p1,
296 Test::ByteSS p2,
297 function<void(const Test::ByteSS&, const Test::ByteSS&)> response,
298 function<void(exception_ptr)>,
299 const Ice::Current&)
300 {
301 Test::ByteSS p3;
302 p3.resize(p1.size());
303 std::reverse_copy(p1.begin(), p1.end(), p3.begin());
304 Test::ByteSS r = p1;
305 std::copy(p2.begin(), p2.end(), std::back_inserter(r));
306 response(r, p3);
307 }
308
309 void
opBoolSSAsync(Test::BoolSS p1,Test::BoolSS p2,function<void (const Test::BoolSS &,const Test::BoolSS &)> response,function<void (exception_ptr)>,const Ice::Current &)310 MyDerivedClassI::opBoolSSAsync(Test::BoolSS p1,
311 Test::BoolSS p2,
312 function<void(const Test::BoolSS&, const Test::BoolSS&)> response,
313 function<void(exception_ptr)>,
314 const Ice::Current&)
315 {
316 auto p3 = p1;
317 std::copy(p2.begin(), p2.end(), std::back_inserter(p3));
318 Test::BoolSS r;
319 r.resize(p1.size());
320 std::reverse_copy(p1.begin(), p1.end(), r.begin());
321 response(r, p3);
322 }
323
324 void
opShortIntLongSSAsync(Test::ShortSS p1,Test::IntSS p2,Test::LongSS p3,function<void (const Test::LongSS &,const Test::ShortSS &,const Test::IntSS &,const Test::LongSS &)> response,function<void (exception_ptr)>,const Ice::Current &)325 MyDerivedClassI::opShortIntLongSSAsync(Test::ShortSS p1,
326 Test::IntSS p2,
327 Test::LongSS p3,
328 function<void(const Test::LongSS&,
329 const Test::ShortSS&,
330 const Test::IntSS&,
331 const Test::LongSS&)> response,
332 function<void(exception_ptr)>,
333 const Ice::Current&)
334 {
335 auto p4 = p1;
336 Test::IntSS p5;
337 p5.resize(p2.size());
338 std::reverse_copy(p2.begin(), p2.end(), p5.begin());
339 auto p6 = p3;
340 std::copy(p3.begin(), p3.end(), std::back_inserter(p6));
341 response(p3, p4, p5, p6);
342 }
343
344 void
opFloatDoubleSSAsync(Test::FloatSS p1,Test::DoubleSS p2,function<void (const Test::DoubleSS &,const Test::FloatSS &,const Test::DoubleSS &)> response,function<void (exception_ptr)>,const Ice::Current &)345 MyDerivedClassI::opFloatDoubleSSAsync(Test::FloatSS p1,
346 Test::DoubleSS p2,
347 function<void(const Test::DoubleSS&,
348 const Test::FloatSS&,
349 const Test::DoubleSS&)> response,
350 function<void(exception_ptr)>,
351 const Ice::Current&)
352 {
353 Test::FloatSS p3 = p1;
354 Test::DoubleSS p4;
355 p4.resize(p2.size());
356 std::reverse_copy(p2.begin(), p2.end(), p4.begin());
357 Test::DoubleSS r = p2;
358 std::copy(p2.begin(), p2.end(), std::back_inserter(r));
359 response(r, p3, p4);
360 }
361
362 void
opStringSSAsync(Test::StringSS p1,Test::StringSS p2,function<void (const Test::StringSS &,const Test::StringSS &)> response,function<void (exception_ptr)>,const Ice::Current &)363 MyDerivedClassI::opStringSSAsync(Test::StringSS p1,
364 Test::StringSS p2,
365 function<void(const Test::StringSS&, const Test::StringSS&)> response,
366 function<void(exception_ptr)>,
367 const Ice::Current&)
368 {
369 Test::StringSS p3 = p1;
370 std::copy(p2.begin(), p2.end(), std::back_inserter(p3));
371 Test::StringSS r;
372 r.resize(p2.size());
373 std::reverse_copy(p2.begin(), p2.end(), r.begin());
374 response(r, p3);
375 }
376
377 void
opStringSSSAsync(Test::StringSSS p1,Test::StringSSS p2,function<void (const Test::StringSSS &,const Test::StringSSS &)> response,function<void (exception_ptr)>,const Ice::Current &)378 MyDerivedClassI::opStringSSSAsync(Test::StringSSS p1, Test::StringSSS p2,
379 function<void(const Test::StringSSS&, const Test::StringSSS&)> response,
380 function<void(exception_ptr)>,
381 const Ice::Current&)
382 {
383 Test::StringSSS p3 = p1;
384 std::copy(p2.begin(), p2.end(), std::back_inserter(p3));
385 Test::StringSSS r;
386 r.resize(p2.size());
387 std::reverse_copy(p2.begin(), p2.end(), r.begin());
388 response(r, p3);
389 }
390
391 void
opByteBoolDAsync(Test::ByteBoolD p1,Test::ByteBoolD p2,function<void (const Test::ByteBoolD &,const Test::ByteBoolD &)> response,function<void (exception_ptr)>,const Ice::Current &)392 MyDerivedClassI::opByteBoolDAsync(Test::ByteBoolD p1, Test::ByteBoolD p2,
393 function<void(const Test::ByteBoolD&, const Test::ByteBoolD&)> response,
394 function<void(exception_ptr)>,
395 const Ice::Current&)
396 {
397 Test::ByteBoolD p3 = p1;
398 Test::ByteBoolD r = p1;
399 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
400 response(r, p3);
401 }
402
403 void
opShortIntDAsync(Test::ShortIntD p1,Test::ShortIntD p2,function<void (const Test::ShortIntD &,const Test::ShortIntD &)> response,function<void (exception_ptr)>,const Ice::Current &)404 MyDerivedClassI::opShortIntDAsync(Test::ShortIntD p1, Test::ShortIntD p2,
405 function<void(const Test::ShortIntD&, const Test::ShortIntD&)> response,
406 function<void(exception_ptr)>,
407 const Ice::Current&)
408 {
409 Test::ShortIntD p3 = p1;
410 Test::ShortIntD r = p1;
411 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
412 response(r, p3);
413 }
414
415 void
opLongFloatDAsync(Test::LongFloatD p1,Test::LongFloatD p2,function<void (const Test::LongFloatD &,const Test::LongFloatD &)> response,function<void (exception_ptr)>,const Ice::Current &)416 MyDerivedClassI::opLongFloatDAsync(Test::LongFloatD p1, Test::LongFloatD p2,
417 function<void(const Test::LongFloatD&, const Test::LongFloatD&)> response,
418 function<void(exception_ptr)>,
419 const Ice::Current&)
420 {
421 Test::LongFloatD p3 = p1;
422 Test::LongFloatD r = p1;
423 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
424 response(r, p3);
425 }
426
427 void
opStringStringDAsync(Test::StringStringD p1,Test::StringStringD p2,function<void (const Test::StringStringD &,const Test::StringStringD &)> response,function<void (exception_ptr)>,const Ice::Current &)428 MyDerivedClassI::opStringStringDAsync(Test::StringStringD p1, Test::StringStringD p2,
429 function<void(const Test::StringStringD&, const Test::StringStringD&)> response,
430 function<void(exception_ptr)>,
431 const Ice::Current&)
432 {
433 Test::StringStringD p3 = p1;
434 Test::StringStringD r = p1;
435 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
436 response(r, p3);
437 }
438
439 void
opStringMyEnumDAsync(Test::StringMyEnumD p1,Test::StringMyEnumD p2,function<void (const Test::StringMyEnumD &,const Test::StringMyEnumD &)> response,function<void (exception_ptr)>,const Ice::Current &)440 MyDerivedClassI::opStringMyEnumDAsync(Test::StringMyEnumD p1, Test::StringMyEnumD p2,
441 function<void(const Test::StringMyEnumD&, const Test::StringMyEnumD&)> response,
442 function<void(exception_ptr)>,
443 const Ice::Current&)
444 {
445 Test::StringMyEnumD p3 = p1;
446 Test::StringMyEnumD r = p1;
447 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
448 response(r, p3);
449 }
450
451 void
opMyEnumStringDAsync(Test::MyEnumStringD p1,Test::MyEnumStringD p2,function<void (const Test::MyEnumStringD &,const Test::MyEnumStringD &)> response,function<void (exception_ptr)>,const Ice::Current &)452 MyDerivedClassI::opMyEnumStringDAsync(Test::MyEnumStringD p1, Test::MyEnumStringD p2,
453 function<void(const Test::MyEnumStringD&, const Test::MyEnumStringD&)> response,
454 function<void(exception_ptr)>,
455 const Ice::Current&)
456 {
457 Test::MyEnumStringD p3 = p1;
458 Test::MyEnumStringD r = p1;
459 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
460 response(r, p3);
461 }
462
463 void
opMyStructMyEnumDAsync(Test::MyStructMyEnumD p1,Test::MyStructMyEnumD p2,function<void (const Test::MyStructMyEnumD &,const Test::MyStructMyEnumD &)> response,function<void (exception_ptr)>,const Ice::Current &)464 MyDerivedClassI::opMyStructMyEnumDAsync(Test::MyStructMyEnumD p1, Test::MyStructMyEnumD p2,
465 function<void(const Test::MyStructMyEnumD&,
466 const Test::MyStructMyEnumD&)> response,
467 function<void(exception_ptr)>,
468 const Ice::Current&)
469 {
470 Test::MyStructMyEnumD p3 = p1;
471 Test::MyStructMyEnumD r = p1;
472 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
473 response(r, p3);
474 }
475
476 void
opByteBoolDSAsync(Test::ByteBoolDS p1,Test::ByteBoolDS p2,function<void (const Test::ByteBoolDS &,const Test::ByteBoolDS &)> response,function<void (exception_ptr)>,const Ice::Current &)477 MyDerivedClassI::opByteBoolDSAsync(Test::ByteBoolDS p1,
478 Test::ByteBoolDS p2,
479 function<void(const Test::ByteBoolDS&, const Test::ByteBoolDS&)> response,
480 function<void(exception_ptr)>,
481 const Ice::Current&)
482 {
483 Test::ByteBoolDS p3 = p2;
484 std::copy(p1.begin(), p1.end(), std::back_inserter(p3));
485 Test::ByteBoolDS r;
486 r.resize(p1.size());
487 std::reverse_copy(p1.begin(), p1.end(), r.begin());
488 response(r, p3);
489 }
490
491 void
opShortIntDSAsync(Test::ShortIntDS p1,Test::ShortIntDS p2,function<void (const Test::ShortIntDS &,const Test::ShortIntDS &)> response,function<void (exception_ptr)>,const Ice::Current &)492 MyDerivedClassI::opShortIntDSAsync(Test::ShortIntDS p1,
493 Test::ShortIntDS p2,
494 function<void(const Test::ShortIntDS&, const Test::ShortIntDS&)> response,
495 function<void(exception_ptr)>,
496 const Ice::Current&)
497 {
498 Test::ShortIntDS p3 = p2;
499 std::copy(p1.begin(), p1.end(), std::back_inserter(p3));
500 Test::ShortIntDS r;
501 r.resize(p1.size());
502 std::reverse_copy(p1.begin(), p1.end(), r.begin());
503 response(r, p3);
504 }
505
506 void
opLongFloatDSAsync(Test::LongFloatDS p1,Test::LongFloatDS p2,function<void (const Test::LongFloatDS &,const Test::LongFloatDS &)> response,function<void (exception_ptr)>,const Ice::Current &)507 MyDerivedClassI::opLongFloatDSAsync(Test::LongFloatDS p1,
508 Test::LongFloatDS p2,
509 function<void(const Test::LongFloatDS&, const Test::LongFloatDS&)> response,
510 function<void(exception_ptr)>,
511 const Ice::Current&)
512 {
513 Test::LongFloatDS p3 = p2;
514 std::copy(p1.begin(), p1.end(), std::back_inserter(p3));
515 Test::LongFloatDS r;
516 r.resize(p1.size());
517 std::reverse_copy(p1.begin(), p1.end(), r.begin());
518 response(r, p3);
519 }
520
521 void
opStringStringDSAsync(Test::StringStringDS p1,Test::StringStringDS p2,function<void (const Test::StringStringDS &,const Test::StringStringDS &)> response,function<void (exception_ptr)>,const Ice::Current &)522 MyDerivedClassI::opStringStringDSAsync(Test::StringStringDS p1,
523 Test::StringStringDS p2,
524 function<void(const Test::StringStringDS&, const Test::StringStringDS&)> response,
525 function<void(exception_ptr)>,
526 const Ice::Current&)
527 {
528 Test::StringStringDS p3 = p2;
529 std::copy(p1.begin(), p1.end(), std::back_inserter(p3));
530 Test::StringStringDS r;
531 r.resize(p1.size());
532 std::reverse_copy(p1.begin(), p1.end(), r.begin());
533 response(r, p3);
534 }
535
536 void
opStringMyEnumDSAsync(Test::StringMyEnumDS p1,Test::StringMyEnumDS p2,function<void (const Test::StringMyEnumDS &,const Test::StringMyEnumDS &)> response,function<void (exception_ptr)>,const Ice::Current &)537 MyDerivedClassI::opStringMyEnumDSAsync(Test::StringMyEnumDS p1,
538 Test::StringMyEnumDS p2,
539 function<void(const Test::StringMyEnumDS&, const Test::StringMyEnumDS&)> response,
540 function<void(exception_ptr)>,
541 const Ice::Current&)
542 {
543 Test::StringMyEnumDS p3 = p2;
544 std::copy(p1.begin(), p1.end(), std::back_inserter(p3));
545 Test::StringMyEnumDS r;
546 r.resize(p1.size());
547 std::reverse_copy(p1.begin(), p1.end(), r.begin());
548 response(r, p3);
549 }
550
551 void
opMyEnumStringDSAsync(Test::MyEnumStringDS p1,Test::MyEnumStringDS p2,function<void (const Test::MyEnumStringDS &,const Test::MyEnumStringDS &)> response,function<void (exception_ptr)>,const Ice::Current &)552 MyDerivedClassI::opMyEnumStringDSAsync(Test::MyEnumStringDS p1,
553 Test::MyEnumStringDS p2,
554 function<void(const Test::MyEnumStringDS&, const Test::MyEnumStringDS&)> response,
555 function<void(exception_ptr)>,
556 const Ice::Current&)
557 {
558 Test::MyEnumStringDS p3 = p2;
559 std::copy(p1.begin(), p1.end(), std::back_inserter(p3));
560 Test::MyEnumStringDS r;
561 r.resize(p1.size());
562 std::reverse_copy(p1.begin(), p1.end(), r.begin());
563 response(r, p3);
564 }
565
566 void
opMyStructMyEnumDSAsync(Test::MyStructMyEnumDS p1,Test::MyStructMyEnumDS p2,function<void (const Test::MyStructMyEnumDS &,const Test::MyStructMyEnumDS &)> response,function<void (exception_ptr)>,const Ice::Current &)567 MyDerivedClassI::opMyStructMyEnumDSAsync(Test::MyStructMyEnumDS p1,
568 Test::MyStructMyEnumDS p2,
569 function<void(const Test::MyStructMyEnumDS&,
570 const Test::MyStructMyEnumDS&)> response,
571 function<void(exception_ptr)>,
572 const Ice::Current&)
573 {
574 Test::MyStructMyEnumDS p3 = p2;
575 std::copy(p1.begin(), p1.end(), std::back_inserter(p3));
576 Test::MyStructMyEnumDS r;
577 r.resize(p1.size());
578 std::reverse_copy(p1.begin(), p1.end(), r.begin());
579 response(r, p3);
580 }
581
582 void
opByteByteSDAsync(Test::ByteByteSD p1,Test::ByteByteSD p2,function<void (const Test::ByteByteSD &,const Test::ByteByteSD &)> response,function<void (exception_ptr)>,const Ice::Current &)583 MyDerivedClassI::opByteByteSDAsync(Test::ByteByteSD p1,
584 Test::ByteByteSD p2,
585 function<void(const Test::ByteByteSD&, const Test::ByteByteSD&)> response,
586 function<void(exception_ptr)>,
587 const Ice::Current&)
588 {
589 Test::ByteByteSD p3 = p2;
590 Test::ByteByteSD r;
591 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
592 response(r, p3);
593 }
594
595 void
opBoolBoolSDAsync(Test::BoolBoolSD p1,Test::BoolBoolSD p2,function<void (const Test::BoolBoolSD &,const Test::BoolBoolSD &)> response,function<void (exception_ptr)>,const Ice::Current &)596 MyDerivedClassI::opBoolBoolSDAsync(Test::BoolBoolSD p1,
597 Test::BoolBoolSD p2,
598 function<void(const Test::BoolBoolSD&, const Test::BoolBoolSD&)> response,
599 function<void(exception_ptr)>,
600 const Ice::Current&)
601 {
602 Test::BoolBoolSD p3 = p2;
603 Test::BoolBoolSD r;
604 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
605 response(r, p3);
606 }
607
608 void
opShortShortSDAsync(Test::ShortShortSD p1,Test::ShortShortSD p2,function<void (const Test::ShortShortSD &,const Test::ShortShortSD &)> response,function<void (exception_ptr)>,const Ice::Current &)609 MyDerivedClassI::opShortShortSDAsync(Test::ShortShortSD p1,
610 Test::ShortShortSD p2,
611 function<void(const Test::ShortShortSD&, const Test::ShortShortSD&)> response,
612 function<void(exception_ptr)>,
613 const Ice::Current&)
614 {
615 Test::ShortShortSD p3 = p2;
616 Test::ShortShortSD r;
617 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
618 response(r, p3);
619 }
620
621 void
opIntIntSDAsync(Test::IntIntSD p1,Test::IntIntSD p2,function<void (const Test::IntIntSD &,const Test::IntIntSD &)> response,function<void (exception_ptr)>,const Ice::Current &)622 MyDerivedClassI::opIntIntSDAsync(Test::IntIntSD p1,
623 Test::IntIntSD p2,
624 function<void(const Test::IntIntSD&, const Test::IntIntSD&)> response,
625 function<void(exception_ptr)>,
626 const Ice::Current&)
627 {
628 Test::IntIntSD p3 = p2;
629 Test::IntIntSD r;
630 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
631 response(r, p3);
632 }
633
634 void
opLongLongSDAsync(Test::LongLongSD p1,Test::LongLongSD p2,function<void (const Test::LongLongSD &,const Test::LongLongSD &)> response,function<void (exception_ptr)>,const Ice::Current &)635 MyDerivedClassI::opLongLongSDAsync(Test::LongLongSD p1,
636 Test::LongLongSD p2,
637 function<void(const Test::LongLongSD&, const Test::LongLongSD&)> response,
638 function<void(exception_ptr)>,
639 const Ice::Current&)
640 {
641 Test::LongLongSD p3 = p2;
642 Test::LongLongSD r;
643 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
644 response(r, p3);
645 }
646
647 void
opStringFloatSDAsync(Test::StringFloatSD p1,Test::StringFloatSD p2,function<void (const Test::StringFloatSD &,const Test::StringFloatSD &)> response,function<void (exception_ptr)>,const Ice::Current &)648 MyDerivedClassI::opStringFloatSDAsync(Test::StringFloatSD p1,
649 Test::StringFloatSD p2,
650 function<void(const Test::StringFloatSD&, const Test::StringFloatSD&)> response,
651 function<void(exception_ptr)>,
652 const Ice::Current&)
653 {
654 Test::StringFloatSD p3 = p2;
655 Test::StringFloatSD r;
656 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
657 response(r, p3);
658 }
659
660 void
opStringDoubleSDAsync(Test::StringDoubleSD p1,Test::StringDoubleSD p2,function<void (const Test::StringDoubleSD &,const Test::StringDoubleSD &)> response,function<void (exception_ptr)>,const Ice::Current &)661 MyDerivedClassI::opStringDoubleSDAsync(Test::StringDoubleSD p1,
662 Test::StringDoubleSD p2,
663 function<void(const Test::StringDoubleSD&,
664 const Test::StringDoubleSD&)> response,
665 function<void(exception_ptr)>,
666 const Ice::Current&)
667 {
668 Test::StringDoubleSD p3 = p2;
669 Test::StringDoubleSD r;
670 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
671 response(r, p3);
672 }
673
674 void
opStringStringSDAsync(Test::StringStringSD p1,Test::StringStringSD p2,function<void (const Test::StringStringSD &,const Test::StringStringSD &)> response,function<void (exception_ptr)>,const Ice::Current &)675 MyDerivedClassI::opStringStringSDAsync(Test::StringStringSD p1,
676 Test::StringStringSD p2,
677 function<void(const Test::StringStringSD&,
678 const Test::StringStringSD&)> response,
679 function<void(exception_ptr)>,
680 const Ice::Current&)
681 {
682 Test::StringStringSD p3 = p2;
683 Test::StringStringSD r;
684 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
685 response(r, p3);
686 }
687
688 void
opMyEnumMyEnumSDAsync(Test::MyEnumMyEnumSD p1,Test::MyEnumMyEnumSD p2,function<void (const Test::MyEnumMyEnumSD &,const Test::MyEnumMyEnumSD &)> response,function<void (exception_ptr)>,const Ice::Current &)689 MyDerivedClassI::opMyEnumMyEnumSDAsync(Test::MyEnumMyEnumSD p1,
690 Test::MyEnumMyEnumSD p2,
691 function<void(const Test::MyEnumMyEnumSD&,
692 const Test::MyEnumMyEnumSD&)> response,
693 function<void(exception_ptr)>,
694 const Ice::Current&)
695 {
696 Test::MyEnumMyEnumSD p3 = p2;
697 Test::MyEnumMyEnumSD r;
698 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
699 response(r, p3);
700 }
701
702 void
opIntSAsync(Test::IntS s,function<void (const Test::IntS &)> response,function<void (exception_ptr)>,const Ice::Current &)703 MyDerivedClassI::opIntSAsync(Test::IntS s,
704 function<void(const Test::IntS&)> response,
705 function<void(exception_ptr)>,
706 const Ice::Current&)
707 {
708 Test::IntS r;
709 std::transform(s.begin(), s.end(), std::back_inserter(r), std::negate<int>());
710 response(r);
711 }
712
713 void
opByteSOnewayAsync(Test::ByteS,function<void ()> response,function<void (exception_ptr)>,const Ice::Current &)714 MyDerivedClassI::opByteSOnewayAsync(Test::ByteS,
715 function<void()> response,
716 function<void(exception_ptr)>,
717 const Ice::Current&)
718 {
719 IceUtil::Mutex::Lock sync(_mutex);
720 ++_opByteSOnewayCallCount;
721 response();
722 }
723
724 void
opByteSOnewayCallCountAsync(function<void (int)> response,function<void (exception_ptr)>,const Ice::Current &)725 MyDerivedClassI::opByteSOnewayCallCountAsync(function<void(int)> response,
726 function<void(exception_ptr)>,
727 const Ice::Current&)
728 {
729 IceUtil::Mutex::Lock sync(_mutex);
730 response(_opByteSOnewayCallCount);
731 _opByteSOnewayCallCount = 0;
732 }
733
734 void
opContextAsync(function<void (const Ice::Context &)> response,function<void (exception_ptr)>,const Ice::Current & current)735 MyDerivedClassI::opContextAsync(function<void(const Ice::Context&)> response,
736 function<void(exception_ptr)>,
737 const Ice::Current& current)
738 {
739 Test::StringStringD r = current.ctx;
740 response(r);
741 }
742
743 void
opDoubleMarshalingAsync(Ice::Double p1,Test::DoubleS p2,function<void ()> response,function<void (exception_ptr)>,const Ice::Current &)744 MyDerivedClassI::opDoubleMarshalingAsync(Ice::Double p1,
745 Test::DoubleS p2,
746 function<void()> response,
747 function<void(exception_ptr)>,
748 const Ice::Current&)
749 {
750 Ice::Double d = 1278312346.0 / 13.0;
751 test(p1 == d);
752 for(unsigned int i = 0; i < p2.size(); ++i)
753 {
754 test(p2[i] == d);
755 }
756 response();
757 }
758
759 void
opIdempotentAsync(function<void ()> response,function<void (exception_ptr)>,const Ice::Current & current)760 MyDerivedClassI::opIdempotentAsync(function<void()> response,
761 function<void(exception_ptr)>,
762 const Ice::Current& current)
763 {
764 test(current.mode == OperationMode::Idempotent);
765 response();
766 }
767
768 void
opNonmutatingAsync(function<void ()> response,function<void (exception_ptr)>,const Ice::Current & current)769 MyDerivedClassI::opNonmutatingAsync(function<void()> response,
770 function<void(exception_ptr)>,
771 const Ice::Current& current)
772 {
773 test(current.mode == OperationMode::Nonmutating);
774 response();
775 }
776
777 void
opDerivedAsync(function<void ()> response,function<void (exception_ptr)>,const Ice::Current &)778 MyDerivedClassI::opDerivedAsync(function<void()> response,
779 function<void(exception_ptr)>,
780 const Ice::Current&)
781 {
782 response();
783 }
784
785 void
opByte1Async(Ice::Byte b,function<void (Ice::Byte)> response,function<void (exception_ptr)>,const Ice::Current &)786 MyDerivedClassI::opByte1Async(Ice::Byte b,
787 function<void(Ice::Byte)> response,
788 function<void(exception_ptr)>,
789 const Ice::Current&)
790 {
791 response(b);
792 }
793
794 void
opShort1Async(Ice::Short s,function<void (Ice::Short)> response,function<void (exception_ptr)>,const Ice::Current &)795 MyDerivedClassI::opShort1Async(Ice::Short s,
796 function<void(Ice::Short)> response,
797 function<void(exception_ptr)>,
798 const Ice::Current&)
799 {
800 response(s);
801 }
802
803 void
opInt1Async(Ice::Int i,function<void (Ice::Int)> response,function<void (exception_ptr)>,const Ice::Current &)804 MyDerivedClassI::opInt1Async(Ice::Int i,
805 function<void(Ice::Int)> response,
806 function<void(exception_ptr)>,
807 const Ice::Current&)
808 {
809 response(i);
810 }
811
812 void
opLong1Async(Ice::Long l,function<void (Ice::Long)> response,function<void (exception_ptr)>,const Ice::Current &)813 MyDerivedClassI::opLong1Async(Ice::Long l,
814 function<void(Ice::Long)> response,
815 function<void(exception_ptr)>,
816 const Ice::Current&)
817 {
818 response(l);
819 }
820
821 void
opFloat1Async(Ice::Float f,function<void (Ice::Float)> response,function<void (exception_ptr)>,const Ice::Current &)822 MyDerivedClassI::opFloat1Async(Ice::Float f,
823 function<void(Ice::Float)> response,
824 function<void(exception_ptr)>,
825 const Ice::Current&)
826 {
827 response(f);
828 }
829
830 void
opDouble1Async(Ice::Double d,function<void (Ice::Double)> response,function<void (exception_ptr)>,const Ice::Current &)831 MyDerivedClassI::opDouble1Async(Ice::Double d,
832 function<void(Ice::Double)> response,
833 function<void(exception_ptr)>,
834 const Ice::Current&)
835 {
836 response(d);
837 }
838
839 void
opString1Async(string s,function<void (const string &)> response,function<void (exception_ptr)>,const Ice::Current &)840 MyDerivedClassI::opString1Async(string s,
841 function<void(const string&)> response,
842 function<void(exception_ptr)>,
843 const Ice::Current&)
844 {
845 response(s);
846 }
847
848 void
opStringS1Async(Test::StringS seq,function<void (const Test::StringS &)> response,function<void (exception_ptr)>,const Ice::Current &)849 MyDerivedClassI::opStringS1Async(Test::StringS seq,
850 function<void(const Test::StringS&)> response,
851 function<void(exception_ptr)>,
852 const Ice::Current&)
853 {
854 response(seq);
855 }
856
857 void
opByteBoolD1Async(Test::ByteBoolD dict,function<void (const Test::ByteBoolD &)> response,function<void (exception_ptr)>,const Ice::Current &)858 MyDerivedClassI::opByteBoolD1Async(Test::ByteBoolD dict,
859 function<void(const Test::ByteBoolD&)> response,
860 function<void(exception_ptr)>,
861 const Ice::Current&)
862 {
863 response(dict);
864 }
865
866 void
opStringS2Async(Test::StringS seq,function<void (const Test::StringS &)> response,function<void (exception_ptr)>,const Ice::Current &)867 MyDerivedClassI::opStringS2Async(Test::StringS seq,
868 function<void(const Test::StringS&)> response,
869 function<void(exception_ptr)>,
870 const Ice::Current&)
871 {
872 response(seq);
873 }
874
875 void
opByteBoolD2Async(Test::ByteBoolD dict,function<void (const Test::ByteBoolD &)> response,function<void (exception_ptr)>,const Ice::Current &)876 MyDerivedClassI::opByteBoolD2Async(Test::ByteBoolD dict,
877 function<void(const Test::ByteBoolD&)> response,
878 function<void(exception_ptr)>,
879 const Ice::Current&)
880 {
881 response(dict);
882 }
883
884 void
opMyStruct1Async(Test::MyStruct1 s,function<void (const Test::MyStruct1 &)> response,function<void (exception_ptr)>,const Ice::Current &)885 MyDerivedClassI::opMyStruct1Async(Test::MyStruct1 s,
886 function<void(const Test::MyStruct1&)> response,
887 function<void(exception_ptr)>,
888 const Ice::Current&)
889 {
890 response(s);
891 }
892
893 void
opMyClass1Async(shared_ptr<Test::MyClass1> c,function<void (const shared_ptr<Test::MyClass1> &)> response,function<void (exception_ptr)>,const Ice::Current &)894 MyDerivedClassI::opMyClass1Async(shared_ptr<Test::MyClass1> c,
895 function<void(const shared_ptr<Test::MyClass1>&)> response,
896 function<void(exception_ptr)>,
897 const Ice::Current&)
898 {
899 response(c);
900 }
901
902 void
opStringLiteralsAsync(function<void (const Test::StringS &)> response,function<void (exception_ptr)>,const Ice::Current &)903 MyDerivedClassI::opStringLiteralsAsync(function<void(const Test::StringS&)> response,
904 function<void(exception_ptr)>,
905 const Ice::Current&)
906 {
907 Test::StringS data;
908 data.push_back(Test::s0);
909 data.push_back(Test::s1);
910 data.push_back(Test::s2);
911 data.push_back(Test::s3);
912 data.push_back(Test::s4);
913 data.push_back(Test::s5);
914 data.push_back(Test::s6);
915 data.push_back(Test::s7);
916 data.push_back(Test::s8);
917 data.push_back(Test::s9);
918 data.push_back(Test::s10);
919
920 data.push_back(Test::sw0);
921 data.push_back(Test::sw1);
922 data.push_back(Test::sw2);
923 data.push_back(Test::sw3);
924 data.push_back(Test::sw4);
925 data.push_back(Test::sw5);
926 data.push_back(Test::sw6);
927 data.push_back(Test::sw7);
928 data.push_back(Test::sw8);
929 data.push_back(Test::sw9);
930 data.push_back(Test::sw10);
931
932 data.push_back(Test::ss0);
933 data.push_back(Test::ss1);
934 data.push_back(Test::ss2);
935 data.push_back(Test::ss3);
936 data.push_back(Test::ss4);
937 data.push_back(Test::ss5);
938
939 data.push_back(Test::su0);
940 data.push_back(Test::su1);
941 data.push_back(Test::su2);
942
943 response(data);
944 }
945
946 void
opWStringLiteralsAsync(function<void (const Test::WStringS &)> response,function<void (exception_ptr)>,const Ice::Current &)947 MyDerivedClassI::opWStringLiteralsAsync(function<void(const Test::WStringS&)> response,
948 function<void(exception_ptr)>,
949 const Ice::Current&)
950 {
951 Test::WStringS data;
952 data.push_back(Test::ws0);
953 data.push_back(Test::ws1);
954 data.push_back(Test::ws2);
955 data.push_back(Test::ws3);
956 data.push_back(Test::ws4);
957 data.push_back(Test::ws5);
958 data.push_back(Test::ws6);
959 data.push_back(Test::ws7);
960 data.push_back(Test::ws8);
961 data.push_back(Test::ws9);
962 data.push_back(Test::ws10);
963
964 data.push_back(Test::wsw0);
965 data.push_back(Test::wsw1);
966 data.push_back(Test::wsw2);
967 data.push_back(Test::wsw3);
968 data.push_back(Test::wsw4);
969 data.push_back(Test::wsw5);
970 data.push_back(Test::wsw6);
971 data.push_back(Test::wsw7);
972 data.push_back(Test::wsw8);
973 data.push_back(Test::wsw9);
974 data.push_back(Test::wsw10);
975
976 data.push_back(Test::wss0);
977 data.push_back(Test::wss1);
978 data.push_back(Test::wss2);
979 data.push_back(Test::wss3);
980 data.push_back(Test::wss4);
981 data.push_back(Test::wss5);
982
983 data.push_back(Test::wsu0);
984 data.push_back(Test::wsu1);
985 data.push_back(Test::wsu2);
986
987 response(data);
988 }
989
990 void
opMStruct1Async(function<void (const OpMStruct1MarshaledResult &)> response,function<void (std::exception_ptr)>,const Ice::Current & current)991 MyDerivedClassI::opMStruct1Async(function<void(const OpMStruct1MarshaledResult&)> response,
992 function<void(std::exception_ptr)>,
993 const Ice::Current& current)
994 {
995 Test::Structure s;
996 s.e = ICE_ENUM(MyEnum, enum1); // enum must be initialized
997 response(OpMStruct1MarshaledResult(s, current));
998 }
999
1000 void
opMStruct2Async(Test::Structure p1,function<void (const OpMStruct2MarshaledResult &)> response,function<void (std::exception_ptr)>,const Ice::Current & current)1001 MyDerivedClassI::opMStruct2Async(Test::Structure p1,
1002 function<void(const OpMStruct2MarshaledResult&)> response,
1003 function<void(std::exception_ptr)>,
1004 const Ice::Current& current)
1005 {
1006 response(OpMStruct2MarshaledResult(p1, p1, current));
1007 }
1008
1009 void
opMSeq1Async(function<void (const OpMSeq1MarshaledResult &)> response,function<void (std::exception_ptr)>,const Ice::Current & current)1010 MyDerivedClassI::opMSeq1Async(function<void(const OpMSeq1MarshaledResult&)> response,
1011 function<void(std::exception_ptr)>,
1012 const Ice::Current& current)
1013 {
1014 response(OpMSeq1MarshaledResult(Test::StringS(), current));
1015 }
1016
1017 void
opMSeq2Async(Test::StringS p1,function<void (const OpMSeq2MarshaledResult &)> response,function<void (std::exception_ptr)>,const Ice::Current & current)1018 MyDerivedClassI::opMSeq2Async(Test::StringS p1,
1019 function<void(const OpMSeq2MarshaledResult&)> response,
1020 function<void(std::exception_ptr)>,
1021 const Ice::Current& current)
1022 {
1023 response(OpMSeq2MarshaledResult(p1, p1, current));
1024 }
1025
1026 void
opMDict1Async(function<void (const OpMDict1MarshaledResult &)> response,function<void (std::exception_ptr)>,const Ice::Current & current)1027 MyDerivedClassI::opMDict1Async(function<void(const OpMDict1MarshaledResult&)> response,
1028 function<void(std::exception_ptr)>,
1029 const Ice::Current& current)
1030 {
1031 response(OpMDict1MarshaledResult(Test::StringStringD(), current));
1032 }
1033
1034 void
opMDict2Async(Test::StringStringD p1,function<void (const OpMDict2MarshaledResult &)> response,function<void (std::exception_ptr)>,const Ice::Current & current)1035 MyDerivedClassI::opMDict2Async(Test::StringStringD p1,
1036 function<void(const OpMDict2MarshaledResult&)> response,
1037 function<void(std::exception_ptr)>,
1038 const Ice::Current& current)
1039 {
1040 response(OpMDict2MarshaledResult(p1, p1, current));
1041 }
1042
1043 #else
1044
1045 class Thread_opVoid : public IceUtil::Thread
1046 {
1047 public:
1048
Thread_opVoid(const Test::AMD_MyClass_opVoidPtr & cb)1049 Thread_opVoid(const Test::AMD_MyClass_opVoidPtr& cb) :
1050 _cb(cb)
1051 {
1052 }
1053
run()1054 virtual void run()
1055 {
1056 _cb->ice_response();
1057 }
1058
1059 private:
1060
1061 const Test::AMD_MyClass_opVoidPtr _cb;
1062 };
1063
1064 void
shutdown_async(const Test::AMD_MyClass_shutdownPtr & cb,const Ice::Current & current)1065 MyDerivedClassI::shutdown_async(const Test::AMD_MyClass_shutdownPtr& cb, const Ice::Current& current)
1066 {
1067 {
1068 IceUtil::Mutex::Lock sync(_opVoidMutex);
1069 if(_opVoidThread)
1070 {
1071 _opVoidThread->getThreadControl().join();
1072 _opVoidThread = 0;
1073 }
1074 }
1075
1076 current.adapter->getCommunicator()->shutdown();
1077 cb->ice_response();
1078 }
1079
1080 void
supportsCompress_async(const Test::AMD_MyClass_supportsCompressPtr & cb,const Ice::Current &)1081 MyDerivedClassI::supportsCompress_async(const Test::AMD_MyClass_supportsCompressPtr& cb,
1082 const Ice::Current&)
1083 {
1084 #if defined(ICE_OS_UWP)
1085 cb->ice_response(false);
1086 #else
1087 cb->ice_response(true);
1088 #endif
1089 }
1090
1091 void
opVoid_async(const Test::AMD_MyClass_opVoidPtr & cb,const Ice::Current & current)1092 MyDerivedClassI::opVoid_async(const Test::AMD_MyClass_opVoidPtr& cb, const Ice::Current& current)
1093 {
1094 test(current.mode == ICE_ENUM(OperationMode, Normal));
1095
1096 IceUtil::Mutex::Lock sync(_opVoidMutex);
1097 if(_opVoidThread)
1098 {
1099 _opVoidThread->getThreadControl().join();
1100 _opVoidThread = 0;
1101 }
1102
1103 _opVoidThread = new Thread_opVoid(cb);
1104 _opVoidThread->start();
1105 }
1106
1107 void
opByte_async(const Test::AMD_MyClass_opBytePtr & cb,Ice::Byte p1,Ice::Byte p2,const Ice::Current &)1108 MyDerivedClassI::opByte_async(const Test::AMD_MyClass_opBytePtr& cb,
1109 Ice::Byte p1,
1110 Ice::Byte p2,
1111 const Ice::Current&)
1112 {
1113 cb->ice_response(p1, p1 ^ p2);
1114 }
1115
1116 void
opBool_async(const Test::AMD_MyClass_opBoolPtr & cb,bool p1,bool p2,const Ice::Current &)1117 MyDerivedClassI::opBool_async(const Test::AMD_MyClass_opBoolPtr& cb,
1118 bool p1,
1119 bool p2,
1120 const Ice::Current&)
1121 {
1122 cb->ice_response(p2, p1);
1123 }
1124
1125 void
opShortIntLong_async(const Test::AMD_MyClass_opShortIntLongPtr & cb,Ice::Short p1,Ice::Int p2,Ice::Long p3,const Ice::Current &)1126 MyDerivedClassI::opShortIntLong_async(const Test::AMD_MyClass_opShortIntLongPtr& cb,
1127 Ice::Short p1,
1128 Ice::Int p2,
1129 Ice::Long p3,
1130 const Ice::Current&)
1131 {
1132 cb->ice_response(p3, p1, p2, p3);
1133 }
1134
1135 void
opFloatDouble_async(const Test::AMD_MyClass_opFloatDoublePtr & cb,Ice::Float p1,Ice::Double p2,const Ice::Current &)1136 MyDerivedClassI::opFloatDouble_async(const Test::AMD_MyClass_opFloatDoublePtr& cb,
1137 Ice::Float p1,
1138 Ice::Double p2,
1139 const Ice::Current&)
1140 {
1141 cb->ice_response(p2, p1, p2);
1142 }
1143
1144 void
opString_async(const Test::AMD_MyClass_opStringPtr & cb,const std::string & p1,const std::string & p2,const Ice::Current &)1145 MyDerivedClassI::opString_async(const Test::AMD_MyClass_opStringPtr& cb,
1146 const std::string& p1,
1147 const std::string& p2,
1148 const Ice::Current&)
1149 {
1150 cb->ice_response(p1 + " " + p2, p2 + " " + p1);
1151 }
1152
1153 void
opMyEnum_async(const Test::AMD_MyClass_opMyEnumPtr & cb,Test::MyEnum p1,const Ice::Current &)1154 MyDerivedClassI::opMyEnum_async(const Test::AMD_MyClass_opMyEnumPtr& cb,
1155 Test::MyEnum p1,
1156 const Ice::Current&)
1157 {
1158 cb->ice_response(ICE_ENUM(MyEnum, enum3), p1);
1159 }
1160
1161 void
opMyClass_async(const Test::AMD_MyClass_opMyClassPtr & cb,const Test::MyClassPrxPtr & p1,const Ice::Current & current)1162 MyDerivedClassI::opMyClass_async(const Test::AMD_MyClass_opMyClassPtr& cb,
1163 const Test::MyClassPrxPtr& p1,
1164 const Ice::Current& current)
1165 {
1166 Test::MyClassPrxPtr p2 = p1;
1167 Test::MyClassPrxPtr p3 = ICE_UNCHECKED_CAST(
1168 Test::MyClassPrx, current.adapter->createProxy(
1169 stringToIdentity("noSuchIdentity")));
1170 cb->ice_response(ICE_UNCHECKED_CAST(Test::MyClassPrx, current.adapter->createProxy(current.id)), p2, p3);
1171 }
1172
1173 void
opStruct_async(const Test::AMD_MyClass_opStructPtr & cb,const Test::Structure & p1,const Test::Structure & p2,const Ice::Current &)1174 MyDerivedClassI::opStruct_async(const Test::AMD_MyClass_opStructPtr& cb,
1175 const Test::Structure& p1,
1176 const Test::Structure& p2,
1177 const Ice::Current&)
1178 {
1179 Test::Structure p3 = p1;
1180 p3.s.s = "a new string";
1181 cb->ice_response(p2, p3);
1182 }
1183
1184 void
opByteS_async(const Test::AMD_MyClass_opByteSPtr & cb,const Test::ByteS & p1,const Test::ByteS & p2,const Ice::Current &)1185 MyDerivedClassI::opByteS_async(const Test::AMD_MyClass_opByteSPtr& cb,
1186 const Test::ByteS& p1,
1187 const Test::ByteS& p2,
1188 const Ice::Current&)
1189 {
1190 Test::ByteS p3;
1191 p3.resize(p1.size());
1192 std::reverse_copy(p1.begin(), p1.end(), p3.begin());
1193 Test::ByteS r = p1;
1194 std::copy(p2.begin(), p2.end(), std::back_inserter(r));
1195 cb->ice_response(r, p3);
1196 }
1197
1198 void
opBoolS_async(const Test::AMD_MyClass_opBoolSPtr & cb,const Test::BoolS & p1,const Test::BoolS & p2,const Ice::Current &)1199 MyDerivedClassI::opBoolS_async(const Test::AMD_MyClass_opBoolSPtr& cb,
1200 const Test::BoolS& p1,
1201 const Test::BoolS& p2,
1202 const Ice::Current&)
1203 {
1204 Test::BoolS p3 = p1;
1205 std::copy(p2.begin(), p2.end(), std::back_inserter(p3));
1206 Test::BoolS r;
1207 r.resize(p1.size());
1208 std::reverse_copy(p1.begin(), p1.end(), r.begin());
1209 cb->ice_response(r, p3);
1210 }
1211
1212 void
opShortIntLongS_async(const Test::AMD_MyClass_opShortIntLongSPtr & cb,const Test::ShortS & p1,const Test::IntS & p2,const Test::LongS & p3,const Ice::Current &)1213 MyDerivedClassI::opShortIntLongS_async(const Test::AMD_MyClass_opShortIntLongSPtr& cb,
1214 const Test::ShortS& p1,
1215 const Test::IntS& p2,
1216 const Test::LongS& p3,
1217 const Ice::Current&)
1218 {
1219 Test::ShortS p4 = p1;
1220 Test::IntS p5;
1221 p5.resize(p2.size());
1222 std::reverse_copy(p2.begin(), p2.end(), p5.begin());
1223 Test::LongS p6 = p3;
1224 std::copy(p3.begin(), p3.end(), std::back_inserter(p6));
1225 cb->ice_response(p3, p4, p5, p6);
1226 }
1227
1228 void
opFloatDoubleS_async(const Test::AMD_MyClass_opFloatDoubleSPtr & cb,const Test::FloatS & p1,const Test::DoubleS & p2,const Ice::Current &)1229 MyDerivedClassI::opFloatDoubleS_async(const Test::AMD_MyClass_opFloatDoubleSPtr& cb,
1230 const Test::FloatS& p1,
1231 const Test::DoubleS& p2,
1232 const Ice::Current&)
1233 {
1234 Test::FloatS p3 = p1;
1235 Test::DoubleS p4;
1236 p4.resize(p2.size());
1237 std::reverse_copy(p2.begin(), p2.end(), p4.begin());
1238 Test::DoubleS r = p2;
1239 std::copy(p1.begin(), p1.end(), std::back_inserter(r));
1240 cb->ice_response(r, p3, p4);
1241 }
1242
1243 void
opStringS_async(const Test::AMD_MyClass_opStringSPtr & cb,const Test::StringS & p1,const Test::StringS & p2,const Ice::Current &)1244 MyDerivedClassI::opStringS_async(const Test::AMD_MyClass_opStringSPtr& cb,
1245 const Test::StringS& p1,
1246 const Test::StringS& p2,
1247 const Ice::Current&)
1248 {
1249 Test::StringS p3 = p1;
1250 std::copy(p2.begin(), p2.end(), std::back_inserter(p3));
1251 Test::StringS r;
1252 r.resize(p1.size());
1253 std::reverse_copy(p1.begin(), p1.end(), r.begin());
1254 cb->ice_response(r, p3);
1255 }
1256
1257 void
opByteSS_async(const Test::AMD_MyClass_opByteSSPtr & cb,const Test::ByteSS & p1,const Test::ByteSS & p2,const Ice::Current &)1258 MyDerivedClassI::opByteSS_async(const Test::AMD_MyClass_opByteSSPtr& cb,
1259 const Test::ByteSS& p1,
1260 const Test::ByteSS& p2,
1261 const Ice::Current&)
1262 {
1263 Test::ByteSS p3;
1264 p3.resize(p1.size());
1265 std::reverse_copy(p1.begin(), p1.end(), p3.begin());
1266 Test::ByteSS r = p1;
1267 std::copy(p2.begin(), p2.end(), std::back_inserter(r));
1268 cb->ice_response(r, p3);
1269 }
1270
1271 void
opBoolSS_async(const Test::AMD_MyClass_opBoolSSPtr & cb,const Test::BoolSS & p1,const Test::BoolSS & p2,const Ice::Current &)1272 MyDerivedClassI::opBoolSS_async(const Test::AMD_MyClass_opBoolSSPtr& cb,
1273 const Test::BoolSS& p1,
1274 const Test::BoolSS& p2,
1275 const Ice::Current&)
1276 {
1277 Test::BoolSS p3 = p1;
1278 std::copy(p2.begin(), p2.end(), std::back_inserter(p3));
1279 Test::BoolSS r;
1280 r.resize(p1.size());
1281 std::reverse_copy(p1.begin(), p1.end(), r.begin());
1282 cb->ice_response(r, p3);
1283 }
1284
1285 void
opShortIntLongSS_async(const Test::AMD_MyClass_opShortIntLongSSPtr & cb,const Test::ShortSS & p1,const Test::IntSS & p2,const Test::LongSS & p3,const Ice::Current &)1286 MyDerivedClassI::opShortIntLongSS_async(const Test::AMD_MyClass_opShortIntLongSSPtr& cb,
1287 const Test::ShortSS& p1,
1288 const Test::IntSS& p2,
1289 const Test::LongSS& p3,
1290 const Ice::Current&)
1291 {
1292 Test::ShortSS p4 = p1;
1293 Test::IntSS p5;
1294 p5.resize(p2.size());
1295 std::reverse_copy(p2.begin(), p2.end(), p5.begin());
1296 Test::LongSS p6 = p3;
1297 std::copy(p3.begin(), p3.end(), std::back_inserter(p6));
1298 cb->ice_response(p3, p4, p5, p6);
1299 }
1300
1301 void
opFloatDoubleSS_async(const Test::AMD_MyClass_opFloatDoubleSSPtr & cb,const Test::FloatSS & p1,const Test::DoubleSS & p2,const Ice::Current &)1302 MyDerivedClassI::opFloatDoubleSS_async(const Test::AMD_MyClass_opFloatDoubleSSPtr& cb,
1303 const Test::FloatSS& p1,
1304 const Test::DoubleSS& p2,
1305 const Ice::Current&)
1306 {
1307 Test::FloatSS p3 = p1;
1308 Test::DoubleSS p4;
1309 p4.resize(p2.size());
1310 std::reverse_copy(p2.begin(), p2.end(), p4.begin());
1311 Test::DoubleSS r = p2;
1312 std::copy(p2.begin(), p2.end(), std::back_inserter(r));
1313 cb->ice_response(r, p3, p4);
1314 }
1315
1316 void
opStringSS_async(const Test::AMD_MyClass_opStringSSPtr & cb,const Test::StringSS & p1,const Test::StringSS & p2,const Ice::Current &)1317 MyDerivedClassI::opStringSS_async(const Test::AMD_MyClass_opStringSSPtr& cb,
1318 const Test::StringSS& p1,
1319 const Test::StringSS& p2,
1320 const Ice::Current&)
1321 {
1322 Test::StringSS p3 = p1;
1323 std::copy(p2.begin(), p2.end(), std::back_inserter(p3));
1324 Test::StringSS r;
1325 r.resize(p2.size());
1326 std::reverse_copy(p2.begin(), p2.end(), r.begin());
1327 cb->ice_response(r, p3);
1328 }
1329
1330 void
opStringSSS_async(const Test::AMD_MyClass_opStringSSSPtr & cb,const Test::StringSSS & p1,const Test::StringSSS & p2,const Ice::Current &)1331 MyDerivedClassI::opStringSSS_async(const Test::AMD_MyClass_opStringSSSPtr& cb,
1332 const Test::StringSSS& p1,
1333 const Test::StringSSS& p2,
1334 const Ice::Current&)
1335 {
1336 Test::StringSSS p3 = p1;
1337 std::copy(p2.begin(), p2.end(), std::back_inserter(p3));
1338 Test::StringSSS r;
1339 r.resize(p2.size());
1340 std::reverse_copy(p2.begin(), p2.end(), r.begin());
1341 cb->ice_response(r, p3);
1342 }
1343
1344 void
opByteBoolD_async(const Test::AMD_MyClass_opByteBoolDPtr & cb,const Test::ByteBoolD & p1,const Test::ByteBoolD & p2,const Ice::Current &)1345 MyDerivedClassI::opByteBoolD_async(const Test::AMD_MyClass_opByteBoolDPtr& cb,
1346 const Test::ByteBoolD& p1,
1347 const Test::ByteBoolD& p2,
1348 const Ice::Current&)
1349 {
1350 Test::ByteBoolD p3 = p1;
1351 Test::ByteBoolD r = p1;
1352 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
1353 cb->ice_response(r, p3);
1354 }
1355
1356 void
opShortIntD_async(const Test::AMD_MyClass_opShortIntDPtr & cb,const Test::ShortIntD & p1,const Test::ShortIntD & p2,const Ice::Current &)1357 MyDerivedClassI::opShortIntD_async(const Test::AMD_MyClass_opShortIntDPtr& cb,
1358 const Test::ShortIntD& p1,
1359 const Test::ShortIntD& p2,
1360 const Ice::Current&)
1361 {
1362 Test::ShortIntD p3 = p1;
1363 Test::ShortIntD r = p1;
1364 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
1365 cb->ice_response(r, p3);
1366 }
1367
1368 void
opLongFloatD_async(const Test::AMD_MyClass_opLongFloatDPtr & cb,const Test::LongFloatD & p1,const Test::LongFloatD & p2,const Ice::Current &)1369 MyDerivedClassI::opLongFloatD_async(const Test::AMD_MyClass_opLongFloatDPtr& cb,
1370 const Test::LongFloatD& p1,
1371 const Test::LongFloatD& p2,
1372 const Ice::Current&)
1373 {
1374 Test::LongFloatD p3 = p1;
1375 Test::LongFloatD r = p1;
1376 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
1377 cb->ice_response(r, p3);
1378 }
1379
1380 void
opStringStringD_async(const Test::AMD_MyClass_opStringStringDPtr & cb,const Test::StringStringD & p1,const Test::StringStringD & p2,const Ice::Current &)1381 MyDerivedClassI::opStringStringD_async(const Test::AMD_MyClass_opStringStringDPtr& cb,
1382 const Test::StringStringD& p1,
1383 const Test::StringStringD& p2,
1384 const Ice::Current&)
1385 {
1386 Test::StringStringD p3 = p1;
1387 Test::StringStringD r = p1;
1388 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
1389 cb->ice_response(r, p3);
1390 }
1391
1392 void
opStringMyEnumD_async(const Test::AMD_MyClass_opStringMyEnumDPtr & cb,const Test::StringMyEnumD & p1,const Test::StringMyEnumD & p2,const Ice::Current &)1393 MyDerivedClassI::opStringMyEnumD_async(const Test::AMD_MyClass_opStringMyEnumDPtr& cb,
1394 const Test::StringMyEnumD& p1,
1395 const Test::StringMyEnumD& p2,
1396 const Ice::Current&)
1397 {
1398 Test::StringMyEnumD p3 = p1;
1399 Test::StringMyEnumD r = p1;
1400 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
1401 cb->ice_response(r, p3);
1402 }
1403
1404 void
opMyEnumStringD_async(const Test::AMD_MyClass_opMyEnumStringDPtr & cb,const Test::MyEnumStringD & p1,const Test::MyEnumStringD & p2,const Ice::Current &)1405 MyDerivedClassI::opMyEnumStringD_async(const Test::AMD_MyClass_opMyEnumStringDPtr& cb,
1406 const Test::MyEnumStringD& p1,
1407 const Test::MyEnumStringD& p2,
1408 const Ice::Current&)
1409 {
1410 Test::MyEnumStringD p3 = p1;
1411 Test::MyEnumStringD r = p1;
1412 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
1413 cb->ice_response(r, p3);
1414 }
1415
1416 void
opMyStructMyEnumD_async(const Test::AMD_MyClass_opMyStructMyEnumDPtr & cb,const Test::MyStructMyEnumD & p1,const Test::MyStructMyEnumD & p2,const Ice::Current &)1417 MyDerivedClassI::opMyStructMyEnumD_async(const Test::AMD_MyClass_opMyStructMyEnumDPtr& cb,
1418 const Test::MyStructMyEnumD& p1,
1419 const Test::MyStructMyEnumD& p2,
1420 const Ice::Current&)
1421 {
1422 Test::MyStructMyEnumD p3 = p1;
1423 Test::MyStructMyEnumD r = p1;
1424 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
1425 cb->ice_response(r, p3);
1426 }
1427
1428 void
opByteBoolDS_async(const Test::AMD_MyClass_opByteBoolDSPtr & cb,const Test::ByteBoolDS & p1,const Test::ByteBoolDS & p2,const Ice::Current &)1429 MyDerivedClassI::opByteBoolDS_async(const Test::AMD_MyClass_opByteBoolDSPtr& cb,
1430 const Test::ByteBoolDS& p1,
1431 const Test::ByteBoolDS& p2,
1432 const Ice::Current&)
1433 {
1434 Test::ByteBoolDS p3 = p2;
1435 std::copy(p1.begin(), p1.end(), std::back_inserter(p3));
1436 Test::ByteBoolDS r;
1437 r.resize(p1.size());
1438 std::reverse_copy(p1.begin(), p1.end(), r.begin());
1439 cb->ice_response(r, p3);
1440 }
1441
1442 void
opShortIntDS_async(const Test::AMD_MyClass_opShortIntDSPtr & cb,const Test::ShortIntDS & p1,const Test::ShortIntDS & p2,const Ice::Current &)1443 MyDerivedClassI::opShortIntDS_async(const Test::AMD_MyClass_opShortIntDSPtr& cb,
1444 const Test::ShortIntDS& p1,
1445 const Test::ShortIntDS& p2,
1446 const Ice::Current&)
1447 {
1448 Test::ShortIntDS p3 = p2;
1449 std::copy(p1.begin(), p1.end(), std::back_inserter(p3));
1450 Test::ShortIntDS r;
1451 r.resize(p1.size());
1452 std::reverse_copy(p1.begin(), p1.end(), r.begin());
1453 cb->ice_response(r, p3);
1454 }
1455
1456 void
opLongFloatDS_async(const Test::AMD_MyClass_opLongFloatDSPtr & cb,const Test::LongFloatDS & p1,const Test::LongFloatDS & p2,const Ice::Current &)1457 MyDerivedClassI::opLongFloatDS_async(const Test::AMD_MyClass_opLongFloatDSPtr& cb,
1458 const Test::LongFloatDS& p1,
1459 const Test::LongFloatDS& p2,
1460 const Ice::Current&)
1461 {
1462 Test::LongFloatDS p3 = p2;
1463 std::copy(p1.begin(), p1.end(), std::back_inserter(p3));
1464 Test::LongFloatDS r;
1465 r.resize(p1.size());
1466 std::reverse_copy(p1.begin(), p1.end(), r.begin());
1467 cb->ice_response(r, p3);
1468 }
1469
1470 void
opStringStringDS_async(const Test::AMD_MyClass_opStringStringDSPtr & cb,const Test::StringStringDS & p1,const Test::StringStringDS & p2,const Ice::Current &)1471 MyDerivedClassI::opStringStringDS_async(const Test::AMD_MyClass_opStringStringDSPtr& cb,
1472 const Test::StringStringDS& p1,
1473 const Test::StringStringDS& p2,
1474 const Ice::Current&)
1475 {
1476 Test::StringStringDS p3 = p2;
1477 std::copy(p1.begin(), p1.end(), std::back_inserter(p3));
1478 Test::StringStringDS r;
1479 r.resize(p1.size());
1480 std::reverse_copy(p1.begin(), p1.end(), r.begin());
1481 cb->ice_response(r, p3);
1482 }
1483
1484 void
opStringMyEnumDS_async(const Test::AMD_MyClass_opStringMyEnumDSPtr & cb,const Test::StringMyEnumDS & p1,const Test::StringMyEnumDS & p2,const Ice::Current &)1485 MyDerivedClassI::opStringMyEnumDS_async(const Test::AMD_MyClass_opStringMyEnumDSPtr& cb,
1486 const Test::StringMyEnumDS& p1,
1487 const Test::StringMyEnumDS& p2,
1488 const Ice::Current&)
1489 {
1490 Test::StringMyEnumDS p3 = p2;
1491 std::copy(p1.begin(), p1.end(), std::back_inserter(p3));
1492 Test::StringMyEnumDS r;
1493 r.resize(p1.size());
1494 std::reverse_copy(p1.begin(), p1.end(), r.begin());
1495 cb->ice_response(r, p3);
1496 }
1497
1498 void
opMyEnumStringDS_async(const Test::AMD_MyClass_opMyEnumStringDSPtr & cb,const Test::MyEnumStringDS & p1,const Test::MyEnumStringDS & p2,const Ice::Current &)1499 MyDerivedClassI::opMyEnumStringDS_async(const Test::AMD_MyClass_opMyEnumStringDSPtr& cb,
1500 const Test::MyEnumStringDS& p1,
1501 const Test::MyEnumStringDS& p2,
1502 const Ice::Current&)
1503 {
1504 Test::MyEnumStringDS p3 = p2;
1505 std::copy(p1.begin(), p1.end(), std::back_inserter(p3));
1506 Test::MyEnumStringDS r;
1507 r.resize(p1.size());
1508 std::reverse_copy(p1.begin(), p1.end(), r.begin());
1509 cb->ice_response(r, p3);
1510 }
1511
1512 void
opMyStructMyEnumDS_async(const Test::AMD_MyClass_opMyStructMyEnumDSPtr & cb,const Test::MyStructMyEnumDS & p1,const Test::MyStructMyEnumDS & p2,const Ice::Current &)1513 MyDerivedClassI::opMyStructMyEnumDS_async(const Test::AMD_MyClass_opMyStructMyEnumDSPtr& cb,
1514 const Test::MyStructMyEnumDS& p1,
1515 const Test::MyStructMyEnumDS& p2,
1516 const Ice::Current&)
1517 {
1518 Test::MyStructMyEnumDS p3 = p2;
1519 std::copy(p1.begin(), p1.end(), std::back_inserter(p3));
1520 Test::MyStructMyEnumDS r;
1521 r.resize(p1.size());
1522 std::reverse_copy(p1.begin(), p1.end(), r.begin());
1523 cb->ice_response(r, p3);
1524 }
1525
1526 void
opByteByteSD_async(const Test::AMD_MyClass_opByteByteSDPtr & cb,const Test::ByteByteSD & p1,const Test::ByteByteSD & p2,const Ice::Current &)1527 MyDerivedClassI::opByteByteSD_async(const Test::AMD_MyClass_opByteByteSDPtr& cb,
1528 const Test::ByteByteSD& p1,
1529 const Test::ByteByteSD& p2,
1530 const Ice::Current&)
1531 {
1532 Test::ByteByteSD p3 = p2;
1533 Test::ByteByteSD r;
1534 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
1535 cb->ice_response(r, p3);
1536 }
1537
1538 void
opBoolBoolSD_async(const Test::AMD_MyClass_opBoolBoolSDPtr & cb,const Test::BoolBoolSD & p1,const Test::BoolBoolSD & p2,const Ice::Current &)1539 MyDerivedClassI::opBoolBoolSD_async(const Test::AMD_MyClass_opBoolBoolSDPtr& cb,
1540 const Test::BoolBoolSD& p1,
1541 const Test::BoolBoolSD& p2,
1542 const Ice::Current&)
1543 {
1544 Test::BoolBoolSD p3 = p2;
1545 Test::BoolBoolSD r;
1546 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
1547 cb->ice_response(r, p3);
1548 }
1549
1550 void
opShortShortSD_async(const Test::AMD_MyClass_opShortShortSDPtr & cb,const Test::ShortShortSD & p1,const Test::ShortShortSD & p2,const Ice::Current &)1551 MyDerivedClassI::opShortShortSD_async(const Test::AMD_MyClass_opShortShortSDPtr& cb,
1552 const Test::ShortShortSD& p1,
1553 const Test::ShortShortSD& p2,
1554 const Ice::Current&)
1555 {
1556 Test::ShortShortSD p3 = p2;
1557 Test::ShortShortSD r;
1558 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
1559 cb->ice_response(r, p3);
1560 }
1561
1562 void
opIntIntSD_async(const Test::AMD_MyClass_opIntIntSDPtr & cb,const Test::IntIntSD & p1,const Test::IntIntSD & p2,const Ice::Current &)1563 MyDerivedClassI::opIntIntSD_async(const Test::AMD_MyClass_opIntIntSDPtr& cb,
1564 const Test::IntIntSD& p1,
1565 const Test::IntIntSD& p2,
1566 const Ice::Current&)
1567 {
1568 Test::IntIntSD p3 = p2;
1569 Test::IntIntSD r;
1570 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
1571 cb->ice_response(r, p3);
1572 }
1573
1574 void
opLongLongSD_async(const Test::AMD_MyClass_opLongLongSDPtr & cb,const Test::LongLongSD & p1,const Test::LongLongSD & p2,const Ice::Current &)1575 MyDerivedClassI::opLongLongSD_async(const Test::AMD_MyClass_opLongLongSDPtr& cb,
1576 const Test::LongLongSD& p1,
1577 const Test::LongLongSD& p2,
1578 const Ice::Current&)
1579 {
1580 Test::LongLongSD p3 = p2;
1581 Test::LongLongSD r;
1582 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
1583 cb->ice_response(r, p3);
1584 }
1585
1586 void
opStringFloatSD_async(const Test::AMD_MyClass_opStringFloatSDPtr & cb,const Test::StringFloatSD & p1,const Test::StringFloatSD & p2,const Ice::Current &)1587 MyDerivedClassI::opStringFloatSD_async(const Test::AMD_MyClass_opStringFloatSDPtr& cb,
1588 const Test::StringFloatSD& p1,
1589 const Test::StringFloatSD& p2,
1590 const Ice::Current&)
1591 {
1592 Test::StringFloatSD p3 = p2;
1593 Test::StringFloatSD r;
1594 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
1595 cb->ice_response(r, p3);
1596 }
1597
1598 void
opStringDoubleSD_async(const Test::AMD_MyClass_opStringDoubleSDPtr & cb,const Test::StringDoubleSD & p1,const Test::StringDoubleSD & p2,const Ice::Current &)1599 MyDerivedClassI::opStringDoubleSD_async(const Test::AMD_MyClass_opStringDoubleSDPtr& cb,
1600 const Test::StringDoubleSD& p1,
1601 const Test::StringDoubleSD& p2,
1602 const Ice::Current&)
1603 {
1604 Test::StringDoubleSD p3 = p2;
1605 Test::StringDoubleSD r;
1606 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
1607 cb->ice_response(r, p3);
1608 }
1609
1610 void
opStringStringSD_async(const Test::AMD_MyClass_opStringStringSDPtr & cb,const Test::StringStringSD & p1,const Test::StringStringSD & p2,const Ice::Current &)1611 MyDerivedClassI::opStringStringSD_async(const Test::AMD_MyClass_opStringStringSDPtr& cb,
1612 const Test::StringStringSD& p1,
1613 const Test::StringStringSD& p2,
1614 const Ice::Current&)
1615 {
1616 Test::StringStringSD p3 = p2;
1617 Test::StringStringSD r;
1618 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
1619 cb->ice_response(r, p3);
1620 }
1621
1622 void
opMyEnumMyEnumSD_async(const Test::AMD_MyClass_opMyEnumMyEnumSDPtr & cb,const Test::MyEnumMyEnumSD & p1,const Test::MyEnumMyEnumSD & p2,const Ice::Current &)1623 MyDerivedClassI::opMyEnumMyEnumSD_async(const Test::AMD_MyClass_opMyEnumMyEnumSDPtr& cb,
1624 const Test::MyEnumMyEnumSD& p1,
1625 const Test::MyEnumMyEnumSD& p2,
1626 const Ice::Current&)
1627 {
1628 Test::MyEnumMyEnumSD p3 = p2;
1629 Test::MyEnumMyEnumSD r;
1630 std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end()));
1631 cb->ice_response(r, p3);
1632 }
1633
1634 void
opIntS_async(const Test::AMD_MyClass_opIntSPtr & cb,const Test::IntS & s,const Ice::Current &)1635 MyDerivedClassI::opIntS_async(const Test::AMD_MyClass_opIntSPtr& cb, const Test::IntS& s, const Ice::Current&)
1636 {
1637 Test::IntS r;
1638 std::transform(s.begin(), s.end(), std::back_inserter(r), std::negate<int>());
1639 cb->ice_response(r);
1640 }
1641
1642 void
opByteSOneway_async(const Test::AMD_MyClass_opByteSOnewayPtr & cb,const Test::ByteS &,const Ice::Current &)1643 MyDerivedClassI::opByteSOneway_async(const Test::AMD_MyClass_opByteSOnewayPtr& cb, const Test::ByteS&,
1644 const Ice::Current&)
1645 {
1646 IceUtil::Mutex::Lock sync(_mutex);
1647 ++_opByteSOnewayCallCount;
1648 cb->ice_response();
1649 }
1650
1651 void
opByteSOnewayCallCount_async(const Test::AMD_MyClass_opByteSOnewayCallCountPtr & cb,const Ice::Current &)1652 MyDerivedClassI::opByteSOnewayCallCount_async(const Test::AMD_MyClass_opByteSOnewayCallCountPtr& cb,
1653 const Ice::Current&)
1654 {
1655 IceUtil::Mutex::Lock sync(_mutex);
1656 cb->ice_response(_opByteSOnewayCallCount);
1657 _opByteSOnewayCallCount = 0;
1658 }
1659
1660 void
opContext_async(const Test::AMD_MyClass_opContextPtr & cb,const Ice::Current & c)1661 MyDerivedClassI::opContext_async(const Test::AMD_MyClass_opContextPtr& cb, const Ice::Current& c)
1662 {
1663 Test::StringStringD r = c.ctx;
1664 cb->ice_response(r);
1665 }
1666
1667 void
opDoubleMarshaling_async(const Test::AMD_MyClass_opDoubleMarshalingPtr & cb,Ice::Double p1,const Test::DoubleS & p2,const Ice::Current &)1668 MyDerivedClassI::opDoubleMarshaling_async(const Test::AMD_MyClass_opDoubleMarshalingPtr& cb,
1669 Ice::Double p1, const Test::DoubleS& p2, const Ice::Current&)
1670 {
1671 Ice::Double d = 1278312346.0 / 13.0;
1672 test(p1 == d);
1673 for(unsigned int i = 0; i < p2.size(); ++i)
1674 {
1675 test(p2[i] == d);
1676 }
1677 cb->ice_response();
1678 }
1679
1680 void
opIdempotent_async(const Test::AMD_MyClass_opIdempotentPtr & cb,const Ice::Current & current)1681 MyDerivedClassI::opIdempotent_async(const Test::AMD_MyClass_opIdempotentPtr& cb, const Ice::Current& current)
1682 {
1683 test(current.mode == ICE_ENUM(OperationMode, Idempotent));
1684 cb->ice_response();
1685 }
1686
1687 void
opNonmutating_async(const Test::AMD_MyClass_opNonmutatingPtr & cb,const Ice::Current & current)1688 MyDerivedClassI::opNonmutating_async(const Test::AMD_MyClass_opNonmutatingPtr& cb, const Ice::Current& current)
1689 {
1690 test(current.mode == ICE_ENUM(OperationMode, Nonmutating));
1691 cb->ice_response();
1692 }
1693
1694 void
opDerived_async(const Test::AMD_MyDerivedClass_opDerivedPtr & cb,const Ice::Current &)1695 MyDerivedClassI::opDerived_async(const Test::AMD_MyDerivedClass_opDerivedPtr& cb, const Ice::Current&)
1696 {
1697 cb->ice_response();
1698 }
1699
1700 void
opByte1_async(const Test::AMD_MyClass_opByte1Ptr & cb,Ice::Byte b,const Ice::Current &)1701 MyDerivedClassI::opByte1_async(const Test::AMD_MyClass_opByte1Ptr& cb, Ice::Byte b, const Ice::Current&)
1702 {
1703 cb->ice_response(b);
1704 }
1705
1706 void
opShort1_async(const Test::AMD_MyClass_opShort1Ptr & cb,Ice::Short s,const Ice::Current &)1707 MyDerivedClassI::opShort1_async(const Test::AMD_MyClass_opShort1Ptr& cb, Ice::Short s, const Ice::Current&)
1708 {
1709 cb->ice_response(s);
1710 }
1711
1712 void
opInt1_async(const Test::AMD_MyClass_opInt1Ptr & cb,Ice::Int i,const Ice::Current &)1713 MyDerivedClassI::opInt1_async(const Test::AMD_MyClass_opInt1Ptr& cb, Ice::Int i, const Ice::Current&)
1714 {
1715 cb->ice_response(i);
1716 }
1717
1718 void
opLong1_async(const Test::AMD_MyClass_opLong1Ptr & cb,Ice::Long l,const Ice::Current &)1719 MyDerivedClassI::opLong1_async(const Test::AMD_MyClass_opLong1Ptr& cb, Ice::Long l, const Ice::Current&)
1720 {
1721 cb->ice_response(l);
1722 }
1723
1724 void
opFloat1_async(const Test::AMD_MyClass_opFloat1Ptr & cb,Ice::Float f,const Ice::Current &)1725 MyDerivedClassI::opFloat1_async(const Test::AMD_MyClass_opFloat1Ptr& cb, Ice::Float f, const Ice::Current&)
1726 {
1727 cb->ice_response(f);
1728 }
1729
1730 void
opDouble1_async(const Test::AMD_MyClass_opDouble1Ptr & cb,Ice::Double d,const Ice::Current &)1731 MyDerivedClassI::opDouble1_async(const Test::AMD_MyClass_opDouble1Ptr& cb, Ice::Double d, const Ice::Current&)
1732 {
1733 cb->ice_response(d);
1734 }
1735
1736 void
opString1_async(const Test::AMD_MyClass_opString1Ptr & cb,const std::string & s,const Ice::Current &)1737 MyDerivedClassI::opString1_async(const Test::AMD_MyClass_opString1Ptr& cb, const std::string& s,
1738 const Ice::Current&)
1739 {
1740 cb->ice_response(s);
1741 }
1742
1743 void
opStringS1_async(const Test::AMD_MyClass_opStringS1Ptr & cb,const Test::StringS & seq,const Ice::Current &)1744 MyDerivedClassI::opStringS1_async(const Test::AMD_MyClass_opStringS1Ptr& cb, const Test::StringS& seq,
1745 const Ice::Current&)
1746 {
1747 cb->ice_response(seq);
1748 }
1749
1750 void
opByteBoolD1_async(const Test::AMD_MyClass_opByteBoolD1Ptr & cb,const Test::ByteBoolD & dict,const Ice::Current &)1751 MyDerivedClassI::opByteBoolD1_async(const Test::AMD_MyClass_opByteBoolD1Ptr& cb, const Test::ByteBoolD& dict,
1752 const Ice::Current&)
1753 {
1754 cb->ice_response(dict);
1755 }
1756
1757 void
opStringS2_async(const Test::AMD_MyClass_opStringS2Ptr & cb,const Test::StringS & seq,const Ice::Current &)1758 MyDerivedClassI::opStringS2_async(const Test::AMD_MyClass_opStringS2Ptr& cb, const Test::StringS& seq,
1759 const Ice::Current&)
1760 {
1761 cb->ice_response(seq);
1762 }
1763
1764 void
opByteBoolD2_async(const Test::AMD_MyClass_opByteBoolD2Ptr & cb,const Test::ByteBoolD & dict,const Ice::Current &)1765 MyDerivedClassI::opByteBoolD2_async(const Test::AMD_MyClass_opByteBoolD2Ptr& cb, const Test::ByteBoolD& dict,
1766 const Ice::Current&)
1767 {
1768 cb->ice_response(dict);
1769 }
1770
1771 void
opMyStruct1_async(const Test::AMD_MyDerivedClass_opMyStruct1Ptr & cb,const Test::MyStruct1 & s,const Ice::Current &)1772 MyDerivedClassI::opMyStruct1_async(const Test::AMD_MyDerivedClass_opMyStruct1Ptr& cb, const Test::MyStruct1& s,
1773 const Ice::Current&)
1774 {
1775 cb->ice_response(s);
1776 }
1777
1778 void
opMyClass1_async(const Test::AMD_MyDerivedClass_opMyClass1Ptr & cb,const Test::MyClass1Ptr & c,const Ice::Current &)1779 MyDerivedClassI::opMyClass1_async(const Test::AMD_MyDerivedClass_opMyClass1Ptr& cb, const Test::MyClass1Ptr& c,
1780 const Ice::Current&)
1781 {
1782 cb->ice_response(c);
1783 }
1784
1785 void
opStringLiterals_async(const Test::AMD_MyClass_opStringLiteralsPtr & cb,const Ice::Current &)1786 MyDerivedClassI::opStringLiterals_async(const Test::AMD_MyClass_opStringLiteralsPtr& cb,
1787 const Ice::Current&)
1788 {
1789 Test::StringS data;
1790 data.push_back(Test::s0);
1791 data.push_back(Test::s1);
1792 data.push_back(Test::s2);
1793 data.push_back(Test::s3);
1794 data.push_back(Test::s4);
1795 data.push_back(Test::s5);
1796 data.push_back(Test::s6);
1797 data.push_back(Test::s7);
1798 data.push_back(Test::s8);
1799 data.push_back(Test::s9);
1800 data.push_back(Test::s10);
1801
1802 data.push_back(Test::sw0);
1803 data.push_back(Test::sw1);
1804 data.push_back(Test::sw2);
1805 data.push_back(Test::sw3);
1806 data.push_back(Test::sw4);
1807 data.push_back(Test::sw5);
1808 data.push_back(Test::sw6);
1809 data.push_back(Test::sw7);
1810 data.push_back(Test::sw8);
1811 data.push_back(Test::sw9);
1812 data.push_back(Test::sw10);
1813
1814 data.push_back(Test::ss0);
1815 data.push_back(Test::ss1);
1816 data.push_back(Test::ss2);
1817 data.push_back(Test::ss3);
1818 data.push_back(Test::ss4);
1819 data.push_back(Test::ss5);
1820
1821 data.push_back(Test::su0);
1822 data.push_back(Test::su1);
1823 data.push_back(Test::su2);
1824 cb->ice_response(data);
1825 }
1826
1827 void
opWStringLiterals_async(const Test::AMD_MyClass_opWStringLiteralsPtr & cb,const Ice::Current &)1828 MyDerivedClassI::opWStringLiterals_async(const Test::AMD_MyClass_opWStringLiteralsPtr& cb,
1829 const Ice::Current&)
1830 {
1831 Test::WStringS data;
1832 data.push_back(Test::ws0);
1833 data.push_back(Test::ws1);
1834 data.push_back(Test::ws2);
1835 data.push_back(Test::ws3);
1836 data.push_back(Test::ws4);
1837 data.push_back(Test::ws5);
1838 data.push_back(Test::ws6);
1839 data.push_back(Test::ws7);
1840 data.push_back(Test::ws8);
1841 data.push_back(Test::ws9);
1842 data.push_back(Test::ws10);
1843
1844 data.push_back(Test::wsw0);
1845 data.push_back(Test::wsw1);
1846 data.push_back(Test::wsw2);
1847 data.push_back(Test::wsw3);
1848 data.push_back(Test::wsw4);
1849 data.push_back(Test::wsw5);
1850 data.push_back(Test::wsw6);
1851 data.push_back(Test::wsw7);
1852 data.push_back(Test::wsw8);
1853 data.push_back(Test::wsw9);
1854 data.push_back(Test::wsw10);
1855
1856 data.push_back(Test::wss0);
1857 data.push_back(Test::wss1);
1858 data.push_back(Test::wss2);
1859 data.push_back(Test::wss3);
1860 data.push_back(Test::wss4);
1861 data.push_back(Test::wss5);
1862
1863 data.push_back(Test::wsu0);
1864 data.push_back(Test::wsu1);
1865 data.push_back(Test::wsu2);
1866 cb->ice_response(data);
1867 }
1868
1869 void
opMStruct1_async(const Test::AMD_MyClass_opMStruct1Ptr & cb,const Ice::Current &)1870 MyDerivedClassI::opMStruct1_async(const Test::AMD_MyClass_opMStruct1Ptr& cb,
1871 const Ice::Current&)
1872 {
1873 Test::Structure s;
1874 s.e = ICE_ENUM(MyEnum, enum1); // enum must be initialized
1875 return cb->ice_response(s);
1876 }
1877
1878 void
opMStruct2_async(const Test::AMD_MyClass_opMStruct2Ptr & cb,const Test::Structure & p1,const Ice::Current &)1879 MyDerivedClassI::opMStruct2_async(const Test::AMD_MyClass_opMStruct2Ptr& cb,
1880 const Test::Structure& p1,
1881 const Ice::Current&)
1882 {
1883 cb->ice_response(p1,p1);
1884 }
1885
1886 void
opMSeq1_async(const Test::AMD_MyClass_opMSeq1Ptr & cb,const Ice::Current &)1887 MyDerivedClassI::opMSeq1_async(const Test::AMD_MyClass_opMSeq1Ptr& cb,
1888 const Ice::Current&)
1889 {
1890 cb->ice_response(Test::StringS());
1891 }
1892
1893 void
opMSeq2_async(const Test::AMD_MyClass_opMSeq2Ptr & cb,const Test::StringS & p1,const Ice::Current &)1894 MyDerivedClassI::opMSeq2_async(const Test::AMD_MyClass_opMSeq2Ptr& cb,
1895 const Test::StringS& p1,
1896 const Ice::Current&)
1897 {
1898 cb->ice_response(p1,p1);
1899 }
1900
1901 void
opMDict1_async(const Test::AMD_MyClass_opMDict1Ptr & cb,const Ice::Current &)1902 MyDerivedClassI::opMDict1_async(const Test::AMD_MyClass_opMDict1Ptr& cb,
1903 const Ice::Current&)
1904 {
1905 cb->ice_response(Test::StringStringD());
1906 }
1907
1908 void
opMDict2_async(const Test::AMD_MyClass_opMDict2Ptr & cb,const Test::StringStringD & p1,const Ice::Current &)1909 MyDerivedClassI::opMDict2_async(const Test::AMD_MyClass_opMDict2Ptr& cb,
1910 const Test::StringStringD& p1,
1911 const Ice::Current&)
1912 {
1913 cb->ice_response(p1,p1);
1914 }
1915
1916 #endif
1917