| 1 | # | ||
| 2 | # Licensed to the Apache Software Foundation (ASF) under one | ||
| 3 | # or more contributor license agreements. See the NOTICE file | ||
| 4 | # distributed with this work for additional information | ||
| 5 | # regarding copyright ownership. The ASF licenses this file | ||
| 6 | # to you under the Apache License, Version 2.0 (the | ||
| 7 | # "License"); you may not use this file except in compliance | ||
| 8 | # with the License. You may obtain a copy of the License at | ||
| 9 | # | ||
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | # | ||
| 12 | # Unless required by applicable law or agreed to in writing, | ||
| 13 | # software distributed under the License is distributed on an | ||
| 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| 15 | # KIND, either express or implied. See the License for the | ||
| 16 | # specific language governing permissions and limitations | ||
| 17 | # under the License. | ||
| 18 | # | ||
| 19 | |||
| 20 | 1 | ▶ | use 5.10.0; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 21 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 22 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 23 | |||
| 24 | 1 | ▶ | use Thrift; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 25 | 1 | ▶ | use Thrift::Protocol; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 26 | |||
| 27 | package Thrift::ProtocolDecorator; | ||
| 28 | 1 | ▶ | use base qw(Thrift::Protocol); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 29 | 1 | ▶ | use version 0.77; our $VERSION = version->declare("$Thrift::VERSION"); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 30 | |||
| 31 | 13 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 32 | 13 | my $classname = shift; | |
| 33 | 13 | my $protocol = shift; | |
| 34 | 13 | my $self = $classname->SUPER::new($protocol->getTransport()); | |
| 35 | |||
| 36 | 13 | $self->{concreteProtocol} = $protocol; | |
| 37 | |||
| 38 | 13 | return bless($self,$classname); | |
| 39 | } | ||
| 40 | |||
| 41 | # | ||
| 42 | # Writes the message header | ||
| 43 | # | ||
| 44 | # @param string $name Function name | ||
| 45 | # @param int $type message type TMessageType::CALL or TMessageType::REPLY | ||
| 46 | # @param int $seqid The sequence id of this message | ||
| 47 | # | ||
| 48 | 11 | ▶ | sub writeMessageBegin { |
|
Subroutine
writeMessageBegin: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 49 | 11 | my $self = shift; | |
| 50 | 11 | my ($name, $type, $seqid) = @_; | |
| 51 | |||
| 52 | 11 | return $self->{concreteProtocol}->writeMessageBegin($name, $type, $seqid); | |
| 53 | } | ||
| 54 | |||
| 55 | # | ||
| 56 | # Close the message | ||
| 57 | # | ||
| 58 | 11 | ▶ | sub writeMessageEnd { |
|
Subroutine
writeMessageEnd: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 59 | 11 | my $self = shift; | |
| 60 | |||
| 61 | 11 | return $self->{concreteProtocol}->writeMessageEnd(); | |
| 62 | } | ||
| 63 | |||
| 64 | # | ||
| 65 | # Writes a struct header. | ||
| 66 | # | ||
| 67 | # @param string $name Struct name | ||
| 68 | # @throws TException on write error | ||
| 69 | # @return int How many bytes written | ||
| 70 | # | ||
| 71 | 11 | ▶ | sub writeStructBegin { |
|
Subroutine
writeStructBegin: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 72 | 11 | my $self = shift; | |
| 73 | 11 | my ($name) = @_; | |
| 74 | |||
| 75 | 11 | return $self->{concreteProtocol}->writeStructBegin($name); | |
| 76 | } | ||
| 77 | |||
| 78 | # | ||
| 79 | # Close a struct. | ||
| 80 | # | ||
| 81 | # @throws TException on write error | ||
| 82 | # @return int How many bytes written | ||
| 83 | # | ||
| 84 | 11 | ▶ | sub writeStructEnd { |
|
Subroutine
writeStructEnd: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 85 | 11 | my $self = shift; | |
| 86 | |||
| 87 | 11 | return $self->{concreteProtocol}->writeStructEnd(); | |
| 88 | } | ||
| 89 | |||
| 90 | # | ||
| 91 | # Starts a field. | ||
| 92 | # | ||
| 93 | # @param string $name Field name | ||
| 94 | # @param int $type Field type | ||
| 95 | # @param int $fid Field id | ||
| 96 | # @throws TException on write error | ||
| 97 | # @return int How many bytes written | ||
| 98 | # | ||
| 99 | 10 | ▶ | sub writeFieldBegin { |
|
Subroutine
writeFieldBegin: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 100 | 10 | my $self = shift; | |
| 101 | 10 | my ($fieldName, $fieldType, $fieldId) = @_; | |
| 102 | |||
| 103 | 10 | return $self->{concreteProtocol}->writeFieldBegin($fieldName, $fieldType, $fieldId); | |
| 104 | } | ||
| 105 | |||
| 106 | 10 | ▶ | sub writeFieldEnd { |
|
Subroutine
writeFieldEnd: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 107 | 10 | my $self = shift; | |
| 108 | |||
| 109 | 10 | return $self->{concreteProtocol}->writeFieldEnd(); | |
| 110 | } | ||
| 111 | |||
| 112 | 11 | ▶ | sub writeFieldStop { |
|
Subroutine
writeFieldStop: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 113 | 11 | my $self = shift; | |
| 114 | |||
| 115 | 11 | return $self->{concreteProtocol}->writeFieldStop(); | |
| 116 | } | ||
| 117 | |||
| 118 | 0 | ▶ | sub writeMapBegin { |
|
Subroutine
writeMapBegin: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 119 | 0 | my $self = shift; | |
| 120 | 0 | my ($keyType, $valType, $size) = @_; | |
| 121 | |||
| 122 | 0 | return $self->{concreteProtocol}->writeMapBegin($keyType, $valType, $size); | |
| 123 | } | ||
| 124 | |||
| 125 | 0 | ▶ | sub writeMapEnd { |
|
Subroutine
writeMapEnd: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 126 | 0 | my $self = shift; | |
| 127 | |||
| 128 | 0 | return $self->{concreteProtocol}->writeMapEnd(); | |
| 129 | } | ||
| 130 | |||
| 131 | 0 | ▶ | sub writeListBegin { |
|
Subroutine
writeListBegin: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 132 | 0 | my $self = shift; | |
| 133 | 0 | my ($elemType, $size) = @_; | |
| 134 | |||
| 135 | 0 | return $self->{concreteProtocol}->writeListBegin($elemType, $size); | |
| 136 | } | ||
| 137 | |||
| 138 | 0 | ▶ | sub writeListEnd { |
|
Subroutine
writeListEnd: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 139 | 0 | my $self = shift; | |
| 140 | |||
| 141 | 0 | return $self->{concreteProtocol}->writeListEnd(); | |
| 142 | } | ||
| 143 | |||
| 144 | 0 | ▶ | sub writeSetBegin { |
|
Subroutine
writeSetBegin: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 145 | 0 | my $self = shift; | |
| 146 | 0 | my ($elemType, $size) = @_; | |
| 147 | |||
| 148 | 0 | return $self->{concreteProtocol}->writeSetBegin($elemType, $size); | |
| 149 | } | ||
| 150 | |||
| 151 | 0 | ▶ | sub writeSetEnd { |
|
Subroutine
writeSetEnd: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 152 | 0 | my $self = shift; | |
| 153 | |||
| 154 | 0 | return $self->{concreteProtocol}->writeListEnd(); | |
| 155 | } | ||
| 156 | |||
| 157 | 0 | ▶ | sub writeBool { |
|
Subroutine
writeBool: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 158 | 0 | my $self = shift; | |
| 159 | 0 | my $bool = shift; | |
| 160 | |||
| 161 | 0 | return $self->{concreteProtocol}->writeBool($bool); | |
| 162 | } | ||
| 163 | |||
| 164 | 5 | ▶ | sub writeByte { |
|
Subroutine
writeByte: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 165 | 5 | my $self = shift; | |
| 166 | 5 | my $byte = shift; | |
| 167 | |||
| 168 | 5 | return $self->{concreteProtocol}->writeByte($byte); | |
| 169 | } | ||
| 170 | |||
| 171 | 0 | ▶ | sub writeI16 { |
|
Subroutine
writeI16: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 172 | 0 | my $self = shift; | |
| 173 | 0 | my $i16 = shift; | |
| 174 | |||
| 175 | 0 | return $self->{concreteProtocol}->writeI16($i16); | |
| 176 | } | ||
| 177 | |||
| 178 | 5 | ▶ | sub writeI32 { |
|
Subroutine
writeI32: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 179 | 5 | my $self = shift; | |
| 180 | 5 | my ($i32) = @_; | |
| 181 | |||
| 182 | 5 | return $self->{concreteProtocol}->writeI32($i32); | |
| 183 | |||
| 184 | } | ||
| 185 | |||
| 186 | 0 | ▶ | sub writeI64 { |
|
Subroutine
writeI64: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 187 | 0 | my $self = shift; | |
| 188 | 0 | my $i64 = shift; | |
| 189 | |||
| 190 | 0 | return $self->{concreteProtocol}->writeI64($i64); | |
| 191 | } | ||
| 192 | |||
| 193 | 0 | ▶ | sub writeDouble { |
|
Subroutine
writeDouble: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 194 | 0 | my $self = shift; | |
| 195 | 0 | my $dub = shift; | |
| 196 | |||
| 197 | 0 | return $self->{concreteProtocol}->writeDouble($dub); | |
| 198 | } | ||
| 199 | |||
| 200 | 0 | ▶ | sub writeString { |
|
Subroutine
writeString: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 201 | 0 | my $self = shift; | |
| 202 | 0 | my $str = shift; | |
| 203 | |||
| 204 | 0 | return $self->{concreteProtocol}->writeString($str); | |
| 205 | } | ||
| 206 | |||
| 207 | # | ||
| 208 | # Reads the message header | ||
| 209 | # | ||
| 210 | # @param string $name Function name | ||
| 211 | # @param int $type message type TMessageType::CALL or TMessageType::REPLY | ||
| 212 | # @parem int $seqid The sequence id of this message | ||
| 213 | # | ||
| 214 | sub readMessageBegin | ||
| 215 | 11 | ▶ | { |
|
Subroutine
readMessageBegin: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 216 | 11 | my $self = shift; | |
| 217 | 11 | my ($name, $type, $seqid) = @_; | |
| 218 | |||
| 219 | 11 | return $self->{concreteProtocol}->readMessageBegin($name, $type, $seqid); | |
| 220 | } | ||
| 221 | |||
| 222 | # | ||
| 223 | # Read the close of message | ||
| 224 | # | ||
| 225 | sub readMessageEnd | ||
| 226 | 22 | ▶ | { |
|
Subroutine
readMessageEnd: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 227 | 22 | my $self = shift; | |
| 228 | |||
| 229 | 22 | return $self->{concreteProtocol}->readMessageEnd(); | |
| 230 | } | ||
| 231 | |||
| 232 | sub readStructBegin | ||
| 233 | 22 | ▶ | { |
|
Subroutine
readStructBegin: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 234 | 22 | my $self = shift; | |
| 235 | 22 | my $name = shift; | |
| 236 | |||
| 237 | 22 | return $self->{concreteProtocol}->readStructBegin($name); | |
| 238 | } | ||
| 239 | |||
| 240 | sub readStructEnd | ||
| 241 | 22 | ▶ | { |
|
Subroutine
readStructEnd: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 242 | 22 | my $self = shift; | |
| 243 | |||
| 244 | 22 | return $self->{concreteProtocol}->readStructEnd(); | |
| 245 | } | ||
| 246 | |||
| 247 | sub readFieldBegin | ||
| 248 | 38 | ▶ | { |
|
Subroutine
readFieldBegin: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 249 | 38 | my $self = shift; | |
| 250 | 38 | my ($name, $fieldType, $fieldId) = @_; | |
| 251 | |||
| 252 | 38 | return $self->{concreteProtocol}->readFieldBegin($name, $fieldType, $fieldId); | |
| 253 | } | ||
| 254 | |||
| 255 | sub readFieldEnd | ||
| 256 | 16 | ▶ | { |
|
Subroutine
readFieldEnd: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 257 | 16 | my $self = shift; | |
| 258 | |||
| 259 | 16 | return $self->{concreteProtocol}->readFieldEnd(); | |
| 260 | } | ||
| 261 | |||
| 262 | sub readMapBegin | ||
| 263 | 0 | ▶ | { |
|
Subroutine
readMapBegin: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 264 | 0 | my $self = shift; | |
| 265 | 0 | my ($keyType, $valType, $size) = @_; | |
| 266 | |||
| 267 | 0 | return $self->{concreteProtocol}->readMapBegin($keyType, $valType, $size); | |
| 268 | } | ||
| 269 | |||
| 270 | sub readMapEnd | ||
| 271 | 0 | ▶ | { |
|
Subroutine
readMapEnd: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 272 | 0 | my $self = shift; | |
| 273 | |||
| 274 | 0 | return $self->{concreteProtocol}->readMapEnd(); | |
| 275 | } | ||
| 276 | |||
| 277 | sub readListBegin | ||
| 278 | 1 | ▶ | { |
|
Subroutine
readListBegin: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 279 | 1 | my $self = shift; | |
| 280 | 1 | my ($elemType, $size) = @_; | |
| 281 | |||
| 282 | 1 | return $self->{concreteProtocol}->readListBegin($elemType, $size); | |
| 283 | } | ||
| 284 | |||
| 285 | sub readListEnd | ||
| 286 | 1 | ▶ | { |
|
Subroutine
readListEnd: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 287 | 1 | my $self = shift; | |
| 288 | |||
| 289 | 1 | return $self->{concreteProtocol}->readListEnd(); | |
| 290 | } | ||
| 291 | |||
| 292 | sub readSetBegin | ||
| 293 | 0 | ▶ | { |
|
Subroutine
readSetBegin: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 294 | 0 | my $self = shift; | |
| 295 | 0 | my ($elemType, $size) = @_; | |
| 296 | |||
| 297 | 0 | return $self->{concreteProtocol}->readSetBegin($elemType, $size); | |
| 298 | } | ||
| 299 | |||
| 300 | sub readSetEnd | ||
| 301 | 0 | ▶ | { |
|
Subroutine
readSetEnd: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 302 | 0 | my $self = shift; | |
| 303 | |||
| 304 | 0 | return $self->{concreteProtocol}->readSetEnd(); | |
| 305 | } | ||
| 306 | |||
| 307 | sub readBool | ||
| 308 | 0 | ▶ | { |
|
Subroutine
readBool: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 309 | 0 | my $self = shift; | |
| 310 | 0 | my $bool = shift; | |
| 311 | |||
| 312 | 0 | return $self->{concreteProtocol}->readBool($bool); | |
| 313 | } | ||
| 314 | |||
| 315 | sub readByte | ||
| 316 | 5 | ▶ | { |
|
Subroutine
readByte: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 317 | 5 | my $self = shift; | |
| 318 | 5 | my $byte = shift; | |
| 319 | |||
| 320 | 5 | return $self->{concreteProtocol}->readByte($byte); | |
| 321 | } | ||
| 322 | |||
| 323 | sub readI16 | ||
| 324 | 0 | ▶ | { |
|
Subroutine
readI16: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 325 | 0 | my $self = shift; | |
| 326 | 0 | my $i16 = shift; | |
| 327 | |||
| 328 | 0 | return $self->{concreteProtocol}->readI16($i16); | |
| 329 | } | ||
| 330 | |||
| 331 | sub readI32 | ||
| 332 | 15 | ▶ | { |
|
Subroutine
readI32: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 333 | 15 | my $self = shift; | |
| 334 | 15 | my $i32 = shift; | |
| 335 | |||
| 336 | 15 | return $self->{concreteProtocol}->readI32($i32); | |
| 337 | } | ||
| 338 | |||
| 339 | sub readI64 | ||
| 340 | 0 | ▶ | { |
|
Subroutine
readI64: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 341 | 0 | my $self = shift; | |
| 342 | 0 | my $i64 = shift; | |
| 343 | |||
| 344 | 0 | return $self->{concreteProtocol}->readI64($i64); | |
| 345 | } | ||
| 346 | |||
| 347 | sub readDouble | ||
| 348 | 0 | ▶ | { |
|
Subroutine
readDouble: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 349 | 0 | my $self = shift; | |
| 350 | 0 | my $dub = shift; | |
| 351 | |||
| 352 | 0 | return $self->{concreteProtocol}->readDouble($dub); | |
| 353 | } | ||
| 354 | |||
| 355 | sub readString | ||
| 356 | 0 | ▶ | { |
|
Subroutine
readString: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 357 | 0 | my $self = shift; | |
| 358 | 0 | my $str = shift; | |
| 359 | |||
| 360 | 0 | return $self->{concreteProtocol}->readString($str); | |
| 361 | } | ||
| 362 | |||
| 363 | 1 | 1; | |