line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Autogenerated by Thrift Compiler (0.16.0) |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING |
5
|
|
|
|
|
|
|
# |
6
|
2
|
|
|
2
|
|
686
|
use 5.10.0; |
|
2
|
|
|
|
|
5
|
|
7
|
2
|
|
|
2
|
|
9
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
54
|
|
8
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
38
|
|
9
|
2
|
|
|
2
|
|
8
|
use Thrift::Exception; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
39
|
|
10
|
2
|
|
|
2
|
|
9
|
use Thrift::MessageType; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
33
|
|
11
|
2
|
|
|
2
|
|
8
|
use Thrift::Type; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
67
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
package ThriftTest::Numberz; |
14
|
2
|
|
|
2
|
|
10
|
use constant ONE => 1; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
146
|
|
15
|
2
|
|
|
2
|
|
12
|
use constant TWO => 2; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
95
|
|
16
|
2
|
|
|
2
|
|
11
|
use constant THREE => 3; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
76
|
|
17
|
2
|
|
|
2
|
|
9
|
use constant FIVE => 5; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
83
|
|
18
|
2
|
|
|
2
|
|
11
|
use constant SIX => 6; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
65
|
|
19
|
2
|
|
|
2
|
|
8
|
use constant EIGHT => 8; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
123
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
package ThriftTest::Bonk; |
22
|
2
|
|
|
2
|
|
12
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
949
|
|
23
|
|
|
|
|
|
|
ThriftTest::Bonk->mk_accessors( qw( message type ) ); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub new { |
26
|
0
|
|
|
0
|
|
0
|
my $classname = shift; |
27
|
0
|
|
|
|
|
0
|
my $self = {}; |
28
|
0
|
|
0
|
|
|
0
|
my $vals = shift || {}; |
29
|
0
|
|
|
|
|
0
|
$self->{message} = undef; |
30
|
0
|
|
|
|
|
0
|
$self->{type} = undef; |
31
|
0
|
0
|
|
|
|
0
|
if (UNIVERSAL::isa($vals,'HASH')) { |
32
|
0
|
0
|
|
|
|
0
|
if (defined $vals->{message}) { |
33
|
0
|
|
|
|
|
0
|
$self->{message} = $vals->{message}; |
34
|
|
|
|
|
|
|
} |
35
|
0
|
0
|
|
|
|
0
|
if (defined $vals->{type}) { |
36
|
0
|
|
|
|
|
0
|
$self->{type} = $vals->{type}; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
0
|
|
|
|
|
0
|
return bless ($self, $classname); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub getName { |
43
|
0
|
|
|
0
|
|
0
|
return 'Bonk'; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub read { |
47
|
0
|
|
|
0
|
|
0
|
my ($self, $input) = @_; |
48
|
0
|
|
|
|
|
0
|
my $xfer = 0; |
49
|
0
|
|
|
|
|
0
|
my $fname; |
50
|
0
|
|
|
|
|
0
|
my $ftype = 0; |
51
|
0
|
|
|
|
|
0
|
my $fid = 0; |
52
|
0
|
|
|
|
|
0
|
$xfer += $input->readStructBegin(\$fname); |
53
|
0
|
|
|
|
|
0
|
while (1) |
54
|
|
|
|
|
|
|
{ |
55
|
0
|
|
|
|
|
0
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
56
|
0
|
0
|
|
|
|
0
|
if ($ftype == Thrift::TType::STOP) { |
57
|
0
|
|
|
|
|
0
|
last; |
58
|
|
|
|
|
|
|
} |
59
|
0
|
|
|
|
|
0
|
SWITCH: for($fid) |
60
|
|
|
|
|
|
|
{ |
61
|
0
|
0
|
|
|
|
0
|
/^1$/ && do{ if ($ftype == Thrift::TType::STRING) { |
|
0
|
0
|
|
|
|
0
|
|
62
|
0
|
|
|
|
|
0
|
$xfer += $input->readString(\$self->{message}); |
63
|
|
|
|
|
|
|
} else { |
64
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
65
|
|
|
|
|
|
|
} |
66
|
0
|
|
|
|
|
0
|
last; }; |
67
|
0
|
0
|
|
|
|
0
|
/^2$/ && do{ if ($ftype == Thrift::TType::I32) { |
|
0
|
0
|
|
|
|
0
|
|
68
|
0
|
|
|
|
|
0
|
$xfer += $input->readI32(\$self->{type}); |
69
|
|
|
|
|
|
|
} else { |
70
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
71
|
|
|
|
|
|
|
} |
72
|
0
|
|
|
|
|
0
|
last; }; |
73
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
74
|
|
|
|
|
|
|
} |
75
|
0
|
|
|
|
|
0
|
$xfer += $input->readFieldEnd(); |
76
|
|
|
|
|
|
|
} |
77
|
0
|
|
|
|
|
0
|
$xfer += $input->readStructEnd(); |
78
|
0
|
|
|
|
|
0
|
return $xfer; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub write { |
82
|
0
|
|
|
0
|
|
0
|
my ($self, $output) = @_; |
83
|
0
|
|
|
|
|
0
|
my $xfer = 0; |
84
|
0
|
|
|
|
|
0
|
$xfer += $output->writeStructBegin('Bonk'); |
85
|
0
|
0
|
|
|
|
0
|
if (defined $self->{message}) { |
86
|
0
|
|
|
|
|
0
|
$xfer += $output->writeFieldBegin('message', Thrift::TType::STRING, 1); |
87
|
0
|
|
|
|
|
0
|
$xfer += $output->writeString($self->{message}); |
88
|
0
|
|
|
|
|
0
|
$xfer += $output->writeFieldEnd(); |
89
|
|
|
|
|
|
|
} |
90
|
0
|
0
|
|
|
|
0
|
if (defined $self->{type}) { |
91
|
0
|
|
|
|
|
0
|
$xfer += $output->writeFieldBegin('type', Thrift::TType::I32, 2); |
92
|
0
|
|
|
|
|
0
|
$xfer += $output->writeI32($self->{type}); |
93
|
0
|
|
|
|
|
0
|
$xfer += $output->writeFieldEnd(); |
94
|
|
|
|
|
|
|
} |
95
|
0
|
|
|
|
|
0
|
$xfer += $output->writeFieldStop(); |
96
|
0
|
|
|
|
|
0
|
$xfer += $output->writeStructEnd(); |
97
|
0
|
|
|
|
|
0
|
return $xfer; |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
package ThriftTest::Bools; |
101
|
2
|
|
|
2
|
|
4443
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1019
|
|
102
|
|
|
|
|
|
|
ThriftTest::Bools->mk_accessors( qw( im_true im_false ) ); |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub new { |
105
|
0
|
|
|
0
|
|
0
|
my $classname = shift; |
106
|
0
|
|
|
|
|
0
|
my $self = {}; |
107
|
0
|
|
0
|
|
|
0
|
my $vals = shift || {}; |
108
|
0
|
|
|
|
|
0
|
$self->{im_true} = undef; |
109
|
0
|
|
|
|
|
0
|
$self->{im_false} = undef; |
110
|
0
|
0
|
|
|
|
0
|
if (UNIVERSAL::isa($vals,'HASH')) { |
111
|
0
|
0
|
|
|
|
0
|
if (defined $vals->{im_true}) { |
112
|
0
|
|
|
|
|
0
|
$self->{im_true} = $vals->{im_true}; |
113
|
|
|
|
|
|
|
} |
114
|
0
|
0
|
|
|
|
0
|
if (defined $vals->{im_false}) { |
115
|
0
|
|
|
|
|
0
|
$self->{im_false} = $vals->{im_false}; |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
} |
118
|
0
|
|
|
|
|
0
|
return bless ($self, $classname); |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
sub getName { |
122
|
0
|
|
|
0
|
|
0
|
return 'Bools'; |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
sub read { |
126
|
0
|
|
|
0
|
|
0
|
my ($self, $input) = @_; |
127
|
0
|
|
|
|
|
0
|
my $xfer = 0; |
128
|
0
|
|
|
|
|
0
|
my $fname; |
129
|
0
|
|
|
|
|
0
|
my $ftype = 0; |
130
|
0
|
|
|
|
|
0
|
my $fid = 0; |
131
|
0
|
|
|
|
|
0
|
$xfer += $input->readStructBegin(\$fname); |
132
|
0
|
|
|
|
|
0
|
while (1) |
133
|
|
|
|
|
|
|
{ |
134
|
0
|
|
|
|
|
0
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
135
|
0
|
0
|
|
|
|
0
|
if ($ftype == Thrift::TType::STOP) { |
136
|
0
|
|
|
|
|
0
|
last; |
137
|
|
|
|
|
|
|
} |
138
|
0
|
|
|
|
|
0
|
SWITCH: for($fid) |
139
|
|
|
|
|
|
|
{ |
140
|
0
|
0
|
|
|
|
0
|
/^1$/ && do{ if ($ftype == Thrift::TType::BOOL) { |
|
0
|
0
|
|
|
|
0
|
|
141
|
0
|
|
|
|
|
0
|
$xfer += $input->readBool(\$self->{im_true}); |
142
|
|
|
|
|
|
|
} else { |
143
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
144
|
|
|
|
|
|
|
} |
145
|
0
|
|
|
|
|
0
|
last; }; |
146
|
0
|
0
|
|
|
|
0
|
/^2$/ && do{ if ($ftype == Thrift::TType::BOOL) { |
|
0
|
0
|
|
|
|
0
|
|
147
|
0
|
|
|
|
|
0
|
$xfer += $input->readBool(\$self->{im_false}); |
148
|
|
|
|
|
|
|
} else { |
149
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
150
|
|
|
|
|
|
|
} |
151
|
0
|
|
|
|
|
0
|
last; }; |
152
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
153
|
|
|
|
|
|
|
} |
154
|
0
|
|
|
|
|
0
|
$xfer += $input->readFieldEnd(); |
155
|
|
|
|
|
|
|
} |
156
|
0
|
|
|
|
|
0
|
$xfer += $input->readStructEnd(); |
157
|
0
|
|
|
|
|
0
|
return $xfer; |
158
|
|
|
|
|
|
|
} |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
sub write { |
161
|
0
|
|
|
0
|
|
0
|
my ($self, $output) = @_; |
162
|
0
|
|
|
|
|
0
|
my $xfer = 0; |
163
|
0
|
|
|
|
|
0
|
$xfer += $output->writeStructBegin('Bools'); |
164
|
0
|
0
|
|
|
|
0
|
if (defined $self->{im_true}) { |
165
|
0
|
|
|
|
|
0
|
$xfer += $output->writeFieldBegin('im_true', Thrift::TType::BOOL, 1); |
166
|
0
|
|
|
|
|
0
|
$xfer += $output->writeBool($self->{im_true}); |
167
|
0
|
|
|
|
|
0
|
$xfer += $output->writeFieldEnd(); |
168
|
|
|
|
|
|
|
} |
169
|
0
|
0
|
|
|
|
0
|
if (defined $self->{im_false}) { |
170
|
0
|
|
|
|
|
0
|
$xfer += $output->writeFieldBegin('im_false', Thrift::TType::BOOL, 2); |
171
|
0
|
|
|
|
|
0
|
$xfer += $output->writeBool($self->{im_false}); |
172
|
0
|
|
|
|
|
0
|
$xfer += $output->writeFieldEnd(); |
173
|
|
|
|
|
|
|
} |
174
|
0
|
|
|
|
|
0
|
$xfer += $output->writeFieldStop(); |
175
|
0
|
|
|
|
|
0
|
$xfer += $output->writeStructEnd(); |
176
|
0
|
|
|
|
|
0
|
return $xfer; |
177
|
|
|
|
|
|
|
} |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
package ThriftTest::Xtruct; |
180
|
2
|
|
|
2
|
|
13
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
1419
|
|
181
|
|
|
|
|
|
|
ThriftTest::Xtruct->mk_accessors( qw( string_thing byte_thing i32_thing i64_thing ) ); |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
sub new { |
184
|
3
|
|
|
3
|
|
462
|
my $classname = shift; |
185
|
3
|
|
|
|
|
6
|
my $self = {}; |
186
|
3
|
|
50
|
|
|
10
|
my $vals = shift || {}; |
187
|
3
|
|
|
|
|
7
|
$self->{string_thing} = undef; |
188
|
3
|
|
|
|
|
3
|
$self->{byte_thing} = undef; |
189
|
3
|
|
|
|
|
4
|
$self->{i32_thing} = undef; |
190
|
3
|
|
|
|
|
4
|
$self->{i64_thing} = undef; |
191
|
3
|
50
|
|
|
|
10
|
if (UNIVERSAL::isa($vals,'HASH')) { |
192
|
3
|
50
|
|
|
|
7
|
if (defined $vals->{string_thing}) { |
193
|
0
|
|
|
|
|
0
|
$self->{string_thing} = $vals->{string_thing}; |
194
|
|
|
|
|
|
|
} |
195
|
3
|
50
|
|
|
|
5
|
if (defined $vals->{byte_thing}) { |
196
|
0
|
|
|
|
|
0
|
$self->{byte_thing} = $vals->{byte_thing}; |
197
|
|
|
|
|
|
|
} |
198
|
3
|
50
|
|
|
|
4
|
if (defined $vals->{i32_thing}) { |
199
|
0
|
|
|
|
|
0
|
$self->{i32_thing} = $vals->{i32_thing}; |
200
|
|
|
|
|
|
|
} |
201
|
3
|
50
|
|
|
|
8
|
if (defined $vals->{i64_thing}) { |
202
|
0
|
|
|
|
|
0
|
$self->{i64_thing} = $vals->{i64_thing}; |
203
|
|
|
|
|
|
|
} |
204
|
|
|
|
|
|
|
} |
205
|
3
|
|
|
|
|
7
|
return bless ($self, $classname); |
206
|
|
|
|
|
|
|
} |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
sub getName { |
209
|
0
|
|
|
0
|
|
0
|
return 'Xtruct'; |
210
|
|
|
|
|
|
|
} |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
sub read { |
213
|
2
|
|
|
2
|
|
17
|
my ($self, $input) = @_; |
214
|
2
|
|
|
|
|
2
|
my $xfer = 0; |
215
|
2
|
|
|
|
|
3
|
my $fname; |
216
|
2
|
|
|
|
|
2
|
my $ftype = 0; |
217
|
2
|
|
|
|
|
3
|
my $fid = 0; |
218
|
2
|
|
|
|
|
5
|
$xfer += $input->readStructBegin(\$fname); |
219
|
2
|
|
|
|
|
10
|
while (1) |
220
|
|
|
|
|
|
|
{ |
221
|
8
|
|
|
|
|
18
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
222
|
8
|
100
|
|
|
|
14
|
if ($ftype == Thrift::TType::STOP) { |
223
|
2
|
|
|
|
|
2
|
last; |
224
|
|
|
|
|
|
|
} |
225
|
6
|
|
|
|
|
8
|
SWITCH: for($fid) |
226
|
|
|
|
|
|
|
{ |
227
|
6
|
50
|
|
|
|
20
|
/^1$/ && do{ if ($ftype == Thrift::TType::STRING) { |
|
2
|
100
|
|
|
|
5
|
|
228
|
2
|
|
|
|
|
12
|
$xfer += $input->readString(\$self->{string_thing}); |
229
|
|
|
|
|
|
|
} else { |
230
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
231
|
|
|
|
|
|
|
} |
232
|
2
|
|
|
|
|
3
|
last; }; |
233
|
4
|
0
|
|
|
|
8
|
/^4$/ && do{ if ($ftype == Thrift::TType::BYTE) { |
|
0
|
50
|
|
|
|
0
|
|
234
|
0
|
|
|
|
|
0
|
$xfer += $input->readByte(\$self->{byte_thing}); |
235
|
|
|
|
|
|
|
} else { |
236
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
237
|
|
|
|
|
|
|
} |
238
|
0
|
|
|
|
|
0
|
last; }; |
239
|
4
|
50
|
|
|
|
9
|
/^9$/ && do{ if ($ftype == Thrift::TType::I32) { |
|
2
|
100
|
|
|
|
13
|
|
240
|
2
|
|
|
|
|
11
|
$xfer += $input->readI32(\$self->{i32_thing}); |
241
|
|
|
|
|
|
|
} else { |
242
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
243
|
|
|
|
|
|
|
} |
244
|
2
|
|
|
|
|
3
|
last; }; |
245
|
2
|
50
|
|
|
|
9
|
/^11$/ && do{ if ($ftype == Thrift::TType::I64) { |
|
2
|
50
|
|
|
|
5
|
|
246
|
2
|
|
|
|
|
5
|
$xfer += $input->readI64(\$self->{i64_thing}); |
247
|
|
|
|
|
|
|
} else { |
248
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
249
|
|
|
|
|
|
|
} |
250
|
2
|
|
|
|
|
4
|
last; }; |
251
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
252
|
|
|
|
|
|
|
} |
253
|
6
|
|
|
|
|
13
|
$xfer += $input->readFieldEnd(); |
254
|
|
|
|
|
|
|
} |
255
|
2
|
|
|
|
|
5
|
$xfer += $input->readStructEnd(); |
256
|
2
|
|
|
|
|
4
|
return $xfer; |
257
|
|
|
|
|
|
|
} |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
sub write { |
260
|
2
|
|
|
2
|
|
1475
|
my ($self, $output) = @_; |
261
|
2
|
|
|
|
|
3
|
my $xfer = 0; |
262
|
2
|
|
|
|
|
6
|
$xfer += $output->writeStructBegin('Xtruct'); |
263
|
2
|
50
|
|
|
|
5
|
if (defined $self->{string_thing}) { |
264
|
2
|
|
|
|
|
6
|
$xfer += $output->writeFieldBegin('string_thing', Thrift::TType::STRING, 1); |
265
|
2
|
|
|
|
|
3
|
$xfer += $output->writeString($self->{string_thing}); |
266
|
2
|
|
|
|
|
5
|
$xfer += $output->writeFieldEnd(); |
267
|
|
|
|
|
|
|
} |
268
|
2
|
50
|
|
|
|
5
|
if (defined $self->{byte_thing}) { |
269
|
0
|
|
|
|
|
0
|
$xfer += $output->writeFieldBegin('byte_thing', Thrift::TType::BYTE, 4); |
270
|
0
|
|
|
|
|
0
|
$xfer += $output->writeByte($self->{byte_thing}); |
271
|
0
|
|
|
|
|
0
|
$xfer += $output->writeFieldEnd(); |
272
|
|
|
|
|
|
|
} |
273
|
2
|
50
|
|
|
|
4
|
if (defined $self->{i32_thing}) { |
274
|
2
|
|
|
|
|
4
|
$xfer += $output->writeFieldBegin('i32_thing', Thrift::TType::I32, 9); |
275
|
2
|
|
|
|
|
5
|
$xfer += $output->writeI32($self->{i32_thing}); |
276
|
2
|
|
|
|
|
4
|
$xfer += $output->writeFieldEnd(); |
277
|
|
|
|
|
|
|
} |
278
|
2
|
50
|
|
|
|
4
|
if (defined $self->{i64_thing}) { |
279
|
2
|
|
|
|
|
4
|
$xfer += $output->writeFieldBegin('i64_thing', Thrift::TType::I64, 11); |
280
|
2
|
|
|
|
|
4
|
$xfer += $output->writeI64($self->{i64_thing}); |
281
|
2
|
|
|
|
|
5
|
$xfer += $output->writeFieldEnd(); |
282
|
|
|
|
|
|
|
} |
283
|
2
|
|
|
|
|
5
|
$xfer += $output->writeFieldStop(); |
284
|
2
|
|
|
|
|
4
|
$xfer += $output->writeStructEnd(); |
285
|
2
|
|
|
|
|
4
|
return $xfer; |
286
|
|
|
|
|
|
|
} |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
package ThriftTest::Xtruct2; |
289
|
2
|
|
|
2
|
|
13
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
1211
|
|
290
|
|
|
|
|
|
|
ThriftTest::Xtruct2->mk_accessors( qw( byte_thing struct_thing i32_thing ) ); |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
sub new { |
293
|
0
|
|
|
0
|
|
|
my $classname = shift; |
294
|
0
|
|
|
|
|
|
my $self = {}; |
295
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
296
|
0
|
|
|
|
|
|
$self->{byte_thing} = undef; |
297
|
0
|
|
|
|
|
|
$self->{struct_thing} = undef; |
298
|
0
|
|
|
|
|
|
$self->{i32_thing} = undef; |
299
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
300
|
0
|
0
|
|
|
|
|
if (defined $vals->{byte_thing}) { |
301
|
0
|
|
|
|
|
|
$self->{byte_thing} = $vals->{byte_thing}; |
302
|
|
|
|
|
|
|
} |
303
|
0
|
0
|
|
|
|
|
if (defined $vals->{struct_thing}) { |
304
|
0
|
|
|
|
|
|
$self->{struct_thing} = $vals->{struct_thing}; |
305
|
|
|
|
|
|
|
} |
306
|
0
|
0
|
|
|
|
|
if (defined $vals->{i32_thing}) { |
307
|
0
|
|
|
|
|
|
$self->{i32_thing} = $vals->{i32_thing}; |
308
|
|
|
|
|
|
|
} |
309
|
|
|
|
|
|
|
} |
310
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
311
|
|
|
|
|
|
|
} |
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
sub getName { |
314
|
0
|
|
|
0
|
|
|
return 'Xtruct2'; |
315
|
|
|
|
|
|
|
} |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
sub read { |
318
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
319
|
0
|
|
|
|
|
|
my $xfer = 0; |
320
|
0
|
|
|
|
|
|
my $fname; |
321
|
0
|
|
|
|
|
|
my $ftype = 0; |
322
|
0
|
|
|
|
|
|
my $fid = 0; |
323
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
324
|
0
|
|
|
|
|
|
while (1) |
325
|
|
|
|
|
|
|
{ |
326
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
327
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
328
|
0
|
|
|
|
|
|
last; |
329
|
|
|
|
|
|
|
} |
330
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
331
|
|
|
|
|
|
|
{ |
332
|
0
|
0
|
|
|
|
|
/^1$/ && do{ if ($ftype == Thrift::TType::BYTE) { |
|
0
|
0
|
|
|
|
|
|
333
|
0
|
|
|
|
|
|
$xfer += $input->readByte(\$self->{byte_thing}); |
334
|
|
|
|
|
|
|
} else { |
335
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
336
|
|
|
|
|
|
|
} |
337
|
0
|
|
|
|
|
|
last; }; |
338
|
0
|
0
|
|
|
|
|
/^2$/ && do{ if ($ftype == Thrift::TType::STRUCT) { |
|
0
|
0
|
|
|
|
|
|
339
|
0
|
|
|
|
|
|
$self->{struct_thing} = ThriftTest::Xtruct->new(); |
340
|
0
|
|
|
|
|
|
$xfer += $self->{struct_thing}->read($input); |
341
|
|
|
|
|
|
|
} else { |
342
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
343
|
|
|
|
|
|
|
} |
344
|
0
|
|
|
|
|
|
last; }; |
345
|
0
|
0
|
|
|
|
|
/^3$/ && do{ if ($ftype == Thrift::TType::I32) { |
|
0
|
0
|
|
|
|
|
|
346
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$self->{i32_thing}); |
347
|
|
|
|
|
|
|
} else { |
348
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
349
|
|
|
|
|
|
|
} |
350
|
0
|
|
|
|
|
|
last; }; |
351
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
352
|
|
|
|
|
|
|
} |
353
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
354
|
|
|
|
|
|
|
} |
355
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
356
|
0
|
|
|
|
|
|
return $xfer; |
357
|
|
|
|
|
|
|
} |
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
sub write { |
360
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
361
|
0
|
|
|
|
|
|
my $xfer = 0; |
362
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('Xtruct2'); |
363
|
0
|
0
|
|
|
|
|
if (defined $self->{byte_thing}) { |
364
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('byte_thing', Thrift::TType::BYTE, 1); |
365
|
0
|
|
|
|
|
|
$xfer += $output->writeByte($self->{byte_thing}); |
366
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
367
|
|
|
|
|
|
|
} |
368
|
0
|
0
|
|
|
|
|
if (defined $self->{struct_thing}) { |
369
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('struct_thing', Thrift::TType::STRUCT, 2); |
370
|
0
|
|
|
|
|
|
$xfer += $self->{struct_thing}->write($output); |
371
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
372
|
|
|
|
|
|
|
} |
373
|
0
|
0
|
|
|
|
|
if (defined $self->{i32_thing}) { |
374
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('i32_thing', Thrift::TType::I32, 3); |
375
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($self->{i32_thing}); |
376
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
377
|
|
|
|
|
|
|
} |
378
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
379
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
380
|
0
|
|
|
|
|
|
return $xfer; |
381
|
|
|
|
|
|
|
} |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
package ThriftTest::Xtruct3; |
384
|
2
|
|
|
2
|
|
13
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
1359
|
|
385
|
|
|
|
|
|
|
ThriftTest::Xtruct3->mk_accessors( qw( string_thing changed i32_thing i64_thing ) ); |
386
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
sub new { |
388
|
0
|
|
|
0
|
|
|
my $classname = shift; |
389
|
0
|
|
|
|
|
|
my $self = {}; |
390
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
391
|
0
|
|
|
|
|
|
$self->{string_thing} = undef; |
392
|
0
|
|
|
|
|
|
$self->{changed} = undef; |
393
|
0
|
|
|
|
|
|
$self->{i32_thing} = undef; |
394
|
0
|
|
|
|
|
|
$self->{i64_thing} = undef; |
395
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
396
|
0
|
0
|
|
|
|
|
if (defined $vals->{string_thing}) { |
397
|
0
|
|
|
|
|
|
$self->{string_thing} = $vals->{string_thing}; |
398
|
|
|
|
|
|
|
} |
399
|
0
|
0
|
|
|
|
|
if (defined $vals->{changed}) { |
400
|
0
|
|
|
|
|
|
$self->{changed} = $vals->{changed}; |
401
|
|
|
|
|
|
|
} |
402
|
0
|
0
|
|
|
|
|
if (defined $vals->{i32_thing}) { |
403
|
0
|
|
|
|
|
|
$self->{i32_thing} = $vals->{i32_thing}; |
404
|
|
|
|
|
|
|
} |
405
|
0
|
0
|
|
|
|
|
if (defined $vals->{i64_thing}) { |
406
|
0
|
|
|
|
|
|
$self->{i64_thing} = $vals->{i64_thing}; |
407
|
|
|
|
|
|
|
} |
408
|
|
|
|
|
|
|
} |
409
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
410
|
|
|
|
|
|
|
} |
411
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
sub getName { |
413
|
0
|
|
|
0
|
|
|
return 'Xtruct3'; |
414
|
|
|
|
|
|
|
} |
415
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
sub read { |
417
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
418
|
0
|
|
|
|
|
|
my $xfer = 0; |
419
|
0
|
|
|
|
|
|
my $fname; |
420
|
0
|
|
|
|
|
|
my $ftype = 0; |
421
|
0
|
|
|
|
|
|
my $fid = 0; |
422
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
423
|
0
|
|
|
|
|
|
while (1) |
424
|
|
|
|
|
|
|
{ |
425
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
426
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
427
|
0
|
|
|
|
|
|
last; |
428
|
|
|
|
|
|
|
} |
429
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
430
|
|
|
|
|
|
|
{ |
431
|
0
|
0
|
|
|
|
|
/^1$/ && do{ if ($ftype == Thrift::TType::STRING) { |
|
0
|
0
|
|
|
|
|
|
432
|
0
|
|
|
|
|
|
$xfer += $input->readString(\$self->{string_thing}); |
433
|
|
|
|
|
|
|
} else { |
434
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
435
|
|
|
|
|
|
|
} |
436
|
0
|
|
|
|
|
|
last; }; |
437
|
0
|
0
|
|
|
|
|
/^4$/ && do{ if ($ftype == Thrift::TType::I32) { |
|
0
|
0
|
|
|
|
|
|
438
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$self->{changed}); |
439
|
|
|
|
|
|
|
} else { |
440
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
441
|
|
|
|
|
|
|
} |
442
|
0
|
|
|
|
|
|
last; }; |
443
|
0
|
0
|
|
|
|
|
/^9$/ && do{ if ($ftype == Thrift::TType::I32) { |
|
0
|
0
|
|
|
|
|
|
444
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$self->{i32_thing}); |
445
|
|
|
|
|
|
|
} else { |
446
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
447
|
|
|
|
|
|
|
} |
448
|
0
|
|
|
|
|
|
last; }; |
449
|
0
|
0
|
|
|
|
|
/^11$/ && do{ if ($ftype == Thrift::TType::I64) { |
|
0
|
0
|
|
|
|
|
|
450
|
0
|
|
|
|
|
|
$xfer += $input->readI64(\$self->{i64_thing}); |
451
|
|
|
|
|
|
|
} else { |
452
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
453
|
|
|
|
|
|
|
} |
454
|
0
|
|
|
|
|
|
last; }; |
455
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
456
|
|
|
|
|
|
|
} |
457
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
458
|
|
|
|
|
|
|
} |
459
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
460
|
0
|
|
|
|
|
|
return $xfer; |
461
|
|
|
|
|
|
|
} |
462
|
|
|
|
|
|
|
|
463
|
|
|
|
|
|
|
sub write { |
464
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
465
|
0
|
|
|
|
|
|
my $xfer = 0; |
466
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('Xtruct3'); |
467
|
0
|
0
|
|
|
|
|
if (defined $self->{string_thing}) { |
468
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('string_thing', Thrift::TType::STRING, 1); |
469
|
0
|
|
|
|
|
|
$xfer += $output->writeString($self->{string_thing}); |
470
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
471
|
|
|
|
|
|
|
} |
472
|
0
|
0
|
|
|
|
|
if (defined $self->{changed}) { |
473
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('changed', Thrift::TType::I32, 4); |
474
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($self->{changed}); |
475
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
476
|
|
|
|
|
|
|
} |
477
|
0
|
0
|
|
|
|
|
if (defined $self->{i32_thing}) { |
478
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('i32_thing', Thrift::TType::I32, 9); |
479
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($self->{i32_thing}); |
480
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
481
|
|
|
|
|
|
|
} |
482
|
0
|
0
|
|
|
|
|
if (defined $self->{i64_thing}) { |
483
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('i64_thing', Thrift::TType::I64, 11); |
484
|
0
|
|
|
|
|
|
$xfer += $output->writeI64($self->{i64_thing}); |
485
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
486
|
|
|
|
|
|
|
} |
487
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
488
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
489
|
0
|
|
|
|
|
|
return $xfer; |
490
|
|
|
|
|
|
|
} |
491
|
|
|
|
|
|
|
|
492
|
|
|
|
|
|
|
package ThriftTest::Insanity; |
493
|
2
|
|
|
2
|
|
13
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
1479
|
|
494
|
|
|
|
|
|
|
ThriftTest::Insanity->mk_accessors( qw( userMap xtructs ) ); |
495
|
|
|
|
|
|
|
|
496
|
|
|
|
|
|
|
sub new { |
497
|
0
|
|
|
0
|
|
|
my $classname = shift; |
498
|
0
|
|
|
|
|
|
my $self = {}; |
499
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
500
|
0
|
|
|
|
|
|
$self->{userMap} = undef; |
501
|
0
|
|
|
|
|
|
$self->{xtructs} = undef; |
502
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
503
|
0
|
0
|
|
|
|
|
if (defined $vals->{userMap}) { |
504
|
0
|
|
|
|
|
|
$self->{userMap} = $vals->{userMap}; |
505
|
|
|
|
|
|
|
} |
506
|
0
|
0
|
|
|
|
|
if (defined $vals->{xtructs}) { |
507
|
0
|
|
|
|
|
|
$self->{xtructs} = $vals->{xtructs}; |
508
|
|
|
|
|
|
|
} |
509
|
|
|
|
|
|
|
} |
510
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
511
|
|
|
|
|
|
|
} |
512
|
|
|
|
|
|
|
|
513
|
|
|
|
|
|
|
sub getName { |
514
|
0
|
|
|
0
|
|
|
return 'Insanity'; |
515
|
|
|
|
|
|
|
} |
516
|
|
|
|
|
|
|
|
517
|
|
|
|
|
|
|
sub read { |
518
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
519
|
0
|
|
|
|
|
|
my $xfer = 0; |
520
|
0
|
|
|
|
|
|
my $fname; |
521
|
0
|
|
|
|
|
|
my $ftype = 0; |
522
|
0
|
|
|
|
|
|
my $fid = 0; |
523
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
524
|
0
|
|
|
|
|
|
while (1) |
525
|
|
|
|
|
|
|
{ |
526
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
527
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
528
|
0
|
|
|
|
|
|
last; |
529
|
|
|
|
|
|
|
} |
530
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
531
|
|
|
|
|
|
|
{ |
532
|
0
|
0
|
|
|
|
|
/^1$/ && do{ if ($ftype == Thrift::TType::MAP) { |
|
0
|
0
|
|
|
|
|
|
533
|
|
|
|
|
|
|
{ |
534
|
0
|
|
|
|
|
|
my $_size0 = 0; |
|
0
|
|
|
|
|
|
|
535
|
0
|
|
|
|
|
|
$self->{userMap} = {}; |
536
|
0
|
|
|
|
|
|
my $_ktype1 = 0; |
537
|
0
|
|
|
|
|
|
my $_vtype2 = 0; |
538
|
0
|
|
|
|
|
|
$xfer += $input->readMapBegin(\$_ktype1, \$_vtype2, \$_size0); |
539
|
0
|
|
|
|
|
|
for (my $_i4 = 0; $_i4 < $_size0; ++$_i4) |
540
|
|
|
|
|
|
|
{ |
541
|
0
|
|
|
|
|
|
my $key5 = 0; |
542
|
0
|
|
|
|
|
|
my $val6 = 0; |
543
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$key5); |
544
|
0
|
|
|
|
|
|
$xfer += $input->readI64(\$val6); |
545
|
0
|
|
|
|
|
|
$self->{userMap}->{$key5} = $val6; |
546
|
|
|
|
|
|
|
} |
547
|
0
|
|
|
|
|
|
$xfer += $input->readMapEnd(); |
548
|
|
|
|
|
|
|
} |
549
|
|
|
|
|
|
|
} else { |
550
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
551
|
|
|
|
|
|
|
} |
552
|
0
|
|
|
|
|
|
last; }; |
553
|
0
|
0
|
|
|
|
|
/^2$/ && do{ if ($ftype == Thrift::TType::LIST) { |
|
0
|
0
|
|
|
|
|
|
554
|
|
|
|
|
|
|
{ |
555
|
0
|
|
|
|
|
|
my $_size7 = 0; |
|
0
|
|
|
|
|
|
|
556
|
0
|
|
|
|
|
|
$self->{xtructs} = []; |
557
|
0
|
|
|
|
|
|
my $_etype10 = 0; |
558
|
0
|
|
|
|
|
|
$xfer += $input->readListBegin(\$_etype10, \$_size7); |
559
|
0
|
|
|
|
|
|
for (my $_i11 = 0; $_i11 < $_size7; ++$_i11) |
560
|
|
|
|
|
|
|
{ |
561
|
0
|
|
|
|
|
|
my $elem12 = undef; |
562
|
0
|
|
|
|
|
|
$elem12 = ThriftTest::Xtruct->new(); |
563
|
0
|
|
|
|
|
|
$xfer += $elem12->read($input); |
564
|
0
|
|
|
|
|
|
push(@{$self->{xtructs}},$elem12); |
|
0
|
|
|
|
|
|
|
565
|
|
|
|
|
|
|
} |
566
|
0
|
|
|
|
|
|
$xfer += $input->readListEnd(); |
567
|
|
|
|
|
|
|
} |
568
|
|
|
|
|
|
|
} else { |
569
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
570
|
|
|
|
|
|
|
} |
571
|
0
|
|
|
|
|
|
last; }; |
572
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
573
|
|
|
|
|
|
|
} |
574
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
575
|
|
|
|
|
|
|
} |
576
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
577
|
0
|
|
|
|
|
|
return $xfer; |
578
|
|
|
|
|
|
|
} |
579
|
|
|
|
|
|
|
|
580
|
|
|
|
|
|
|
sub write { |
581
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
582
|
0
|
|
|
|
|
|
my $xfer = 0; |
583
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('Insanity'); |
584
|
0
|
0
|
|
|
|
|
if (defined $self->{userMap}) { |
585
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('userMap', Thrift::TType::MAP, 1); |
586
|
|
|
|
|
|
|
{ |
587
|
0
|
|
|
|
|
|
$xfer += $output->writeMapBegin(Thrift::TType::I32, Thrift::TType::I64, scalar(keys %{$self->{userMap}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
588
|
|
|
|
|
|
|
{ |
589
|
0
|
|
|
|
|
|
while( my ($kiter13,$viter14) = each %{$self->{userMap}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
590
|
|
|
|
|
|
|
{ |
591
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($kiter13); |
592
|
0
|
|
|
|
|
|
$xfer += $output->writeI64($viter14); |
593
|
|
|
|
|
|
|
} |
594
|
|
|
|
|
|
|
} |
595
|
0
|
|
|
|
|
|
$xfer += $output->writeMapEnd(); |
596
|
|
|
|
|
|
|
} |
597
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
598
|
|
|
|
|
|
|
} |
599
|
0
|
0
|
|
|
|
|
if (defined $self->{xtructs}) { |
600
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('xtructs', Thrift::TType::LIST, 2); |
601
|
|
|
|
|
|
|
{ |
602
|
0
|
|
|
|
|
|
$xfer += $output->writeListBegin(Thrift::TType::STRUCT, scalar(@{$self->{xtructs}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
603
|
|
|
|
|
|
|
{ |
604
|
0
|
|
|
|
|
|
foreach my $iter15 (@{$self->{xtructs}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
605
|
|
|
|
|
|
|
{ |
606
|
0
|
|
|
|
|
|
$xfer += ${iter15}->write($output); |
607
|
|
|
|
|
|
|
} |
608
|
|
|
|
|
|
|
} |
609
|
0
|
|
|
|
|
|
$xfer += $output->writeListEnd(); |
610
|
|
|
|
|
|
|
} |
611
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
612
|
|
|
|
|
|
|
} |
613
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
614
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
615
|
0
|
|
|
|
|
|
return $xfer; |
616
|
|
|
|
|
|
|
} |
617
|
|
|
|
|
|
|
|
618
|
|
|
|
|
|
|
package ThriftTest::CrazyNesting; |
619
|
2
|
|
|
2
|
|
13
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
2775
|
|
620
|
|
|
|
|
|
|
ThriftTest::CrazyNesting->mk_accessors( qw( string_field set_field list_field binary_field ) ); |
621
|
|
|
|
|
|
|
|
622
|
|
|
|
|
|
|
sub new { |
623
|
0
|
|
|
0
|
|
|
my $classname = shift; |
624
|
0
|
|
|
|
|
|
my $self = {}; |
625
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
626
|
0
|
|
|
|
|
|
$self->{string_field} = undef; |
627
|
0
|
|
|
|
|
|
$self->{set_field} = undef; |
628
|
0
|
|
|
|
|
|
$self->{list_field} = undef; |
629
|
0
|
|
|
|
|
|
$self->{binary_field} = undef; |
630
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
631
|
0
|
0
|
|
|
|
|
if (defined $vals->{string_field}) { |
632
|
0
|
|
|
|
|
|
$self->{string_field} = $vals->{string_field}; |
633
|
|
|
|
|
|
|
} |
634
|
0
|
0
|
|
|
|
|
if (defined $vals->{set_field}) { |
635
|
0
|
|
|
|
|
|
$self->{set_field} = $vals->{set_field}; |
636
|
|
|
|
|
|
|
} |
637
|
0
|
0
|
|
|
|
|
if (defined $vals->{list_field}) { |
638
|
0
|
|
|
|
|
|
$self->{list_field} = $vals->{list_field}; |
639
|
|
|
|
|
|
|
} |
640
|
0
|
0
|
|
|
|
|
if (defined $vals->{binary_field}) { |
641
|
0
|
|
|
|
|
|
$self->{binary_field} = $vals->{binary_field}; |
642
|
|
|
|
|
|
|
} |
643
|
|
|
|
|
|
|
} |
644
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
645
|
|
|
|
|
|
|
} |
646
|
|
|
|
|
|
|
|
647
|
|
|
|
|
|
|
sub getName { |
648
|
0
|
|
|
0
|
|
|
return 'CrazyNesting'; |
649
|
|
|
|
|
|
|
} |
650
|
|
|
|
|
|
|
|
651
|
|
|
|
|
|
|
sub read { |
652
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
653
|
0
|
|
|
|
|
|
my $xfer = 0; |
654
|
0
|
|
|
|
|
|
my $fname; |
655
|
0
|
|
|
|
|
|
my $ftype = 0; |
656
|
0
|
|
|
|
|
|
my $fid = 0; |
657
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
658
|
0
|
|
|
|
|
|
while (1) |
659
|
|
|
|
|
|
|
{ |
660
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
661
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
662
|
0
|
|
|
|
|
|
last; |
663
|
|
|
|
|
|
|
} |
664
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
665
|
|
|
|
|
|
|
{ |
666
|
0
|
0
|
|
|
|
|
/^1$/ && do{ if ($ftype == Thrift::TType::STRING) { |
|
0
|
0
|
|
|
|
|
|
667
|
0
|
|
|
|
|
|
$xfer += $input->readString(\$self->{string_field}); |
668
|
|
|
|
|
|
|
} else { |
669
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
670
|
|
|
|
|
|
|
} |
671
|
0
|
|
|
|
|
|
last; }; |
672
|
0
|
0
|
|
|
|
|
/^2$/ && do{ if ($ftype == Thrift::TType::SET) { |
|
0
|
0
|
|
|
|
|
|
673
|
|
|
|
|
|
|
{ |
674
|
0
|
|
|
|
|
|
my $_size16 = 0; |
|
0
|
|
|
|
|
|
|
675
|
0
|
|
|
|
|
|
$self->{set_field} = {}; |
676
|
0
|
|
|
|
|
|
my $_etype19 = 0; |
677
|
0
|
|
|
|
|
|
$xfer += $input->readSetBegin(\$_etype19, \$_size16); |
678
|
0
|
|
|
|
|
|
for (my $_i20 = 0; $_i20 < $_size16; ++$_i20) |
679
|
|
|
|
|
|
|
{ |
680
|
0
|
|
|
|
|
|
my $elem21 = undef; |
681
|
0
|
|
|
|
|
|
$elem21 = ThriftTest::Insanity->new(); |
682
|
0
|
|
|
|
|
|
$xfer += $elem21->read($input); |
683
|
0
|
|
|
|
|
|
$self->{set_field}->{$elem21} = 1; |
684
|
|
|
|
|
|
|
} |
685
|
0
|
|
|
|
|
|
$xfer += $input->readSetEnd(); |
686
|
|
|
|
|
|
|
} |
687
|
|
|
|
|
|
|
} else { |
688
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
689
|
|
|
|
|
|
|
} |
690
|
0
|
|
|
|
|
|
last; }; |
691
|
0
|
0
|
|
|
|
|
/^3$/ && do{ if ($ftype == Thrift::TType::LIST) { |
|
0
|
0
|
|
|
|
|
|
692
|
|
|
|
|
|
|
{ |
693
|
0
|
|
|
|
|
|
my $_size22 = 0; |
|
0
|
|
|
|
|
|
|
694
|
0
|
|
|
|
|
|
$self->{list_field} = []; |
695
|
0
|
|
|
|
|
|
my $_etype25 = 0; |
696
|
0
|
|
|
|
|
|
$xfer += $input->readListBegin(\$_etype25, \$_size22); |
697
|
0
|
|
|
|
|
|
for (my $_i26 = 0; $_i26 < $_size22; ++$_i26) |
698
|
|
|
|
|
|
|
{ |
699
|
0
|
|
|
|
|
|
my $elem27 = undef; |
700
|
|
|
|
|
|
|
{ |
701
|
0
|
|
|
|
|
|
my $_size28 = 0; |
|
0
|
|
|
|
|
|
|
702
|
0
|
|
|
|
|
|
$elem27 = {}; |
703
|
0
|
|
|
|
|
|
my $_ktype29 = 0; |
704
|
0
|
|
|
|
|
|
my $_vtype30 = 0; |
705
|
0
|
|
|
|
|
|
$xfer += $input->readMapBegin(\$_ktype29, \$_vtype30, \$_size28); |
706
|
0
|
|
|
|
|
|
for (my $_i32 = 0; $_i32 < $_size28; ++$_i32) |
707
|
|
|
|
|
|
|
{ |
708
|
0
|
|
|
|
|
|
my $key33 = []; |
709
|
0
|
|
|
|
|
|
my $val34 = []; |
710
|
|
|
|
|
|
|
{ |
711
|
0
|
|
|
|
|
|
my $_size35 = 0; |
712
|
0
|
|
|
|
|
|
$key33 = {}; |
713
|
0
|
|
|
|
|
|
my $_etype38 = 0; |
714
|
0
|
|
|
|
|
|
$xfer += $input->readSetBegin(\$_etype38, \$_size35); |
715
|
0
|
|
|
|
|
|
for (my $_i39 = 0; $_i39 < $_size35; ++$_i39) |
716
|
|
|
|
|
|
|
{ |
717
|
0
|
|
|
|
|
|
my $elem40 = undef; |
718
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$elem40); |
719
|
0
|
|
|
|
|
|
$key33->{$elem40} = 1; |
720
|
|
|
|
|
|
|
} |
721
|
0
|
|
|
|
|
|
$xfer += $input->readSetEnd(); |
722
|
|
|
|
|
|
|
} |
723
|
|
|
|
|
|
|
{ |
724
|
0
|
|
|
|
|
|
my $_size41 = 0; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
725
|
0
|
|
|
|
|
|
$val34 = {}; |
726
|
0
|
|
|
|
|
|
my $_ktype42 = 0; |
727
|
0
|
|
|
|
|
|
my $_vtype43 = 0; |
728
|
0
|
|
|
|
|
|
$xfer += $input->readMapBegin(\$_ktype42, \$_vtype43, \$_size41); |
729
|
0
|
|
|
|
|
|
for (my $_i45 = 0; $_i45 < $_size41; ++$_i45) |
730
|
|
|
|
|
|
|
{ |
731
|
0
|
|
|
|
|
|
my $key46 = 0; |
732
|
0
|
|
|
|
|
|
my $val47 = []; |
733
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$key46); |
734
|
|
|
|
|
|
|
{ |
735
|
0
|
|
|
|
|
|
my $_size48 = 0; |
|
0
|
|
|
|
|
|
|
736
|
0
|
|
|
|
|
|
$val47 = {}; |
737
|
0
|
|
|
|
|
|
my $_etype51 = 0; |
738
|
0
|
|
|
|
|
|
$xfer += $input->readSetBegin(\$_etype51, \$_size48); |
739
|
0
|
|
|
|
|
|
for (my $_i52 = 0; $_i52 < $_size48; ++$_i52) |
740
|
|
|
|
|
|
|
{ |
741
|
0
|
|
|
|
|
|
my $elem53 = undef; |
742
|
|
|
|
|
|
|
{ |
743
|
0
|
|
|
|
|
|
my $_size54 = 0; |
|
0
|
|
|
|
|
|
|
744
|
0
|
|
|
|
|
|
$elem53 = []; |
745
|
0
|
|
|
|
|
|
my $_etype57 = 0; |
746
|
0
|
|
|
|
|
|
$xfer += $input->readListBegin(\$_etype57, \$_size54); |
747
|
0
|
|
|
|
|
|
for (my $_i58 = 0; $_i58 < $_size54; ++$_i58) |
748
|
|
|
|
|
|
|
{ |
749
|
0
|
|
|
|
|
|
my $elem59 = undef; |
750
|
|
|
|
|
|
|
{ |
751
|
0
|
|
|
|
|
|
my $_size60 = 0; |
|
0
|
|
|
|
|
|
|
752
|
0
|
|
|
|
|
|
$elem59 = {}; |
753
|
0
|
|
|
|
|
|
my $_ktype61 = 0; |
754
|
0
|
|
|
|
|
|
my $_vtype62 = 0; |
755
|
0
|
|
|
|
|
|
$xfer += $input->readMapBegin(\$_ktype61, \$_vtype62, \$_size60); |
756
|
0
|
|
|
|
|
|
for (my $_i64 = 0; $_i64 < $_size60; ++$_i64) |
757
|
|
|
|
|
|
|
{ |
758
|
0
|
|
|
|
|
|
my $key65 = ThriftTest::Insanity->new(); |
759
|
0
|
|
|
|
|
|
my $val66 = ''; |
760
|
0
|
|
|
|
|
|
$key65 = ThriftTest::Insanity->new(); |
761
|
0
|
|
|
|
|
|
$xfer += $key65->read($input); |
762
|
0
|
|
|
|
|
|
$xfer += $input->readString(\$val66); |
763
|
0
|
|
|
|
|
|
$elem59->{$key65} = $val66; |
764
|
|
|
|
|
|
|
} |
765
|
0
|
|
|
|
|
|
$xfer += $input->readMapEnd(); |
766
|
|
|
|
|
|
|
} |
767
|
0
|
|
|
|
|
|
push(@{$elem53},$elem59); |
|
0
|
|
|
|
|
|
|
768
|
|
|
|
|
|
|
} |
769
|
0
|
|
|
|
|
|
$xfer += $input->readListEnd(); |
770
|
|
|
|
|
|
|
} |
771
|
0
|
|
|
|
|
|
$val47->{$elem53} = 1; |
772
|
|
|
|
|
|
|
} |
773
|
0
|
|
|
|
|
|
$xfer += $input->readSetEnd(); |
774
|
|
|
|
|
|
|
} |
775
|
0
|
|
|
|
|
|
$val34->{$key46} = $val47; |
776
|
|
|
|
|
|
|
} |
777
|
0
|
|
|
|
|
|
$xfer += $input->readMapEnd(); |
778
|
|
|
|
|
|
|
} |
779
|
0
|
|
|
|
|
|
$elem27->{$key33} = $val34; |
780
|
|
|
|
|
|
|
} |
781
|
0
|
|
|
|
|
|
$xfer += $input->readMapEnd(); |
782
|
|
|
|
|
|
|
} |
783
|
0
|
|
|
|
|
|
push(@{$self->{list_field}},$elem27); |
|
0
|
|
|
|
|
|
|
784
|
|
|
|
|
|
|
} |
785
|
0
|
|
|
|
|
|
$xfer += $input->readListEnd(); |
786
|
|
|
|
|
|
|
} |
787
|
|
|
|
|
|
|
} else { |
788
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
789
|
|
|
|
|
|
|
} |
790
|
0
|
|
|
|
|
|
last; }; |
791
|
0
|
0
|
|
|
|
|
/^4$/ && do{ if ($ftype == Thrift::TType::STRING) { |
|
0
|
0
|
|
|
|
|
|
792
|
0
|
|
|
|
|
|
$xfer += $input->readString(\$self->{binary_field}); |
793
|
|
|
|
|
|
|
} else { |
794
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
795
|
|
|
|
|
|
|
} |
796
|
0
|
|
|
|
|
|
last; }; |
797
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
798
|
|
|
|
|
|
|
} |
799
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
800
|
|
|
|
|
|
|
} |
801
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
802
|
0
|
|
|
|
|
|
return $xfer; |
803
|
|
|
|
|
|
|
} |
804
|
|
|
|
|
|
|
|
805
|
|
|
|
|
|
|
sub write { |
806
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
807
|
0
|
|
|
|
|
|
my $xfer = 0; |
808
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('CrazyNesting'); |
809
|
0
|
0
|
|
|
|
|
if (defined $self->{string_field}) { |
810
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('string_field', Thrift::TType::STRING, 1); |
811
|
0
|
|
|
|
|
|
$xfer += $output->writeString($self->{string_field}); |
812
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
813
|
|
|
|
|
|
|
} |
814
|
0
|
0
|
|
|
|
|
if (defined $self->{set_field}) { |
815
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('set_field', Thrift::TType::SET, 2); |
816
|
|
|
|
|
|
|
{ |
817
|
0
|
|
|
|
|
|
$xfer += $output->writeSetBegin(Thrift::TType::STRUCT, scalar(@{$self->{set_field}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
818
|
|
|
|
|
|
|
{ |
819
|
0
|
|
|
|
|
|
foreach my $iter67 (@{$self->{set_field}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
820
|
|
|
|
|
|
|
{ |
821
|
0
|
|
|
|
|
|
$xfer += ${iter67}->write($output); |
822
|
|
|
|
|
|
|
} |
823
|
|
|
|
|
|
|
} |
824
|
0
|
|
|
|
|
|
$xfer += $output->writeSetEnd(); |
825
|
|
|
|
|
|
|
} |
826
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
827
|
|
|
|
|
|
|
} |
828
|
0
|
0
|
|
|
|
|
if (defined $self->{list_field}) { |
829
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('list_field', Thrift::TType::LIST, 3); |
830
|
|
|
|
|
|
|
{ |
831
|
0
|
|
|
|
|
|
$xfer += $output->writeListBegin(Thrift::TType::MAP, scalar(@{$self->{list_field}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
832
|
|
|
|
|
|
|
{ |
833
|
0
|
|
|
|
|
|
foreach my $iter68 (@{$self->{list_field}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
834
|
|
|
|
|
|
|
{ |
835
|
|
|
|
|
|
|
{ |
836
|
0
|
|
|
|
|
|
$xfer += $output->writeMapBegin(Thrift::TType::SET, Thrift::TType::MAP, scalar(keys %{${iter68}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
837
|
|
|
|
|
|
|
{ |
838
|
0
|
|
|
|
|
|
while( my ($kiter69,$viter70) = each %{${iter68}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
839
|
|
|
|
|
|
|
{ |
840
|
|
|
|
|
|
|
{ |
841
|
0
|
|
|
|
|
|
$xfer += $output->writeSetBegin(Thrift::TType::I32, scalar(@{${kiter69}})); |
|
0
|
|
|
|
|
|
|
842
|
|
|
|
|
|
|
{ |
843
|
0
|
|
|
|
|
|
foreach my $iter71 (@{${kiter69}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
844
|
|
|
|
|
|
|
{ |
845
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($iter71); |
846
|
|
|
|
|
|
|
} |
847
|
|
|
|
|
|
|
} |
848
|
0
|
|
|
|
|
|
$xfer += $output->writeSetEnd(); |
849
|
|
|
|
|
|
|
} |
850
|
|
|
|
|
|
|
{ |
851
|
0
|
|
|
|
|
|
$xfer += $output->writeMapBegin(Thrift::TType::I32, Thrift::TType::SET, scalar(keys %{${viter70}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
852
|
|
|
|
|
|
|
{ |
853
|
0
|
|
|
|
|
|
while( my ($kiter72,$viter73) = each %{${viter70}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
854
|
|
|
|
|
|
|
{ |
855
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($kiter72); |
856
|
|
|
|
|
|
|
{ |
857
|
0
|
|
|
|
|
|
$xfer += $output->writeSetBegin(Thrift::TType::LIST, scalar(@{${viter73}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
858
|
|
|
|
|
|
|
{ |
859
|
0
|
|
|
|
|
|
foreach my $iter74 (@{${viter73}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
860
|
|
|
|
|
|
|
{ |
861
|
|
|
|
|
|
|
{ |
862
|
0
|
|
|
|
|
|
$xfer += $output->writeListBegin(Thrift::TType::MAP, scalar(@{${iter74}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
863
|
|
|
|
|
|
|
{ |
864
|
0
|
|
|
|
|
|
foreach my $iter75 (@{${iter74}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
865
|
|
|
|
|
|
|
{ |
866
|
|
|
|
|
|
|
{ |
867
|
0
|
|
|
|
|
|
$xfer += $output->writeMapBegin(Thrift::TType::STRUCT, Thrift::TType::STRING, scalar(keys %{${iter75}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
868
|
|
|
|
|
|
|
{ |
869
|
0
|
|
|
|
|
|
while( my ($kiter76,$viter77) = each %{${iter75}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
870
|
|
|
|
|
|
|
{ |
871
|
0
|
|
|
|
|
|
$xfer += ${kiter76}->write($output); |
872
|
0
|
|
|
|
|
|
$xfer += $output->writeString($viter77); |
873
|
|
|
|
|
|
|
} |
874
|
|
|
|
|
|
|
} |
875
|
0
|
|
|
|
|
|
$xfer += $output->writeMapEnd(); |
876
|
|
|
|
|
|
|
} |
877
|
|
|
|
|
|
|
} |
878
|
|
|
|
|
|
|
} |
879
|
0
|
|
|
|
|
|
$xfer += $output->writeListEnd(); |
880
|
|
|
|
|
|
|
} |
881
|
|
|
|
|
|
|
} |
882
|
|
|
|
|
|
|
} |
883
|
0
|
|
|
|
|
|
$xfer += $output->writeSetEnd(); |
884
|
|
|
|
|
|
|
} |
885
|
|
|
|
|
|
|
} |
886
|
|
|
|
|
|
|
} |
887
|
0
|
|
|
|
|
|
$xfer += $output->writeMapEnd(); |
888
|
|
|
|
|
|
|
} |
889
|
|
|
|
|
|
|
} |
890
|
|
|
|
|
|
|
} |
891
|
0
|
|
|
|
|
|
$xfer += $output->writeMapEnd(); |
892
|
|
|
|
|
|
|
} |
893
|
|
|
|
|
|
|
} |
894
|
|
|
|
|
|
|
} |
895
|
0
|
|
|
|
|
|
$xfer += $output->writeListEnd(); |
896
|
|
|
|
|
|
|
} |
897
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
898
|
|
|
|
|
|
|
} |
899
|
0
|
0
|
|
|
|
|
if (defined $self->{binary_field}) { |
900
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('binary_field', Thrift::TType::STRING, 4); |
901
|
0
|
|
|
|
|
|
$xfer += $output->writeString($self->{binary_field}); |
902
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
903
|
|
|
|
|
|
|
} |
904
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
905
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
906
|
0
|
|
|
|
|
|
return $xfer; |
907
|
|
|
|
|
|
|
} |
908
|
|
|
|
|
|
|
|
909
|
|
|
|
|
|
|
package ThriftTest::SomeUnion; |
910
|
2
|
|
|
2
|
|
14
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1843
|
|
911
|
|
|
|
|
|
|
ThriftTest::SomeUnion->mk_accessors( qw( map_thing string_thing i32_thing xtruct_thing insanity_thing ) ); |
912
|
|
|
|
|
|
|
|
913
|
|
|
|
|
|
|
sub new { |
914
|
0
|
|
|
0
|
|
|
my $classname = shift; |
915
|
0
|
|
|
|
|
|
my $self = {}; |
916
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
917
|
0
|
|
|
|
|
|
$self->{map_thing} = undef; |
918
|
0
|
|
|
|
|
|
$self->{string_thing} = undef; |
919
|
0
|
|
|
|
|
|
$self->{i32_thing} = undef; |
920
|
0
|
|
|
|
|
|
$self->{xtruct_thing} = undef; |
921
|
0
|
|
|
|
|
|
$self->{insanity_thing} = undef; |
922
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
923
|
0
|
0
|
|
|
|
|
if (defined $vals->{map_thing}) { |
924
|
0
|
|
|
|
|
|
$self->{map_thing} = $vals->{map_thing}; |
925
|
|
|
|
|
|
|
} |
926
|
0
|
0
|
|
|
|
|
if (defined $vals->{string_thing}) { |
927
|
0
|
|
|
|
|
|
$self->{string_thing} = $vals->{string_thing}; |
928
|
|
|
|
|
|
|
} |
929
|
0
|
0
|
|
|
|
|
if (defined $vals->{i32_thing}) { |
930
|
0
|
|
|
|
|
|
$self->{i32_thing} = $vals->{i32_thing}; |
931
|
|
|
|
|
|
|
} |
932
|
0
|
0
|
|
|
|
|
if (defined $vals->{xtruct_thing}) { |
933
|
0
|
|
|
|
|
|
$self->{xtruct_thing} = $vals->{xtruct_thing}; |
934
|
|
|
|
|
|
|
} |
935
|
0
|
0
|
|
|
|
|
if (defined $vals->{insanity_thing}) { |
936
|
0
|
|
|
|
|
|
$self->{insanity_thing} = $vals->{insanity_thing}; |
937
|
|
|
|
|
|
|
} |
938
|
|
|
|
|
|
|
} |
939
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
940
|
|
|
|
|
|
|
} |
941
|
|
|
|
|
|
|
|
942
|
|
|
|
|
|
|
sub getName { |
943
|
0
|
|
|
0
|
|
|
return 'SomeUnion'; |
944
|
|
|
|
|
|
|
} |
945
|
|
|
|
|
|
|
|
946
|
|
|
|
|
|
|
sub read { |
947
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
948
|
0
|
|
|
|
|
|
my $xfer = 0; |
949
|
0
|
|
|
|
|
|
my $fname; |
950
|
0
|
|
|
|
|
|
my $ftype = 0; |
951
|
0
|
|
|
|
|
|
my $fid = 0; |
952
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
953
|
0
|
|
|
|
|
|
while (1) |
954
|
|
|
|
|
|
|
{ |
955
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
956
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
957
|
0
|
|
|
|
|
|
last; |
958
|
|
|
|
|
|
|
} |
959
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
960
|
|
|
|
|
|
|
{ |
961
|
0
|
0
|
|
|
|
|
/^1$/ && do{ if ($ftype == Thrift::TType::MAP) { |
|
0
|
0
|
|
|
|
|
|
962
|
|
|
|
|
|
|
{ |
963
|
0
|
|
|
|
|
|
my $_size78 = 0; |
|
0
|
|
|
|
|
|
|
964
|
0
|
|
|
|
|
|
$self->{map_thing} = {}; |
965
|
0
|
|
|
|
|
|
my $_ktype79 = 0; |
966
|
0
|
|
|
|
|
|
my $_vtype80 = 0; |
967
|
0
|
|
|
|
|
|
$xfer += $input->readMapBegin(\$_ktype79, \$_vtype80, \$_size78); |
968
|
0
|
|
|
|
|
|
for (my $_i82 = 0; $_i82 < $_size78; ++$_i82) |
969
|
|
|
|
|
|
|
{ |
970
|
0
|
|
|
|
|
|
my $key83 = 0; |
971
|
0
|
|
|
|
|
|
my $val84 = 0; |
972
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$key83); |
973
|
0
|
|
|
|
|
|
$xfer += $input->readI64(\$val84); |
974
|
0
|
|
|
|
|
|
$self->{map_thing}->{$key83} = $val84; |
975
|
|
|
|
|
|
|
} |
976
|
0
|
|
|
|
|
|
$xfer += $input->readMapEnd(); |
977
|
|
|
|
|
|
|
} |
978
|
|
|
|
|
|
|
} else { |
979
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
980
|
|
|
|
|
|
|
} |
981
|
0
|
|
|
|
|
|
last; }; |
982
|
0
|
0
|
|
|
|
|
/^2$/ && do{ if ($ftype == Thrift::TType::STRING) { |
|
0
|
0
|
|
|
|
|
|
983
|
0
|
|
|
|
|
|
$xfer += $input->readString(\$self->{string_thing}); |
984
|
|
|
|
|
|
|
} else { |
985
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
986
|
|
|
|
|
|
|
} |
987
|
0
|
|
|
|
|
|
last; }; |
988
|
0
|
0
|
|
|
|
|
/^3$/ && do{ if ($ftype == Thrift::TType::I32) { |
|
0
|
0
|
|
|
|
|
|
989
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$self->{i32_thing}); |
990
|
|
|
|
|
|
|
} else { |
991
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
992
|
|
|
|
|
|
|
} |
993
|
0
|
|
|
|
|
|
last; }; |
994
|
0
|
0
|
|
|
|
|
/^4$/ && do{ if ($ftype == Thrift::TType::STRUCT) { |
|
0
|
0
|
|
|
|
|
|
995
|
0
|
|
|
|
|
|
$self->{xtruct_thing} = ThriftTest::Xtruct3->new(); |
996
|
0
|
|
|
|
|
|
$xfer += $self->{xtruct_thing}->read($input); |
997
|
|
|
|
|
|
|
} else { |
998
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
999
|
|
|
|
|
|
|
} |
1000
|
0
|
|
|
|
|
|
last; }; |
1001
|
0
|
0
|
|
|
|
|
/^5$/ && do{ if ($ftype == Thrift::TType::STRUCT) { |
|
0
|
0
|
|
|
|
|
|
1002
|
0
|
|
|
|
|
|
$self->{insanity_thing} = ThriftTest::Insanity->new(); |
1003
|
0
|
|
|
|
|
|
$xfer += $self->{insanity_thing}->read($input); |
1004
|
|
|
|
|
|
|
} else { |
1005
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1006
|
|
|
|
|
|
|
} |
1007
|
0
|
|
|
|
|
|
last; }; |
1008
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1009
|
|
|
|
|
|
|
} |
1010
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
1011
|
|
|
|
|
|
|
} |
1012
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
1013
|
0
|
|
|
|
|
|
return $xfer; |
1014
|
|
|
|
|
|
|
} |
1015
|
|
|
|
|
|
|
|
1016
|
|
|
|
|
|
|
sub write { |
1017
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
1018
|
0
|
|
|
|
|
|
my $xfer = 0; |
1019
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('SomeUnion'); |
1020
|
0
|
0
|
|
|
|
|
if (defined $self->{map_thing}) { |
1021
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('map_thing', Thrift::TType::MAP, 1); |
1022
|
|
|
|
|
|
|
{ |
1023
|
0
|
|
|
|
|
|
$xfer += $output->writeMapBegin(Thrift::TType::I32, Thrift::TType::I64, scalar(keys %{$self->{map_thing}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1024
|
|
|
|
|
|
|
{ |
1025
|
0
|
|
|
|
|
|
while( my ($kiter85,$viter86) = each %{$self->{map_thing}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1026
|
|
|
|
|
|
|
{ |
1027
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($kiter85); |
1028
|
0
|
|
|
|
|
|
$xfer += $output->writeI64($viter86); |
1029
|
|
|
|
|
|
|
} |
1030
|
|
|
|
|
|
|
} |
1031
|
0
|
|
|
|
|
|
$xfer += $output->writeMapEnd(); |
1032
|
|
|
|
|
|
|
} |
1033
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1034
|
|
|
|
|
|
|
} |
1035
|
0
|
0
|
|
|
|
|
if (defined $self->{string_thing}) { |
1036
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('string_thing', Thrift::TType::STRING, 2); |
1037
|
0
|
|
|
|
|
|
$xfer += $output->writeString($self->{string_thing}); |
1038
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1039
|
|
|
|
|
|
|
} |
1040
|
0
|
0
|
|
|
|
|
if (defined $self->{i32_thing}) { |
1041
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('i32_thing', Thrift::TType::I32, 3); |
1042
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($self->{i32_thing}); |
1043
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1044
|
|
|
|
|
|
|
} |
1045
|
0
|
0
|
|
|
|
|
if (defined $self->{xtruct_thing}) { |
1046
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('xtruct_thing', Thrift::TType::STRUCT, 4); |
1047
|
0
|
|
|
|
|
|
$xfer += $self->{xtruct_thing}->write($output); |
1048
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1049
|
|
|
|
|
|
|
} |
1050
|
0
|
0
|
|
|
|
|
if (defined $self->{insanity_thing}) { |
1051
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('insanity_thing', Thrift::TType::STRUCT, 5); |
1052
|
0
|
|
|
|
|
|
$xfer += $self->{insanity_thing}->write($output); |
1053
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1054
|
|
|
|
|
|
|
} |
1055
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
1056
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
1057
|
0
|
|
|
|
|
|
return $xfer; |
1058
|
|
|
|
|
|
|
} |
1059
|
|
|
|
|
|
|
|
1060
|
|
|
|
|
|
|
package ThriftTest::Xception; |
1061
|
2
|
|
|
2
|
|
14
|
use base qw(Thrift::TException); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
485
|
|
1062
|
2
|
|
|
2
|
|
13
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
1003
|
|
1063
|
|
|
|
|
|
|
ThriftTest::Xception->mk_accessors( qw( errorCode message ) ); |
1064
|
|
|
|
|
|
|
|
1065
|
|
|
|
|
|
|
sub new { |
1066
|
0
|
|
|
0
|
|
|
my $classname = shift; |
1067
|
0
|
|
|
|
|
|
my $self = {}; |
1068
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
1069
|
0
|
|
|
|
|
|
$self->{errorCode} = undef; |
1070
|
0
|
|
|
|
|
|
$self->{message} = undef; |
1071
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
1072
|
0
|
0
|
|
|
|
|
if (defined $vals->{errorCode}) { |
1073
|
0
|
|
|
|
|
|
$self->{errorCode} = $vals->{errorCode}; |
1074
|
|
|
|
|
|
|
} |
1075
|
0
|
0
|
|
|
|
|
if (defined $vals->{message}) { |
1076
|
0
|
|
|
|
|
|
$self->{message} = $vals->{message}; |
1077
|
|
|
|
|
|
|
} |
1078
|
|
|
|
|
|
|
} |
1079
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
1080
|
|
|
|
|
|
|
} |
1081
|
|
|
|
|
|
|
|
1082
|
|
|
|
|
|
|
sub getName { |
1083
|
0
|
|
|
0
|
|
|
return 'Xception'; |
1084
|
|
|
|
|
|
|
} |
1085
|
|
|
|
|
|
|
|
1086
|
|
|
|
|
|
|
sub read { |
1087
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
1088
|
0
|
|
|
|
|
|
my $xfer = 0; |
1089
|
0
|
|
|
|
|
|
my $fname; |
1090
|
0
|
|
|
|
|
|
my $ftype = 0; |
1091
|
0
|
|
|
|
|
|
my $fid = 0; |
1092
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
1093
|
0
|
|
|
|
|
|
while (1) |
1094
|
|
|
|
|
|
|
{ |
1095
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
1096
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
1097
|
0
|
|
|
|
|
|
last; |
1098
|
|
|
|
|
|
|
} |
1099
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
1100
|
|
|
|
|
|
|
{ |
1101
|
0
|
0
|
|
|
|
|
/^1$/ && do{ if ($ftype == Thrift::TType::I32) { |
|
0
|
0
|
|
|
|
|
|
1102
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$self->{errorCode}); |
1103
|
|
|
|
|
|
|
} else { |
1104
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1105
|
|
|
|
|
|
|
} |
1106
|
0
|
|
|
|
|
|
last; }; |
1107
|
0
|
0
|
|
|
|
|
/^2$/ && do{ if ($ftype == Thrift::TType::STRING) { |
|
0
|
0
|
|
|
|
|
|
1108
|
0
|
|
|
|
|
|
$xfer += $input->readString(\$self->{message}); |
1109
|
|
|
|
|
|
|
} else { |
1110
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1111
|
|
|
|
|
|
|
} |
1112
|
0
|
|
|
|
|
|
last; }; |
1113
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1114
|
|
|
|
|
|
|
} |
1115
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
1116
|
|
|
|
|
|
|
} |
1117
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
1118
|
0
|
|
|
|
|
|
return $xfer; |
1119
|
|
|
|
|
|
|
} |
1120
|
|
|
|
|
|
|
|
1121
|
|
|
|
|
|
|
sub write { |
1122
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
1123
|
0
|
|
|
|
|
|
my $xfer = 0; |
1124
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('Xception'); |
1125
|
0
|
0
|
|
|
|
|
if (defined $self->{errorCode}) { |
1126
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('errorCode', Thrift::TType::I32, 1); |
1127
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($self->{errorCode}); |
1128
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1129
|
|
|
|
|
|
|
} |
1130
|
0
|
0
|
|
|
|
|
if (defined $self->{message}) { |
1131
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('message', Thrift::TType::STRING, 2); |
1132
|
0
|
|
|
|
|
|
$xfer += $output->writeString($self->{message}); |
1133
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1134
|
|
|
|
|
|
|
} |
1135
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
1136
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
1137
|
0
|
|
|
|
|
|
return $xfer; |
1138
|
|
|
|
|
|
|
} |
1139
|
|
|
|
|
|
|
|
1140
|
|
|
|
|
|
|
package ThriftTest::Xception2; |
1141
|
2
|
|
|
2
|
|
14
|
use base qw(Thrift::TException); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
467
|
|
1142
|
2
|
|
|
2
|
|
13
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
1035
|
|
1143
|
|
|
|
|
|
|
ThriftTest::Xception2->mk_accessors( qw( errorCode struct_thing ) ); |
1144
|
|
|
|
|
|
|
|
1145
|
|
|
|
|
|
|
sub new { |
1146
|
0
|
|
|
0
|
|
|
my $classname = shift; |
1147
|
0
|
|
|
|
|
|
my $self = {}; |
1148
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
1149
|
0
|
|
|
|
|
|
$self->{errorCode} = undef; |
1150
|
0
|
|
|
|
|
|
$self->{struct_thing} = undef; |
1151
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
1152
|
0
|
0
|
|
|
|
|
if (defined $vals->{errorCode}) { |
1153
|
0
|
|
|
|
|
|
$self->{errorCode} = $vals->{errorCode}; |
1154
|
|
|
|
|
|
|
} |
1155
|
0
|
0
|
|
|
|
|
if (defined $vals->{struct_thing}) { |
1156
|
0
|
|
|
|
|
|
$self->{struct_thing} = $vals->{struct_thing}; |
1157
|
|
|
|
|
|
|
} |
1158
|
|
|
|
|
|
|
} |
1159
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
1160
|
|
|
|
|
|
|
} |
1161
|
|
|
|
|
|
|
|
1162
|
|
|
|
|
|
|
sub getName { |
1163
|
0
|
|
|
0
|
|
|
return 'Xception2'; |
1164
|
|
|
|
|
|
|
} |
1165
|
|
|
|
|
|
|
|
1166
|
|
|
|
|
|
|
sub read { |
1167
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
1168
|
0
|
|
|
|
|
|
my $xfer = 0; |
1169
|
0
|
|
|
|
|
|
my $fname; |
1170
|
0
|
|
|
|
|
|
my $ftype = 0; |
1171
|
0
|
|
|
|
|
|
my $fid = 0; |
1172
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
1173
|
0
|
|
|
|
|
|
while (1) |
1174
|
|
|
|
|
|
|
{ |
1175
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
1176
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
1177
|
0
|
|
|
|
|
|
last; |
1178
|
|
|
|
|
|
|
} |
1179
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
1180
|
|
|
|
|
|
|
{ |
1181
|
0
|
0
|
|
|
|
|
/^1$/ && do{ if ($ftype == Thrift::TType::I32) { |
|
0
|
0
|
|
|
|
|
|
1182
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$self->{errorCode}); |
1183
|
|
|
|
|
|
|
} else { |
1184
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1185
|
|
|
|
|
|
|
} |
1186
|
0
|
|
|
|
|
|
last; }; |
1187
|
0
|
0
|
|
|
|
|
/^2$/ && do{ if ($ftype == Thrift::TType::STRUCT) { |
|
0
|
0
|
|
|
|
|
|
1188
|
0
|
|
|
|
|
|
$self->{struct_thing} = ThriftTest::Xtruct->new(); |
1189
|
0
|
|
|
|
|
|
$xfer += $self->{struct_thing}->read($input); |
1190
|
|
|
|
|
|
|
} else { |
1191
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1192
|
|
|
|
|
|
|
} |
1193
|
0
|
|
|
|
|
|
last; }; |
1194
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1195
|
|
|
|
|
|
|
} |
1196
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
1197
|
|
|
|
|
|
|
} |
1198
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
1199
|
0
|
|
|
|
|
|
return $xfer; |
1200
|
|
|
|
|
|
|
} |
1201
|
|
|
|
|
|
|
|
1202
|
|
|
|
|
|
|
sub write { |
1203
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
1204
|
0
|
|
|
|
|
|
my $xfer = 0; |
1205
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('Xception2'); |
1206
|
0
|
0
|
|
|
|
|
if (defined $self->{errorCode}) { |
1207
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('errorCode', Thrift::TType::I32, 1); |
1208
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($self->{errorCode}); |
1209
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1210
|
|
|
|
|
|
|
} |
1211
|
0
|
0
|
|
|
|
|
if (defined $self->{struct_thing}) { |
1212
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('struct_thing', Thrift::TType::STRUCT, 2); |
1213
|
0
|
|
|
|
|
|
$xfer += $self->{struct_thing}->write($output); |
1214
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1215
|
|
|
|
|
|
|
} |
1216
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
1217
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
1218
|
0
|
|
|
|
|
|
return $xfer; |
1219
|
|
|
|
|
|
|
} |
1220
|
|
|
|
|
|
|
|
1221
|
|
|
|
|
|
|
package ThriftTest::EmptyStruct; |
1222
|
2
|
|
|
2
|
|
15
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
587
|
|
1223
|
|
|
|
|
|
|
|
1224
|
|
|
|
|
|
|
sub new { |
1225
|
0
|
|
|
0
|
|
|
my $classname = shift; |
1226
|
0
|
|
|
|
|
|
my $self = {}; |
1227
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
1228
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
1229
|
|
|
|
|
|
|
} |
1230
|
|
|
|
|
|
|
|
1231
|
|
|
|
|
|
|
sub getName { |
1232
|
0
|
|
|
0
|
|
|
return 'EmptyStruct'; |
1233
|
|
|
|
|
|
|
} |
1234
|
|
|
|
|
|
|
|
1235
|
|
|
|
|
|
|
sub read { |
1236
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
1237
|
0
|
|
|
|
|
|
my $xfer = 0; |
1238
|
0
|
|
|
|
|
|
my $fname; |
1239
|
0
|
|
|
|
|
|
my $ftype = 0; |
1240
|
0
|
|
|
|
|
|
my $fid = 0; |
1241
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
1242
|
0
|
|
|
|
|
|
while (1) |
1243
|
|
|
|
|
|
|
{ |
1244
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
1245
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
1246
|
0
|
|
|
|
|
|
last; |
1247
|
|
|
|
|
|
|
} |
1248
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
1249
|
|
|
|
|
|
|
{ |
1250
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1251
|
|
|
|
|
|
|
} |
1252
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
1253
|
|
|
|
|
|
|
} |
1254
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
1255
|
0
|
|
|
|
|
|
return $xfer; |
1256
|
|
|
|
|
|
|
} |
1257
|
|
|
|
|
|
|
|
1258
|
|
|
|
|
|
|
sub write { |
1259
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
1260
|
0
|
|
|
|
|
|
my $xfer = 0; |
1261
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('EmptyStruct'); |
1262
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
1263
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
1264
|
0
|
|
|
|
|
|
return $xfer; |
1265
|
|
|
|
|
|
|
} |
1266
|
|
|
|
|
|
|
|
1267
|
|
|
|
|
|
|
package ThriftTest::OneField; |
1268
|
2
|
|
|
2
|
|
13
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
829
|
|
1269
|
|
|
|
|
|
|
ThriftTest::OneField->mk_accessors( qw( field ) ); |
1270
|
|
|
|
|
|
|
|
1271
|
|
|
|
|
|
|
sub new { |
1272
|
0
|
|
|
0
|
|
|
my $classname = shift; |
1273
|
0
|
|
|
|
|
|
my $self = {}; |
1274
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
1275
|
0
|
|
|
|
|
|
$self->{field} = undef; |
1276
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
1277
|
0
|
0
|
|
|
|
|
if (defined $vals->{field}) { |
1278
|
0
|
|
|
|
|
|
$self->{field} = $vals->{field}; |
1279
|
|
|
|
|
|
|
} |
1280
|
|
|
|
|
|
|
} |
1281
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
1282
|
|
|
|
|
|
|
} |
1283
|
|
|
|
|
|
|
|
1284
|
|
|
|
|
|
|
sub getName { |
1285
|
0
|
|
|
0
|
|
|
return 'OneField'; |
1286
|
|
|
|
|
|
|
} |
1287
|
|
|
|
|
|
|
|
1288
|
|
|
|
|
|
|
sub read { |
1289
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
1290
|
0
|
|
|
|
|
|
my $xfer = 0; |
1291
|
0
|
|
|
|
|
|
my $fname; |
1292
|
0
|
|
|
|
|
|
my $ftype = 0; |
1293
|
0
|
|
|
|
|
|
my $fid = 0; |
1294
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
1295
|
0
|
|
|
|
|
|
while (1) |
1296
|
|
|
|
|
|
|
{ |
1297
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
1298
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
1299
|
0
|
|
|
|
|
|
last; |
1300
|
|
|
|
|
|
|
} |
1301
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
1302
|
|
|
|
|
|
|
{ |
1303
|
0
|
0
|
|
|
|
|
/^1$/ && do{ if ($ftype == Thrift::TType::STRUCT) { |
|
0
|
0
|
|
|
|
|
|
1304
|
0
|
|
|
|
|
|
$self->{field} = ThriftTest::EmptyStruct->new(); |
1305
|
0
|
|
|
|
|
|
$xfer += $self->{field}->read($input); |
1306
|
|
|
|
|
|
|
} else { |
1307
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1308
|
|
|
|
|
|
|
} |
1309
|
0
|
|
|
|
|
|
last; }; |
1310
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1311
|
|
|
|
|
|
|
} |
1312
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
1313
|
|
|
|
|
|
|
} |
1314
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
1315
|
0
|
|
|
|
|
|
return $xfer; |
1316
|
|
|
|
|
|
|
} |
1317
|
|
|
|
|
|
|
|
1318
|
|
|
|
|
|
|
sub write { |
1319
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
1320
|
0
|
|
|
|
|
|
my $xfer = 0; |
1321
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('OneField'); |
1322
|
0
|
0
|
|
|
|
|
if (defined $self->{field}) { |
1323
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('field', Thrift::TType::STRUCT, 1); |
1324
|
0
|
|
|
|
|
|
$xfer += $self->{field}->write($output); |
1325
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1326
|
|
|
|
|
|
|
} |
1327
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
1328
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
1329
|
0
|
|
|
|
|
|
return $xfer; |
1330
|
|
|
|
|
|
|
} |
1331
|
|
|
|
|
|
|
|
1332
|
|
|
|
|
|
|
package ThriftTest::VersioningTestV1; |
1333
|
2
|
|
|
2
|
|
32
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
1198
|
|
1334
|
|
|
|
|
|
|
ThriftTest::VersioningTestV1->mk_accessors( qw( begin_in_both old_string end_in_both ) ); |
1335
|
|
|
|
|
|
|
|
1336
|
|
|
|
|
|
|
sub new { |
1337
|
0
|
|
|
0
|
|
|
my $classname = shift; |
1338
|
0
|
|
|
|
|
|
my $self = {}; |
1339
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
1340
|
0
|
|
|
|
|
|
$self->{begin_in_both} = undef; |
1341
|
0
|
|
|
|
|
|
$self->{old_string} = undef; |
1342
|
0
|
|
|
|
|
|
$self->{end_in_both} = undef; |
1343
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
1344
|
0
|
0
|
|
|
|
|
if (defined $vals->{begin_in_both}) { |
1345
|
0
|
|
|
|
|
|
$self->{begin_in_both} = $vals->{begin_in_both}; |
1346
|
|
|
|
|
|
|
} |
1347
|
0
|
0
|
|
|
|
|
if (defined $vals->{old_string}) { |
1348
|
0
|
|
|
|
|
|
$self->{old_string} = $vals->{old_string}; |
1349
|
|
|
|
|
|
|
} |
1350
|
0
|
0
|
|
|
|
|
if (defined $vals->{end_in_both}) { |
1351
|
0
|
|
|
|
|
|
$self->{end_in_both} = $vals->{end_in_both}; |
1352
|
|
|
|
|
|
|
} |
1353
|
|
|
|
|
|
|
} |
1354
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
1355
|
|
|
|
|
|
|
} |
1356
|
|
|
|
|
|
|
|
1357
|
|
|
|
|
|
|
sub getName { |
1358
|
0
|
|
|
0
|
|
|
return 'VersioningTestV1'; |
1359
|
|
|
|
|
|
|
} |
1360
|
|
|
|
|
|
|
|
1361
|
|
|
|
|
|
|
sub read { |
1362
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
1363
|
0
|
|
|
|
|
|
my $xfer = 0; |
1364
|
0
|
|
|
|
|
|
my $fname; |
1365
|
0
|
|
|
|
|
|
my $ftype = 0; |
1366
|
0
|
|
|
|
|
|
my $fid = 0; |
1367
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
1368
|
0
|
|
|
|
|
|
while (1) |
1369
|
|
|
|
|
|
|
{ |
1370
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
1371
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
1372
|
0
|
|
|
|
|
|
last; |
1373
|
|
|
|
|
|
|
} |
1374
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
1375
|
|
|
|
|
|
|
{ |
1376
|
0
|
0
|
|
|
|
|
/^1$/ && do{ if ($ftype == Thrift::TType::I32) { |
|
0
|
0
|
|
|
|
|
|
1377
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$self->{begin_in_both}); |
1378
|
|
|
|
|
|
|
} else { |
1379
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1380
|
|
|
|
|
|
|
} |
1381
|
0
|
|
|
|
|
|
last; }; |
1382
|
0
|
0
|
|
|
|
|
/^3$/ && do{ if ($ftype == Thrift::TType::STRING) { |
|
0
|
0
|
|
|
|
|
|
1383
|
0
|
|
|
|
|
|
$xfer += $input->readString(\$self->{old_string}); |
1384
|
|
|
|
|
|
|
} else { |
1385
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1386
|
|
|
|
|
|
|
} |
1387
|
0
|
|
|
|
|
|
last; }; |
1388
|
0
|
0
|
|
|
|
|
/^12$/ && do{ if ($ftype == Thrift::TType::I32) { |
|
0
|
0
|
|
|
|
|
|
1389
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$self->{end_in_both}); |
1390
|
|
|
|
|
|
|
} else { |
1391
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1392
|
|
|
|
|
|
|
} |
1393
|
0
|
|
|
|
|
|
last; }; |
1394
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1395
|
|
|
|
|
|
|
} |
1396
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
1397
|
|
|
|
|
|
|
} |
1398
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
1399
|
0
|
|
|
|
|
|
return $xfer; |
1400
|
|
|
|
|
|
|
} |
1401
|
|
|
|
|
|
|
|
1402
|
|
|
|
|
|
|
sub write { |
1403
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
1404
|
0
|
|
|
|
|
|
my $xfer = 0; |
1405
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('VersioningTestV1'); |
1406
|
0
|
0
|
|
|
|
|
if (defined $self->{begin_in_both}) { |
1407
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('begin_in_both', Thrift::TType::I32, 1); |
1408
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($self->{begin_in_both}); |
1409
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1410
|
|
|
|
|
|
|
} |
1411
|
0
|
0
|
|
|
|
|
if (defined $self->{old_string}) { |
1412
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('old_string', Thrift::TType::STRING, 3); |
1413
|
0
|
|
|
|
|
|
$xfer += $output->writeString($self->{old_string}); |
1414
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1415
|
|
|
|
|
|
|
} |
1416
|
0
|
0
|
|
|
|
|
if (defined $self->{end_in_both}) { |
1417
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('end_in_both', Thrift::TType::I32, 12); |
1418
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($self->{end_in_both}); |
1419
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1420
|
|
|
|
|
|
|
} |
1421
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
1422
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
1423
|
0
|
|
|
|
|
|
return $xfer; |
1424
|
|
|
|
|
|
|
} |
1425
|
|
|
|
|
|
|
|
1426
|
|
|
|
|
|
|
package ThriftTest::VersioningTestV2; |
1427
|
2
|
|
|
2
|
|
14
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
3232
|
|
1428
|
|
|
|
|
|
|
ThriftTest::VersioningTestV2->mk_accessors( qw( begin_in_both newint newbyte newshort newlong newdouble newstruct newlist newset newmap newstring end_in_both ) ); |
1429
|
|
|
|
|
|
|
|
1430
|
|
|
|
|
|
|
sub new { |
1431
|
0
|
|
|
0
|
|
|
my $classname = shift; |
1432
|
0
|
|
|
|
|
|
my $self = {}; |
1433
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
1434
|
0
|
|
|
|
|
|
$self->{begin_in_both} = undef; |
1435
|
0
|
|
|
|
|
|
$self->{newint} = undef; |
1436
|
0
|
|
|
|
|
|
$self->{newbyte} = undef; |
1437
|
0
|
|
|
|
|
|
$self->{newshort} = undef; |
1438
|
0
|
|
|
|
|
|
$self->{newlong} = undef; |
1439
|
0
|
|
|
|
|
|
$self->{newdouble} = undef; |
1440
|
0
|
|
|
|
|
|
$self->{newstruct} = undef; |
1441
|
0
|
|
|
|
|
|
$self->{newlist} = undef; |
1442
|
0
|
|
|
|
|
|
$self->{newset} = undef; |
1443
|
0
|
|
|
|
|
|
$self->{newmap} = undef; |
1444
|
0
|
|
|
|
|
|
$self->{newstring} = undef; |
1445
|
0
|
|
|
|
|
|
$self->{end_in_both} = undef; |
1446
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
1447
|
0
|
0
|
|
|
|
|
if (defined $vals->{begin_in_both}) { |
1448
|
0
|
|
|
|
|
|
$self->{begin_in_both} = $vals->{begin_in_both}; |
1449
|
|
|
|
|
|
|
} |
1450
|
0
|
0
|
|
|
|
|
if (defined $vals->{newint}) { |
1451
|
0
|
|
|
|
|
|
$self->{newint} = $vals->{newint}; |
1452
|
|
|
|
|
|
|
} |
1453
|
0
|
0
|
|
|
|
|
if (defined $vals->{newbyte}) { |
1454
|
0
|
|
|
|
|
|
$self->{newbyte} = $vals->{newbyte}; |
1455
|
|
|
|
|
|
|
} |
1456
|
0
|
0
|
|
|
|
|
if (defined $vals->{newshort}) { |
1457
|
0
|
|
|
|
|
|
$self->{newshort} = $vals->{newshort}; |
1458
|
|
|
|
|
|
|
} |
1459
|
0
|
0
|
|
|
|
|
if (defined $vals->{newlong}) { |
1460
|
0
|
|
|
|
|
|
$self->{newlong} = $vals->{newlong}; |
1461
|
|
|
|
|
|
|
} |
1462
|
0
|
0
|
|
|
|
|
if (defined $vals->{newdouble}) { |
1463
|
0
|
|
|
|
|
|
$self->{newdouble} = $vals->{newdouble}; |
1464
|
|
|
|
|
|
|
} |
1465
|
0
|
0
|
|
|
|
|
if (defined $vals->{newstruct}) { |
1466
|
0
|
|
|
|
|
|
$self->{newstruct} = $vals->{newstruct}; |
1467
|
|
|
|
|
|
|
} |
1468
|
0
|
0
|
|
|
|
|
if (defined $vals->{newlist}) { |
1469
|
0
|
|
|
|
|
|
$self->{newlist} = $vals->{newlist}; |
1470
|
|
|
|
|
|
|
} |
1471
|
0
|
0
|
|
|
|
|
if (defined $vals->{newset}) { |
1472
|
0
|
|
|
|
|
|
$self->{newset} = $vals->{newset}; |
1473
|
|
|
|
|
|
|
} |
1474
|
0
|
0
|
|
|
|
|
if (defined $vals->{newmap}) { |
1475
|
0
|
|
|
|
|
|
$self->{newmap} = $vals->{newmap}; |
1476
|
|
|
|
|
|
|
} |
1477
|
0
|
0
|
|
|
|
|
if (defined $vals->{newstring}) { |
1478
|
0
|
|
|
|
|
|
$self->{newstring} = $vals->{newstring}; |
1479
|
|
|
|
|
|
|
} |
1480
|
0
|
0
|
|
|
|
|
if (defined $vals->{end_in_both}) { |
1481
|
0
|
|
|
|
|
|
$self->{end_in_both} = $vals->{end_in_both}; |
1482
|
|
|
|
|
|
|
} |
1483
|
|
|
|
|
|
|
} |
1484
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
1485
|
|
|
|
|
|
|
} |
1486
|
|
|
|
|
|
|
|
1487
|
|
|
|
|
|
|
sub getName { |
1488
|
0
|
|
|
0
|
|
|
return 'VersioningTestV2'; |
1489
|
|
|
|
|
|
|
} |
1490
|
|
|
|
|
|
|
|
1491
|
|
|
|
|
|
|
sub read { |
1492
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
1493
|
0
|
|
|
|
|
|
my $xfer = 0; |
1494
|
0
|
|
|
|
|
|
my $fname; |
1495
|
0
|
|
|
|
|
|
my $ftype = 0; |
1496
|
0
|
|
|
|
|
|
my $fid = 0; |
1497
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
1498
|
0
|
|
|
|
|
|
while (1) |
1499
|
|
|
|
|
|
|
{ |
1500
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
1501
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
1502
|
0
|
|
|
|
|
|
last; |
1503
|
|
|
|
|
|
|
} |
1504
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
1505
|
|
|
|
|
|
|
{ |
1506
|
0
|
0
|
|
|
|
|
/^1$/ && do{ if ($ftype == Thrift::TType::I32) { |
|
0
|
0
|
|
|
|
|
|
1507
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$self->{begin_in_both}); |
1508
|
|
|
|
|
|
|
} else { |
1509
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1510
|
|
|
|
|
|
|
} |
1511
|
0
|
|
|
|
|
|
last; }; |
1512
|
0
|
0
|
|
|
|
|
/^2$/ && do{ if ($ftype == Thrift::TType::I32) { |
|
0
|
0
|
|
|
|
|
|
1513
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$self->{newint}); |
1514
|
|
|
|
|
|
|
} else { |
1515
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1516
|
|
|
|
|
|
|
} |
1517
|
0
|
|
|
|
|
|
last; }; |
1518
|
0
|
0
|
|
|
|
|
/^3$/ && do{ if ($ftype == Thrift::TType::BYTE) { |
|
0
|
0
|
|
|
|
|
|
1519
|
0
|
|
|
|
|
|
$xfer += $input->readByte(\$self->{newbyte}); |
1520
|
|
|
|
|
|
|
} else { |
1521
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1522
|
|
|
|
|
|
|
} |
1523
|
0
|
|
|
|
|
|
last; }; |
1524
|
0
|
0
|
|
|
|
|
/^4$/ && do{ if ($ftype == Thrift::TType::I16) { |
|
0
|
0
|
|
|
|
|
|
1525
|
0
|
|
|
|
|
|
$xfer += $input->readI16(\$self->{newshort}); |
1526
|
|
|
|
|
|
|
} else { |
1527
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1528
|
|
|
|
|
|
|
} |
1529
|
0
|
|
|
|
|
|
last; }; |
1530
|
0
|
0
|
|
|
|
|
/^5$/ && do{ if ($ftype == Thrift::TType::I64) { |
|
0
|
0
|
|
|
|
|
|
1531
|
0
|
|
|
|
|
|
$xfer += $input->readI64(\$self->{newlong}); |
1532
|
|
|
|
|
|
|
} else { |
1533
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1534
|
|
|
|
|
|
|
} |
1535
|
0
|
|
|
|
|
|
last; }; |
1536
|
0
|
0
|
|
|
|
|
/^6$/ && do{ if ($ftype == Thrift::TType::DOUBLE) { |
|
0
|
0
|
|
|
|
|
|
1537
|
0
|
|
|
|
|
|
$xfer += $input->readDouble(\$self->{newdouble}); |
1538
|
|
|
|
|
|
|
} else { |
1539
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1540
|
|
|
|
|
|
|
} |
1541
|
0
|
|
|
|
|
|
last; }; |
1542
|
0
|
0
|
|
|
|
|
/^7$/ && do{ if ($ftype == Thrift::TType::STRUCT) { |
|
0
|
0
|
|
|
|
|
|
1543
|
0
|
|
|
|
|
|
$self->{newstruct} = ThriftTest::Bonk->new(); |
1544
|
0
|
|
|
|
|
|
$xfer += $self->{newstruct}->read($input); |
1545
|
|
|
|
|
|
|
} else { |
1546
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1547
|
|
|
|
|
|
|
} |
1548
|
0
|
|
|
|
|
|
last; }; |
1549
|
0
|
0
|
|
|
|
|
/^8$/ && do{ if ($ftype == Thrift::TType::LIST) { |
|
0
|
0
|
|
|
|
|
|
1550
|
|
|
|
|
|
|
{ |
1551
|
0
|
|
|
|
|
|
my $_size87 = 0; |
|
0
|
|
|
|
|
|
|
1552
|
0
|
|
|
|
|
|
$self->{newlist} = []; |
1553
|
0
|
|
|
|
|
|
my $_etype90 = 0; |
1554
|
0
|
|
|
|
|
|
$xfer += $input->readListBegin(\$_etype90, \$_size87); |
1555
|
0
|
|
|
|
|
|
for (my $_i91 = 0; $_i91 < $_size87; ++$_i91) |
1556
|
|
|
|
|
|
|
{ |
1557
|
0
|
|
|
|
|
|
my $elem92 = undef; |
1558
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$elem92); |
1559
|
0
|
|
|
|
|
|
push(@{$self->{newlist}},$elem92); |
|
0
|
|
|
|
|
|
|
1560
|
|
|
|
|
|
|
} |
1561
|
0
|
|
|
|
|
|
$xfer += $input->readListEnd(); |
1562
|
|
|
|
|
|
|
} |
1563
|
|
|
|
|
|
|
} else { |
1564
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1565
|
|
|
|
|
|
|
} |
1566
|
0
|
|
|
|
|
|
last; }; |
1567
|
0
|
0
|
|
|
|
|
/^9$/ && do{ if ($ftype == Thrift::TType::SET) { |
|
0
|
0
|
|
|
|
|
|
1568
|
|
|
|
|
|
|
{ |
1569
|
0
|
|
|
|
|
|
my $_size93 = 0; |
|
0
|
|
|
|
|
|
|
1570
|
0
|
|
|
|
|
|
$self->{newset} = {}; |
1571
|
0
|
|
|
|
|
|
my $_etype96 = 0; |
1572
|
0
|
|
|
|
|
|
$xfer += $input->readSetBegin(\$_etype96, \$_size93); |
1573
|
0
|
|
|
|
|
|
for (my $_i97 = 0; $_i97 < $_size93; ++$_i97) |
1574
|
|
|
|
|
|
|
{ |
1575
|
0
|
|
|
|
|
|
my $elem98 = undef; |
1576
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$elem98); |
1577
|
0
|
|
|
|
|
|
$self->{newset}->{$elem98} = 1; |
1578
|
|
|
|
|
|
|
} |
1579
|
0
|
|
|
|
|
|
$xfer += $input->readSetEnd(); |
1580
|
|
|
|
|
|
|
} |
1581
|
|
|
|
|
|
|
} else { |
1582
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1583
|
|
|
|
|
|
|
} |
1584
|
0
|
|
|
|
|
|
last; }; |
1585
|
0
|
0
|
|
|
|
|
/^10$/ && do{ if ($ftype == Thrift::TType::MAP) { |
|
0
|
0
|
|
|
|
|
|
1586
|
|
|
|
|
|
|
{ |
1587
|
0
|
|
|
|
|
|
my $_size99 = 0; |
|
0
|
|
|
|
|
|
|
1588
|
0
|
|
|
|
|
|
$self->{newmap} = {}; |
1589
|
0
|
|
|
|
|
|
my $_ktype100 = 0; |
1590
|
0
|
|
|
|
|
|
my $_vtype101 = 0; |
1591
|
0
|
|
|
|
|
|
$xfer += $input->readMapBegin(\$_ktype100, \$_vtype101, \$_size99); |
1592
|
0
|
|
|
|
|
|
for (my $_i103 = 0; $_i103 < $_size99; ++$_i103) |
1593
|
|
|
|
|
|
|
{ |
1594
|
0
|
|
|
|
|
|
my $key104 = 0; |
1595
|
0
|
|
|
|
|
|
my $val105 = 0; |
1596
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$key104); |
1597
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$val105); |
1598
|
0
|
|
|
|
|
|
$self->{newmap}->{$key104} = $val105; |
1599
|
|
|
|
|
|
|
} |
1600
|
0
|
|
|
|
|
|
$xfer += $input->readMapEnd(); |
1601
|
|
|
|
|
|
|
} |
1602
|
|
|
|
|
|
|
} else { |
1603
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1604
|
|
|
|
|
|
|
} |
1605
|
0
|
|
|
|
|
|
last; }; |
1606
|
0
|
0
|
|
|
|
|
/^11$/ && do{ if ($ftype == Thrift::TType::STRING) { |
|
0
|
0
|
|
|
|
|
|
1607
|
0
|
|
|
|
|
|
$xfer += $input->readString(\$self->{newstring}); |
1608
|
|
|
|
|
|
|
} else { |
1609
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1610
|
|
|
|
|
|
|
} |
1611
|
0
|
|
|
|
|
|
last; }; |
1612
|
0
|
0
|
|
|
|
|
/^12$/ && do{ if ($ftype == Thrift::TType::I32) { |
|
0
|
0
|
|
|
|
|
|
1613
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$self->{end_in_both}); |
1614
|
|
|
|
|
|
|
} else { |
1615
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1616
|
|
|
|
|
|
|
} |
1617
|
0
|
|
|
|
|
|
last; }; |
1618
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1619
|
|
|
|
|
|
|
} |
1620
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
1621
|
|
|
|
|
|
|
} |
1622
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
1623
|
0
|
|
|
|
|
|
return $xfer; |
1624
|
|
|
|
|
|
|
} |
1625
|
|
|
|
|
|
|
|
1626
|
|
|
|
|
|
|
sub write { |
1627
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
1628
|
0
|
|
|
|
|
|
my $xfer = 0; |
1629
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('VersioningTestV2'); |
1630
|
0
|
0
|
|
|
|
|
if (defined $self->{begin_in_both}) { |
1631
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('begin_in_both', Thrift::TType::I32, 1); |
1632
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($self->{begin_in_both}); |
1633
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1634
|
|
|
|
|
|
|
} |
1635
|
0
|
0
|
|
|
|
|
if (defined $self->{newint}) { |
1636
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('newint', Thrift::TType::I32, 2); |
1637
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($self->{newint}); |
1638
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1639
|
|
|
|
|
|
|
} |
1640
|
0
|
0
|
|
|
|
|
if (defined $self->{newbyte}) { |
1641
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('newbyte', Thrift::TType::BYTE, 3); |
1642
|
0
|
|
|
|
|
|
$xfer += $output->writeByte($self->{newbyte}); |
1643
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1644
|
|
|
|
|
|
|
} |
1645
|
0
|
0
|
|
|
|
|
if (defined $self->{newshort}) { |
1646
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('newshort', Thrift::TType::I16, 4); |
1647
|
0
|
|
|
|
|
|
$xfer += $output->writeI16($self->{newshort}); |
1648
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1649
|
|
|
|
|
|
|
} |
1650
|
0
|
0
|
|
|
|
|
if (defined $self->{newlong}) { |
1651
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('newlong', Thrift::TType::I64, 5); |
1652
|
0
|
|
|
|
|
|
$xfer += $output->writeI64($self->{newlong}); |
1653
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1654
|
|
|
|
|
|
|
} |
1655
|
0
|
0
|
|
|
|
|
if (defined $self->{newdouble}) { |
1656
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('newdouble', Thrift::TType::DOUBLE, 6); |
1657
|
0
|
|
|
|
|
|
$xfer += $output->writeDouble($self->{newdouble}); |
1658
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1659
|
|
|
|
|
|
|
} |
1660
|
0
|
0
|
|
|
|
|
if (defined $self->{newstruct}) { |
1661
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('newstruct', Thrift::TType::STRUCT, 7); |
1662
|
0
|
|
|
|
|
|
$xfer += $self->{newstruct}->write($output); |
1663
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1664
|
|
|
|
|
|
|
} |
1665
|
0
|
0
|
|
|
|
|
if (defined $self->{newlist}) { |
1666
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('newlist', Thrift::TType::LIST, 8); |
1667
|
|
|
|
|
|
|
{ |
1668
|
0
|
|
|
|
|
|
$xfer += $output->writeListBegin(Thrift::TType::I32, scalar(@{$self->{newlist}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1669
|
|
|
|
|
|
|
{ |
1670
|
0
|
|
|
|
|
|
foreach my $iter106 (@{$self->{newlist}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1671
|
|
|
|
|
|
|
{ |
1672
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($iter106); |
1673
|
|
|
|
|
|
|
} |
1674
|
|
|
|
|
|
|
} |
1675
|
0
|
|
|
|
|
|
$xfer += $output->writeListEnd(); |
1676
|
|
|
|
|
|
|
} |
1677
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1678
|
|
|
|
|
|
|
} |
1679
|
0
|
0
|
|
|
|
|
if (defined $self->{newset}) { |
1680
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('newset', Thrift::TType::SET, 9); |
1681
|
|
|
|
|
|
|
{ |
1682
|
0
|
|
|
|
|
|
$xfer += $output->writeSetBegin(Thrift::TType::I32, scalar(@{$self->{newset}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1683
|
|
|
|
|
|
|
{ |
1684
|
0
|
|
|
|
|
|
foreach my $iter107 (@{$self->{newset}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1685
|
|
|
|
|
|
|
{ |
1686
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($iter107); |
1687
|
|
|
|
|
|
|
} |
1688
|
|
|
|
|
|
|
} |
1689
|
0
|
|
|
|
|
|
$xfer += $output->writeSetEnd(); |
1690
|
|
|
|
|
|
|
} |
1691
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1692
|
|
|
|
|
|
|
} |
1693
|
0
|
0
|
|
|
|
|
if (defined $self->{newmap}) { |
1694
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('newmap', Thrift::TType::MAP, 10); |
1695
|
|
|
|
|
|
|
{ |
1696
|
0
|
|
|
|
|
|
$xfer += $output->writeMapBegin(Thrift::TType::I32, Thrift::TType::I32, scalar(keys %{$self->{newmap}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1697
|
|
|
|
|
|
|
{ |
1698
|
0
|
|
|
|
|
|
while( my ($kiter108,$viter109) = each %{$self->{newmap}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1699
|
|
|
|
|
|
|
{ |
1700
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($kiter108); |
1701
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($viter109); |
1702
|
|
|
|
|
|
|
} |
1703
|
|
|
|
|
|
|
} |
1704
|
0
|
|
|
|
|
|
$xfer += $output->writeMapEnd(); |
1705
|
|
|
|
|
|
|
} |
1706
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1707
|
|
|
|
|
|
|
} |
1708
|
0
|
0
|
|
|
|
|
if (defined $self->{newstring}) { |
1709
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('newstring', Thrift::TType::STRING, 11); |
1710
|
0
|
|
|
|
|
|
$xfer += $output->writeString($self->{newstring}); |
1711
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1712
|
|
|
|
|
|
|
} |
1713
|
0
|
0
|
|
|
|
|
if (defined $self->{end_in_both}) { |
1714
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('end_in_both', Thrift::TType::I32, 12); |
1715
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($self->{end_in_both}); |
1716
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1717
|
|
|
|
|
|
|
} |
1718
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
1719
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
1720
|
0
|
|
|
|
|
|
return $xfer; |
1721
|
|
|
|
|
|
|
} |
1722
|
|
|
|
|
|
|
|
1723
|
|
|
|
|
|
|
package ThriftTest::ListTypeVersioningV1; |
1724
|
2
|
|
|
2
|
|
14
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
1178
|
|
1725
|
|
|
|
|
|
|
ThriftTest::ListTypeVersioningV1->mk_accessors( qw( myints hello ) ); |
1726
|
|
|
|
|
|
|
|
1727
|
|
|
|
|
|
|
sub new { |
1728
|
0
|
|
|
0
|
|
|
my $classname = shift; |
1729
|
0
|
|
|
|
|
|
my $self = {}; |
1730
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
1731
|
0
|
|
|
|
|
|
$self->{myints} = undef; |
1732
|
0
|
|
|
|
|
|
$self->{hello} = undef; |
1733
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
1734
|
0
|
0
|
|
|
|
|
if (defined $vals->{myints}) { |
1735
|
0
|
|
|
|
|
|
$self->{myints} = $vals->{myints}; |
1736
|
|
|
|
|
|
|
} |
1737
|
0
|
0
|
|
|
|
|
if (defined $vals->{hello}) { |
1738
|
0
|
|
|
|
|
|
$self->{hello} = $vals->{hello}; |
1739
|
|
|
|
|
|
|
} |
1740
|
|
|
|
|
|
|
} |
1741
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
1742
|
|
|
|
|
|
|
} |
1743
|
|
|
|
|
|
|
|
1744
|
|
|
|
|
|
|
sub getName { |
1745
|
0
|
|
|
0
|
|
|
return 'ListTypeVersioningV1'; |
1746
|
|
|
|
|
|
|
} |
1747
|
|
|
|
|
|
|
|
1748
|
|
|
|
|
|
|
sub read { |
1749
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
1750
|
0
|
|
|
|
|
|
my $xfer = 0; |
1751
|
0
|
|
|
|
|
|
my $fname; |
1752
|
0
|
|
|
|
|
|
my $ftype = 0; |
1753
|
0
|
|
|
|
|
|
my $fid = 0; |
1754
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
1755
|
0
|
|
|
|
|
|
while (1) |
1756
|
|
|
|
|
|
|
{ |
1757
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
1758
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
1759
|
0
|
|
|
|
|
|
last; |
1760
|
|
|
|
|
|
|
} |
1761
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
1762
|
|
|
|
|
|
|
{ |
1763
|
0
|
0
|
|
|
|
|
/^1$/ && do{ if ($ftype == Thrift::TType::LIST) { |
|
0
|
0
|
|
|
|
|
|
1764
|
|
|
|
|
|
|
{ |
1765
|
0
|
|
|
|
|
|
my $_size110 = 0; |
|
0
|
|
|
|
|
|
|
1766
|
0
|
|
|
|
|
|
$self->{myints} = []; |
1767
|
0
|
|
|
|
|
|
my $_etype113 = 0; |
1768
|
0
|
|
|
|
|
|
$xfer += $input->readListBegin(\$_etype113, \$_size110); |
1769
|
0
|
|
|
|
|
|
for (my $_i114 = 0; $_i114 < $_size110; ++$_i114) |
1770
|
|
|
|
|
|
|
{ |
1771
|
0
|
|
|
|
|
|
my $elem115 = undef; |
1772
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$elem115); |
1773
|
0
|
|
|
|
|
|
push(@{$self->{myints}},$elem115); |
|
0
|
|
|
|
|
|
|
1774
|
|
|
|
|
|
|
} |
1775
|
0
|
|
|
|
|
|
$xfer += $input->readListEnd(); |
1776
|
|
|
|
|
|
|
} |
1777
|
|
|
|
|
|
|
} else { |
1778
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1779
|
|
|
|
|
|
|
} |
1780
|
0
|
|
|
|
|
|
last; }; |
1781
|
0
|
0
|
|
|
|
|
/^2$/ && do{ if ($ftype == Thrift::TType::STRING) { |
|
0
|
0
|
|
|
|
|
|
1782
|
0
|
|
|
|
|
|
$xfer += $input->readString(\$self->{hello}); |
1783
|
|
|
|
|
|
|
} else { |
1784
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1785
|
|
|
|
|
|
|
} |
1786
|
0
|
|
|
|
|
|
last; }; |
1787
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1788
|
|
|
|
|
|
|
} |
1789
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
1790
|
|
|
|
|
|
|
} |
1791
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
1792
|
0
|
|
|
|
|
|
return $xfer; |
1793
|
|
|
|
|
|
|
} |
1794
|
|
|
|
|
|
|
|
1795
|
|
|
|
|
|
|
sub write { |
1796
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
1797
|
0
|
|
|
|
|
|
my $xfer = 0; |
1798
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('ListTypeVersioningV1'); |
1799
|
0
|
0
|
|
|
|
|
if (defined $self->{myints}) { |
1800
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('myints', Thrift::TType::LIST, 1); |
1801
|
|
|
|
|
|
|
{ |
1802
|
0
|
|
|
|
|
|
$xfer += $output->writeListBegin(Thrift::TType::I32, scalar(@{$self->{myints}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1803
|
|
|
|
|
|
|
{ |
1804
|
0
|
|
|
|
|
|
foreach my $iter116 (@{$self->{myints}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1805
|
|
|
|
|
|
|
{ |
1806
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($iter116); |
1807
|
|
|
|
|
|
|
} |
1808
|
|
|
|
|
|
|
} |
1809
|
0
|
|
|
|
|
|
$xfer += $output->writeListEnd(); |
1810
|
|
|
|
|
|
|
} |
1811
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1812
|
|
|
|
|
|
|
} |
1813
|
0
|
0
|
|
|
|
|
if (defined $self->{hello}) { |
1814
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('hello', Thrift::TType::STRING, 2); |
1815
|
0
|
|
|
|
|
|
$xfer += $output->writeString($self->{hello}); |
1816
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1817
|
|
|
|
|
|
|
} |
1818
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
1819
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
1820
|
0
|
|
|
|
|
|
return $xfer; |
1821
|
|
|
|
|
|
|
} |
1822
|
|
|
|
|
|
|
|
1823
|
|
|
|
|
|
|
package ThriftTest::ListTypeVersioningV2; |
1824
|
2
|
|
|
2
|
|
19
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1184
|
|
1825
|
|
|
|
|
|
|
ThriftTest::ListTypeVersioningV2->mk_accessors( qw( strings hello ) ); |
1826
|
|
|
|
|
|
|
|
1827
|
|
|
|
|
|
|
sub new { |
1828
|
0
|
|
|
0
|
|
|
my $classname = shift; |
1829
|
0
|
|
|
|
|
|
my $self = {}; |
1830
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
1831
|
0
|
|
|
|
|
|
$self->{strings} = undef; |
1832
|
0
|
|
|
|
|
|
$self->{hello} = undef; |
1833
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
1834
|
0
|
0
|
|
|
|
|
if (defined $vals->{strings}) { |
1835
|
0
|
|
|
|
|
|
$self->{strings} = $vals->{strings}; |
1836
|
|
|
|
|
|
|
} |
1837
|
0
|
0
|
|
|
|
|
if (defined $vals->{hello}) { |
1838
|
0
|
|
|
|
|
|
$self->{hello} = $vals->{hello}; |
1839
|
|
|
|
|
|
|
} |
1840
|
|
|
|
|
|
|
} |
1841
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
1842
|
|
|
|
|
|
|
} |
1843
|
|
|
|
|
|
|
|
1844
|
|
|
|
|
|
|
sub getName { |
1845
|
0
|
|
|
0
|
|
|
return 'ListTypeVersioningV2'; |
1846
|
|
|
|
|
|
|
} |
1847
|
|
|
|
|
|
|
|
1848
|
|
|
|
|
|
|
sub read { |
1849
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
1850
|
0
|
|
|
|
|
|
my $xfer = 0; |
1851
|
0
|
|
|
|
|
|
my $fname; |
1852
|
0
|
|
|
|
|
|
my $ftype = 0; |
1853
|
0
|
|
|
|
|
|
my $fid = 0; |
1854
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
1855
|
0
|
|
|
|
|
|
while (1) |
1856
|
|
|
|
|
|
|
{ |
1857
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
1858
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
1859
|
0
|
|
|
|
|
|
last; |
1860
|
|
|
|
|
|
|
} |
1861
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
1862
|
|
|
|
|
|
|
{ |
1863
|
0
|
0
|
|
|
|
|
/^1$/ && do{ if ($ftype == Thrift::TType::LIST) { |
|
0
|
0
|
|
|
|
|
|
1864
|
|
|
|
|
|
|
{ |
1865
|
0
|
|
|
|
|
|
my $_size117 = 0; |
|
0
|
|
|
|
|
|
|
1866
|
0
|
|
|
|
|
|
$self->{strings} = []; |
1867
|
0
|
|
|
|
|
|
my $_etype120 = 0; |
1868
|
0
|
|
|
|
|
|
$xfer += $input->readListBegin(\$_etype120, \$_size117); |
1869
|
0
|
|
|
|
|
|
for (my $_i121 = 0; $_i121 < $_size117; ++$_i121) |
1870
|
|
|
|
|
|
|
{ |
1871
|
0
|
|
|
|
|
|
my $elem122 = undef; |
1872
|
0
|
|
|
|
|
|
$xfer += $input->readString(\$elem122); |
1873
|
0
|
|
|
|
|
|
push(@{$self->{strings}},$elem122); |
|
0
|
|
|
|
|
|
|
1874
|
|
|
|
|
|
|
} |
1875
|
0
|
|
|
|
|
|
$xfer += $input->readListEnd(); |
1876
|
|
|
|
|
|
|
} |
1877
|
|
|
|
|
|
|
} else { |
1878
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1879
|
|
|
|
|
|
|
} |
1880
|
0
|
|
|
|
|
|
last; }; |
1881
|
0
|
0
|
|
|
|
|
/^2$/ && do{ if ($ftype == Thrift::TType::STRING) { |
|
0
|
0
|
|
|
|
|
|
1882
|
0
|
|
|
|
|
|
$xfer += $input->readString(\$self->{hello}); |
1883
|
|
|
|
|
|
|
} else { |
1884
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1885
|
|
|
|
|
|
|
} |
1886
|
0
|
|
|
|
|
|
last; }; |
1887
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1888
|
|
|
|
|
|
|
} |
1889
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
1890
|
|
|
|
|
|
|
} |
1891
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
1892
|
0
|
|
|
|
|
|
return $xfer; |
1893
|
|
|
|
|
|
|
} |
1894
|
|
|
|
|
|
|
|
1895
|
|
|
|
|
|
|
sub write { |
1896
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
1897
|
0
|
|
|
|
|
|
my $xfer = 0; |
1898
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('ListTypeVersioningV2'); |
1899
|
0
|
0
|
|
|
|
|
if (defined $self->{strings}) { |
1900
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('strings', Thrift::TType::LIST, 1); |
1901
|
|
|
|
|
|
|
{ |
1902
|
0
|
|
|
|
|
|
$xfer += $output->writeListBegin(Thrift::TType::STRING, scalar(@{$self->{strings}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1903
|
|
|
|
|
|
|
{ |
1904
|
0
|
|
|
|
|
|
foreach my $iter123 (@{$self->{strings}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1905
|
|
|
|
|
|
|
{ |
1906
|
0
|
|
|
|
|
|
$xfer += $output->writeString($iter123); |
1907
|
|
|
|
|
|
|
} |
1908
|
|
|
|
|
|
|
} |
1909
|
0
|
|
|
|
|
|
$xfer += $output->writeListEnd(); |
1910
|
|
|
|
|
|
|
} |
1911
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1912
|
|
|
|
|
|
|
} |
1913
|
0
|
0
|
|
|
|
|
if (defined $self->{hello}) { |
1914
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('hello', Thrift::TType::STRING, 2); |
1915
|
0
|
|
|
|
|
|
$xfer += $output->writeString($self->{hello}); |
1916
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
1917
|
|
|
|
|
|
|
} |
1918
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
1919
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
1920
|
0
|
|
|
|
|
|
return $xfer; |
1921
|
|
|
|
|
|
|
} |
1922
|
|
|
|
|
|
|
|
1923
|
|
|
|
|
|
|
package ThriftTest::GuessProtocolStruct; |
1924
|
2
|
|
|
2
|
|
13
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1116
|
|
1925
|
|
|
|
|
|
|
ThriftTest::GuessProtocolStruct->mk_accessors( qw( map_field ) ); |
1926
|
|
|
|
|
|
|
|
1927
|
|
|
|
|
|
|
sub new { |
1928
|
0
|
|
|
0
|
|
|
my $classname = shift; |
1929
|
0
|
|
|
|
|
|
my $self = {}; |
1930
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
1931
|
0
|
|
|
|
|
|
$self->{map_field} = undef; |
1932
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
1933
|
0
|
0
|
|
|
|
|
if (defined $vals->{map_field}) { |
1934
|
0
|
|
|
|
|
|
$self->{map_field} = $vals->{map_field}; |
1935
|
|
|
|
|
|
|
} |
1936
|
|
|
|
|
|
|
} |
1937
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
1938
|
|
|
|
|
|
|
} |
1939
|
|
|
|
|
|
|
|
1940
|
|
|
|
|
|
|
sub getName { |
1941
|
0
|
|
|
0
|
|
|
return 'GuessProtocolStruct'; |
1942
|
|
|
|
|
|
|
} |
1943
|
|
|
|
|
|
|
|
1944
|
|
|
|
|
|
|
sub read { |
1945
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
1946
|
0
|
|
|
|
|
|
my $xfer = 0; |
1947
|
0
|
|
|
|
|
|
my $fname; |
1948
|
0
|
|
|
|
|
|
my $ftype = 0; |
1949
|
0
|
|
|
|
|
|
my $fid = 0; |
1950
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
1951
|
0
|
|
|
|
|
|
while (1) |
1952
|
|
|
|
|
|
|
{ |
1953
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
1954
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
1955
|
0
|
|
|
|
|
|
last; |
1956
|
|
|
|
|
|
|
} |
1957
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
1958
|
|
|
|
|
|
|
{ |
1959
|
0
|
0
|
|
|
|
|
/^7$/ && do{ if ($ftype == Thrift::TType::MAP) { |
|
0
|
0
|
|
|
|
|
|
1960
|
|
|
|
|
|
|
{ |
1961
|
0
|
|
|
|
|
|
my $_size124 = 0; |
|
0
|
|
|
|
|
|
|
1962
|
0
|
|
|
|
|
|
$self->{map_field} = {}; |
1963
|
0
|
|
|
|
|
|
my $_ktype125 = 0; |
1964
|
0
|
|
|
|
|
|
my $_vtype126 = 0; |
1965
|
0
|
|
|
|
|
|
$xfer += $input->readMapBegin(\$_ktype125, \$_vtype126, \$_size124); |
1966
|
0
|
|
|
|
|
|
for (my $_i128 = 0; $_i128 < $_size124; ++$_i128) |
1967
|
|
|
|
|
|
|
{ |
1968
|
0
|
|
|
|
|
|
my $key129 = ''; |
1969
|
0
|
|
|
|
|
|
my $val130 = ''; |
1970
|
0
|
|
|
|
|
|
$xfer += $input->readString(\$key129); |
1971
|
0
|
|
|
|
|
|
$xfer += $input->readString(\$val130); |
1972
|
0
|
|
|
|
|
|
$self->{map_field}->{$key129} = $val130; |
1973
|
|
|
|
|
|
|
} |
1974
|
0
|
|
|
|
|
|
$xfer += $input->readMapEnd(); |
1975
|
|
|
|
|
|
|
} |
1976
|
|
|
|
|
|
|
} else { |
1977
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1978
|
|
|
|
|
|
|
} |
1979
|
0
|
|
|
|
|
|
last; }; |
1980
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
1981
|
|
|
|
|
|
|
} |
1982
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
1983
|
|
|
|
|
|
|
} |
1984
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
1985
|
0
|
|
|
|
|
|
return $xfer; |
1986
|
|
|
|
|
|
|
} |
1987
|
|
|
|
|
|
|
|
1988
|
|
|
|
|
|
|
sub write { |
1989
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
1990
|
0
|
|
|
|
|
|
my $xfer = 0; |
1991
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('GuessProtocolStruct'); |
1992
|
0
|
0
|
|
|
|
|
if (defined $self->{map_field}) { |
1993
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('map_field', Thrift::TType::MAP, 7); |
1994
|
|
|
|
|
|
|
{ |
1995
|
0
|
|
|
|
|
|
$xfer += $output->writeMapBegin(Thrift::TType::STRING, Thrift::TType::STRING, scalar(keys %{$self->{map_field}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1996
|
|
|
|
|
|
|
{ |
1997
|
0
|
|
|
|
|
|
while( my ($kiter131,$viter132) = each %{$self->{map_field}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
1998
|
|
|
|
|
|
|
{ |
1999
|
0
|
|
|
|
|
|
$xfer += $output->writeString($kiter131); |
2000
|
0
|
|
|
|
|
|
$xfer += $output->writeString($viter132); |
2001
|
|
|
|
|
|
|
} |
2002
|
|
|
|
|
|
|
} |
2003
|
0
|
|
|
|
|
|
$xfer += $output->writeMapEnd(); |
2004
|
|
|
|
|
|
|
} |
2005
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
2006
|
|
|
|
|
|
|
} |
2007
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
2008
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
2009
|
0
|
|
|
|
|
|
return $xfer; |
2010
|
|
|
|
|
|
|
} |
2011
|
|
|
|
|
|
|
|
2012
|
|
|
|
|
|
|
package ThriftTest::LargeDeltas; |
2013
|
2
|
|
|
2
|
|
14
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
2827
|
|
2014
|
|
|
|
|
|
|
ThriftTest::LargeDeltas->mk_accessors( qw( b1 b10 b100 check_true b1000 check_false vertwo2000 a_set2500 vertwo3000 big_numbers ) ); |
2015
|
|
|
|
|
|
|
|
2016
|
|
|
|
|
|
|
sub new { |
2017
|
0
|
|
|
0
|
|
|
my $classname = shift; |
2018
|
0
|
|
|
|
|
|
my $self = {}; |
2019
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
2020
|
0
|
|
|
|
|
|
$self->{b1} = undef; |
2021
|
0
|
|
|
|
|
|
$self->{b10} = undef; |
2022
|
0
|
|
|
|
|
|
$self->{b100} = undef; |
2023
|
0
|
|
|
|
|
|
$self->{check_true} = undef; |
2024
|
0
|
|
|
|
|
|
$self->{b1000} = undef; |
2025
|
0
|
|
|
|
|
|
$self->{check_false} = undef; |
2026
|
0
|
|
|
|
|
|
$self->{vertwo2000} = undef; |
2027
|
0
|
|
|
|
|
|
$self->{a_set2500} = undef; |
2028
|
0
|
|
|
|
|
|
$self->{vertwo3000} = undef; |
2029
|
0
|
|
|
|
|
|
$self->{big_numbers} = undef; |
2030
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
2031
|
0
|
0
|
|
|
|
|
if (defined $vals->{b1}) { |
2032
|
0
|
|
|
|
|
|
$self->{b1} = $vals->{b1}; |
2033
|
|
|
|
|
|
|
} |
2034
|
0
|
0
|
|
|
|
|
if (defined $vals->{b10}) { |
2035
|
0
|
|
|
|
|
|
$self->{b10} = $vals->{b10}; |
2036
|
|
|
|
|
|
|
} |
2037
|
0
|
0
|
|
|
|
|
if (defined $vals->{b100}) { |
2038
|
0
|
|
|
|
|
|
$self->{b100} = $vals->{b100}; |
2039
|
|
|
|
|
|
|
} |
2040
|
0
|
0
|
|
|
|
|
if (defined $vals->{check_true}) { |
2041
|
0
|
|
|
|
|
|
$self->{check_true} = $vals->{check_true}; |
2042
|
|
|
|
|
|
|
} |
2043
|
0
|
0
|
|
|
|
|
if (defined $vals->{b1000}) { |
2044
|
0
|
|
|
|
|
|
$self->{b1000} = $vals->{b1000}; |
2045
|
|
|
|
|
|
|
} |
2046
|
0
|
0
|
|
|
|
|
if (defined $vals->{check_false}) { |
2047
|
0
|
|
|
|
|
|
$self->{check_false} = $vals->{check_false}; |
2048
|
|
|
|
|
|
|
} |
2049
|
0
|
0
|
|
|
|
|
if (defined $vals->{vertwo2000}) { |
2050
|
0
|
|
|
|
|
|
$self->{vertwo2000} = $vals->{vertwo2000}; |
2051
|
|
|
|
|
|
|
} |
2052
|
0
|
0
|
|
|
|
|
if (defined $vals->{a_set2500}) { |
2053
|
0
|
|
|
|
|
|
$self->{a_set2500} = $vals->{a_set2500}; |
2054
|
|
|
|
|
|
|
} |
2055
|
0
|
0
|
|
|
|
|
if (defined $vals->{vertwo3000}) { |
2056
|
0
|
|
|
|
|
|
$self->{vertwo3000} = $vals->{vertwo3000}; |
2057
|
|
|
|
|
|
|
} |
2058
|
0
|
0
|
|
|
|
|
if (defined $vals->{big_numbers}) { |
2059
|
0
|
|
|
|
|
|
$self->{big_numbers} = $vals->{big_numbers}; |
2060
|
|
|
|
|
|
|
} |
2061
|
|
|
|
|
|
|
} |
2062
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
2063
|
|
|
|
|
|
|
} |
2064
|
|
|
|
|
|
|
|
2065
|
|
|
|
|
|
|
sub getName { |
2066
|
0
|
|
|
0
|
|
|
return 'LargeDeltas'; |
2067
|
|
|
|
|
|
|
} |
2068
|
|
|
|
|
|
|
|
2069
|
|
|
|
|
|
|
sub read { |
2070
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
2071
|
0
|
|
|
|
|
|
my $xfer = 0; |
2072
|
0
|
|
|
|
|
|
my $fname; |
2073
|
0
|
|
|
|
|
|
my $ftype = 0; |
2074
|
0
|
|
|
|
|
|
my $fid = 0; |
2075
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
2076
|
0
|
|
|
|
|
|
while (1) |
2077
|
|
|
|
|
|
|
{ |
2078
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
2079
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
2080
|
0
|
|
|
|
|
|
last; |
2081
|
|
|
|
|
|
|
} |
2082
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
2083
|
|
|
|
|
|
|
{ |
2084
|
0
|
0
|
|
|
|
|
/^1$/ && do{ if ($ftype == Thrift::TType::STRUCT) { |
|
0
|
0
|
|
|
|
|
|
2085
|
0
|
|
|
|
|
|
$self->{b1} = ThriftTest::Bools->new(); |
2086
|
0
|
|
|
|
|
|
$xfer += $self->{b1}->read($input); |
2087
|
|
|
|
|
|
|
} else { |
2088
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2089
|
|
|
|
|
|
|
} |
2090
|
0
|
|
|
|
|
|
last; }; |
2091
|
0
|
0
|
|
|
|
|
/^10$/ && do{ if ($ftype == Thrift::TType::STRUCT) { |
|
0
|
0
|
|
|
|
|
|
2092
|
0
|
|
|
|
|
|
$self->{b10} = ThriftTest::Bools->new(); |
2093
|
0
|
|
|
|
|
|
$xfer += $self->{b10}->read($input); |
2094
|
|
|
|
|
|
|
} else { |
2095
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2096
|
|
|
|
|
|
|
} |
2097
|
0
|
|
|
|
|
|
last; }; |
2098
|
0
|
0
|
|
|
|
|
/^100$/ && do{ if ($ftype == Thrift::TType::STRUCT) { |
|
0
|
0
|
|
|
|
|
|
2099
|
0
|
|
|
|
|
|
$self->{b100} = ThriftTest::Bools->new(); |
2100
|
0
|
|
|
|
|
|
$xfer += $self->{b100}->read($input); |
2101
|
|
|
|
|
|
|
} else { |
2102
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2103
|
|
|
|
|
|
|
} |
2104
|
0
|
|
|
|
|
|
last; }; |
2105
|
0
|
0
|
|
|
|
|
/^500$/ && do{ if ($ftype == Thrift::TType::BOOL) { |
|
0
|
0
|
|
|
|
|
|
2106
|
0
|
|
|
|
|
|
$xfer += $input->readBool(\$self->{check_true}); |
2107
|
|
|
|
|
|
|
} else { |
2108
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2109
|
|
|
|
|
|
|
} |
2110
|
0
|
|
|
|
|
|
last; }; |
2111
|
0
|
0
|
|
|
|
|
/^1000$/ && do{ if ($ftype == Thrift::TType::STRUCT) { |
|
0
|
0
|
|
|
|
|
|
2112
|
0
|
|
|
|
|
|
$self->{b1000} = ThriftTest::Bools->new(); |
2113
|
0
|
|
|
|
|
|
$xfer += $self->{b1000}->read($input); |
2114
|
|
|
|
|
|
|
} else { |
2115
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2116
|
|
|
|
|
|
|
} |
2117
|
0
|
|
|
|
|
|
last; }; |
2118
|
0
|
0
|
|
|
|
|
/^1500$/ && do{ if ($ftype == Thrift::TType::BOOL) { |
|
0
|
0
|
|
|
|
|
|
2119
|
0
|
|
|
|
|
|
$xfer += $input->readBool(\$self->{check_false}); |
2120
|
|
|
|
|
|
|
} else { |
2121
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2122
|
|
|
|
|
|
|
} |
2123
|
0
|
|
|
|
|
|
last; }; |
2124
|
0
|
0
|
|
|
|
|
/^2000$/ && do{ if ($ftype == Thrift::TType::STRUCT) { |
|
0
|
0
|
|
|
|
|
|
2125
|
0
|
|
|
|
|
|
$self->{vertwo2000} = ThriftTest::VersioningTestV2->new(); |
2126
|
0
|
|
|
|
|
|
$xfer += $self->{vertwo2000}->read($input); |
2127
|
|
|
|
|
|
|
} else { |
2128
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2129
|
|
|
|
|
|
|
} |
2130
|
0
|
|
|
|
|
|
last; }; |
2131
|
0
|
0
|
|
|
|
|
/^2500$/ && do{ if ($ftype == Thrift::TType::SET) { |
|
0
|
0
|
|
|
|
|
|
2132
|
|
|
|
|
|
|
{ |
2133
|
0
|
|
|
|
|
|
my $_size133 = 0; |
|
0
|
|
|
|
|
|
|
2134
|
0
|
|
|
|
|
|
$self->{a_set2500} = {}; |
2135
|
0
|
|
|
|
|
|
my $_etype136 = 0; |
2136
|
0
|
|
|
|
|
|
$xfer += $input->readSetBegin(\$_etype136, \$_size133); |
2137
|
0
|
|
|
|
|
|
for (my $_i137 = 0; $_i137 < $_size133; ++$_i137) |
2138
|
|
|
|
|
|
|
{ |
2139
|
0
|
|
|
|
|
|
my $elem138 = undef; |
2140
|
0
|
|
|
|
|
|
$xfer += $input->readString(\$elem138); |
2141
|
0
|
|
|
|
|
|
$self->{a_set2500}->{$elem138} = 1; |
2142
|
|
|
|
|
|
|
} |
2143
|
0
|
|
|
|
|
|
$xfer += $input->readSetEnd(); |
2144
|
|
|
|
|
|
|
} |
2145
|
|
|
|
|
|
|
} else { |
2146
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2147
|
|
|
|
|
|
|
} |
2148
|
0
|
|
|
|
|
|
last; }; |
2149
|
0
|
0
|
|
|
|
|
/^3000$/ && do{ if ($ftype == Thrift::TType::STRUCT) { |
|
0
|
0
|
|
|
|
|
|
2150
|
0
|
|
|
|
|
|
$self->{vertwo3000} = ThriftTest::VersioningTestV2->new(); |
2151
|
0
|
|
|
|
|
|
$xfer += $self->{vertwo3000}->read($input); |
2152
|
|
|
|
|
|
|
} else { |
2153
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2154
|
|
|
|
|
|
|
} |
2155
|
0
|
|
|
|
|
|
last; }; |
2156
|
0
|
0
|
|
|
|
|
/^4000$/ && do{ if ($ftype == Thrift::TType::LIST) { |
|
0
|
0
|
|
|
|
|
|
2157
|
|
|
|
|
|
|
{ |
2158
|
0
|
|
|
|
|
|
my $_size139 = 0; |
|
0
|
|
|
|
|
|
|
2159
|
0
|
|
|
|
|
|
$self->{big_numbers} = []; |
2160
|
0
|
|
|
|
|
|
my $_etype142 = 0; |
2161
|
0
|
|
|
|
|
|
$xfer += $input->readListBegin(\$_etype142, \$_size139); |
2162
|
0
|
|
|
|
|
|
for (my $_i143 = 0; $_i143 < $_size139; ++$_i143) |
2163
|
|
|
|
|
|
|
{ |
2164
|
0
|
|
|
|
|
|
my $elem144 = undef; |
2165
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$elem144); |
2166
|
0
|
|
|
|
|
|
push(@{$self->{big_numbers}},$elem144); |
|
0
|
|
|
|
|
|
|
2167
|
|
|
|
|
|
|
} |
2168
|
0
|
|
|
|
|
|
$xfer += $input->readListEnd(); |
2169
|
|
|
|
|
|
|
} |
2170
|
|
|
|
|
|
|
} else { |
2171
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2172
|
|
|
|
|
|
|
} |
2173
|
0
|
|
|
|
|
|
last; }; |
2174
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2175
|
|
|
|
|
|
|
} |
2176
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
2177
|
|
|
|
|
|
|
} |
2178
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
2179
|
0
|
|
|
|
|
|
return $xfer; |
2180
|
|
|
|
|
|
|
} |
2181
|
|
|
|
|
|
|
|
2182
|
|
|
|
|
|
|
sub write { |
2183
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
2184
|
0
|
|
|
|
|
|
my $xfer = 0; |
2185
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('LargeDeltas'); |
2186
|
0
|
0
|
|
|
|
|
if (defined $self->{b1}) { |
2187
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('b1', Thrift::TType::STRUCT, 1); |
2188
|
0
|
|
|
|
|
|
$xfer += $self->{b1}->write($output); |
2189
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
2190
|
|
|
|
|
|
|
} |
2191
|
0
|
0
|
|
|
|
|
if (defined $self->{b10}) { |
2192
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('b10', Thrift::TType::STRUCT, 10); |
2193
|
0
|
|
|
|
|
|
$xfer += $self->{b10}->write($output); |
2194
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
2195
|
|
|
|
|
|
|
} |
2196
|
0
|
0
|
|
|
|
|
if (defined $self->{b100}) { |
2197
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('b100', Thrift::TType::STRUCT, 100); |
2198
|
0
|
|
|
|
|
|
$xfer += $self->{b100}->write($output); |
2199
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
2200
|
|
|
|
|
|
|
} |
2201
|
0
|
0
|
|
|
|
|
if (defined $self->{check_true}) { |
2202
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('check_true', Thrift::TType::BOOL, 500); |
2203
|
0
|
|
|
|
|
|
$xfer += $output->writeBool($self->{check_true}); |
2204
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
2205
|
|
|
|
|
|
|
} |
2206
|
0
|
0
|
|
|
|
|
if (defined $self->{b1000}) { |
2207
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('b1000', Thrift::TType::STRUCT, 1000); |
2208
|
0
|
|
|
|
|
|
$xfer += $self->{b1000}->write($output); |
2209
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
2210
|
|
|
|
|
|
|
} |
2211
|
0
|
0
|
|
|
|
|
if (defined $self->{check_false}) { |
2212
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('check_false', Thrift::TType::BOOL, 1500); |
2213
|
0
|
|
|
|
|
|
$xfer += $output->writeBool($self->{check_false}); |
2214
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
2215
|
|
|
|
|
|
|
} |
2216
|
0
|
0
|
|
|
|
|
if (defined $self->{vertwo2000}) { |
2217
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('vertwo2000', Thrift::TType::STRUCT, 2000); |
2218
|
0
|
|
|
|
|
|
$xfer += $self->{vertwo2000}->write($output); |
2219
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
2220
|
|
|
|
|
|
|
} |
2221
|
0
|
0
|
|
|
|
|
if (defined $self->{a_set2500}) { |
2222
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('a_set2500', Thrift::TType::SET, 2500); |
2223
|
|
|
|
|
|
|
{ |
2224
|
0
|
|
|
|
|
|
$xfer += $output->writeSetBegin(Thrift::TType::STRING, scalar(@{$self->{a_set2500}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2225
|
|
|
|
|
|
|
{ |
2226
|
0
|
|
|
|
|
|
foreach my $iter145 (@{$self->{a_set2500}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2227
|
|
|
|
|
|
|
{ |
2228
|
0
|
|
|
|
|
|
$xfer += $output->writeString($iter145); |
2229
|
|
|
|
|
|
|
} |
2230
|
|
|
|
|
|
|
} |
2231
|
0
|
|
|
|
|
|
$xfer += $output->writeSetEnd(); |
2232
|
|
|
|
|
|
|
} |
2233
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
2234
|
|
|
|
|
|
|
} |
2235
|
0
|
0
|
|
|
|
|
if (defined $self->{vertwo3000}) { |
2236
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('vertwo3000', Thrift::TType::STRUCT, 3000); |
2237
|
0
|
|
|
|
|
|
$xfer += $self->{vertwo3000}->write($output); |
2238
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
2239
|
|
|
|
|
|
|
} |
2240
|
0
|
0
|
|
|
|
|
if (defined $self->{big_numbers}) { |
2241
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('big_numbers', Thrift::TType::LIST, 4000); |
2242
|
|
|
|
|
|
|
{ |
2243
|
0
|
|
|
|
|
|
$xfer += $output->writeListBegin(Thrift::TType::I32, scalar(@{$self->{big_numbers}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2244
|
|
|
|
|
|
|
{ |
2245
|
0
|
|
|
|
|
|
foreach my $iter146 (@{$self->{big_numbers}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2246
|
|
|
|
|
|
|
{ |
2247
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($iter146); |
2248
|
|
|
|
|
|
|
} |
2249
|
|
|
|
|
|
|
} |
2250
|
0
|
|
|
|
|
|
$xfer += $output->writeListEnd(); |
2251
|
|
|
|
|
|
|
} |
2252
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
2253
|
|
|
|
|
|
|
} |
2254
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
2255
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
2256
|
0
|
|
|
|
|
|
return $xfer; |
2257
|
|
|
|
|
|
|
} |
2258
|
|
|
|
|
|
|
|
2259
|
|
|
|
|
|
|
package ThriftTest::NestedListsI32x2; |
2260
|
2
|
|
|
2
|
|
16
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
1536
|
|
2261
|
|
|
|
|
|
|
ThriftTest::NestedListsI32x2->mk_accessors( qw( integerlist ) ); |
2262
|
|
|
|
|
|
|
|
2263
|
|
|
|
|
|
|
sub new { |
2264
|
0
|
|
|
0
|
|
|
my $classname = shift; |
2265
|
0
|
|
|
|
|
|
my $self = {}; |
2266
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
2267
|
0
|
|
|
|
|
|
$self->{integerlist} = undef; |
2268
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
2269
|
0
|
0
|
|
|
|
|
if (defined $vals->{integerlist}) { |
2270
|
0
|
|
|
|
|
|
$self->{integerlist} = $vals->{integerlist}; |
2271
|
|
|
|
|
|
|
} |
2272
|
|
|
|
|
|
|
} |
2273
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
2274
|
|
|
|
|
|
|
} |
2275
|
|
|
|
|
|
|
|
2276
|
|
|
|
|
|
|
sub getName { |
2277
|
0
|
|
|
0
|
|
|
return 'NestedListsI32x2'; |
2278
|
|
|
|
|
|
|
} |
2279
|
|
|
|
|
|
|
|
2280
|
|
|
|
|
|
|
sub read { |
2281
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
2282
|
0
|
|
|
|
|
|
my $xfer = 0; |
2283
|
0
|
|
|
|
|
|
my $fname; |
2284
|
0
|
|
|
|
|
|
my $ftype = 0; |
2285
|
0
|
|
|
|
|
|
my $fid = 0; |
2286
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
2287
|
0
|
|
|
|
|
|
while (1) |
2288
|
|
|
|
|
|
|
{ |
2289
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
2290
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
2291
|
0
|
|
|
|
|
|
last; |
2292
|
|
|
|
|
|
|
} |
2293
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
2294
|
|
|
|
|
|
|
{ |
2295
|
0
|
0
|
|
|
|
|
/^1$/ && do{ if ($ftype == Thrift::TType::LIST) { |
|
0
|
0
|
|
|
|
|
|
2296
|
|
|
|
|
|
|
{ |
2297
|
0
|
|
|
|
|
|
my $_size147 = 0; |
|
0
|
|
|
|
|
|
|
2298
|
0
|
|
|
|
|
|
$self->{integerlist} = []; |
2299
|
0
|
|
|
|
|
|
my $_etype150 = 0; |
2300
|
0
|
|
|
|
|
|
$xfer += $input->readListBegin(\$_etype150, \$_size147); |
2301
|
0
|
|
|
|
|
|
for (my $_i151 = 0; $_i151 < $_size147; ++$_i151) |
2302
|
|
|
|
|
|
|
{ |
2303
|
0
|
|
|
|
|
|
my $elem152 = undef; |
2304
|
|
|
|
|
|
|
{ |
2305
|
0
|
|
|
|
|
|
my $_size153 = 0; |
|
0
|
|
|
|
|
|
|
2306
|
0
|
|
|
|
|
|
$elem152 = []; |
2307
|
0
|
|
|
|
|
|
my $_etype156 = 0; |
2308
|
0
|
|
|
|
|
|
$xfer += $input->readListBegin(\$_etype156, \$_size153); |
2309
|
0
|
|
|
|
|
|
for (my $_i157 = 0; $_i157 < $_size153; ++$_i157) |
2310
|
|
|
|
|
|
|
{ |
2311
|
0
|
|
|
|
|
|
my $elem158 = undef; |
2312
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$elem158); |
2313
|
0
|
|
|
|
|
|
push(@{$elem152},$elem158); |
|
0
|
|
|
|
|
|
|
2314
|
|
|
|
|
|
|
} |
2315
|
0
|
|
|
|
|
|
$xfer += $input->readListEnd(); |
2316
|
|
|
|
|
|
|
} |
2317
|
0
|
|
|
|
|
|
push(@{$self->{integerlist}},$elem152); |
|
0
|
|
|
|
|
|
|
2318
|
|
|
|
|
|
|
} |
2319
|
0
|
|
|
|
|
|
$xfer += $input->readListEnd(); |
2320
|
|
|
|
|
|
|
} |
2321
|
|
|
|
|
|
|
} else { |
2322
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2323
|
|
|
|
|
|
|
} |
2324
|
0
|
|
|
|
|
|
last; }; |
2325
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2326
|
|
|
|
|
|
|
} |
2327
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
2328
|
|
|
|
|
|
|
} |
2329
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
2330
|
0
|
|
|
|
|
|
return $xfer; |
2331
|
|
|
|
|
|
|
} |
2332
|
|
|
|
|
|
|
|
2333
|
|
|
|
|
|
|
sub write { |
2334
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
2335
|
0
|
|
|
|
|
|
my $xfer = 0; |
2336
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('NestedListsI32x2'); |
2337
|
0
|
0
|
|
|
|
|
if (defined $self->{integerlist}) { |
2338
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('integerlist', Thrift::TType::LIST, 1); |
2339
|
|
|
|
|
|
|
{ |
2340
|
0
|
|
|
|
|
|
$xfer += $output->writeListBegin(Thrift::TType::LIST, scalar(@{$self->{integerlist}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2341
|
|
|
|
|
|
|
{ |
2342
|
0
|
|
|
|
|
|
foreach my $iter159 (@{$self->{integerlist}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2343
|
|
|
|
|
|
|
{ |
2344
|
|
|
|
|
|
|
{ |
2345
|
0
|
|
|
|
|
|
$xfer += $output->writeListBegin(Thrift::TType::I32, scalar(@{${iter159}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2346
|
|
|
|
|
|
|
{ |
2347
|
0
|
|
|
|
|
|
foreach my $iter160 (@{${iter159}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2348
|
|
|
|
|
|
|
{ |
2349
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($iter160); |
2350
|
|
|
|
|
|
|
} |
2351
|
|
|
|
|
|
|
} |
2352
|
0
|
|
|
|
|
|
$xfer += $output->writeListEnd(); |
2353
|
|
|
|
|
|
|
} |
2354
|
|
|
|
|
|
|
} |
2355
|
|
|
|
|
|
|
} |
2356
|
0
|
|
|
|
|
|
$xfer += $output->writeListEnd(); |
2357
|
|
|
|
|
|
|
} |
2358
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
2359
|
|
|
|
|
|
|
} |
2360
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
2361
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
2362
|
0
|
|
|
|
|
|
return $xfer; |
2363
|
|
|
|
|
|
|
} |
2364
|
|
|
|
|
|
|
|
2365
|
|
|
|
|
|
|
package ThriftTest::NestedListsI32x3; |
2366
|
2
|
|
|
2
|
|
13
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
1311
|
|
2367
|
|
|
|
|
|
|
ThriftTest::NestedListsI32x3->mk_accessors( qw( integerlist ) ); |
2368
|
|
|
|
|
|
|
|
2369
|
|
|
|
|
|
|
sub new { |
2370
|
0
|
|
|
0
|
|
|
my $classname = shift; |
2371
|
0
|
|
|
|
|
|
my $self = {}; |
2372
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
2373
|
0
|
|
|
|
|
|
$self->{integerlist} = undef; |
2374
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
2375
|
0
|
0
|
|
|
|
|
if (defined $vals->{integerlist}) { |
2376
|
0
|
|
|
|
|
|
$self->{integerlist} = $vals->{integerlist}; |
2377
|
|
|
|
|
|
|
} |
2378
|
|
|
|
|
|
|
} |
2379
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
2380
|
|
|
|
|
|
|
} |
2381
|
|
|
|
|
|
|
|
2382
|
|
|
|
|
|
|
sub getName { |
2383
|
0
|
|
|
0
|
|
|
return 'NestedListsI32x3'; |
2384
|
|
|
|
|
|
|
} |
2385
|
|
|
|
|
|
|
|
2386
|
|
|
|
|
|
|
sub read { |
2387
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
2388
|
0
|
|
|
|
|
|
my $xfer = 0; |
2389
|
0
|
|
|
|
|
|
my $fname; |
2390
|
0
|
|
|
|
|
|
my $ftype = 0; |
2391
|
0
|
|
|
|
|
|
my $fid = 0; |
2392
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
2393
|
0
|
|
|
|
|
|
while (1) |
2394
|
|
|
|
|
|
|
{ |
2395
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
2396
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
2397
|
0
|
|
|
|
|
|
last; |
2398
|
|
|
|
|
|
|
} |
2399
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
2400
|
|
|
|
|
|
|
{ |
2401
|
0
|
0
|
|
|
|
|
/^1$/ && do{ if ($ftype == Thrift::TType::LIST) { |
|
0
|
0
|
|
|
|
|
|
2402
|
|
|
|
|
|
|
{ |
2403
|
0
|
|
|
|
|
|
my $_size161 = 0; |
|
0
|
|
|
|
|
|
|
2404
|
0
|
|
|
|
|
|
$self->{integerlist} = []; |
2405
|
0
|
|
|
|
|
|
my $_etype164 = 0; |
2406
|
0
|
|
|
|
|
|
$xfer += $input->readListBegin(\$_etype164, \$_size161); |
2407
|
0
|
|
|
|
|
|
for (my $_i165 = 0; $_i165 < $_size161; ++$_i165) |
2408
|
|
|
|
|
|
|
{ |
2409
|
0
|
|
|
|
|
|
my $elem166 = undef; |
2410
|
|
|
|
|
|
|
{ |
2411
|
0
|
|
|
|
|
|
my $_size167 = 0; |
|
0
|
|
|
|
|
|
|
2412
|
0
|
|
|
|
|
|
$elem166 = []; |
2413
|
0
|
|
|
|
|
|
my $_etype170 = 0; |
2414
|
0
|
|
|
|
|
|
$xfer += $input->readListBegin(\$_etype170, \$_size167); |
2415
|
0
|
|
|
|
|
|
for (my $_i171 = 0; $_i171 < $_size167; ++$_i171) |
2416
|
|
|
|
|
|
|
{ |
2417
|
0
|
|
|
|
|
|
my $elem172 = undef; |
2418
|
|
|
|
|
|
|
{ |
2419
|
0
|
|
|
|
|
|
my $_size173 = 0; |
|
0
|
|
|
|
|
|
|
2420
|
0
|
|
|
|
|
|
$elem172 = []; |
2421
|
0
|
|
|
|
|
|
my $_etype176 = 0; |
2422
|
0
|
|
|
|
|
|
$xfer += $input->readListBegin(\$_etype176, \$_size173); |
2423
|
0
|
|
|
|
|
|
for (my $_i177 = 0; $_i177 < $_size173; ++$_i177) |
2424
|
|
|
|
|
|
|
{ |
2425
|
0
|
|
|
|
|
|
my $elem178 = undef; |
2426
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$elem178); |
2427
|
0
|
|
|
|
|
|
push(@{$elem172},$elem178); |
|
0
|
|
|
|
|
|
|
2428
|
|
|
|
|
|
|
} |
2429
|
0
|
|
|
|
|
|
$xfer += $input->readListEnd(); |
2430
|
|
|
|
|
|
|
} |
2431
|
0
|
|
|
|
|
|
push(@{$elem166},$elem172); |
|
0
|
|
|
|
|
|
|
2432
|
|
|
|
|
|
|
} |
2433
|
0
|
|
|
|
|
|
$xfer += $input->readListEnd(); |
2434
|
|
|
|
|
|
|
} |
2435
|
0
|
|
|
|
|
|
push(@{$self->{integerlist}},$elem166); |
|
0
|
|
|
|
|
|
|
2436
|
|
|
|
|
|
|
} |
2437
|
0
|
|
|
|
|
|
$xfer += $input->readListEnd(); |
2438
|
|
|
|
|
|
|
} |
2439
|
|
|
|
|
|
|
} else { |
2440
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2441
|
|
|
|
|
|
|
} |
2442
|
0
|
|
|
|
|
|
last; }; |
2443
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2444
|
|
|
|
|
|
|
} |
2445
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
2446
|
|
|
|
|
|
|
} |
2447
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
2448
|
0
|
|
|
|
|
|
return $xfer; |
2449
|
|
|
|
|
|
|
} |
2450
|
|
|
|
|
|
|
|
2451
|
|
|
|
|
|
|
sub write { |
2452
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
2453
|
0
|
|
|
|
|
|
my $xfer = 0; |
2454
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('NestedListsI32x3'); |
2455
|
0
|
0
|
|
|
|
|
if (defined $self->{integerlist}) { |
2456
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('integerlist', Thrift::TType::LIST, 1); |
2457
|
|
|
|
|
|
|
{ |
2458
|
0
|
|
|
|
|
|
$xfer += $output->writeListBegin(Thrift::TType::LIST, scalar(@{$self->{integerlist}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2459
|
|
|
|
|
|
|
{ |
2460
|
0
|
|
|
|
|
|
foreach my $iter179 (@{$self->{integerlist}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2461
|
|
|
|
|
|
|
{ |
2462
|
|
|
|
|
|
|
{ |
2463
|
0
|
|
|
|
|
|
$xfer += $output->writeListBegin(Thrift::TType::LIST, scalar(@{${iter179}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2464
|
|
|
|
|
|
|
{ |
2465
|
0
|
|
|
|
|
|
foreach my $iter180 (@{${iter179}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2466
|
|
|
|
|
|
|
{ |
2467
|
|
|
|
|
|
|
{ |
2468
|
0
|
|
|
|
|
|
$xfer += $output->writeListBegin(Thrift::TType::I32, scalar(@{${iter180}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2469
|
|
|
|
|
|
|
{ |
2470
|
0
|
|
|
|
|
|
foreach my $iter181 (@{${iter180}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2471
|
|
|
|
|
|
|
{ |
2472
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($iter181); |
2473
|
|
|
|
|
|
|
} |
2474
|
|
|
|
|
|
|
} |
2475
|
0
|
|
|
|
|
|
$xfer += $output->writeListEnd(); |
2476
|
|
|
|
|
|
|
} |
2477
|
|
|
|
|
|
|
} |
2478
|
|
|
|
|
|
|
} |
2479
|
0
|
|
|
|
|
|
$xfer += $output->writeListEnd(); |
2480
|
|
|
|
|
|
|
} |
2481
|
|
|
|
|
|
|
} |
2482
|
|
|
|
|
|
|
} |
2483
|
0
|
|
|
|
|
|
$xfer += $output->writeListEnd(); |
2484
|
|
|
|
|
|
|
} |
2485
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
2486
|
|
|
|
|
|
|
} |
2487
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
2488
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
2489
|
0
|
|
|
|
|
|
return $xfer; |
2490
|
|
|
|
|
|
|
} |
2491
|
|
|
|
|
|
|
|
2492
|
|
|
|
|
|
|
package ThriftTest::NestedMixedx2; |
2493
|
2
|
|
|
2
|
|
13
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
2453
|
|
2494
|
|
|
|
|
|
|
ThriftTest::NestedMixedx2->mk_accessors( qw( int_set_list map_int_strset map_int_strset_list ) ); |
2495
|
|
|
|
|
|
|
|
2496
|
|
|
|
|
|
|
sub new { |
2497
|
0
|
|
|
0
|
|
|
my $classname = shift; |
2498
|
0
|
|
|
|
|
|
my $self = {}; |
2499
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
2500
|
0
|
|
|
|
|
|
$self->{int_set_list} = undef; |
2501
|
0
|
|
|
|
|
|
$self->{map_int_strset} = undef; |
2502
|
0
|
|
|
|
|
|
$self->{map_int_strset_list} = undef; |
2503
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
2504
|
0
|
0
|
|
|
|
|
if (defined $vals->{int_set_list}) { |
2505
|
0
|
|
|
|
|
|
$self->{int_set_list} = $vals->{int_set_list}; |
2506
|
|
|
|
|
|
|
} |
2507
|
0
|
0
|
|
|
|
|
if (defined $vals->{map_int_strset}) { |
2508
|
0
|
|
|
|
|
|
$self->{map_int_strset} = $vals->{map_int_strset}; |
2509
|
|
|
|
|
|
|
} |
2510
|
0
|
0
|
|
|
|
|
if (defined $vals->{map_int_strset_list}) { |
2511
|
0
|
|
|
|
|
|
$self->{map_int_strset_list} = $vals->{map_int_strset_list}; |
2512
|
|
|
|
|
|
|
} |
2513
|
|
|
|
|
|
|
} |
2514
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
2515
|
|
|
|
|
|
|
} |
2516
|
|
|
|
|
|
|
|
2517
|
|
|
|
|
|
|
sub getName { |
2518
|
0
|
|
|
0
|
|
|
return 'NestedMixedx2'; |
2519
|
|
|
|
|
|
|
} |
2520
|
|
|
|
|
|
|
|
2521
|
|
|
|
|
|
|
sub read { |
2522
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
2523
|
0
|
|
|
|
|
|
my $xfer = 0; |
2524
|
0
|
|
|
|
|
|
my $fname; |
2525
|
0
|
|
|
|
|
|
my $ftype = 0; |
2526
|
0
|
|
|
|
|
|
my $fid = 0; |
2527
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
2528
|
0
|
|
|
|
|
|
while (1) |
2529
|
|
|
|
|
|
|
{ |
2530
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
2531
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
2532
|
0
|
|
|
|
|
|
last; |
2533
|
|
|
|
|
|
|
} |
2534
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
2535
|
|
|
|
|
|
|
{ |
2536
|
0
|
0
|
|
|
|
|
/^1$/ && do{ if ($ftype == Thrift::TType::LIST) { |
|
0
|
0
|
|
|
|
|
|
2537
|
|
|
|
|
|
|
{ |
2538
|
0
|
|
|
|
|
|
my $_size182 = 0; |
|
0
|
|
|
|
|
|
|
2539
|
0
|
|
|
|
|
|
$self->{int_set_list} = []; |
2540
|
0
|
|
|
|
|
|
my $_etype185 = 0; |
2541
|
0
|
|
|
|
|
|
$xfer += $input->readListBegin(\$_etype185, \$_size182); |
2542
|
0
|
|
|
|
|
|
for (my $_i186 = 0; $_i186 < $_size182; ++$_i186) |
2543
|
|
|
|
|
|
|
{ |
2544
|
0
|
|
|
|
|
|
my $elem187 = undef; |
2545
|
|
|
|
|
|
|
{ |
2546
|
0
|
|
|
|
|
|
my $_size188 = 0; |
|
0
|
|
|
|
|
|
|
2547
|
0
|
|
|
|
|
|
$elem187 = {}; |
2548
|
0
|
|
|
|
|
|
my $_etype191 = 0; |
2549
|
0
|
|
|
|
|
|
$xfer += $input->readSetBegin(\$_etype191, \$_size188); |
2550
|
0
|
|
|
|
|
|
for (my $_i192 = 0; $_i192 < $_size188; ++$_i192) |
2551
|
|
|
|
|
|
|
{ |
2552
|
0
|
|
|
|
|
|
my $elem193 = undef; |
2553
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$elem193); |
2554
|
0
|
|
|
|
|
|
$elem187->{$elem193} = 1; |
2555
|
|
|
|
|
|
|
} |
2556
|
0
|
|
|
|
|
|
$xfer += $input->readSetEnd(); |
2557
|
|
|
|
|
|
|
} |
2558
|
0
|
|
|
|
|
|
push(@{$self->{int_set_list}},$elem187); |
|
0
|
|
|
|
|
|
|
2559
|
|
|
|
|
|
|
} |
2560
|
0
|
|
|
|
|
|
$xfer += $input->readListEnd(); |
2561
|
|
|
|
|
|
|
} |
2562
|
|
|
|
|
|
|
} else { |
2563
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2564
|
|
|
|
|
|
|
} |
2565
|
0
|
|
|
|
|
|
last; }; |
2566
|
0
|
0
|
|
|
|
|
/^2$/ && do{ if ($ftype == Thrift::TType::MAP) { |
|
0
|
0
|
|
|
|
|
|
2567
|
|
|
|
|
|
|
{ |
2568
|
0
|
|
|
|
|
|
my $_size194 = 0; |
|
0
|
|
|
|
|
|
|
2569
|
0
|
|
|
|
|
|
$self->{map_int_strset} = {}; |
2570
|
0
|
|
|
|
|
|
my $_ktype195 = 0; |
2571
|
0
|
|
|
|
|
|
my $_vtype196 = 0; |
2572
|
0
|
|
|
|
|
|
$xfer += $input->readMapBegin(\$_ktype195, \$_vtype196, \$_size194); |
2573
|
0
|
|
|
|
|
|
for (my $_i198 = 0; $_i198 < $_size194; ++$_i198) |
2574
|
|
|
|
|
|
|
{ |
2575
|
0
|
|
|
|
|
|
my $key199 = 0; |
2576
|
0
|
|
|
|
|
|
my $val200 = []; |
2577
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$key199); |
2578
|
|
|
|
|
|
|
{ |
2579
|
0
|
|
|
|
|
|
my $_size201 = 0; |
|
0
|
|
|
|
|
|
|
2580
|
0
|
|
|
|
|
|
$val200 = {}; |
2581
|
0
|
|
|
|
|
|
my $_etype204 = 0; |
2582
|
0
|
|
|
|
|
|
$xfer += $input->readSetBegin(\$_etype204, \$_size201); |
2583
|
0
|
|
|
|
|
|
for (my $_i205 = 0; $_i205 < $_size201; ++$_i205) |
2584
|
|
|
|
|
|
|
{ |
2585
|
0
|
|
|
|
|
|
my $elem206 = undef; |
2586
|
0
|
|
|
|
|
|
$xfer += $input->readString(\$elem206); |
2587
|
0
|
|
|
|
|
|
$val200->{$elem206} = 1; |
2588
|
|
|
|
|
|
|
} |
2589
|
0
|
|
|
|
|
|
$xfer += $input->readSetEnd(); |
2590
|
|
|
|
|
|
|
} |
2591
|
0
|
|
|
|
|
|
$self->{map_int_strset}->{$key199} = $val200; |
2592
|
|
|
|
|
|
|
} |
2593
|
0
|
|
|
|
|
|
$xfer += $input->readMapEnd(); |
2594
|
|
|
|
|
|
|
} |
2595
|
|
|
|
|
|
|
} else { |
2596
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2597
|
|
|
|
|
|
|
} |
2598
|
0
|
|
|
|
|
|
last; }; |
2599
|
0
|
0
|
|
|
|
|
/^3$/ && do{ if ($ftype == Thrift::TType::LIST) { |
|
0
|
0
|
|
|
|
|
|
2600
|
|
|
|
|
|
|
{ |
2601
|
0
|
|
|
|
|
|
my $_size207 = 0; |
|
0
|
|
|
|
|
|
|
2602
|
0
|
|
|
|
|
|
$self->{map_int_strset_list} = []; |
2603
|
0
|
|
|
|
|
|
my $_etype210 = 0; |
2604
|
0
|
|
|
|
|
|
$xfer += $input->readListBegin(\$_etype210, \$_size207); |
2605
|
0
|
|
|
|
|
|
for (my $_i211 = 0; $_i211 < $_size207; ++$_i211) |
2606
|
|
|
|
|
|
|
{ |
2607
|
0
|
|
|
|
|
|
my $elem212 = undef; |
2608
|
|
|
|
|
|
|
{ |
2609
|
0
|
|
|
|
|
|
my $_size213 = 0; |
|
0
|
|
|
|
|
|
|
2610
|
0
|
|
|
|
|
|
$elem212 = {}; |
2611
|
0
|
|
|
|
|
|
my $_ktype214 = 0; |
2612
|
0
|
|
|
|
|
|
my $_vtype215 = 0; |
2613
|
0
|
|
|
|
|
|
$xfer += $input->readMapBegin(\$_ktype214, \$_vtype215, \$_size213); |
2614
|
0
|
|
|
|
|
|
for (my $_i217 = 0; $_i217 < $_size213; ++$_i217) |
2615
|
|
|
|
|
|
|
{ |
2616
|
0
|
|
|
|
|
|
my $key218 = 0; |
2617
|
0
|
|
|
|
|
|
my $val219 = []; |
2618
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$key218); |
2619
|
|
|
|
|
|
|
{ |
2620
|
0
|
|
|
|
|
|
my $_size220 = 0; |
|
0
|
|
|
|
|
|
|
2621
|
0
|
|
|
|
|
|
$val219 = {}; |
2622
|
0
|
|
|
|
|
|
my $_etype223 = 0; |
2623
|
0
|
|
|
|
|
|
$xfer += $input->readSetBegin(\$_etype223, \$_size220); |
2624
|
0
|
|
|
|
|
|
for (my $_i224 = 0; $_i224 < $_size220; ++$_i224) |
2625
|
|
|
|
|
|
|
{ |
2626
|
0
|
|
|
|
|
|
my $elem225 = undef; |
2627
|
0
|
|
|
|
|
|
$xfer += $input->readString(\$elem225); |
2628
|
0
|
|
|
|
|
|
$val219->{$elem225} = 1; |
2629
|
|
|
|
|
|
|
} |
2630
|
0
|
|
|
|
|
|
$xfer += $input->readSetEnd(); |
2631
|
|
|
|
|
|
|
} |
2632
|
0
|
|
|
|
|
|
$elem212->{$key218} = $val219; |
2633
|
|
|
|
|
|
|
} |
2634
|
0
|
|
|
|
|
|
$xfer += $input->readMapEnd(); |
2635
|
|
|
|
|
|
|
} |
2636
|
0
|
|
|
|
|
|
push(@{$self->{map_int_strset_list}},$elem212); |
|
0
|
|
|
|
|
|
|
2637
|
|
|
|
|
|
|
} |
2638
|
0
|
|
|
|
|
|
$xfer += $input->readListEnd(); |
2639
|
|
|
|
|
|
|
} |
2640
|
|
|
|
|
|
|
} else { |
2641
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2642
|
|
|
|
|
|
|
} |
2643
|
0
|
|
|
|
|
|
last; }; |
2644
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2645
|
|
|
|
|
|
|
} |
2646
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
2647
|
|
|
|
|
|
|
} |
2648
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
2649
|
0
|
|
|
|
|
|
return $xfer; |
2650
|
|
|
|
|
|
|
} |
2651
|
|
|
|
|
|
|
|
2652
|
|
|
|
|
|
|
sub write { |
2653
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
2654
|
0
|
|
|
|
|
|
my $xfer = 0; |
2655
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('NestedMixedx2'); |
2656
|
0
|
0
|
|
|
|
|
if (defined $self->{int_set_list}) { |
2657
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('int_set_list', Thrift::TType::LIST, 1); |
2658
|
|
|
|
|
|
|
{ |
2659
|
0
|
|
|
|
|
|
$xfer += $output->writeListBegin(Thrift::TType::SET, scalar(@{$self->{int_set_list}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2660
|
|
|
|
|
|
|
{ |
2661
|
0
|
|
|
|
|
|
foreach my $iter226 (@{$self->{int_set_list}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2662
|
|
|
|
|
|
|
{ |
2663
|
|
|
|
|
|
|
{ |
2664
|
0
|
|
|
|
|
|
$xfer += $output->writeSetBegin(Thrift::TType::I32, scalar(@{${iter226}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2665
|
|
|
|
|
|
|
{ |
2666
|
0
|
|
|
|
|
|
foreach my $iter227 (@{${iter226}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2667
|
|
|
|
|
|
|
{ |
2668
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($iter227); |
2669
|
|
|
|
|
|
|
} |
2670
|
|
|
|
|
|
|
} |
2671
|
0
|
|
|
|
|
|
$xfer += $output->writeSetEnd(); |
2672
|
|
|
|
|
|
|
} |
2673
|
|
|
|
|
|
|
} |
2674
|
|
|
|
|
|
|
} |
2675
|
0
|
|
|
|
|
|
$xfer += $output->writeListEnd(); |
2676
|
|
|
|
|
|
|
} |
2677
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
2678
|
|
|
|
|
|
|
} |
2679
|
0
|
0
|
|
|
|
|
if (defined $self->{map_int_strset}) { |
2680
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('map_int_strset', Thrift::TType::MAP, 2); |
2681
|
|
|
|
|
|
|
{ |
2682
|
0
|
|
|
|
|
|
$xfer += $output->writeMapBegin(Thrift::TType::I32, Thrift::TType::SET, scalar(keys %{$self->{map_int_strset}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2683
|
|
|
|
|
|
|
{ |
2684
|
0
|
|
|
|
|
|
while( my ($kiter228,$viter229) = each %{$self->{map_int_strset}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2685
|
|
|
|
|
|
|
{ |
2686
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($kiter228); |
2687
|
|
|
|
|
|
|
{ |
2688
|
0
|
|
|
|
|
|
$xfer += $output->writeSetBegin(Thrift::TType::STRING, scalar(@{${viter229}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2689
|
|
|
|
|
|
|
{ |
2690
|
0
|
|
|
|
|
|
foreach my $iter230 (@{${viter229}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2691
|
|
|
|
|
|
|
{ |
2692
|
0
|
|
|
|
|
|
$xfer += $output->writeString($iter230); |
2693
|
|
|
|
|
|
|
} |
2694
|
|
|
|
|
|
|
} |
2695
|
0
|
|
|
|
|
|
$xfer += $output->writeSetEnd(); |
2696
|
|
|
|
|
|
|
} |
2697
|
|
|
|
|
|
|
} |
2698
|
|
|
|
|
|
|
} |
2699
|
0
|
|
|
|
|
|
$xfer += $output->writeMapEnd(); |
2700
|
|
|
|
|
|
|
} |
2701
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
2702
|
|
|
|
|
|
|
} |
2703
|
0
|
0
|
|
|
|
|
if (defined $self->{map_int_strset_list}) { |
2704
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('map_int_strset_list', Thrift::TType::LIST, 3); |
2705
|
|
|
|
|
|
|
{ |
2706
|
0
|
|
|
|
|
|
$xfer += $output->writeListBegin(Thrift::TType::MAP, scalar(@{$self->{map_int_strset_list}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2707
|
|
|
|
|
|
|
{ |
2708
|
0
|
|
|
|
|
|
foreach my $iter231 (@{$self->{map_int_strset_list}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2709
|
|
|
|
|
|
|
{ |
2710
|
|
|
|
|
|
|
{ |
2711
|
0
|
|
|
|
|
|
$xfer += $output->writeMapBegin(Thrift::TType::I32, Thrift::TType::SET, scalar(keys %{${iter231}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2712
|
|
|
|
|
|
|
{ |
2713
|
0
|
|
|
|
|
|
while( my ($kiter232,$viter233) = each %{${iter231}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2714
|
|
|
|
|
|
|
{ |
2715
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($kiter232); |
2716
|
|
|
|
|
|
|
{ |
2717
|
0
|
|
|
|
|
|
$xfer += $output->writeSetBegin(Thrift::TType::STRING, scalar(@{${viter233}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2718
|
|
|
|
|
|
|
{ |
2719
|
0
|
|
|
|
|
|
foreach my $iter234 (@{${viter233}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2720
|
|
|
|
|
|
|
{ |
2721
|
0
|
|
|
|
|
|
$xfer += $output->writeString($iter234); |
2722
|
|
|
|
|
|
|
} |
2723
|
|
|
|
|
|
|
} |
2724
|
0
|
|
|
|
|
|
$xfer += $output->writeSetEnd(); |
2725
|
|
|
|
|
|
|
} |
2726
|
|
|
|
|
|
|
} |
2727
|
|
|
|
|
|
|
} |
2728
|
0
|
|
|
|
|
|
$xfer += $output->writeMapEnd(); |
2729
|
|
|
|
|
|
|
} |
2730
|
|
|
|
|
|
|
} |
2731
|
|
|
|
|
|
|
} |
2732
|
0
|
|
|
|
|
|
$xfer += $output->writeListEnd(); |
2733
|
|
|
|
|
|
|
} |
2734
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
2735
|
|
|
|
|
|
|
} |
2736
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
2737
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
2738
|
0
|
|
|
|
|
|
return $xfer; |
2739
|
|
|
|
|
|
|
} |
2740
|
|
|
|
|
|
|
|
2741
|
|
|
|
|
|
|
package ThriftTest::ListBonks; |
2742
|
2
|
|
|
2
|
|
30
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
1101
|
|
2743
|
|
|
|
|
|
|
ThriftTest::ListBonks->mk_accessors( qw( bonk ) ); |
2744
|
|
|
|
|
|
|
|
2745
|
|
|
|
|
|
|
sub new { |
2746
|
0
|
|
|
0
|
|
|
my $classname = shift; |
2747
|
0
|
|
|
|
|
|
my $self = {}; |
2748
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
2749
|
0
|
|
|
|
|
|
$self->{bonk} = undef; |
2750
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
2751
|
0
|
0
|
|
|
|
|
if (defined $vals->{bonk}) { |
2752
|
0
|
|
|
|
|
|
$self->{bonk} = $vals->{bonk}; |
2753
|
|
|
|
|
|
|
} |
2754
|
|
|
|
|
|
|
} |
2755
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
2756
|
|
|
|
|
|
|
} |
2757
|
|
|
|
|
|
|
|
2758
|
|
|
|
|
|
|
sub getName { |
2759
|
0
|
|
|
0
|
|
|
return 'ListBonks'; |
2760
|
|
|
|
|
|
|
} |
2761
|
|
|
|
|
|
|
|
2762
|
|
|
|
|
|
|
sub read { |
2763
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
2764
|
0
|
|
|
|
|
|
my $xfer = 0; |
2765
|
0
|
|
|
|
|
|
my $fname; |
2766
|
0
|
|
|
|
|
|
my $ftype = 0; |
2767
|
0
|
|
|
|
|
|
my $fid = 0; |
2768
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
2769
|
0
|
|
|
|
|
|
while (1) |
2770
|
|
|
|
|
|
|
{ |
2771
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
2772
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
2773
|
0
|
|
|
|
|
|
last; |
2774
|
|
|
|
|
|
|
} |
2775
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
2776
|
|
|
|
|
|
|
{ |
2777
|
0
|
0
|
|
|
|
|
/^1$/ && do{ if ($ftype == Thrift::TType::LIST) { |
|
0
|
0
|
|
|
|
|
|
2778
|
|
|
|
|
|
|
{ |
2779
|
0
|
|
|
|
|
|
my $_size235 = 0; |
|
0
|
|
|
|
|
|
|
2780
|
0
|
|
|
|
|
|
$self->{bonk} = []; |
2781
|
0
|
|
|
|
|
|
my $_etype238 = 0; |
2782
|
0
|
|
|
|
|
|
$xfer += $input->readListBegin(\$_etype238, \$_size235); |
2783
|
0
|
|
|
|
|
|
for (my $_i239 = 0; $_i239 < $_size235; ++$_i239) |
2784
|
|
|
|
|
|
|
{ |
2785
|
0
|
|
|
|
|
|
my $elem240 = undef; |
2786
|
0
|
|
|
|
|
|
$elem240 = ThriftTest::Bonk->new(); |
2787
|
0
|
|
|
|
|
|
$xfer += $elem240->read($input); |
2788
|
0
|
|
|
|
|
|
push(@{$self->{bonk}},$elem240); |
|
0
|
|
|
|
|
|
|
2789
|
|
|
|
|
|
|
} |
2790
|
0
|
|
|
|
|
|
$xfer += $input->readListEnd(); |
2791
|
|
|
|
|
|
|
} |
2792
|
|
|
|
|
|
|
} else { |
2793
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2794
|
|
|
|
|
|
|
} |
2795
|
0
|
|
|
|
|
|
last; }; |
2796
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2797
|
|
|
|
|
|
|
} |
2798
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
2799
|
|
|
|
|
|
|
} |
2800
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
2801
|
0
|
|
|
|
|
|
return $xfer; |
2802
|
|
|
|
|
|
|
} |
2803
|
|
|
|
|
|
|
|
2804
|
|
|
|
|
|
|
sub write { |
2805
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
2806
|
0
|
|
|
|
|
|
my $xfer = 0; |
2807
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('ListBonks'); |
2808
|
0
|
0
|
|
|
|
|
if (defined $self->{bonk}) { |
2809
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('bonk', Thrift::TType::LIST, 1); |
2810
|
|
|
|
|
|
|
{ |
2811
|
0
|
|
|
|
|
|
$xfer += $output->writeListBegin(Thrift::TType::STRUCT, scalar(@{$self->{bonk}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2812
|
|
|
|
|
|
|
{ |
2813
|
0
|
|
|
|
|
|
foreach my $iter241 (@{$self->{bonk}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2814
|
|
|
|
|
|
|
{ |
2815
|
0
|
|
|
|
|
|
$xfer += ${iter241}->write($output); |
2816
|
|
|
|
|
|
|
} |
2817
|
|
|
|
|
|
|
} |
2818
|
0
|
|
|
|
|
|
$xfer += $output->writeListEnd(); |
2819
|
|
|
|
|
|
|
} |
2820
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
2821
|
|
|
|
|
|
|
} |
2822
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
2823
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
2824
|
0
|
|
|
|
|
|
return $xfer; |
2825
|
|
|
|
|
|
|
} |
2826
|
|
|
|
|
|
|
|
2827
|
|
|
|
|
|
|
package ThriftTest::NestedListsBonk; |
2828
|
2
|
|
|
2
|
|
14
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
1411
|
|
2829
|
|
|
|
|
|
|
ThriftTest::NestedListsBonk->mk_accessors( qw( bonk ) ); |
2830
|
|
|
|
|
|
|
|
2831
|
|
|
|
|
|
|
sub new { |
2832
|
0
|
|
|
0
|
|
|
my $classname = shift; |
2833
|
0
|
|
|
|
|
|
my $self = {}; |
2834
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
2835
|
0
|
|
|
|
|
|
$self->{bonk} = undef; |
2836
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
2837
|
0
|
0
|
|
|
|
|
if (defined $vals->{bonk}) { |
2838
|
0
|
|
|
|
|
|
$self->{bonk} = $vals->{bonk}; |
2839
|
|
|
|
|
|
|
} |
2840
|
|
|
|
|
|
|
} |
2841
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
2842
|
|
|
|
|
|
|
} |
2843
|
|
|
|
|
|
|
|
2844
|
|
|
|
|
|
|
sub getName { |
2845
|
0
|
|
|
0
|
|
|
return 'NestedListsBonk'; |
2846
|
|
|
|
|
|
|
} |
2847
|
|
|
|
|
|
|
|
2848
|
|
|
|
|
|
|
sub read { |
2849
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
2850
|
0
|
|
|
|
|
|
my $xfer = 0; |
2851
|
0
|
|
|
|
|
|
my $fname; |
2852
|
0
|
|
|
|
|
|
my $ftype = 0; |
2853
|
0
|
|
|
|
|
|
my $fid = 0; |
2854
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
2855
|
0
|
|
|
|
|
|
while (1) |
2856
|
|
|
|
|
|
|
{ |
2857
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
2858
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
2859
|
0
|
|
|
|
|
|
last; |
2860
|
|
|
|
|
|
|
} |
2861
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
2862
|
|
|
|
|
|
|
{ |
2863
|
0
|
0
|
|
|
|
|
/^1$/ && do{ if ($ftype == Thrift::TType::LIST) { |
|
0
|
0
|
|
|
|
|
|
2864
|
|
|
|
|
|
|
{ |
2865
|
0
|
|
|
|
|
|
my $_size242 = 0; |
|
0
|
|
|
|
|
|
|
2866
|
0
|
|
|
|
|
|
$self->{bonk} = []; |
2867
|
0
|
|
|
|
|
|
my $_etype245 = 0; |
2868
|
0
|
|
|
|
|
|
$xfer += $input->readListBegin(\$_etype245, \$_size242); |
2869
|
0
|
|
|
|
|
|
for (my $_i246 = 0; $_i246 < $_size242; ++$_i246) |
2870
|
|
|
|
|
|
|
{ |
2871
|
0
|
|
|
|
|
|
my $elem247 = undef; |
2872
|
|
|
|
|
|
|
{ |
2873
|
0
|
|
|
|
|
|
my $_size248 = 0; |
|
0
|
|
|
|
|
|
|
2874
|
0
|
|
|
|
|
|
$elem247 = []; |
2875
|
0
|
|
|
|
|
|
my $_etype251 = 0; |
2876
|
0
|
|
|
|
|
|
$xfer += $input->readListBegin(\$_etype251, \$_size248); |
2877
|
0
|
|
|
|
|
|
for (my $_i252 = 0; $_i252 < $_size248; ++$_i252) |
2878
|
|
|
|
|
|
|
{ |
2879
|
0
|
|
|
|
|
|
my $elem253 = undef; |
2880
|
|
|
|
|
|
|
{ |
2881
|
0
|
|
|
|
|
|
my $_size254 = 0; |
|
0
|
|
|
|
|
|
|
2882
|
0
|
|
|
|
|
|
$elem253 = []; |
2883
|
0
|
|
|
|
|
|
my $_etype257 = 0; |
2884
|
0
|
|
|
|
|
|
$xfer += $input->readListBegin(\$_etype257, \$_size254); |
2885
|
0
|
|
|
|
|
|
for (my $_i258 = 0; $_i258 < $_size254; ++$_i258) |
2886
|
|
|
|
|
|
|
{ |
2887
|
0
|
|
|
|
|
|
my $elem259 = undef; |
2888
|
0
|
|
|
|
|
|
$elem259 = ThriftTest::Bonk->new(); |
2889
|
0
|
|
|
|
|
|
$xfer += $elem259->read($input); |
2890
|
0
|
|
|
|
|
|
push(@{$elem253},$elem259); |
|
0
|
|
|
|
|
|
|
2891
|
|
|
|
|
|
|
} |
2892
|
0
|
|
|
|
|
|
$xfer += $input->readListEnd(); |
2893
|
|
|
|
|
|
|
} |
2894
|
0
|
|
|
|
|
|
push(@{$elem247},$elem253); |
|
0
|
|
|
|
|
|
|
2895
|
|
|
|
|
|
|
} |
2896
|
0
|
|
|
|
|
|
$xfer += $input->readListEnd(); |
2897
|
|
|
|
|
|
|
} |
2898
|
0
|
|
|
|
|
|
push(@{$self->{bonk}},$elem247); |
|
0
|
|
|
|
|
|
|
2899
|
|
|
|
|
|
|
} |
2900
|
0
|
|
|
|
|
|
$xfer += $input->readListEnd(); |
2901
|
|
|
|
|
|
|
} |
2902
|
|
|
|
|
|
|
} else { |
2903
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2904
|
|
|
|
|
|
|
} |
2905
|
0
|
|
|
|
|
|
last; }; |
2906
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2907
|
|
|
|
|
|
|
} |
2908
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
2909
|
|
|
|
|
|
|
} |
2910
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
2911
|
0
|
|
|
|
|
|
return $xfer; |
2912
|
|
|
|
|
|
|
} |
2913
|
|
|
|
|
|
|
|
2914
|
|
|
|
|
|
|
sub write { |
2915
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
2916
|
0
|
|
|
|
|
|
my $xfer = 0; |
2917
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('NestedListsBonk'); |
2918
|
0
|
0
|
|
|
|
|
if (defined $self->{bonk}) { |
2919
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('bonk', Thrift::TType::LIST, 1); |
2920
|
|
|
|
|
|
|
{ |
2921
|
0
|
|
|
|
|
|
$xfer += $output->writeListBegin(Thrift::TType::LIST, scalar(@{$self->{bonk}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2922
|
|
|
|
|
|
|
{ |
2923
|
0
|
|
|
|
|
|
foreach my $iter260 (@{$self->{bonk}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2924
|
|
|
|
|
|
|
{ |
2925
|
|
|
|
|
|
|
{ |
2926
|
0
|
|
|
|
|
|
$xfer += $output->writeListBegin(Thrift::TType::LIST, scalar(@{${iter260}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2927
|
|
|
|
|
|
|
{ |
2928
|
0
|
|
|
|
|
|
foreach my $iter261 (@{${iter260}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2929
|
|
|
|
|
|
|
{ |
2930
|
|
|
|
|
|
|
{ |
2931
|
0
|
|
|
|
|
|
$xfer += $output->writeListBegin(Thrift::TType::STRUCT, scalar(@{${iter261}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2932
|
|
|
|
|
|
|
{ |
2933
|
0
|
|
|
|
|
|
foreach my $iter262 (@{${iter261}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2934
|
|
|
|
|
|
|
{ |
2935
|
0
|
|
|
|
|
|
$xfer += ${iter262}->write($output); |
2936
|
|
|
|
|
|
|
} |
2937
|
|
|
|
|
|
|
} |
2938
|
0
|
|
|
|
|
|
$xfer += $output->writeListEnd(); |
2939
|
|
|
|
|
|
|
} |
2940
|
|
|
|
|
|
|
} |
2941
|
|
|
|
|
|
|
} |
2942
|
0
|
|
|
|
|
|
$xfer += $output->writeListEnd(); |
2943
|
|
|
|
|
|
|
} |
2944
|
|
|
|
|
|
|
} |
2945
|
|
|
|
|
|
|
} |
2946
|
0
|
|
|
|
|
|
$xfer += $output->writeListEnd(); |
2947
|
|
|
|
|
|
|
} |
2948
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
2949
|
|
|
|
|
|
|
} |
2950
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
2951
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
2952
|
0
|
|
|
|
|
|
return $xfer; |
2953
|
|
|
|
|
|
|
} |
2954
|
|
|
|
|
|
|
|
2955
|
|
|
|
|
|
|
package ThriftTest::BoolTest; |
2956
|
2
|
|
|
2
|
|
13
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1064
|
|
2957
|
|
|
|
|
|
|
ThriftTest::BoolTest->mk_accessors( qw( b s ) ); |
2958
|
|
|
|
|
|
|
|
2959
|
|
|
|
|
|
|
sub new { |
2960
|
0
|
|
|
0
|
|
|
my $classname = shift; |
2961
|
0
|
|
|
|
|
|
my $self = {}; |
2962
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
2963
|
0
|
|
|
|
|
|
$self->{b} = 1; |
2964
|
0
|
|
|
|
|
|
$self->{s} = "true"; |
2965
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
2966
|
0
|
0
|
|
|
|
|
if (defined $vals->{b}) { |
2967
|
0
|
|
|
|
|
|
$self->{b} = $vals->{b}; |
2968
|
|
|
|
|
|
|
} |
2969
|
0
|
0
|
|
|
|
|
if (defined $vals->{s}) { |
2970
|
0
|
|
|
|
|
|
$self->{s} = $vals->{s}; |
2971
|
|
|
|
|
|
|
} |
2972
|
|
|
|
|
|
|
} |
2973
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
2974
|
|
|
|
|
|
|
} |
2975
|
|
|
|
|
|
|
|
2976
|
|
|
|
|
|
|
sub getName { |
2977
|
0
|
|
|
0
|
|
|
return 'BoolTest'; |
2978
|
|
|
|
|
|
|
} |
2979
|
|
|
|
|
|
|
|
2980
|
|
|
|
|
|
|
sub read { |
2981
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
2982
|
0
|
|
|
|
|
|
my $xfer = 0; |
2983
|
0
|
|
|
|
|
|
my $fname; |
2984
|
0
|
|
|
|
|
|
my $ftype = 0; |
2985
|
0
|
|
|
|
|
|
my $fid = 0; |
2986
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
2987
|
0
|
|
|
|
|
|
while (1) |
2988
|
|
|
|
|
|
|
{ |
2989
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
2990
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
2991
|
0
|
|
|
|
|
|
last; |
2992
|
|
|
|
|
|
|
} |
2993
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
2994
|
|
|
|
|
|
|
{ |
2995
|
0
|
0
|
|
|
|
|
/^1$/ && do{ if ($ftype == Thrift::TType::BOOL) { |
|
0
|
0
|
|
|
|
|
|
2996
|
0
|
|
|
|
|
|
$xfer += $input->readBool(\$self->{b}); |
2997
|
|
|
|
|
|
|
} else { |
2998
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
2999
|
|
|
|
|
|
|
} |
3000
|
0
|
|
|
|
|
|
last; }; |
3001
|
0
|
0
|
|
|
|
|
/^2$/ && do{ if ($ftype == Thrift::TType::STRING) { |
|
0
|
0
|
|
|
|
|
|
3002
|
0
|
|
|
|
|
|
$xfer += $input->readString(\$self->{s}); |
3003
|
|
|
|
|
|
|
} else { |
3004
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
3005
|
|
|
|
|
|
|
} |
3006
|
0
|
|
|
|
|
|
last; }; |
3007
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
3008
|
|
|
|
|
|
|
} |
3009
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
3010
|
|
|
|
|
|
|
} |
3011
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
3012
|
0
|
|
|
|
|
|
return $xfer; |
3013
|
|
|
|
|
|
|
} |
3014
|
|
|
|
|
|
|
|
3015
|
|
|
|
|
|
|
sub write { |
3016
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
3017
|
0
|
|
|
|
|
|
my $xfer = 0; |
3018
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('BoolTest'); |
3019
|
0
|
0
|
|
|
|
|
if (defined $self->{b}) { |
3020
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('b', Thrift::TType::BOOL, 1); |
3021
|
0
|
|
|
|
|
|
$xfer += $output->writeBool($self->{b}); |
3022
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
3023
|
|
|
|
|
|
|
} |
3024
|
0
|
0
|
|
|
|
|
if (defined $self->{s}) { |
3025
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('s', Thrift::TType::STRING, 2); |
3026
|
0
|
|
|
|
|
|
$xfer += $output->writeString($self->{s}); |
3027
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
3028
|
|
|
|
|
|
|
} |
3029
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
3030
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
3031
|
0
|
|
|
|
|
|
return $xfer; |
3032
|
|
|
|
|
|
|
} |
3033
|
|
|
|
|
|
|
|
3034
|
|
|
|
|
|
|
package ThriftTest::StructA; |
3035
|
2
|
|
|
2
|
|
13
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
908
|
|
3036
|
|
|
|
|
|
|
ThriftTest::StructA->mk_accessors( qw( s ) ); |
3037
|
|
|
|
|
|
|
|
3038
|
|
|
|
|
|
|
sub new { |
3039
|
0
|
|
|
0
|
|
|
my $classname = shift; |
3040
|
0
|
|
|
|
|
|
my $self = {}; |
3041
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
3042
|
0
|
|
|
|
|
|
$self->{s} = undef; |
3043
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
3044
|
0
|
0
|
|
|
|
|
if (defined $vals->{s}) { |
3045
|
0
|
|
|
|
|
|
$self->{s} = $vals->{s}; |
3046
|
|
|
|
|
|
|
} |
3047
|
|
|
|
|
|
|
} |
3048
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
3049
|
|
|
|
|
|
|
} |
3050
|
|
|
|
|
|
|
|
3051
|
|
|
|
|
|
|
sub getName { |
3052
|
0
|
|
|
0
|
|
|
return 'StructA'; |
3053
|
|
|
|
|
|
|
} |
3054
|
|
|
|
|
|
|
|
3055
|
|
|
|
|
|
|
sub read { |
3056
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
3057
|
0
|
|
|
|
|
|
my $xfer = 0; |
3058
|
0
|
|
|
|
|
|
my $fname; |
3059
|
0
|
|
|
|
|
|
my $ftype = 0; |
3060
|
0
|
|
|
|
|
|
my $fid = 0; |
3061
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
3062
|
0
|
|
|
|
|
|
while (1) |
3063
|
|
|
|
|
|
|
{ |
3064
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
3065
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
3066
|
0
|
|
|
|
|
|
last; |
3067
|
|
|
|
|
|
|
} |
3068
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
3069
|
|
|
|
|
|
|
{ |
3070
|
0
|
0
|
|
|
|
|
/^1$/ && do{ if ($ftype == Thrift::TType::STRING) { |
|
0
|
0
|
|
|
|
|
|
3071
|
0
|
|
|
|
|
|
$xfer += $input->readString(\$self->{s}); |
3072
|
|
|
|
|
|
|
} else { |
3073
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
3074
|
|
|
|
|
|
|
} |
3075
|
0
|
|
|
|
|
|
last; }; |
3076
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
3077
|
|
|
|
|
|
|
} |
3078
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
3079
|
|
|
|
|
|
|
} |
3080
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
3081
|
0
|
|
|
|
|
|
return $xfer; |
3082
|
|
|
|
|
|
|
} |
3083
|
|
|
|
|
|
|
|
3084
|
|
|
|
|
|
|
sub write { |
3085
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
3086
|
0
|
|
|
|
|
|
my $xfer = 0; |
3087
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('StructA'); |
3088
|
0
|
0
|
|
|
|
|
if (defined $self->{s}) { |
3089
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('s', Thrift::TType::STRING, 1); |
3090
|
0
|
|
|
|
|
|
$xfer += $output->writeString($self->{s}); |
3091
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
3092
|
|
|
|
|
|
|
} |
3093
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
3094
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
3095
|
0
|
|
|
|
|
|
return $xfer; |
3096
|
|
|
|
|
|
|
} |
3097
|
|
|
|
|
|
|
|
3098
|
|
|
|
|
|
|
package ThriftTest::StructB; |
3099
|
2
|
|
|
2
|
|
14
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
1045
|
|
3100
|
|
|
|
|
|
|
ThriftTest::StructB->mk_accessors( qw( aa ab ) ); |
3101
|
|
|
|
|
|
|
|
3102
|
|
|
|
|
|
|
sub new { |
3103
|
0
|
|
|
0
|
|
|
my $classname = shift; |
3104
|
0
|
|
|
|
|
|
my $self = {}; |
3105
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
3106
|
0
|
|
|
|
|
|
$self->{aa} = undef; |
3107
|
0
|
|
|
|
|
|
$self->{ab} = undef; |
3108
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
3109
|
0
|
0
|
|
|
|
|
if (defined $vals->{aa}) { |
3110
|
0
|
|
|
|
|
|
$self->{aa} = $vals->{aa}; |
3111
|
|
|
|
|
|
|
} |
3112
|
0
|
0
|
|
|
|
|
if (defined $vals->{ab}) { |
3113
|
0
|
|
|
|
|
|
$self->{ab} = $vals->{ab}; |
3114
|
|
|
|
|
|
|
} |
3115
|
|
|
|
|
|
|
} |
3116
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
3117
|
|
|
|
|
|
|
} |
3118
|
|
|
|
|
|
|
|
3119
|
|
|
|
|
|
|
sub getName { |
3120
|
0
|
|
|
0
|
|
|
return 'StructB'; |
3121
|
|
|
|
|
|
|
} |
3122
|
|
|
|
|
|
|
|
3123
|
|
|
|
|
|
|
sub read { |
3124
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
3125
|
0
|
|
|
|
|
|
my $xfer = 0; |
3126
|
0
|
|
|
|
|
|
my $fname; |
3127
|
0
|
|
|
|
|
|
my $ftype = 0; |
3128
|
0
|
|
|
|
|
|
my $fid = 0; |
3129
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
3130
|
0
|
|
|
|
|
|
while (1) |
3131
|
|
|
|
|
|
|
{ |
3132
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
3133
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
3134
|
0
|
|
|
|
|
|
last; |
3135
|
|
|
|
|
|
|
} |
3136
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
3137
|
|
|
|
|
|
|
{ |
3138
|
0
|
0
|
|
|
|
|
/^1$/ && do{ if ($ftype == Thrift::TType::STRUCT) { |
|
0
|
0
|
|
|
|
|
|
3139
|
0
|
|
|
|
|
|
$self->{aa} = ThriftTest::StructA->new(); |
3140
|
0
|
|
|
|
|
|
$xfer += $self->{aa}->read($input); |
3141
|
|
|
|
|
|
|
} else { |
3142
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
3143
|
|
|
|
|
|
|
} |
3144
|
0
|
|
|
|
|
|
last; }; |
3145
|
0
|
0
|
|
|
|
|
/^2$/ && do{ if ($ftype == Thrift::TType::STRUCT) { |
|
0
|
0
|
|
|
|
|
|
3146
|
0
|
|
|
|
|
|
$self->{ab} = ThriftTest::StructA->new(); |
3147
|
0
|
|
|
|
|
|
$xfer += $self->{ab}->read($input); |
3148
|
|
|
|
|
|
|
} else { |
3149
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
3150
|
|
|
|
|
|
|
} |
3151
|
0
|
|
|
|
|
|
last; }; |
3152
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
3153
|
|
|
|
|
|
|
} |
3154
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
3155
|
|
|
|
|
|
|
} |
3156
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
3157
|
0
|
|
|
|
|
|
return $xfer; |
3158
|
|
|
|
|
|
|
} |
3159
|
|
|
|
|
|
|
|
3160
|
|
|
|
|
|
|
sub write { |
3161
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
3162
|
0
|
|
|
|
|
|
my $xfer = 0; |
3163
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('StructB'); |
3164
|
0
|
0
|
|
|
|
|
if (defined $self->{aa}) { |
3165
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('aa', Thrift::TType::STRUCT, 1); |
3166
|
0
|
|
|
|
|
|
$xfer += $self->{aa}->write($output); |
3167
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
3168
|
|
|
|
|
|
|
} |
3169
|
0
|
0
|
|
|
|
|
if (defined $self->{ab}) { |
3170
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('ab', Thrift::TType::STRUCT, 2); |
3171
|
0
|
|
|
|
|
|
$xfer += $self->{ab}->write($output); |
3172
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
3173
|
|
|
|
|
|
|
} |
3174
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
3175
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
3176
|
0
|
|
|
|
|
|
return $xfer; |
3177
|
|
|
|
|
|
|
} |
3178
|
|
|
|
|
|
|
|
3179
|
|
|
|
|
|
|
package ThriftTest::OptionalSetDefaultTest; |
3180
|
2
|
|
|
2
|
|
13
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
980
|
|
3181
|
|
|
|
|
|
|
ThriftTest::OptionalSetDefaultTest->mk_accessors( qw( with_default ) ); |
3182
|
|
|
|
|
|
|
|
3183
|
|
|
|
|
|
|
sub new { |
3184
|
0
|
|
|
0
|
|
|
my $classname = shift; |
3185
|
0
|
|
|
|
|
|
my $self = {}; |
3186
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
3187
|
|
|
|
|
|
|
$self->{with_default} = [ |
3188
|
0
|
|
|
|
|
|
"test" => 1, |
3189
|
|
|
|
|
|
|
]; |
3190
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
3191
|
0
|
0
|
|
|
|
|
if (defined $vals->{with_default}) { |
3192
|
0
|
|
|
|
|
|
$self->{with_default} = $vals->{with_default}; |
3193
|
|
|
|
|
|
|
} |
3194
|
|
|
|
|
|
|
} |
3195
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
3196
|
|
|
|
|
|
|
} |
3197
|
|
|
|
|
|
|
|
3198
|
|
|
|
|
|
|
sub getName { |
3199
|
0
|
|
|
0
|
|
|
return 'OptionalSetDefaultTest'; |
3200
|
|
|
|
|
|
|
} |
3201
|
|
|
|
|
|
|
|
3202
|
|
|
|
|
|
|
sub read { |
3203
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
3204
|
0
|
|
|
|
|
|
my $xfer = 0; |
3205
|
0
|
|
|
|
|
|
my $fname; |
3206
|
0
|
|
|
|
|
|
my $ftype = 0; |
3207
|
0
|
|
|
|
|
|
my $fid = 0; |
3208
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
3209
|
0
|
|
|
|
|
|
while (1) |
3210
|
|
|
|
|
|
|
{ |
3211
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
3212
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
3213
|
0
|
|
|
|
|
|
last; |
3214
|
|
|
|
|
|
|
} |
3215
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
3216
|
|
|
|
|
|
|
{ |
3217
|
0
|
0
|
|
|
|
|
/^1$/ && do{ if ($ftype == Thrift::TType::SET) { |
|
0
|
0
|
|
|
|
|
|
3218
|
|
|
|
|
|
|
{ |
3219
|
0
|
|
|
|
|
|
my $_size263 = 0; |
|
0
|
|
|
|
|
|
|
3220
|
0
|
|
|
|
|
|
$self->{with_default} = {}; |
3221
|
0
|
|
|
|
|
|
my $_etype266 = 0; |
3222
|
0
|
|
|
|
|
|
$xfer += $input->readSetBegin(\$_etype266, \$_size263); |
3223
|
0
|
|
|
|
|
|
for (my $_i267 = 0; $_i267 < $_size263; ++$_i267) |
3224
|
|
|
|
|
|
|
{ |
3225
|
0
|
|
|
|
|
|
my $elem268 = undef; |
3226
|
0
|
|
|
|
|
|
$xfer += $input->readString(\$elem268); |
3227
|
0
|
|
|
|
|
|
$self->{with_default}->{$elem268} = 1; |
3228
|
|
|
|
|
|
|
} |
3229
|
0
|
|
|
|
|
|
$xfer += $input->readSetEnd(); |
3230
|
|
|
|
|
|
|
} |
3231
|
|
|
|
|
|
|
} else { |
3232
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
3233
|
|
|
|
|
|
|
} |
3234
|
0
|
|
|
|
|
|
last; }; |
3235
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
3236
|
|
|
|
|
|
|
} |
3237
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
3238
|
|
|
|
|
|
|
} |
3239
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
3240
|
0
|
|
|
|
|
|
return $xfer; |
3241
|
|
|
|
|
|
|
} |
3242
|
|
|
|
|
|
|
|
3243
|
|
|
|
|
|
|
sub write { |
3244
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
3245
|
0
|
|
|
|
|
|
my $xfer = 0; |
3246
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('OptionalSetDefaultTest'); |
3247
|
0
|
0
|
|
|
|
|
if (defined $self->{with_default}) { |
3248
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('with_default', Thrift::TType::SET, 1); |
3249
|
|
|
|
|
|
|
{ |
3250
|
0
|
|
|
|
|
|
$xfer += $output->writeSetBegin(Thrift::TType::STRING, scalar(@{$self->{with_default}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3251
|
|
|
|
|
|
|
{ |
3252
|
0
|
|
|
|
|
|
foreach my $iter269 (@{$self->{with_default}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3253
|
|
|
|
|
|
|
{ |
3254
|
0
|
|
|
|
|
|
$xfer += $output->writeString($iter269); |
3255
|
|
|
|
|
|
|
} |
3256
|
|
|
|
|
|
|
} |
3257
|
0
|
|
|
|
|
|
$xfer += $output->writeSetEnd(); |
3258
|
|
|
|
|
|
|
} |
3259
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
3260
|
|
|
|
|
|
|
} |
3261
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
3262
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
3263
|
0
|
|
|
|
|
|
return $xfer; |
3264
|
|
|
|
|
|
|
} |
3265
|
|
|
|
|
|
|
|
3266
|
|
|
|
|
|
|
package ThriftTest::OptionalBinary; |
3267
|
2
|
|
|
2
|
|
23
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
1506
|
|
3268
|
|
|
|
|
|
|
ThriftTest::OptionalBinary->mk_accessors( qw( bin_set bin_map ) ); |
3269
|
|
|
|
|
|
|
|
3270
|
|
|
|
|
|
|
sub new { |
3271
|
0
|
|
|
0
|
|
|
my $classname = shift; |
3272
|
0
|
|
|
|
|
|
my $self = {}; |
3273
|
0
|
|
0
|
|
|
|
my $vals = shift || {}; |
3274
|
|
|
|
|
|
|
$self->{bin_set} = [ |
3275
|
0
|
|
|
|
|
|
]; |
3276
|
|
|
|
|
|
|
$self->{bin_map} = { |
3277
|
0
|
|
|
|
|
|
}; |
3278
|
0
|
0
|
|
|
|
|
if (UNIVERSAL::isa($vals,'HASH')) { |
3279
|
0
|
0
|
|
|
|
|
if (defined $vals->{bin_set}) { |
3280
|
0
|
|
|
|
|
|
$self->{bin_set} = $vals->{bin_set}; |
3281
|
|
|
|
|
|
|
} |
3282
|
0
|
0
|
|
|
|
|
if (defined $vals->{bin_map}) { |
3283
|
0
|
|
|
|
|
|
$self->{bin_map} = $vals->{bin_map}; |
3284
|
|
|
|
|
|
|
} |
3285
|
|
|
|
|
|
|
} |
3286
|
0
|
|
|
|
|
|
return bless ($self, $classname); |
3287
|
|
|
|
|
|
|
} |
3288
|
|
|
|
|
|
|
|
3289
|
|
|
|
|
|
|
sub getName { |
3290
|
0
|
|
|
0
|
|
|
return 'OptionalBinary'; |
3291
|
|
|
|
|
|
|
} |
3292
|
|
|
|
|
|
|
|
3293
|
|
|
|
|
|
|
sub read { |
3294
|
0
|
|
|
0
|
|
|
my ($self, $input) = @_; |
3295
|
0
|
|
|
|
|
|
my $xfer = 0; |
3296
|
0
|
|
|
|
|
|
my $fname; |
3297
|
0
|
|
|
|
|
|
my $ftype = 0; |
3298
|
0
|
|
|
|
|
|
my $fid = 0; |
3299
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
3300
|
0
|
|
|
|
|
|
while (1) |
3301
|
|
|
|
|
|
|
{ |
3302
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
3303
|
0
|
0
|
|
|
|
|
if ($ftype == Thrift::TType::STOP) { |
3304
|
0
|
|
|
|
|
|
last; |
3305
|
|
|
|
|
|
|
} |
3306
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
3307
|
|
|
|
|
|
|
{ |
3308
|
0
|
0
|
|
|
|
|
/^1$/ && do{ if ($ftype == Thrift::TType::SET) { |
|
0
|
0
|
|
|
|
|
|
3309
|
|
|
|
|
|
|
{ |
3310
|
0
|
|
|
|
|
|
my $_size270 = 0; |
|
0
|
|
|
|
|
|
|
3311
|
0
|
|
|
|
|
|
$self->{bin_set} = {}; |
3312
|
0
|
|
|
|
|
|
my $_etype273 = 0; |
3313
|
0
|
|
|
|
|
|
$xfer += $input->readSetBegin(\$_etype273, \$_size270); |
3314
|
0
|
|
|
|
|
|
for (my $_i274 = 0; $_i274 < $_size270; ++$_i274) |
3315
|
|
|
|
|
|
|
{ |
3316
|
0
|
|
|
|
|
|
my $elem275 = undef; |
3317
|
0
|
|
|
|
|
|
$xfer += $input->readString(\$elem275); |
3318
|
0
|
|
|
|
|
|
$self->{bin_set}->{$elem275} = 1; |
3319
|
|
|
|
|
|
|
} |
3320
|
0
|
|
|
|
|
|
$xfer += $input->readSetEnd(); |
3321
|
|
|
|
|
|
|
} |
3322
|
|
|
|
|
|
|
} else { |
3323
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
3324
|
|
|
|
|
|
|
} |
3325
|
0
|
|
|
|
|
|
last; }; |
3326
|
0
|
0
|
|
|
|
|
/^2$/ && do{ if ($ftype == Thrift::TType::MAP) { |
|
0
|
0
|
|
|
|
|
|
3327
|
|
|
|
|
|
|
{ |
3328
|
0
|
|
|
|
|
|
my $_size276 = 0; |
|
0
|
|
|
|
|
|
|
3329
|
0
|
|
|
|
|
|
$self->{bin_map} = {}; |
3330
|
0
|
|
|
|
|
|
my $_ktype277 = 0; |
3331
|
0
|
|
|
|
|
|
my $_vtype278 = 0; |
3332
|
0
|
|
|
|
|
|
$xfer += $input->readMapBegin(\$_ktype277, \$_vtype278, \$_size276); |
3333
|
0
|
|
|
|
|
|
for (my $_i280 = 0; $_i280 < $_size276; ++$_i280) |
3334
|
|
|
|
|
|
|
{ |
3335
|
0
|
|
|
|
|
|
my $key281 = ''; |
3336
|
0
|
|
|
|
|
|
my $val282 = 0; |
3337
|
0
|
|
|
|
|
|
$xfer += $input->readString(\$key281); |
3338
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$val282); |
3339
|
0
|
|
|
|
|
|
$self->{bin_map}->{$key281} = $val282; |
3340
|
|
|
|
|
|
|
} |
3341
|
0
|
|
|
|
|
|
$xfer += $input->readMapEnd(); |
3342
|
|
|
|
|
|
|
} |
3343
|
|
|
|
|
|
|
} else { |
3344
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
3345
|
|
|
|
|
|
|
} |
3346
|
0
|
|
|
|
|
|
last; }; |
3347
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
3348
|
|
|
|
|
|
|
} |
3349
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
3350
|
|
|
|
|
|
|
} |
3351
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
3352
|
0
|
|
|
|
|
|
return $xfer; |
3353
|
|
|
|
|
|
|
} |
3354
|
|
|
|
|
|
|
|
3355
|
|
|
|
|
|
|
sub write { |
3356
|
0
|
|
|
0
|
|
|
my ($self, $output) = @_; |
3357
|
0
|
|
|
|
|
|
my $xfer = 0; |
3358
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('OptionalBinary'); |
3359
|
0
|
0
|
|
|
|
|
if (defined $self->{bin_set}) { |
3360
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('bin_set', Thrift::TType::SET, 1); |
3361
|
|
|
|
|
|
|
{ |
3362
|
0
|
|
|
|
|
|
$xfer += $output->writeSetBegin(Thrift::TType::STRING, scalar(@{$self->{bin_set}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3363
|
|
|
|
|
|
|
{ |
3364
|
0
|
|
|
|
|
|
foreach my $iter283 (@{$self->{bin_set}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3365
|
|
|
|
|
|
|
{ |
3366
|
0
|
|
|
|
|
|
$xfer += $output->writeString($iter283); |
3367
|
|
|
|
|
|
|
} |
3368
|
|
|
|
|
|
|
} |
3369
|
0
|
|
|
|
|
|
$xfer += $output->writeSetEnd(); |
3370
|
|
|
|
|
|
|
} |
3371
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
3372
|
|
|
|
|
|
|
} |
3373
|
0
|
0
|
|
|
|
|
if (defined $self->{bin_map}) { |
3374
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('bin_map', Thrift::TType::MAP, 2); |
3375
|
|
|
|
|
|
|
{ |
3376
|
0
|
|
|
|
|
|
$xfer += $output->writeMapBegin(Thrift::TType::STRING, Thrift::TType::I32, scalar(keys %{$self->{bin_map}})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3377
|
|
|
|
|
|
|
{ |
3378
|
0
|
|
|
|
|
|
while( my ($kiter284,$viter285) = each %{$self->{bin_map}}) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3379
|
|
|
|
|
|
|
{ |
3380
|
0
|
|
|
|
|
|
$xfer += $output->writeString($kiter284); |
3381
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($viter285); |
3382
|
|
|
|
|
|
|
} |
3383
|
|
|
|
|
|
|
} |
3384
|
0
|
|
|
|
|
|
$xfer += $output->writeMapEnd(); |
3385
|
|
|
|
|
|
|
} |
3386
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
3387
|
|
|
|
|
|
|
} |
3388
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
3389
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
3390
|
0
|
|
|
|
|
|
return $xfer; |
3391
|
|
|
|
|
|
|
} |
3392
|
|
|
|
|
|
|
|
3393
|
|
|
|
|
|
|
1; |