summaryrefslogtreecommitdiff
path: root/csharp/test/Ice/operations/MyDerivedClassAMDI.cs
blob: cbaee32685b11fdae7b04e5a6c18ca2fa0bec0b7 (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
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
// **********************************************************************
//
// Copyright (c) 2003-2016 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;
using System.Threading;
using System.Threading.Tasks;

using Test;

public sealed class MyDerivedClassI : Test.MyDerivedClass
{
    private static void test(bool b)
    {
        if (!b)
        {
            throw new Exception();
        }
    }

    internal class Thread_opVoid
    {
        public Thread_opVoid(Action response)
        {
            _response = response;
        }

        public void Start()
        {
            lock(this)
            {
                _thread = new Thread(new ThreadStart(Run));
                _thread.Start();
            }
        }

        public void Run()
        {
            _response();
        }

        public void Join()
        {
            lock(this)
            {
                _thread.Join();
            }
        }

        private Action _response;
        private Thread _thread;
    }

    //
    // Override the Object "pseudo" operations to verify the operation mode.
    //
    public override bool ice_isA(String id, Ice.Current current)
    {
        test(current.mode == Ice.OperationMode.Nonmutating);
        return base.ice_isA(id, current);
    }

    public override void ice_ping(Ice.Current current)
    {
        test(current.mode == Ice.OperationMode.Nonmutating);
        base.ice_ping(current);
    }

    public override string[] ice_ids(Ice.Current current)
    {
        test(current.mode == Ice.OperationMode.Nonmutating);
        return base.ice_ids(current);
    }

    public override string ice_id(Ice.Current current)
    {
        test(current.mode == Ice.OperationMode.Nonmutating);
        return base.ice_id(current);
    }

    public override void shutdownAsync(Action response, Action<Exception> exception, Ice.Current current)
    {
        while(_opVoidThread != null)
        {
            _opVoidThread.Join();
            _opVoidThread = null;
        }

        current.adapter.getCommunicator().shutdown();
        response();
    }

    public override async void delayAsync(int ms, Action response, Action<Exception> exception, Ice.Current current)
    {
        await Task.Delay(ms); 
        response();
    }

    public override void opVoidAsync(Action response, Action<Exception> exception, Ice.Current current)
    {
        test(current.mode == Ice.OperationMode.Normal);

        while(_opVoidThread != null)
        {
            _opVoidThread.Join();
            _opVoidThread = null;
        }

        _opVoidThread = new Thread_opVoid(response);
        _opVoidThread.Start();
    }

    public override void opBoolAsync(bool p1, bool p2, 
                                     Action<MyClass_OpBoolResult> response,
                                     Action<Exception> exception,
                                     Ice.Current current)
    {
        response(new MyClass_OpBoolResult(p2, p1));
    }

    public override void opBoolSAsync(bool[] p1, bool[] p2,
                                      Action<MyClass_OpBoolSResult> response,
                                      Action<Exception> exception,
                                      Ice.Current current)
    {
        bool[] p3 = new bool[p1.Length + p2.Length];
        Array.Copy(p1, p3, p1.Length);
        Array.Copy(p2, 0, p3, p1.Length, p2.Length);

        bool[] r = new bool[p1.Length];
        for(int i = 0; i < p1.Length; i++)
        {
            r[i] = p1[p1.Length - (i + 1)];
        }

        response(new MyClass_OpBoolSResult(r, p3));
    }

    public override void
    opBoolSSAsync(bool[][] p1, bool[][] p2,
                  Action<MyClass_OpBoolSSResult> response,
                  Action<Exception> exception,
                  Ice.Current current)
    {
        bool[][] p3 = new bool[p1.Length + p2.Length][];
        Array.Copy(p1, p3, p1.Length);
        Array.Copy(p2, 0, p3, p1.Length, p2.Length);

        bool[][] r = new bool[p1.Length][];
        for(int i = 0; i < p1.Length; i++)
        {
            r[i] = p1[p1.Length - (i + 1)];
        }

        response(new MyClass_OpBoolSSResult(r, p3));
    }

    public override void opByteAsync(byte p1, byte p2,
                                     Action<MyClass_OpByteResult> response,
                                     Action<Exception> exception,
                                     Ice.Current current)
    {
        response(new MyClass_OpByteResult(p1, (byte)(p1 ^ p2)));
    }

    public override void
    opByteBoolDAsync(Dictionary<byte, bool> p1, 
                     Dictionary<byte, bool> p2,
                     Action<MyClass_OpByteBoolDResult> response,
                     Action<Exception> exception,
                     Ice.Current current)
    {
        Dictionary<byte, bool> p3 = p1;
        Dictionary<byte, bool> r = new Dictionary<byte, bool>();
        foreach(KeyValuePair<byte, bool> e in p1)
        {
            r[e.Key] = e.Value;
        }
        foreach(KeyValuePair<byte, bool> e in p2)
        {
            r[e.Key] = e.Value;
        }

        response(new MyClass_OpByteBoolDResult(r, p3));
    }

    public override void
    opByteSAsync(byte[] p1, byte[] p2,
                 Action<MyClass_OpByteSResult> response,
                 Action<Exception> exception,
                 Ice.Current current)
    {
        byte[] p3 = new byte[p1.Length];
        for(int i = 0; i < p1.Length; i++)
        {
            p3[i] = p1[p1.Length - (i + 1)];
        }

        byte[] r = new byte[p1.Length + p2.Length];
        Array.Copy(p1, r, p1.Length);
        Array.Copy(p2, 0, r, p1.Length, p2.Length);

        response(new MyClass_OpByteSResult(r, p3));
    }

    public override void
    opByteSSAsync(byte[][] p1, byte[][] p2,
                  Action<MyClass_OpByteSSResult> response,
                  Action<Exception> exception,
                  Ice.Current current)
    {
        byte[][] p3 = new byte[p1.Length][];
        for(int i = 0; i < p1.Length; i++)
        {
            p3[i] = p1[p1.Length - (i + 1)];
        }

        byte[][] r = new byte[p1.Length + p2.Length][];
        Array.Copy(p1, r, p1.Length);
        Array.Copy(p2, 0, r, p1.Length, p2.Length);

        response(new MyClass_OpByteSSResult(r, p3));
    }

    public override void opFloatDoubleAsync(float p1, double p2,
                                            Action<MyClass_OpFloatDoubleResult> response,
                                            Action<Exception> exception,
                                            Ice.Current current)
    {
        response(new MyClass_OpFloatDoubleResult(p2, p1, p2));
    }

    public override void
    opFloatDoubleSAsync(float[] p1, double[] p2,
                        Action<MyClass_OpFloatDoubleSResult> response,
                        Action<Exception> exception,
                        Ice.Current current)
    {
        float[] p3 = p1;

        double[] p4 = new double[p2.Length];
        for(int i = 0; i < p2.Length; i++)
        {
            p4[i] = p2[p2.Length - (i + 1)];
        }

        double[] r = new double[p2.Length + p1.Length];
        Array.Copy(p2, r, p2.Length);
        for(int i = 0; i < p1.Length; i++)
        {
            r[p2.Length + i] = p1[i];
        }

        response(new MyClass_OpFloatDoubleSResult(r, p3, p4));
    }

    public override void
    opFloatDoubleSSAsync(float[][] p1, double[][] p2,
                         Action<MyClass_OpFloatDoubleSSResult> response,
                         Action<Exception> exception,
                         Ice.Current current)
    {
        var p3 = p1;

        var p4 = new double[p2.Length][];
        for(int i = 0; i < p2.Length; i++)
        {
            p4[i] = p2[p2.Length - (i + 1)];
        }

        var r = new double[p2.Length + p2.Length][];
        Array.Copy(p2, r, p2.Length);
        for(int i = 0; i < p2.Length; i++)
        {
            r[p2.Length + i] = new double[p2[i].Length];
            for(int j = 0; j < p2[i].Length; j++)
            {
                r[p2.Length + i][j] = p2[i][j];
            }
        }

        response(new MyClass_OpFloatDoubleSSResult(r, p3, p4));
    }

    public override void
    opLongFloatDAsync(Dictionary<long, float> p1, Dictionary<long, float> p2,
                      Action<MyClass_OpLongFloatDResult> response,
                      Action<Exception> exception,
                      Ice.Current current)
    {
        var p3 = p1;
        var r = new Dictionary<long, float>();
        foreach(KeyValuePair<long, float> e in p1)
        {
            r[e.Key] = e.Value;
        }
        foreach(KeyValuePair<long, float> e in p2)
        {
            r[e.Key] = e.Value;
        }

        response(new MyClass_OpLongFloatDResult(r, p3));
    }

    public override void
    opMyClassAsync(MyClassPrx p1, Action<MyClass_OpMyClassResult> response,
                   Action<Exception> exception, Ice.Current current)
    {
        var p2 = p1;
        var p3 = MyClassPrxHelper.uncheckedCast(current.adapter.createProxy(
                                                Ice.Util.stringToIdentity("noSuchIdentity")));
        response(new MyClass_OpMyClassResult(
            MyClassPrxHelper.uncheckedCast(current.adapter.createProxy(current.id)), p2, p3));
    }

    public override void
    opMyEnumAsync(MyEnum p1, Action<MyClass_OpMyEnumResult> response, Action<Exception> exception, Ice.Current current)
    {
        response(new MyClass_OpMyEnumResult(MyEnum.enum3, p1));
    }

    public override void
    opShortIntDAsync(Dictionary<short, int> p1, Dictionary<short, int> p2,
                     Action<MyClass_OpShortIntDResult> response,
                     Action<Exception> exception,
                     Ice.Current current)
    {
        var p3 = p1;
        var r = new Dictionary<short, int>();
        foreach(KeyValuePair<short, int> e in p1)
        {
            r[e.Key] = e.Value;
        }
        foreach(KeyValuePair<short, int> e in p2)
        {
            r[e.Key] = e.Value;
        }
        response(new MyClass_OpShortIntDResult(r, p3));
    }

    public override void
    opShortIntLongAsync(short p1, int p2, long p3,
                        Action<MyClass_OpShortIntLongResult> response, 
                        Action<Exception> exception,
                        Ice.Current current)
    {
        response(new MyClass_OpShortIntLongResult(p3, p1, p2, p3));
    }

    public override void
    opShortIntLongSAsync(short[] p1, int[] p2, long[] p3,
                         Action<MyClass_OpShortIntLongSResult> response,
                         Action<Exception> exception,
                         Ice.Current current)
    {
        var p4 = p1;
        var p5 = new int[p2.Length];
        for(int i = 0; i < p2.Length; i++)
        {
            p5[i] = p2[p2.Length - (i + 1)];
        }
        var p6 = new long[p3.Length + p3.Length];
        Array.Copy(p3, p6, p3.Length);
        Array.Copy(p3, 0, p6, p3.Length, p3.Length);
        response(new MyClass_OpShortIntLongSResult(p3, p4, p5, p6));
    }

    public override void
    opShortIntLongSSAsync(short[][] p1, int[][] p2, long[][] p3,
                          Action<MyClass_OpShortIntLongSSResult> response,
                          Action<Exception> exception,
                          Ice.Current current)
    {
        var p4 = p1;

        var p5 = new int[p2.Length][];
        for(int i = 0; i < p2.Length; i++)
        {
            p5[i] = p2[p2.Length - (i + 1)];
        }

        var p6 = new long[p3.Length + p3.Length][];
        Array.Copy(p3, p6, p3.Length);
        Array.Copy(p3, 0, p6, p3.Length, p3.Length);
        response(new MyClass_OpShortIntLongSSResult(p3, p4, p5, p6));
    }

    public override void
    opStringAsync(string p1, string p2,
                  Action<MyClass_OpStringResult> response,
                  Action<Exception> exception,
                  Ice.Current current)
    {
        response(new MyClass_OpStringResult(p1 + " " + p2, p2 + " " + p1));
    }

    public override void
    opStringMyEnumDAsync(Dictionary<string, MyEnum> p1, Dictionary<string, MyEnum> p2,
                         Action<MyClass_OpStringMyEnumDResult> response,
                         Action<Exception> exception,
                         Ice.Current current)
    {
        var p3 = p1;
        var r = new Dictionary<string, Test.MyEnum>();
        foreach(KeyValuePair<string, Test.MyEnum> e in p1)
        {
            r[e.Key] = e.Value;
        }
        foreach(KeyValuePair<string, Test.MyEnum> e in p2)
        {
            r[e.Key] = e.Value;
        }
        response(new MyClass_OpStringMyEnumDResult(r, p3));
    }

    public override void
    opMyEnumStringDAsync(Dictionary<MyEnum, string> p1, Dictionary<MyEnum, string> p2,
                         Action<MyClass_OpMyEnumStringDResult> response,
                         Action<Exception> exception,
                         Ice.Current current)
    {
        var p3 = p1;
        var r = new Dictionary<MyEnum, string>();
        foreach(var e in p1)
        {
            r[e.Key] = e.Value;
        }
        foreach(KeyValuePair<MyEnum, string> e in p2)
        {
            r[e.Key] = e.Value;
        }
        response(new MyClass_OpMyEnumStringDResult(r, p3));
    }

    public override void
    opMyStructMyEnumDAsync(Dictionary<MyStruct, MyEnum> p1,
                           Dictionary<MyStruct, MyEnum> p2,
                           Action<MyClass_OpMyStructMyEnumDResult> response,
                           Action<Exception> exception,
                           Ice.Current current)
    {
        var p3 = p1;
        var r = new Dictionary<MyStruct, MyEnum>();
        foreach(var e in p1)
        {
            r[e.Key] = e.Value;
        }
        foreach(var e in p2)
        {
            r[e.Key] = e.Value;
        }
        response(new MyClass_OpMyStructMyEnumDResult(r, p3));
    }

    public override void
    opByteBoolDSAsync(Dictionary<byte, bool>[] p1,
                      Dictionary<byte, bool>[] p2,
                      Action<MyClass_OpByteBoolDSResult> response,
                      Action<Exception> exception,
                      Ice.Current current)
    {
        var p3 = new Dictionary<byte, bool>[p1.Length + p2.Length];
        Array.Copy(p2, p3, p2.Length);
        Array.Copy(p1, 0, p3, p2.Length, p1.Length);

        var r = new Dictionary<byte, bool>[p1.Length];
        for(int i = 0; i < p1.Length; i++)
        {
            r[i] = p1[p1.Length - (i + 1)];
        }
        response(new MyClass_OpByteBoolDSResult(r, p3));
    }

    public override void
    opShortIntDSAsync(Dictionary<short, int>[] p1, Dictionary<short, int>[] p2,
                      Action<MyClass_OpShortIntDSResult> response,
                      Action<Exception> exception,
                      Ice.Current current)
    {
        var p3 = new Dictionary<short, int>[p1.Length + p2.Length];
        Array.Copy(p2, p3, p2.Length);
        Array.Copy(p1, 0, p3, p2.Length, p1.Length);

        var r = new Dictionary<short, int>[p1.Length];
        for(int i = 0; i < p1.Length; i++)
        {
            r[i] = p1[p1.Length - (i + 1)];
        }
        response(new MyClass_OpShortIntDSResult(r, p3));
    }

    public override void
    opLongFloatDSAsync(Dictionary<long, float>[] p1,
                       Dictionary<long, float>[] p2,
                       Action<MyClass_OpLongFloatDSResult> response,
                       Action<Exception> exception,
                       Ice.Current current)
    {
        var p3 = new Dictionary<long, float>[p1.Length + p2.Length];
        Array.Copy(p2, p3, p2.Length);
        Array.Copy(p1, 0, p3, p2.Length, p1.Length);

        var r = new Dictionary<long, float>[p1.Length];
        for(int i = 0; i < p1.Length; i++)
        {
            r[i] = p1[p1.Length - (i + 1)];
        }
        response(new MyClass_OpLongFloatDSResult(r, p3));
    }

    public override void
    opStringStringDSAsync(Dictionary<string, string>[] p1,
                          Dictionary<string, string>[] p2,
                          Action<MyClass_OpStringStringDSResult> response,
                          Action<Exception> exception,
                          Ice.Current current)
    {
        var p3 = new Dictionary<string, string>[p1.Length + p2.Length];
        Array.Copy(p2, p3, p2.Length);
        Array.Copy(p1, 0, p3, p2.Length, p1.Length);

        var r = new Dictionary<string, string>[p1.Length];
        for(int i = 0; i < p1.Length; i++)
        {
            r[i] = p1[p1.Length - (i + 1)];
        }
        response(new MyClass_OpStringStringDSResult(r, p3));
    }

    public override void
    opStringMyEnumDSAsync(Dictionary<string, MyEnum>[] p1,
                          Dictionary<string, MyEnum>[] p2,
                          Action<MyClass_OpStringMyEnumDSResult> response,
                          Action<Exception> exception,
                          Ice.Current current)
    {
        var p3 = new Dictionary<string, MyEnum>[p1.Length + p2.Length];
        Array.Copy(p2, p3, p2.Length);
        Array.Copy(p1, 0, p3, p2.Length, p1.Length);

        var r = new Dictionary<string, MyEnum>[p1.Length];
        for(int i = 0; i < p1.Length; i++)
        {
            r[i] = p1[p1.Length - (i + 1)];
        }
        response(new MyClass_OpStringMyEnumDSResult(r, p3));
    }

    public override void
    opMyEnumStringDSAsync(Dictionary<MyEnum, string>[] p1,
                          Dictionary<MyEnum, string>[] p2,
                          Action<MyClass_OpMyEnumStringDSResult> response,
                          Action<Exception> exception,
                          Ice.Current current)
    {
        var p3 = new Dictionary<MyEnum, string>[p1.Length + p2.Length];
        Array.Copy(p2, p3, p2.Length);
        Array.Copy(p1, 0, p3, p2.Length, p1.Length);

        var r = new Dictionary<MyEnum, string>[p1.Length];
        for(int i = 0; i < p1.Length; i++)
        {
            r[i] = p1[p1.Length - (i + 1)];
        }
        response(new MyClass_OpMyEnumStringDSResult(r, p3));
    }

    public override void
    opMyStructMyEnumDSAsync(Dictionary<MyStruct, MyEnum>[] p1,
                            Dictionary<MyStruct, MyEnum>[] p2,
                            Action<MyClass_OpMyStructMyEnumDSResult> response,
                            Action<Exception> exception,
                            Ice.Current current)
    {
        var p3 = new Dictionary<MyStruct, MyEnum>[p1.Length + p2.Length];
        Array.Copy(p2, p3, p2.Length);
        Array.Copy(p1, 0, p3, p2.Length, p1.Length);

        var r = new Dictionary<MyStruct, MyEnum>[p1.Length];
        for(int i = 0; i < p1.Length; i++)
        {
            r[i] = p1[p1.Length - (i + 1)];
        }
        response(new MyClass_OpMyStructMyEnumDSResult(r, p3));
    }

    public override void
    opByteByteSDAsync(Dictionary<byte, byte[]> p1,
                      Dictionary<byte, byte[]> p2,
                      Action<MyClass_OpByteByteSDResult> response,
                      Action<Exception> exception,
                      Ice.Current current)
    {
        var p3 = p2;
        var r = new Dictionary<byte, byte[]>();
        foreach(var e in p1)
        {
            r[e.Key] = e.Value;
        }
        foreach(var e in p2)
        {
            r[e.Key] = e.Value;
        }
        response(new MyClass_OpByteByteSDResult(r, p3));
    }

    public override void
    opBoolBoolSDAsync(Dictionary<bool, bool[]> p1,
                      Dictionary<bool, bool[]> p2,
                      Action<MyClass_OpBoolBoolSDResult> response,
                      Action<Exception> exception,
                      Ice.Current current)
    {
        var  p3 = p2;
        var r = new Dictionary<bool, bool[]>();
        foreach(KeyValuePair<bool, bool[]> e in p1)
        {
            r[e.Key] = e.Value;
        }
        foreach(KeyValuePair<bool, bool[]> e in p2)
        {
            r[e.Key] = e.Value;
        }
        response(new MyClass_OpBoolBoolSDResult(r, p3));
    }

    public override void
    opShortShortSDAsync(Dictionary<short, short[]> p1,
                        Dictionary<short, short[]> p2,
                        Action<MyClass_OpShortShortSDResult> response,
                        Action<Exception> exception,
                        Ice.Current current)
    {
        var p3 = p2;
        var r = new Dictionary<short, short[]>();
        foreach(var e in p1)
        {
            r[e.Key] = e.Value;
        }
        foreach(var e in p2)
        {
            r[e.Key] = e.Value;
        }
        response(new MyClass_OpShortShortSDResult(r, p3));
    }

    public override void
    opIntIntSDAsync(Dictionary<int, int[]> p1, 
                    Dictionary<int, int[]> p2,
                    Action<MyClass_OpIntIntSDResult> response,
                    Action<Exception> exception,
                    Ice.Current current)
    {
        var p3 = p2;
        var r = new Dictionary<int, int[]>();
        foreach(var e in p1)
        {
            r[e.Key] = e.Value;
        }
        foreach(var e in p2)
        {
            r[e.Key] = e.Value;
        }
        response(new MyClass_OpIntIntSDResult(r, p3));
    }

    public override void
    opLongLongSDAsync(Dictionary<long, long[]> p1,
                      Dictionary<long, long[]> p2,
                      Action<MyClass_OpLongLongSDResult> response,
                      Action<Exception> exception,
                      Ice.Current current)
    {
        var p3 = p2;
        var r = new Dictionary<long, long[]>();
        foreach(var e in p1)
        {
            r[e.Key] = e.Value;
        }
        foreach(var e in p2)
        {
            r[e.Key] = e.Value;
        }
        response(new MyClass_OpLongLongSDResult(r, p3));
    }

    public override void
    opStringFloatSDAsync(Dictionary<string, float[]> p1,
                         Dictionary<string, float[]> p2,
                         Action<MyClass_OpStringFloatSDResult> response,
                         Action<Exception> exception,
                         Ice.Current current)
    {
        var p3 = p2;
        var r = new Dictionary<string, float[]>();
        foreach(var e in p1)
        {
            r[e.Key] = e.Value;
        }
        foreach(var e in p2)
        {
            r[e.Key] = e.Value;
        }
        response(new MyClass_OpStringFloatSDResult(r, p3));
    }

    public override void
    opStringDoubleSDAsync(Dictionary<string, double[]> p1,
                          Dictionary<string, double[]> p2,
                          Action<MyClass_OpStringDoubleSDResult> response,
                          Action<Exception> exception,
                          Ice.Current current)
    {
        var p3 = p2;
        var r = new Dictionary<string, double[]>();
        foreach(var e in p1)
        {
            r[e.Key] = e.Value;
        }
        foreach(var e in p2)
        {
            r[e.Key] = e.Value;
        }
        response(new MyClass_OpStringDoubleSDResult(r, p3));
    }

    public override void
    opStringStringSDAsync(Dictionary<string, string[]> p1,
                          Dictionary<string, string[]> p2,
                          Action<MyClass_OpStringStringSDResult> response,
                          Action<Exception> exception,
                          Ice.Current current)
    {
        var p3 = p2;
        var r = new Dictionary<string, string[]>();
        foreach(var e in p1)
        {
            r[e.Key] = e.Value;
        }
        foreach(var e in p2)
        {
            r[e.Key] = e.Value;
        }
        response(new MyClass_OpStringStringSDResult(r, p3));
    }

    public override void
    opMyEnumMyEnumSDAsync(Dictionary<MyEnum, MyEnum[]> p1, 
                          Dictionary<MyEnum, MyEnum[]> p2,
                          Action<MyClass_OpMyEnumMyEnumSDResult> response,
                          Action<Exception> exception,
                          Ice.Current current)
    {
        var p3 = p2;
        var r = new Dictionary<Test.MyEnum, Test.MyEnum[]>();
        foreach(var e in p1)
        {
            r[e.Key] = e.Value;
        }
        foreach(var e in p2)
        {
            r[e.Key] = e.Value;
        }
        response(new MyClass_OpMyEnumMyEnumSDResult(r, p3));
    }

    public override void opIntSAsync(int[] s,
                                     Action<int[]> response,
                                     Action<Exception> exception,
                                     Ice.Current current)
    {
        var r = new int[s.Length];
        for(int i = 0; i < s.Length; ++i)
        {
            r[i] = -s[i];
        }
        response(r);
    }

    public override void opContextAsync(Action<Dictionary<string, string>> response,
                                        Action<Exception> exception, 
                                        Ice.Current current)
    {
        response(current.ctx);
    }

    public override void opByteSOnewayAsync(byte[] s, Action response,
                                            Action<Exception> exception,
                                            Ice.Current current)
    {
        lock(this)
        {
            ++_opByteSOnewayCallCount;
        }
        response();
    }

    public override void opByteSOnewayCallCountAsync(Action<int> response,
                                                     Action<Exception> exeption,
                                                     Ice.Current current)
    {
        lock(this)
        {
            var count = _opByteSOnewayCallCount;
            _opByteSOnewayCallCount = 0;
            response(count);
        }
    }

    public override void opDoubleMarshalingAsync(double p1, double[] p2, Action response, 
                                                 Action<Exception> exception, Ice.Current current)
    {
        var d = 1278312346.0 / 13.0;
        test(p1 == d);
        for(int i = 0; i < p2.Length; ++i)
        {
            test(p2[i] == d);
        }
        response();
    }

    public override void
    opStringSAsync(string[] p1, string[] p2,
                   Action<MyClass_OpStringSResult> response,
                   Action<Exception> exception,
                   Ice.Current current)
    {
        var p3 = new string[p1.Length + p2.Length];
        Array.Copy(p1, p3, p1.Length);
        Array.Copy(p2, 0, p3, p1.Length, p2.Length);

        var r = new string[p1.Length];
        for(int i = 0; i < p1.Length; i++)
        {
            r[i] = p1[p1.Length - (i + 1)];
        }
        response(new MyClass_OpStringSResult(r, p3));
    }

    public override void
    opStringSSAsync(string[][] p1, string[][] p2, Action<MyClass_OpStringSSResult> response,
                    Action<Exception> exception, Ice.Current current)
    {
        var p3 = new string[p1.Length + p2.Length][];
        Array.Copy(p1, p3, p1.Length);
        Array.Copy(p2, 0, p3, p1.Length, p2.Length);
        var r = new string[p2.Length][];
        for(int i = 0; i < p2.Length; i++)
        {
            r[i] = p2[p2.Length - (i + 1)];
        }
        response(new MyClass_OpStringSSResult(r, p3));
    }

    public override void
    opStringSSSAsync(string[][][] p1, string[][][] p2, Action<MyClass_OpStringSSSResult> response,
                     Action<Exception> exception, Ice.Current current)
    {
        var p3 = new string[p1.Length + p2.Length][][];
        Array.Copy(p1, p3, p1.Length);
        Array.Copy(p2, 0, p3, p1.Length, p2.Length);

        var r = new string[p2.Length][][];
        for(int i = 0; i < p2.Length; i++)
        {
            r[i] = p2[p2.Length - (i + 1)];
        }
        response(new MyClass_OpStringSSSResult(r, p3));
    }

    public override void
    opStringStringDAsync(Dictionary<string, string> p1, Dictionary<string, string> p2,
                         Action<MyClass_OpStringStringDResult> response, Action<Exception> exception,
                         Ice.Current current)
    {
        var p3 = p1;
        var r = new Dictionary<string, string>();
        foreach(var e in p1)
        {
            r[e.Key] = e.Value;
        }
        foreach(var e in p2)
        {
            r[e.Key] = e.Value;
        }
        response(new MyClass_OpStringStringDResult(r, p3));
    }

    public override void
    opStructAsync(Structure p1, Structure p2, Action<MyClass_OpStructResult> response,
                  Action<Exception> exception, Ice.Current current)
    {
        var p3 = p1;
        p3.s.s = "a new string";
        response(new MyClass_OpStructResult(p2, p3));
    }

    public override void opIdempotentAsync(Action response, Action<Exception> exception, Ice.Current current)
    {
        test(current.mode == Ice.OperationMode.Idempotent);
        response();
    }

    public override void opNonmutatingAsync(Action response, Action<Exception> exception, Ice.Current current)
    {
        test(current.mode == Ice.OperationMode.Nonmutating);
        response();
    }

    public override void opDerivedAsync(Action response, Action<Exception> exception, Ice.Current current)
    {
        response();
    }
    
    public override void opByte1Async(byte value, Action<byte> response, Action<Exception> exception, 
                                      Ice.Current current)
    {
        response(value);
    }
    
    public override void opShort1Async(short value, Action<short> response, Action<Exception> exception,
                                       Ice.Current current)
    {
        response(value);
    }
    
    public override void opInt1Async(int value, Action<int> response, Action<Exception> exception,
                                     Ice.Current current)
    {
        response(value);
    }
    
    public override void opLong1Async(long value, Action<long> response, Action<Exception> exception,
                                      Ice.Current current)
    {
        response(value);
    }
    
    public override void opFloat1Async(float value, Action<float> response, Action<Exception> exception,
                                       Ice.Current current)
    {
        response(value);
    }
    
    public override void opDouble1Async(double value, Action<double> response, Action<Exception> exception,
                                        Ice.Current current)
    {
        response(value);
    }
    
    public override void opString1Async(string value, Action<string> response, Action<Exception> exception,
                                        Ice.Current current)
    {
        response(value);
    }
    
    public override void opStringS1Async(string[] value, Action<string[]> response, Action<Exception> exception,
                                                   Ice.Current current)
    {
        response(value);
    }
    
    public override void
    opByteBoolD1Async(Dictionary<byte, bool> value, Action<Dictionary<byte, bool>> response, Action<Exception> exception,
                      Ice.Current current)
    {
        response(value);
    }
    
    public override void
    opStringS2Async(string[] value, Action<string[]> response, Action<Exception> exception, Ice.Current current)
    {
        response(value);
    }
    
    public override void
    opByteBoolD2Async(Dictionary<byte, bool> value, Action<Dictionary<byte, bool>> response, Action<Exception> exception,
                      Ice.Current current)
    {
        response(value);
    }
    
    public override void
    opMyClass1Async(MyClass1 value, Action<MyClass1> response, Action<Exception> exception, Ice.Current current)
    {
        response(value);
    }
    
    public override void
    opMyStruct1Async(MyStruct1 value, Action<MyStruct1> response, Action<Exception> exception, Ice.Current current)
    {
        response(value);
    }
    
    
    public override void
    opStringLiteralsAsync(Action<string[]> response, Action<Exception> exception, Ice.Current current)
    {
        response(new string[]
            {
                s0.value,
                s1.value,
                s2.value,
                s3.value,
                s4.value,
                s5.value,
                s6.value,
                s7.value,
                s8.value,
                s9.value,
                s10.value,
                
                sw0.value,
                sw1.value,
                sw2.value,
                sw3.value,
                sw4.value,
                sw5.value,
                sw6.value,
                sw7.value,
                sw8.value,
                sw9.value,
                sw10.value,
                
                ss0.value,
                ss1.value,
                ss2.value,
                ss3.value,
                ss4.value,
                ss5.value,
                
                su0.value,
                su1.value,
                su2.value
            });
    }
    
    public override void
    opWStringLiteralsAsync(Action<string[]> response, Action<Exception> exception, Ice.Current current)
    {
        response(new string[]
            {
                s0.value,
                s1.value,
                s2.value,
                s3.value,
                s4.value,
                s5.value,
                s6.value,
                s7.value,
                s8.value,
                s9.value,
                s10.value,
                
                sw0.value,
                sw1.value,
                sw2.value,
                sw3.value,
                sw4.value,
                sw5.value,
                sw6.value,
                sw7.value,
                sw8.value,
                sw9.value,
                sw10.value,
                
                ss0.value,
                ss1.value,
                ss2.value,
                ss3.value,
                ss4.value,
                ss5.value,
                
                su0.value,
                su1.value,
                su2.value
            });
    }

    private Thread_opVoid _opVoidThread;
    private int _opByteSOnewayCallCount = 0;
}