diff options
Diffstat (limited to 'csharp/test/Ice/operations/MyDerivedClassAMDI.cs')
-rw-r--r-- | csharp/test/Ice/operations/MyDerivedClassAMDI.cs | 868 |
1 files changed, 500 insertions, 368 deletions
diff --git a/csharp/test/Ice/operations/MyDerivedClassAMDI.cs b/csharp/test/Ice/operations/MyDerivedClassAMDI.cs index 299385cadaf..2b3ff2af6b8 100644 --- a/csharp/test/Ice/operations/MyDerivedClassAMDI.cs +++ b/csharp/test/Ice/operations/MyDerivedClassAMDI.cs @@ -10,6 +10,9 @@ using System; using System.Collections.Generic; using System.Threading; +using System.Threading.Tasks; + +using Test; public sealed class MyDerivedClassI : Test.MyDerivedClass { @@ -23,9 +26,9 @@ public sealed class MyDerivedClassI : Test.MyDerivedClass internal class Thread_opVoid { - public Thread_opVoid(Test.AMD_MyClass_opVoid cb) + public Thread_opVoid(Action response) { - _cb = cb; + _response = response; } public void Start() @@ -39,7 +42,7 @@ public sealed class MyDerivedClassI : Test.MyDerivedClass public void Run() { - _cb.ice_response(); + _response(); } public void Join() @@ -50,7 +53,7 @@ public sealed class MyDerivedClassI : Test.MyDerivedClass } } - private Test.AMD_MyClass_opVoid _cb; + private Action _response; private Thread _thread; } @@ -81,7 +84,7 @@ public sealed class MyDerivedClassI : Test.MyDerivedClass return base.ice_id(current); } - public override void shutdown_async(Test.AMD_MyClass_shutdown cb, Ice.Current current) + public override void shutdownAsync(Action response, Action<Exception> exception, Ice.Current current) { while(_opVoidThread != null) { @@ -90,16 +93,16 @@ public sealed class MyDerivedClassI : Test.MyDerivedClass } current.adapter.getCommunicator().shutdown(); - cb.ice_response(); + response(); } - public override void delay_async(Test.AMD_MyClass_delay cb, int ms, Ice.Current current) + public override async void delayAsync(int ms, Action response, Action<Exception> exception, Ice.Current current) { - Thread.Sleep(ms); - cb.ice_response(); + await Task.Delay(ms); + response(); } - public override void opVoid_async(Test.AMD_MyClass_opVoid cb, Ice.Current current) + public override void opVoidAsync(Action response, Action<Exception> exception, Ice.Current current) { test(current.mode == Ice.OperationMode.Normal); @@ -109,16 +112,22 @@ public sealed class MyDerivedClassI : Test.MyDerivedClass _opVoidThread = null; } - _opVoidThread = new Thread_opVoid(cb); + _opVoidThread = new Thread_opVoid(response); _opVoidThread.Start(); } - public override void opBool_async(Test.AMD_MyClass_opBool cb, bool p1, bool p2, Ice.Current current) + public override void opBoolAsync(bool p1, bool p2, + Action<MyClass_OpBoolResult> response, + Action<Exception> exception, + Ice.Current current) { - cb.ice_response(p2, p1); + response(new MyClass_OpBoolResult(p2, p1)); } - public override void opBoolS_async(Test.AMD_MyClass_opBoolS cb, bool[] p1, bool[] p2, Ice.Current current) + 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); @@ -129,11 +138,15 @@ public sealed class MyDerivedClassI : Test.MyDerivedClass { r[i] = p1[p1.Length - (i + 1)]; } - cb.ice_response(r, p3); + + response(new MyClass_OpBoolSResult(r, p3)); } - public override void opBoolSS_async(Test.AMD_MyClass_opBoolSS cb, bool[][] p1, bool[][] p2, - Ice.Current current) + 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); @@ -144,16 +157,24 @@ public sealed class MyDerivedClassI : Test.MyDerivedClass { r[i] = p1[p1.Length - (i + 1)]; } - cb.ice_response(r, p3); + + response(new MyClass_OpBoolSSResult(r, p3)); } - public override void opByte_async(Test.AMD_MyClass_opByte cb, byte p1, byte p2, Ice.Current current) + public override void opByteAsync(byte p1, byte p2, + Action<MyClass_OpByteResult> response, + Action<Exception> exception, + Ice.Current current) { - cb.ice_response(p1, (byte)(p1 ^ p2)); + response(new MyClass_OpByteResult(p1, (byte)(p1 ^ p2))); } - public override void opByteBoolD_async(Test.AMD_MyClass_opByteBoolD cb, Dictionary<byte, bool> p1, - Dictionary<byte, bool> p2, Ice.Current current) + 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>(); @@ -165,10 +186,15 @@ public sealed class MyDerivedClassI : Test.MyDerivedClass { r[e.Key] = e.Value; } - cb.ice_response(r, p3); + + response(new MyClass_OpByteBoolDResult(r, p3)); } - public override void opByteS_async(Test.AMD_MyClass_opByteS cb, byte[] p1, byte[] p2, Ice.Current current) + 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++) @@ -179,11 +205,15 @@ public sealed class MyDerivedClassI : Test.MyDerivedClass byte[] r = new byte[p1.Length + p2.Length]; Array.Copy(p1, r, p1.Length); Array.Copy(p2, 0, r, p1.Length, p2.Length); - cb.ice_response(r, p3); + + response(new MyClass_OpByteSResult(r, p3)); } - public override void opByteSS_async(Test.AMD_MyClass_opByteSS cb, byte[][] p1, byte[][] p2, - Ice.Current current) + 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++) @@ -194,17 +224,23 @@ public sealed class MyDerivedClassI : Test.MyDerivedClass byte[][] r = new byte[p1.Length + p2.Length][]; Array.Copy(p1, r, p1.Length); Array.Copy(p2, 0, r, p1.Length, p2.Length); - cb.ice_response(r, p3); + + response(new MyClass_OpByteSSResult(r, p3)); } - public override void opFloatDouble_async(Test.AMD_MyClass_opFloatDouble cb, float p1, double p2, - Ice.Current current) + public override void opFloatDoubleAsync(float p1, double p2, + Action<MyClass_OpFloatDoubleResult> response, + Action<Exception> exception, + Ice.Current current) { - cb.ice_response(p2, p1, p2); + response(new MyClass_OpFloatDoubleResult(p2, p1, p2)); } - public override void opFloatDoubleS_async(Test.AMD_MyClass_opFloatDoubleS cb, float[] p1, double[] p2, - Ice.Current current) + public override void + opFloatDoubleSAsync(float[] p1, double[] p2, + Action<MyClass_OpFloatDoubleSResult> response, + Action<Exception> exception, + Ice.Current current) { float[] p3 = p1; @@ -218,40 +254,48 @@ public sealed class MyDerivedClassI : Test.MyDerivedClass Array.Copy(p2, r, p2.Length); for(int i = 0; i < p1.Length; i++) { - r[p2.Length + i] = (double)p1[i]; + r[p2.Length + i] = p1[i]; } - cb.ice_response(r, p3, p4); + + response(new MyClass_OpFloatDoubleSResult(r, p3, p4)); } - public override void opFloatDoubleSS_async(Test.AMD_MyClass_opFloatDoubleSS cb, float[][] p1, double[][] p2, - Ice.Current current) + public override void + opFloatDoubleSSAsync(float[][] p1, double[][] p2, + Action<MyClass_OpFloatDoubleSSResult> response, + Action<Exception> exception, + Ice.Current current) { - float[][] p3 = p1; + var p3 = p1; - double[][] p4 = new double[p2.Length][]; + var 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 + p2.Length][]; + 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] = (double)p2[i][j]; + r[p2.Length + i][j] = p2[i][j]; } } - cb.ice_response(r, p3, p4); + + response(new MyClass_OpFloatDoubleSSResult(r, p3, p4)); } - public override void opLongFloatD_async(Test.AMD_MyClass_opLongFloatD cb, Dictionary<long, float> p1, - Dictionary<long, float> p2, Ice.Current current) + public override void + opLongFloatDAsync(Dictionary<long, float> p1, Dictionary<long, float> p2, + Action<MyClass_OpLongFloatDResult> response, + Action<Exception> exception, + Ice.Current current) { - Dictionary<long, float> p3 = p1; - Dictionary<long, float> r = new Dictionary<long, float>(); + var p3 = p1; + var r = new Dictionary<long, float>(); foreach(KeyValuePair<long, float> e in p1) { r[e.Key] = e.Value; @@ -260,27 +304,35 @@ public sealed class MyDerivedClassI : Test.MyDerivedClass { r[e.Key] = e.Value; } - cb.ice_response(r, p3); + + response(new MyClass_OpLongFloatDResult(r, p3)); } - public override void opMyClass_async(Test.AMD_MyClass_opMyClass cb, Test.MyClassPrx p1, Ice.Current current) + public override void + opMyClassAsync(MyClassPrx p1, Action<MyClass_OpMyClassResult> response, + Action<Exception> exception, Ice.Current current) { - Test.MyClassPrx p2 = p1; - Test.MyClassPrx p3 = Test.MyClassPrxHelper.uncheckedCast(current.adapter.createProxy( + var p2 = p1; + var p3 = MyClassPrxHelper.uncheckedCast(current.adapter.createProxy( current.adapter.getCommunicator().stringToIdentity("noSuchIdentity"))); - cb.ice_response(Test.MyClassPrxHelper.uncheckedCast(current.adapter.createProxy(current.id)), p2, p3); + response(new MyClass_OpMyClassResult( + MyClassPrxHelper.uncheckedCast(current.adapter.createProxy(current.id)), p2, p3)); } - public override void opMyEnum_async(Test.AMD_MyClass_opMyEnum cb, Test.MyEnum p1, Ice.Current current) + public override void + opMyEnumAsync(MyEnum p1, Action<MyClass_OpMyEnumResult> response, Action<Exception> exception, Ice.Current current) { - cb.ice_response(Test.MyEnum.enum3, p1); + response(new MyClass_OpMyEnumResult(MyEnum.enum3, p1)); } - public override void opShortIntD_async(Test.AMD_MyClass_opShortIntD cb, Dictionary<short, int> p1, - Dictionary<short, int> p2, Ice.Current current) + public override void + opShortIntDAsync(Dictionary<short, int> p1, Dictionary<short, int> p2, + Action<MyClass_OpShortIntDResult> response, + Action<Exception> exception, + Ice.Current current) { - Dictionary<short, int> p3 = p1; - Dictionary<short, int> r = new Dictionary<short, int>(); + var p3 = p1; + var r = new Dictionary<short, int>(); foreach(KeyValuePair<short, int> e in p1) { r[e.Key] = e.Value; @@ -289,59 +341,73 @@ public sealed class MyDerivedClassI : Test.MyDerivedClass { r[e.Key] = e.Value; } - cb.ice_response(r, p3); + response(new MyClass_OpShortIntDResult(r, p3)); } - public override void opShortIntLong_async(Test.AMD_MyClass_opShortIntLong cb, short p1, int p2, long p3, - Ice.Current current) + public override void + opShortIntLongAsync(short p1, int p2, long p3, + Action<MyClass_OpShortIntLongResult> response, + Action<Exception> exception, + Ice.Current current) { - cb.ice_response(p3, p1, p2, p3); + response(new MyClass_OpShortIntLongResult(p3, p1, p2, p3)); } - public override void opShortIntLongS_async(Test.AMD_MyClass_opShortIntLongS cb, short[] p1, int[] p2, - long[] p3, Ice.Current current) + public override void + opShortIntLongSAsync(short[] p1, int[] p2, long[] p3, + Action<MyClass_OpShortIntLongSResult> response, + Action<Exception> exception, + Ice.Current current) { - short[] p4 = p1; - - int[] p5 = new int[p2.Length]; + var p4 = p1; + var p5 = new int[p2.Length]; for(int i = 0; i < p2.Length; i++) { p5[i] = p2[p2.Length - (i + 1)]; } - - long[] p6 = new long[p3.Length + p3.Length]; + var p6 = new long[p3.Length + p3.Length]; Array.Copy(p3, p6, p3.Length); Array.Copy(p3, 0, p6, p3.Length, p3.Length); - cb.ice_response(p3, p4, p5, p6); + response(new MyClass_OpShortIntLongSResult(p3, p4, p5, p6)); } - public override void opShortIntLongSS_async(Test.AMD_MyClass_opShortIntLongSS cb, short[][] p1, - int[][] p2, long[][] p3, Ice.Current current) + public override void + opShortIntLongSSAsync(short[][] p1, int[][] p2, long[][] p3, + Action<MyClass_OpShortIntLongSSResult> response, + Action<Exception> exception, + Ice.Current current) { - short[][] p4 = p1; + var p4 = p1; - int[][] p5 = new int[p2.Length][]; + var p5 = new int[p2.Length][]; for(int i = 0; i < p2.Length; i++) { p5[i] = p2[p2.Length - (i + 1)]; } - long[][] p6 = new long[p3.Length + p3.Length][]; + var p6 = new long[p3.Length + p3.Length][]; Array.Copy(p3, p6, p3.Length); Array.Copy(p3, 0, p6, p3.Length, p3.Length); - cb.ice_response(p3, p4, p5, p6); + response(new MyClass_OpShortIntLongSSResult(p3, p4, p5, p6)); } - public override void opString_async(Test.AMD_MyClass_opString cb, string p1, string p2, Ice.Current current) + public override void + opStringAsync(string p1, string p2, + Action<MyClass_OpStringResult> response, + Action<Exception> exception, + Ice.Current current) { - cb.ice_response(p1 + " " + p2, p2 + " " + p1); + response(new MyClass_OpStringResult(p1 + " " + p2, p2 + " " + p1)); } - public override void opStringMyEnumD_async(Test.AMD_MyClass_opStringMyEnumD cb, Dictionary<string, Test.MyEnum> p1, - Dictionary<string, Test.MyEnum> p2, Ice.Current current) + public override void + opStringMyEnumDAsync(Dictionary<string, MyEnum> p1, Dictionary<string, MyEnum> p2, + Action<MyClass_OpStringMyEnumDResult> response, + Action<Exception> exception, + Ice.Current current) { - Dictionary<string, Test.MyEnum> p3 = p1; - Dictionary<string, Test.MyEnum> r = new Dictionary<string, Test.MyEnum>(); + var p3 = p1; + var r = new Dictionary<string, Test.MyEnum>(); foreach(KeyValuePair<string, Test.MyEnum> e in p1) { r[e.Key] = e.Value; @@ -350,186 +416,209 @@ public sealed class MyDerivedClassI : Test.MyDerivedClass { r[e.Key] = e.Value; } - cb.ice_response(r, p3); + response(new MyClass_OpStringMyEnumDResult(r, p3)); } - public override void opMyEnumStringD_async(Test.AMD_MyClass_opMyEnumStringD cb, Dictionary<Test.MyEnum, string> p1, - Dictionary<Test.MyEnum, string> p2, Ice.Current current) + public override void + opMyEnumStringDAsync(Dictionary<MyEnum, string> p1, Dictionary<MyEnum, string> p2, + Action<MyClass_OpMyEnumStringDResult> response, + Action<Exception> exception, + Ice.Current current) { - Dictionary<Test.MyEnum, string> p3 = p1; - Dictionary<Test.MyEnum, string> r = new Dictionary<Test.MyEnum, string>(); - foreach(KeyValuePair<Test.MyEnum, string> e in p1) + var p3 = p1; + var r = new Dictionary<MyEnum, string>(); + foreach(var e in p1) { r[e.Key] = e.Value; } - foreach(KeyValuePair<Test.MyEnum, string> e in p2) + foreach(KeyValuePair<MyEnum, string> e in p2) { r[e.Key] = e.Value; } - cb.ice_response(r, p3); + response(new MyClass_OpMyEnumStringDResult(r, p3)); } - public override void opMyStructMyEnumD_async(Test.AMD_MyClass_opMyStructMyEnumD cb, - Dictionary<Test.MyStruct, Test.MyEnum> p1, - Dictionary<Test.MyStruct, Test.MyEnum> p2, Ice.Current current) + public override void + opMyStructMyEnumDAsync(Dictionary<MyStruct, MyEnum> p1, + Dictionary<MyStruct, MyEnum> p2, + Action<MyClass_OpMyStructMyEnumDResult> response, + Action<Exception> exception, + Ice.Current current) { - Dictionary<Test.MyStruct, Test.MyEnum> p3 = p1; - Dictionary<Test.MyStruct, Test.MyEnum> r = new Dictionary<Test.MyStruct, Test.MyEnum>(); - foreach(KeyValuePair<Test.MyStruct, Test.MyEnum> e in p1) + var p3 = p1; + var r = new Dictionary<MyStruct, MyEnum>(); + foreach(var e in p1) { r[e.Key] = e.Value; } - foreach(KeyValuePair<Test.MyStruct, Test.MyEnum> e in p2) + foreach(var e in p2) { r[e.Key] = e.Value; } - cb.ice_response(r, p3); + response(new MyClass_OpMyStructMyEnumDResult(r, p3)); } - public override void opByteBoolDS_async(Test.AMD_MyClass_opByteBoolDS cb, - Dictionary<byte, bool>[] p1, - Dictionary<byte, bool>[] p2, - Ice.Current current) + public override void + opByteBoolDSAsync(Dictionary<byte, bool>[] p1, + Dictionary<byte, bool>[] p2, + Action<MyClass_OpByteBoolDSResult> response, + Action<Exception> exception, + Ice.Current current) { - Dictionary<byte, bool>[] p3 = new Dictionary<byte, bool>[p1.Length + p2.Length]; + 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); - Dictionary<byte, bool>[] r = new Dictionary<byte, bool>[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)]; } - cb.ice_response(r,p3); + response(new MyClass_OpByteBoolDSResult(r, p3)); } - public override void opShortIntDS_async(Test.AMD_MyClass_opShortIntDS cb, - Dictionary<short, int>[] p1, - Dictionary<short, int>[] p2, - Ice.Current current) + public override void + opShortIntDSAsync(Dictionary<short, int>[] p1, Dictionary<short, int>[] p2, + Action<MyClass_OpShortIntDSResult> response, + Action<Exception> exception, + Ice.Current current) { - Dictionary<short, int>[] p3 = new Dictionary<short, int>[p1.Length + p2.Length]; + 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); - Dictionary<short, int>[] r = new Dictionary<short, int>[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)]; } - cb.ice_response(r,p3); + response(new MyClass_OpShortIntDSResult(r, p3)); } - public override void opLongFloatDS_async(Test.AMD_MyClass_opLongFloatDS cb, - Dictionary<long, float>[] p1, - Dictionary<long, float>[] p2, - Ice.Current current) + public override void + opLongFloatDSAsync(Dictionary<long, float>[] p1, + Dictionary<long, float>[] p2, + Action<MyClass_OpLongFloatDSResult> response, + Action<Exception> exception, + Ice.Current current) { - Dictionary<long, float>[] p3 = new Dictionary<long, float>[p1.Length + p2.Length]; + 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); - Dictionary<long, float>[] r = new Dictionary<long, float>[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)]; } - cb.ice_response(r,p3); + response(new MyClass_OpLongFloatDSResult(r, p3)); } - public override void opStringStringDS_async(Test.AMD_MyClass_opStringStringDS cb, - Dictionary<string, string>[] p1, - Dictionary<string, string>[] p2, - Ice.Current current) + public override void + opStringStringDSAsync(Dictionary<string, string>[] p1, + Dictionary<string, string>[] p2, + Action<MyClass_OpStringStringDSResult> response, + Action<Exception> exception, + Ice.Current current) { - Dictionary<string, string>[] p3 = new Dictionary<string, string>[p1.Length + p2.Length]; + 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); - Dictionary<string, string>[] r = new Dictionary<string, string>[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)]; } - cb.ice_response(r,p3); + response(new MyClass_OpStringStringDSResult(r, p3)); } - public override void opStringMyEnumDS_async(Test.AMD_MyClass_opStringMyEnumDS cb, - Dictionary<string, Test.MyEnum>[] p1, - Dictionary<string, Test.MyEnum>[] p2, - Ice.Current current) + public override void + opStringMyEnumDSAsync(Dictionary<string, MyEnum>[] p1, + Dictionary<string, MyEnum>[] p2, + Action<MyClass_OpStringMyEnumDSResult> response, + Action<Exception> exception, + Ice.Current current) { - Dictionary<string, Test.MyEnum>[] p3 = new Dictionary<string, Test.MyEnum>[p1.Length + p2.Length]; + 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); - Dictionary<string, Test.MyEnum>[] r = new Dictionary<string, Test.MyEnum>[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)]; } - cb.ice_response(r,p3); + response(new MyClass_OpStringMyEnumDSResult(r, p3)); } - public override void opMyEnumStringDS_async(Test.AMD_MyClass_opMyEnumStringDS cb, - Dictionary<Test.MyEnum, string>[] p1, - Dictionary<Test.MyEnum, string>[] p2, - Ice.Current current) + public override void + opMyEnumStringDSAsync(Dictionary<MyEnum, string>[] p1, + Dictionary<MyEnum, string>[] p2, + Action<MyClass_OpMyEnumStringDSResult> response, + Action<Exception> exception, + Ice.Current current) { - Dictionary<Test.MyEnum, string>[] p3 = new Dictionary<Test.MyEnum, string>[p1.Length + p2.Length]; + 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); - Dictionary<Test.MyEnum, string>[] r = new Dictionary<Test.MyEnum, string>[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)]; } - cb.ice_response(r,p3); + response(new MyClass_OpMyEnumStringDSResult(r, p3)); } - public override void opMyStructMyEnumDS_async(Test.AMD_MyClass_opMyStructMyEnumDS cb, - Dictionary<Test.MyStruct, Test.MyEnum>[] p1, - Dictionary<Test.MyStruct, Test.MyEnum>[] p2, - Ice.Current current) + public override void + opMyStructMyEnumDSAsync(Dictionary<MyStruct, MyEnum>[] p1, + Dictionary<MyStruct, MyEnum>[] p2, + Action<MyClass_OpMyStructMyEnumDSResult> response, + Action<Exception> exception, + Ice.Current current) { - Dictionary<Test.MyStruct, Test.MyEnum>[] p3 = new Dictionary<Test.MyStruct, Test.MyEnum>[p1.Length + p2.Length]; + 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); - Dictionary<Test.MyStruct, Test.MyEnum>[] r = new Dictionary<Test.MyStruct, Test.MyEnum>[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)]; } - cb.ice_response(r,p3); + response(new MyClass_OpMyStructMyEnumDSResult(r, p3)); } - public override void opByteByteSD_async(Test.AMD_MyClass_opByteByteSD cb, - Dictionary<byte, byte[]> p1, - Dictionary<byte, byte[]> p2, - Ice.Current current) + public override void + opByteByteSDAsync(Dictionary<byte, byte[]> p1, + Dictionary<byte, byte[]> p2, + Action<MyClass_OpByteByteSDResult> response, + Action<Exception> exception, + Ice.Current current) { - Dictionary<byte, byte[]> p3 = p2; - Dictionary<byte, byte[]> r = new Dictionary<byte, byte[]>(); - foreach(KeyValuePair<byte, byte[]> e in p1) + var p3 = p2; + var r = new Dictionary<byte, byte[]>(); + foreach(var e in p1) { r[e.Key] = e.Value; } - foreach(KeyValuePair<byte, byte[]> e in p2) + foreach(var e in p2) { r[e.Key] = e.Value; } - cb.ice_response(r,p3); + response(new MyClass_OpByteByteSDResult(r, p3)); } - public override void opBoolBoolSD_async(Test.AMD_MyClass_opBoolBoolSD cb, - Dictionary<bool, bool[]> p1, - Dictionary<bool, bool[]> p2, - Ice.Current current) + public override void + opBoolBoolSDAsync(Dictionary<bool, bool[]> p1, + Dictionary<bool, bool[]> p2, + Action<MyClass_OpBoolBoolSDResult> response, + Action<Exception> exception, + Ice.Current current) { - Dictionary<bool, bool[]> p3 = p2; - Dictionary<bool, bool[]> r = new Dictionary<bool, bool[]>(); + var p3 = p2; + var r = new Dictionary<bool, bool[]>(); foreach(KeyValuePair<bool, bool[]> e in p1) { r[e.Key] = e.Value; @@ -538,416 +627,459 @@ public sealed class MyDerivedClassI : Test.MyDerivedClass { r[e.Key] = e.Value; } - cb.ice_response(r,p3); + response(new MyClass_OpBoolBoolSDResult(r, p3)); } - public override void opShortShortSD_async(Test.AMD_MyClass_opShortShortSD cb, - Dictionary<short, short[]> p1, - Dictionary<short, short[]> p2, - Ice.Current current) + public override void + opShortShortSDAsync(Dictionary<short, short[]> p1, + Dictionary<short, short[]> p2, + Action<MyClass_OpShortShortSDResult> response, + Action<Exception> exception, + Ice.Current current) { - Dictionary<short, short[]> p3 = p2; - Dictionary<short, short[]> r = new Dictionary<short, short[]>(); - foreach(KeyValuePair<short, short[]> e in p1) + var p3 = p2; + var r = new Dictionary<short, short[]>(); + foreach(var e in p1) { r[e.Key] = e.Value; } - foreach(KeyValuePair<short, short[]> e in p2) + foreach(var e in p2) { r[e.Key] = e.Value; } - cb.ice_response(r,p3); + response(new MyClass_OpShortShortSDResult(r, p3)); } - public override void opIntIntSD_async(Test.AMD_MyClass_opIntIntSD cb, - Dictionary<int, int[]> p1, - Dictionary<int, int[]> p2, - Ice.Current current) + public override void + opIntIntSDAsync(Dictionary<int, int[]> p1, + Dictionary<int, int[]> p2, + Action<MyClass_OpIntIntSDResult> response, + Action<Exception> exception, + Ice.Current current) { - Dictionary<int, int[]> p3 = p2; - Dictionary<int, int[]> r = new Dictionary<int, int[]>(); - foreach(KeyValuePair<int, int[]> e in p1) + var p3 = p2; + var r = new Dictionary<int, int[]>(); + foreach(var e in p1) { r[e.Key] = e.Value; } - foreach(KeyValuePair<int, int[]> e in p2) + foreach(var e in p2) { r[e.Key] = e.Value; } - cb.ice_response(r,p3); + response(new MyClass_OpIntIntSDResult(r, p3)); } - public override void opLongLongSD_async(Test.AMD_MyClass_opLongLongSD cb, - Dictionary<long, long[]> p1, - Dictionary<long, long[]> p2, - Ice.Current current) + public override void + opLongLongSDAsync(Dictionary<long, long[]> p1, + Dictionary<long, long[]> p2, + Action<MyClass_OpLongLongSDResult> response, + Action<Exception> exception, + Ice.Current current) { - Dictionary<long, long[]> p3 = p2; - Dictionary<long, long[]> r = new Dictionary<long, long[]>(); - foreach(KeyValuePair<long, long[]> e in p1) + var p3 = p2; + var r = new Dictionary<long, long[]>(); + foreach(var e in p1) { r[e.Key] = e.Value; } - foreach(KeyValuePair<long, long[]> e in p2) + foreach(var e in p2) { r[e.Key] = e.Value; } - cb.ice_response(r,p3); + response(new MyClass_OpLongLongSDResult(r, p3)); } - public override void opStringFloatSD_async(Test.AMD_MyClass_opStringFloatSD cb, - Dictionary<string, float[]> p1, - Dictionary<string, float[]> p2, - Ice.Current current) + public override void + opStringFloatSDAsync(Dictionary<string, float[]> p1, + Dictionary<string, float[]> p2, + Action<MyClass_OpStringFloatSDResult> response, + Action<Exception> exception, + Ice.Current current) { - Dictionary<string, float[]> p3 = p2; - Dictionary<string, float[]> r = new Dictionary<string, float[]>(); - foreach(KeyValuePair<string, float[]> e in p1) + var p3 = p2; + var r = new Dictionary<string, float[]>(); + foreach(var e in p1) { r[e.Key] = e.Value; } - foreach(KeyValuePair<string, float[]> e in p2) + foreach(var e in p2) { r[e.Key] = e.Value; } - cb.ice_response(r,p3); + response(new MyClass_OpStringFloatSDResult(r, p3)); } - public override void opStringDoubleSD_async(Test.AMD_MyClass_opStringDoubleSD cb, - Dictionary<string, double[]> p1, - Dictionary<string, double[]> p2, - Ice.Current current) + public override void + opStringDoubleSDAsync(Dictionary<string, double[]> p1, + Dictionary<string, double[]> p2, + Action<MyClass_OpStringDoubleSDResult> response, + Action<Exception> exception, + Ice.Current current) { - Dictionary<string, double[]> p3 = p2; - Dictionary<string, double[]> r = new Dictionary<string, double[]>(); - foreach(KeyValuePair<string, double[]> e in p1) + var p3 = p2; + var r = new Dictionary<string, double[]>(); + foreach(var e in p1) { r[e.Key] = e.Value; } - foreach(KeyValuePair<string, double[]> e in p2) + foreach(var e in p2) { r[e.Key] = e.Value; } - cb.ice_response(r,p3); + response(new MyClass_OpStringDoubleSDResult(r, p3)); } - public override void opStringStringSD_async(Test.AMD_MyClass_opStringStringSD cb, - Dictionary<string, string[]> p1, - Dictionary<string, string[]> p2, - Ice.Current current) + public override void + opStringStringSDAsync(Dictionary<string, string[]> p1, + Dictionary<string, string[]> p2, + Action<MyClass_OpStringStringSDResult> response, + Action<Exception> exception, + Ice.Current current) { - Dictionary<string, string[]> p3 = p2; - Dictionary<string, string[]> r = new Dictionary<string, string[]>(); - foreach(KeyValuePair<string, string[]> e in p1) + var p3 = p2; + var r = new Dictionary<string, string[]>(); + foreach(var e in p1) { r[e.Key] = e.Value; } - foreach(KeyValuePair<string, string[]> e in p2) + foreach(var e in p2) { r[e.Key] = e.Value; } - cb.ice_response(r,p3); + response(new MyClass_OpStringStringSDResult(r, p3)); } - public override void opMyEnumMyEnumSD_async(Test.AMD_MyClass_opMyEnumMyEnumSD cb, - Dictionary<Test.MyEnum, Test.MyEnum[]> p1, - Dictionary<Test.MyEnum, Test.MyEnum[]> p2, - Ice.Current ice) + public override void + opMyEnumMyEnumSDAsync(Dictionary<MyEnum, MyEnum[]> p1, + Dictionary<MyEnum, MyEnum[]> p2, + Action<MyClass_OpMyEnumMyEnumSDResult> response, + Action<Exception> exception, + Ice.Current current) { - Dictionary<Test.MyEnum, Test.MyEnum[]> p3 = p2; - Dictionary<Test.MyEnum, Test.MyEnum[]> r = new Dictionary<Test.MyEnum, Test.MyEnum[]>(); - foreach(KeyValuePair<Test.MyEnum, Test.MyEnum[]> e in p1) + var p3 = p2; + var r = new Dictionary<Test.MyEnum, Test.MyEnum[]>(); + foreach(var e in p1) { r[e.Key] = e.Value; } - foreach(KeyValuePair<Test.MyEnum, Test.MyEnum[]> e in p2) + foreach(var e in p2) { r[e.Key] = e.Value; } - cb.ice_response(r,p3); + response(new MyClass_OpMyEnumMyEnumSDResult(r, p3)); } - public override void opIntS_async(Test.AMD_MyClass_opIntS cb, int[] s, Ice.Current current) + public override void opIntSAsync(int[] s, + Action<int[]> response, + Action<Exception> exception, + Ice.Current current) { - int[] r = new int[s.Length]; + var r = new int[s.Length]; for(int i = 0; i < s.Length; ++i) { r[i] = -s[i]; } - cb.ice_response(r); + response(r); } - public override void opContext_async(Test.AMD_MyClass_opContext cb, Ice.Current current) + public override void opContextAsync(Action<Dictionary<string, string>> response, + Action<Exception> exception, + Ice.Current current) { - cb.ice_response(current.ctx); + response(current.ctx); } - public override void opByteSOneway_async(Test.AMD_MyClass_opByteSOneway cb, byte[] s, Ice.Current current) + public override void opByteSOnewayAsync(byte[] s, Action response, + Action<Exception> exception, + Ice.Current current) { lock(this) { ++_opByteSOnewayCallCount; } - cb.ice_response(); + response(); } - public override void opByteSOnewayCallCount_async(Test.AMD_MyClass_opByteSOnewayCallCount cb, Ice.Current current) + public override void opByteSOnewayCallCountAsync(Action<int> response, + Action<Exception> exeption, + Ice.Current current) { lock(this) { - int count = _opByteSOnewayCallCount; + var count = _opByteSOnewayCallCount; _opByteSOnewayCallCount = 0; - cb.ice_response(count); + response(count); } } - public override void opDoubleMarshaling_async(Test.AMD_MyClass_opDoubleMarshaling cb, double p1, double[] p2, - Ice.Current current) + public override void opDoubleMarshalingAsync(double p1, double[] p2, Action response, + Action<Exception> exception, Ice.Current current) { - double d = 1278312346.0 / 13.0; + var d = 1278312346.0 / 13.0; test(p1 == d); for(int i = 0; i < p2.Length; ++i) { test(p2[i] == d); } - cb.ice_response(); + response(); } - public override void opStringS_async(Test.AMD_MyClass_opStringS cb, string[] p1, string[] p2, - Ice.Current current) + public override void + opStringSAsync(string[] p1, string[] p2, + Action<MyClass_OpStringSResult> response, + Action<Exception> exception, + Ice.Current current) { - string[] p3 = new string[p1.Length + p2.Length]; + var p3 = new string[p1.Length + p2.Length]; Array.Copy(p1, p3, p1.Length); Array.Copy(p2, 0, p3, p1.Length, p2.Length); - string[] r = new string[p1.Length]; + var r = new string[p1.Length]; for(int i = 0; i < p1.Length; i++) { r[i] = p1[p1.Length - (i + 1)]; } - cb.ice_response(r, p3); + response(new MyClass_OpStringSResult(r, p3)); } - public override void opStringSS_async(Test.AMD_MyClass_opStringSS cb, string[][] p1, string[][] p2, - Ice.Current current) + public override void + opStringSSAsync(string[][] p1, string[][] p2, Action<MyClass_OpStringSSResult> response, + Action<Exception> exception, Ice.Current current) { - string[][] p3 = new string[p1.Length + p2.Length][]; + var p3 = new string[p1.Length + p2.Length][]; Array.Copy(p1, p3, p1.Length); Array.Copy(p2, 0, p3, p1.Length, p2.Length); - - string[][] r = new string[p2.Length][]; + var r = new string[p2.Length][]; for(int i = 0; i < p2.Length; i++) { r[i] = p2[p2.Length - (i + 1)]; } - cb.ice_response(r, p3); + response(new MyClass_OpStringSSResult(r, p3)); } - public override void opStringSSS_async(Test.AMD_MyClass_opStringSSS cb, string[][][] p1, string[][][] p2, - Ice.Current current) + public override void + opStringSSSAsync(string[][][] p1, string[][][] p2, Action<MyClass_OpStringSSSResult> response, + Action<Exception> exception, Ice.Current current) { - string[][][] p3 = new string[p1.Length + p2.Length][][]; + var p3 = new string[p1.Length + p2.Length][][]; Array.Copy(p1, p3, p1.Length); Array.Copy(p2, 0, p3, p1.Length, p2.Length); - string[][][] r = new string[p2.Length][][]; + var r = new string[p2.Length][][]; for(int i = 0; i < p2.Length; i++) { r[i] = p2[p2.Length - (i + 1)]; } - cb.ice_response(r, p3); + response(new MyClass_OpStringSSSResult(r, p3)); } - public override void opStringStringD_async(Test.AMD_MyClass_opStringStringD cb, Dictionary<string, string> p1, - Dictionary<string, string> p2, Ice.Current current) + public override void + opStringStringDAsync(Dictionary<string, string> p1, Dictionary<string, string> p2, + Action<MyClass_OpStringStringDResult> response, Action<Exception> exception, + Ice.Current current) { - Dictionary<string, string> p3 = p1; - Dictionary<string, string> r = new Dictionary<string, string>(); - foreach(KeyValuePair<string, string> e in p1) + var p3 = p1; + var r = new Dictionary<string, string>(); + foreach(var e in p1) { r[e.Key] = e.Value; } - foreach(KeyValuePair<string, string> e in p2) + foreach(var e in p2) { r[e.Key] = e.Value; } - cb.ice_response(r, p3); + response(new MyClass_OpStringStringDResult(r, p3)); } - public override void opStruct_async(Test.AMD_MyClass_opStruct cb, Test.Structure p1, Test.Structure p2, - Ice.Current current) + public override void + opStructAsync(Structure p1, Structure p2, Action<MyClass_OpStructResult> response, + Action<Exception> exception, Ice.Current current) { - Test.Structure p3 = p1; + var p3 = p1; p3.s.s = "a new string"; - cb.ice_response(p2, p3); + response(new MyClass_OpStructResult(p2, p3)); } - public override void opIdempotent_async(Test.AMD_MyClass_opIdempotent cb, Ice.Current current) + public override void opIdempotentAsync(Action response, Action<Exception> exception, Ice.Current current) { test(current.mode == Ice.OperationMode.Idempotent); - cb.ice_response(); + response(); } - public override void opNonmutating_async(Test.AMD_MyClass_opNonmutating cb, Ice.Current current) + public override void opNonmutatingAsync(Action response, Action<Exception> exception, Ice.Current current) { test(current.mode == Ice.OperationMode.Nonmutating); - cb.ice_response(); + response(); } - public override void opDerived_async(Test.AMD_MyDerivedClass_opDerived cb, Ice.Current current) + public override void opDerivedAsync(Action response, Action<Exception> exception, Ice.Current current) { - cb.ice_response(); + response(); } - public override void opByte1_async(Test.AMD_MyClass_opByte1 cb, byte value, Ice.Current current) + public override void opByte1Async(byte value, Action<byte> response, Action<Exception> exception, + Ice.Current current) { - cb.ice_response(value); + response(value); } - public override void opShort1_async(Test.AMD_MyClass_opShort1 cb, short value, Ice.Current current) + public override void opShort1Async(short value, Action<short> response, Action<Exception> exception, + Ice.Current current) { - cb.ice_response(value); + response(value); } - public override void opInt1_async(Test.AMD_MyClass_opInt1 cb, int value, Ice.Current current) + public override void opInt1Async(int value, Action<int> response, Action<Exception> exception, + Ice.Current current) { - cb.ice_response(value); + response(value); } - public override void opLong1_async(Test.AMD_MyClass_opLong1 cb, long value, Ice.Current current) + public override void opLong1Async(long value, Action<long> response, Action<Exception> exception, + Ice.Current current) { - cb.ice_response(value); + response(value); } - public override void opFloat1_async(Test.AMD_MyClass_opFloat1 cb, float value, Ice.Current current) + public override void opFloat1Async(float value, Action<float> response, Action<Exception> exception, + Ice.Current current) { - cb.ice_response(value); + response(value); } - public override void opDouble1_async(Test.AMD_MyClass_opDouble1 cb, double value, Ice.Current current) + public override void opDouble1Async(double value, Action<double> response, Action<Exception> exception, + Ice.Current current) { - cb.ice_response(value); + response(value); } - public override void opString1_async(Test.AMD_MyClass_opString1 cb, string value, Ice.Current current) + public override void opString1Async(string value, Action<string> response, Action<Exception> exception, + Ice.Current current) { - cb.ice_response(value); + response(value); } - public override void opStringS1_async(Test.AMD_MyClass_opStringS1 cb, string[] value, Ice.Current current) + public override void opStringS1Async(string[] value, Action<string[]> response, Action<Exception> exception, + Ice.Current current) { - cb.ice_response(value); + response(value); } - public override void opByteBoolD1_async(Test.AMD_MyClass_opByteBoolD1 cb, Dictionary<byte, bool> value, - Ice.Current current) + public override void + opByteBoolD1Async(Dictionary<byte, bool> value, Action<Dictionary<byte, bool>> response, Action<Exception> exception, + Ice.Current current) { - cb.ice_response(value); + response(value); } - public override void opStringS2_async(Test.AMD_MyClass_opStringS2 cb, string[] value, Ice.Current current) + public override void + opStringS2Async(string[] value, Action<string[]> response, Action<Exception> exception, Ice.Current current) { - cb.ice_response(value); + response(value); } - public override void opByteBoolD2_async(Test.AMD_MyClass_opByteBoolD2 cb, Dictionary<byte, bool> value, - Ice.Current current) + public override void + opByteBoolD2Async(Dictionary<byte, bool> value, Action<Dictionary<byte, bool>> response, Action<Exception> exception, + Ice.Current current) { - cb.ice_response(value); + response(value); } - public override void opMyClass1_async(Test.AMD_MyDerivedClass_opMyClass1 cb, Test.MyClass1 value, - Ice.Current current) + public override void + opMyClass1Async(MyClass1 value, Action<MyClass1> response, Action<Exception> exception, Ice.Current current) { - cb.ice_response(value); + response(value); } - public override void opMyStruct1_async(Test.AMD_MyDerivedClass_opMyStruct1 cb, Test.MyStruct1 value, - Ice.Current current) + public override void + opMyStruct1Async(MyStruct1 value, Action<MyStruct1> response, Action<Exception> exception, Ice.Current current) { - cb.ice_response(value); + response(value); } - public override void opStringLiterals_async(Test.AMD_MyClass_opStringLiterals cb, Ice.Current current) + public override void + opStringLiteralsAsync(Action<string[]> response, Action<Exception> exception, Ice.Current current) { - cb.ice_response(new string[] + response(new string[] { - Test.s0.value, - Test.s1.value, - Test.s2.value, - Test.s3.value, - Test.s4.value, - Test.s5.value, - Test.s6.value, - Test.s7.value, - Test.s8.value, - Test.s9.value, - Test.s10.value, + s0.value, + s1.value, + s2.value, + s3.value, + s4.value, + s5.value, + s6.value, + s7.value, + s8.value, + s9.value, + s10.value, - Test.sw0.value, - Test.sw1.value, - Test.sw2.value, - Test.sw3.value, - Test.sw4.value, - Test.sw5.value, - Test.sw6.value, - Test.sw7.value, - Test.sw8.value, - Test.sw9.value, - Test.sw10.value, + sw0.value, + sw1.value, + sw2.value, + sw3.value, + sw4.value, + sw5.value, + sw6.value, + sw7.value, + sw8.value, + sw9.value, + sw10.value, - Test.ss0.value, - Test.ss1.value, - Test.ss2.value, - Test.ss3.value, - Test.ss4.value, - Test.ss5.value, + ss0.value, + ss1.value, + ss2.value, + ss3.value, + ss4.value, + ss5.value, - Test.su0.value, - Test.su1.value, - Test.su2.value + su0.value, + su1.value, + su2.value }); } - public override void opWStringLiterals_async(Test.AMD_MyClass_opWStringLiterals cb, Ice.Current current) + public override void + opWStringLiteralsAsync(Action<string[]> response, Action<Exception> exception, Ice.Current current) { - cb.ice_response(new string[] + response(new string[] { - Test.s0.value, - Test.s1.value, - Test.s2.value, - Test.s3.value, - Test.s4.value, - Test.s5.value, - Test.s6.value, - Test.s7.value, - Test.s8.value, - Test.s9.value, - Test.s10.value, + s0.value, + s1.value, + s2.value, + s3.value, + s4.value, + s5.value, + s6.value, + s7.value, + s8.value, + s9.value, + s10.value, - Test.sw0.value, - Test.sw1.value, - Test.sw2.value, - Test.sw3.value, - Test.sw4.value, - Test.sw5.value, - Test.sw6.value, - Test.sw7.value, - Test.sw8.value, - Test.sw9.value, - Test.sw10.value, + sw0.value, + sw1.value, + sw2.value, + sw3.value, + sw4.value, + sw5.value, + sw6.value, + sw7.value, + sw8.value, + sw9.value, + sw10.value, - Test.ss0.value, - Test.ss1.value, - Test.ss2.value, - Test.ss3.value, - Test.ss4.value, - Test.ss5.value, + ss0.value, + ss1.value, + ss2.value, + ss3.value, + ss4.value, + ss5.value, - Test.su0.value, - Test.su1.value, - Test.su2.value + su0.value, + su1.value, + su2.value }); } |