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
|
#!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2006 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.
#
# **********************************************************************
import Ice, Test
class MyDerivedClassI(Test.MyDerivedClass):
def __init__(self, adapter, identity):
self.adapter = adapter
self.identity = identity
def shutdown(self, current=None):
self.adapter.getCommunicator().shutdown()
def opVoid(self, current=None):
pass
def opByte(self, p1, p2, current=None):
return (p1, p1 ^ p2)
def opBool(self, p1, p2, current=None):
return (p2, p1)
def opShortIntLong(self, p1, p2, p3, current=None):
return (p3, p1, p2, p3)
def opFloatDouble(self, p1, p2, current=None):
return (p2, p1, p2)
def opString(self, p1, p2, current=None):
return (p1 + " " + p2, p2 + " " + p1)
def opMyEnum(self, p1, current=None):
return (Test.MyEnum.enum3, p1)
def opMyClass(self, p1, current=None):
return (Test.MyClassPrx.uncheckedCast(self.adapter.createProxy(self.identity)), p1,
Test.MyClassPrx.uncheckedCast(self.adapter.createProxy(self.adapter.getCommunicator().stringToIdentity("noSuchIdentity"))))
def opStruct(self, p1, p2, current=None):
p1.s.s = "a new string"
return (p2, p1)
def opByteS(self, p1, p2, current=None):
# By default sequence<byte> maps to a string.
p3 = map(ord, p1)
p3.reverse()
r = map(ord, p1)
r.extend(map(ord, p2))
return (r, p3)
def opBoolS(self, p1, p2, current=None):
p3 = p1[0:]
p3.extend(p2)
r = p1[0:]
r.reverse();
return (r, p3)
def opShortIntLongS(self, p1, p2, p3, current=None):
p4 = p1[0:]
p5 = p2[0:]
p5.reverse()
p6 = p3[0:]
p6.extend(p3)
return (p3, p4, p5, p6)
def opFloatDoubleS(self, p1, p2, current=None):
p3 = p1[0:]
p4 = p2[0:]
p4.reverse()
r = p2[0:]
r.extend(p1)
return (r, p3, p4)
def opStringS(self, p1, p2, current=None):
p3 = p1[0:]
p3.extend(p2)
r = p1[0:]
r.reverse()
return (r, p3)
def opByteSS(self, p1, p2, current=None):
p3 = p1[0:]
p3.reverse()
r = p1[0:]
r.extend(p2)
return (r, p3)
def opBoolSS(self, p1, p2, current=None):
p3 = p1[0:]
p3.extend(p2)
r = p1[0:]
r.reverse()
return (r, p3)
def opShortIntLongSS(self, p1, p2, p3, current=None):
p4 = p1[0:]
p5 = p2[0:]
p5.reverse()
p6 = p3[0:]
p6.extend(p3)
return (p3, p4, p5, p6)
def opFloatDoubleSS(self, p1, p2, current=None):
p3 = p1[0:]
p4 = p2[0:]
p4.reverse()
r = p2[0:]
r.extend(p2)
return (r, p3, p4)
def opStringSS(self, p1, p2, current=None):
p3 = p1[0:]
p3.extend(p2)
r = p2[0:]
r.reverse()
return (r, p3)
def opStringSSS(self, p1, p2, current=None):
p3 = p1[0:]
p3.extend(p2)
r = p2[0:]
r.reverse()
return (r, p3)
def opByteBoolD(self, p1, p2, current=None):
p3 = p1.copy()
r = p1.copy()
r.update(p2)
return (r, p3)
def opShortIntD(self, p1, p2, current=None):
p3 = p1.copy()
r = p1.copy()
r.update(p2)
return (r, p3)
def opLongFloatD(self, p1, p2, current=None):
p3 = p1.copy()
r = p1.copy()
r.update(p2)
return (r, p3)
def opStringStringD(self, p1, p2, current=None):
p3 = p1.copy()
r = p1.copy()
r.update(p2)
return (r, p3)
def opStringMyEnumD(self, p1, p2, current=None):
p3 = p1.copy()
r = p1.copy()
r.update(p2)
return (r, p3)
def opIntS(self, s, current=None):
return [-x for x in s]
def opContext(self, current=None):
return current.ctx
def opDerived(self, current=None):
pass
class TestCheckedCastI(Test.TestCheckedCast):
def __init__(self):
self.ctx = None
def getContext(self, current):
return self.ctx;
def ice_isA(self, s, current):
self.ctx = current.ctx
return Test.TestCheckedCast.ice_isA(self, s, current)
|