1// 2// Copyright (c) ZeroC, Inc. All rights reserved. 3// 4 5import {Ice} from "ice"; 6import {Test} from "./generated"; 7 8export class AMDInitialI extends Test.Initial 9{ 10 shutdown(current:Ice.Current) 11 { 12 current.adapter.getCommunicator().shutdown(); 13 } 14 15 pingPong(obj:Ice.Value, current:Ice.Current):Ice.Value 16 { 17 return obj; 18 } 19 20 opOptionalException(a:number, b:string, o:Test.OneOptional, current:Ice.Current):void 21 { 22 const ex = new Test.OptionalException(); 23 if(a !== undefined) 24 { 25 ex.a = a; 26 } 27 else 28 { 29 ex.a = undefined; // The member "a" has a default value. 30 } 31 if(b !== undefined) 32 { 33 ex.b = b; 34 } 35 if(o !== undefined) 36 { 37 ex.o = o; 38 } 39 throw ex; 40 } 41 42 opDerivedException(a:number, b:string, o:Test.OneOptional, current:Ice.Current):void 43 { 44 const ex = new Test.DerivedException(); 45 if(a !== undefined) 46 { 47 ex.a = a; 48 } 49 else 50 { 51 ex.a = undefined; // The member "a" has a default value. 52 } 53 if(b !== undefined) 54 { 55 ex.b = b; 56 ex.ss = b; 57 } 58 else 59 { 60 ex.ss = undefined; // The member "ss" has a default value. 61 } 62 if(o !== undefined) 63 { 64 ex.o = o; 65 ex.o2 = o; 66 } 67 throw ex; 68 } 69 70 opRequiredException(a:number, b:string, o:Test.OneOptional, current:Ice.Current):void 71 { 72 const ex = new Test.RequiredException(); 73 if(a !== undefined) 74 { 75 ex.a = a; 76 } 77 else 78 { 79 ex.a = undefined; // The member "a" has a default value. 80 } 81 if(b !== undefined) 82 { 83 ex.b = b; 84 ex.ss = b; 85 } 86 if(o !== undefined) 87 { 88 ex.o = o; 89 ex.o2 = o; 90 } 91 throw ex; 92 } 93 94 opByte(p1:number, current:Ice.Current):[number, number] 95 { 96 return [p1, p1]; 97 } 98 99 opBool(p1:boolean, current:Ice.Current):[boolean, boolean] 100 { 101 return [p1, p1]; 102 } 103 104 opShort(p1:number, current:Ice.Current):[number, number] 105 { 106 return [p1, p1]; 107 } 108 109 opInt(p1:number, current:Ice.Current):[number, number] 110 { 111 return [p1, p1]; 112 } 113 114 opLong(p1:Ice.Long, current:Ice.Current):[Ice.Long, Ice.Long] 115 { 116 return [p1, p1]; 117 } 118 119 opFloat(p1:number, current:Ice.Current):[number, number] 120 { 121 return [p1, p1]; 122 } 123 124 opDouble(p1:number, current:Ice.Current):[number, number] 125 { 126 return [p1, p1]; 127 } 128 129 opString(p1:string, current:Ice.Current):[string, string] 130 { 131 return [p1, p1]; 132 } 133 134 opMyEnum(p1:Test.MyEnum, current:Ice.Current):[Test.MyEnum, Test.MyEnum] 135 { 136 return [p1, p1]; 137 } 138 139 opSmallStruct(p1:Test.SmallStruct, current:Ice.Current):[Test.SmallStruct, Test.SmallStruct] 140 { 141 return [p1, p1]; 142 } 143 144 opFixedStruct(p1:Test.FixedStruct, current:Ice.Current):[Test.FixedStruct, Test.FixedStruct] 145 { 146 return [p1, p1]; 147 } 148 149 opVarStruct(p1:Test.VarStruct, current:Ice.Current):[Test.VarStruct, Test.VarStruct] 150 { 151 return [p1, p1]; 152 } 153 154 opOneOptional(p1:Test.OneOptional, current:Ice.Current):[Test.OneOptional, Test.OneOptional] 155 { 156 return [p1, p1]; 157 } 158 159 opOneOptionalProxy(p1:Ice.ObjectPrx, current:Ice.Current):[Ice.ObjectPrx, Ice.ObjectPrx] 160 { 161 return [p1, p1]; 162 } 163 164 opByteSeq(p1:Test.ByteSeq, current:Ice.Current):[Test.ByteSeq, Test.ByteSeq] 165 { 166 return [p1, p1]; 167 } 168 169 opBoolSeq(p1:Test.BoolSeq, current:Ice.Current):[Test.BoolSeq, Test.BoolSeq] 170 { 171 return [p1, p1]; 172 } 173 174 opShortSeq(p1:Test.ShortSeq, current:Ice.Current):[Test.ShortSeq, Test.ShortSeq] 175 { 176 return [p1, p1]; 177 } 178 179 opIntSeq(p1:Test.IntSeq, current:Ice.Current):[Test.IntSeq, Test.IntSeq] 180 { 181 return [p1, p1]; 182 } 183 184 opLongSeq(p1:Test.LongSeq, current:Ice.Current):[Test.LongSeq, Test.LongSeq] 185 { 186 return [p1, p1]; 187 } 188 189 opFloatSeq(p1:Test.FloatSeq, current:Ice.Current):[Test.FloatSeq, Test.FloatSeq] 190 { 191 return [p1, p1]; 192 } 193 194 opDoubleSeq(p1:Test.DoubleSeq, current:Ice.Current):[Test.DoubleSeq, Test.DoubleSeq] 195 { 196 return [p1, p1]; 197 } 198 199 opStringSeq(p1:Test.StringSeq, current:Ice.Current):[Test.StringSeq, Test.StringSeq] 200 { 201 return [p1, p1]; 202 } 203 204 opSmallStructSeq(p1:Test.SmallStructSeq, current:Ice.Current):[Test.SmallStructSeq, Test.SmallStructSeq] 205 { 206 return [p1, p1]; 207 } 208 209 opSmallStructList(p1:Test.SmallStructList, current:Ice.Current):[Test.SmallStructList, Test.SmallStructList] 210 { 211 return [p1, p1]; 212 } 213 214 opFixedStructSeq(p1:Test.FixedStructSeq, current:Ice.Current):[Test.FixedStructSeq, Test.FixedStructSeq] 215 { 216 return [p1, p1]; 217 } 218 219 opFixedStructList(p1:Test.FixedStructList, current:Ice.Current):[Test.FixedStructList, Test.FixedStructList] 220 { 221 return [p1, p1]; 222 } 223 224 opVarStructSeq(p1:Test.VarStructSeq, current:Ice.Current):[Test.VarStructSeq, Test.VarStructSeq] 225 { 226 return [p1, p1]; 227 } 228 229 opSerializable(p1:Test.Serializable, current:Ice.Current):[Test.Serializable, Test.Serializable] 230 { 231 return [p1, p1]; 232 } 233 234 opIntIntDict(p1:Test.IntIntDict, current:Ice.Current):[Test.IntIntDict, Test.IntIntDict] 235 { 236 return [p1, p1]; 237 } 238 239 opStringIntDict(p1:Test.StringIntDict, current:Ice.Current):[Test.StringIntDict, Test.StringIntDict] 240 { 241 return [p1, p1]; 242 } 243 244 opIntOneOptionalDict(p1:Test.IntOneOptionalDict, current:Ice.Current):[Test.IntOneOptionalDict, Test.IntOneOptionalDict] 245 { 246 return [p1, p1]; 247 } 248 249 opClassAndUnknownOptional(p:Test.A, current:Ice.Current):void 250 { 251 } 252 253 sendOptionalClass(req:boolean, one:Test.OneOptional, current:Ice.Current):void 254 { 255 } 256 257 returnOptionalClass(req:boolean, current:Ice.Current):Test.OneOptional 258 { 259 return new Test.OneOptional(53); 260 } 261 262 opG(g:Test.G, current:Ice.Current):Test.G 263 { 264 return g; 265 } 266 267 opVoid(current:Ice.Current):void 268 { 269 } 270 271 opMStruct1(current:Ice.Current):Test.SmallStruct 272 { 273 return new Test.SmallStruct(); 274 } 275 276 opMStruct2(p1:Test.SmallStruct, current:Ice.Current):[Test.SmallStruct, Test.SmallStruct] 277 { 278 return [p1, p1]; 279 } 280 281 opMSeq1(current:Ice.Current):Test.StringSeq 282 { 283 return []; 284 } 285 286 opMSeq2(p1:Test.StringSeq, current:Ice.Current):[Test.StringSeq, Test.StringSeq] 287 { 288 return [p1, p1]; 289 } 290 291 opMDict1(current:Ice.Current):Test.StringIntDict 292 { 293 return new Map(); 294 } 295 296 opMDict2(p1:Test.StringIntDict, current:Ice.Current):[Test.StringIntDict, Test.StringIntDict] 297 { 298 return [p1, p1]; 299 } 300 301 opMG1(current:Ice.Current):Test.G 302 { 303 return new Test.G(); 304 } 305 306 opMG2(p1:Test.G, current:Ice.Current):[Test.G, Test.G] 307 { 308 return [p1, p1]; 309 } 310 311 supportsRequiredParams(current:Ice.Current):boolean 312 { 313 return false; 314 } 315 316 supportsJavaSerializable(current:Ice.Current):boolean 317 { 318 return false; 319 } 320 321 supportsCsharpSerializable(current:Ice.Current):boolean 322 { 323 return false; 324 } 325 326 supportsCppStringView(current:Ice.Current):boolean 327 { 328 return false; 329 } 330 331 supportsNullOptional(current:Ice.Current):boolean 332 { 333 return true; 334 } 335} 336