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 19module Thrift 20 module ProtocolDecorator 21 22 def initialize(protocol) 23 @protocol = protocol 24 end 25 26 def trans 27 @protocol.trans 28 end 29 30 def write_message_begin(name, type, seqid) 31 @protocol.write_message_begin 32 end 33 34 def write_message_end 35 @protocol.write_message_end 36 end 37 38 def write_struct_begin(name) 39 @protocol.write_struct_begin(name) 40 end 41 42 def write_struct_end 43 @protocol.write_struct_end 44 end 45 46 def write_field_begin(name, type, id) 47 @protocol.write_field_begin(name, type, id) 48 end 49 50 def write_field_end 51 @protocol.write_field_end 52 end 53 54 def write_field_stop 55 @protocol.write_field_stop 56 end 57 58 def write_map_begin(ktype, vtype, size) 59 @protocol.write_map_begin(ktype, vtype, size) 60 end 61 62 def write_map_end 63 @protocol.write_map_end 64 end 65 66 def write_list_begin(etype, size) 67 @protocol.write_list_begin(etype, size) 68 end 69 70 def write_list_end 71 @protocol.write_list_end 72 end 73 74 def write_set_begin(etype, size) 75 @protocol.write_set_begin(etype, size) 76 end 77 78 def write_set_end 79 @protocol.write_set_end 80 end 81 82 def write_bool(bool) 83 @protocol.write_bool(bool) 84 end 85 86 def write_byte(byte) 87 @protocol.write_byte(byte) 88 end 89 90 def write_i16(i16) 91 @protocol.write_i16(i16) 92 end 93 94 def write_i32(i32) 95 @protocol.write_i32(i32) 96 end 97 98 def write_i64(i64) 99 @protocol.write_i64(i64) 100 end 101 102 def write_double(dub) 103 @protocol.write_double(dub) 104 end 105 106 def write_string(str) 107 @protocol.write_string(str) 108 end 109 110 def write_binary(buf) 111 @protocol.write_binary(buf) 112 end 113 114 def read_message_begin 115 @protocol.read_message_begin 116 end 117 118 def read_message_end 119 @protocol.read_message_end 120 end 121 122 def read_struct_begin 123 @protocol.read_struct_begin 124 end 125 126 def read_struct_end 127 @protocol.read_struct_end 128 end 129 130 def read_field_begin 131 @protocol.read_field_begin 132 end 133 134 def read_field_end 135 @protocol.read_field_end 136 end 137 138 def read_map_begin 139 @protocol.read_map_begin 140 end 141 142 def read_map_end 143 @protocol.read_map_end 144 end 145 146 def read_list_begin 147 @protocol.read_list_begin 148 end 149 150 def read_list_end 151 @protocol.read_list_end 152 end 153 154 def read_set_begin 155 @protocol.read_set_begin 156 end 157 158 def read_set_end 159 @protocol.read_set_end 160 end 161 162 def read_bool 163 @protocol.read_bool 164 end 165 166 def read_byte 167 @protocol.read_byte 168 end 169 170 def read_i16 171 @protocol.read_i16 172 end 173 174 def read_i32 175 @protocol.read_i32 176 end 177 178 def read_i64 179 @protocol.read_i64 180 end 181 182 def read_double 183 @protocol.read_double 184 end 185 186 def read_string 187 @protocol.read_string 188 end 189 190 def read_binary 191 @protocol.read_binary 192 end 193 end 194end