class Thrift::BaseProtocol

Attributes

trans[R]

Public Class Methods

new(trans) click to toggle source
   # File lib/thrift/protocol/base_protocol.rb
44 def initialize(trans)
45   @trans = trans
46 end

Public Instance Methods

native?() click to toggle source
   # File lib/thrift/protocol/base_protocol.rb
48 def native?
49   puts "wrong method is being called!"
50   false
51 end
read_bool() click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
157 def read_bool
158   raise NotImplementedError
159 end
read_byte() click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
161 def read_byte
162   raise NotImplementedError
163 end
read_double() click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
177 def read_double
178   raise NotImplementedError
179 end
read_field_begin() click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
133 def read_field_begin
134   raise NotImplementedError
135 end
read_field_end() click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
137 def read_field_end; nil; end
read_i16() click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
165 def read_i16
166   raise NotImplementedError
167 end
read_i32() click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
169 def read_i32
170   raise NotImplementedError
171 end
read_i64() click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
173 def read_i64
174   raise NotImplementedError
175 end
read_list_begin() click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
145 def read_list_begin
146   raise NotImplementedError
147 end
read_list_end() click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
149 def read_list_end; nil; end
read_map_begin() click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
139 def read_map_begin
140   raise NotImplementedError
141 end
read_map_end() click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
143 def read_map_end; nil; end
read_message_begin() click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
121 def read_message_begin
122   raise NotImplementedError
123 end
read_message_end() click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
125 def read_message_end; nil; end
read_set_begin() click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
151 def read_set_begin
152   raise NotImplementedError
153 end
read_set_end() click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
155 def read_set_end; nil; end
read_string() click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
181 def read_string
182   raise NotImplementedError
183 end
read_struct_begin() click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
127 def read_struct_begin
128   raise NotImplementedError
129 end
read_struct_end() click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
131 def read_struct_end; nil; end
read_type(type) click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
214 def read_type(type)
215   case type
216   when Types::BOOL
217     read_bool
218   when Types::BYTE
219     read_byte
220   when Types::DOUBLE
221     read_double
222   when Types::I16
223     read_i16
224   when Types::I32
225     read_i32
226   when Types::I64
227     read_i64
228   when Types::STRING
229     read_string
230   else
231     raise NotImplementedError
232   end
233 end
skip(type) click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
235 def skip(type)
236   case type
237   when Types::STOP
238     nil
239   when Types::BOOL
240     read_bool
241   when Types::BYTE
242     read_byte
243   when Types::I16
244     read_i16
245   when Types::I32
246     read_i32
247   when Types::I64
248     read_i64
249   when Types::DOUBLE
250     read_double
251   when Types::STRING
252     read_string
253   when Types::STRUCT
254     read_struct_begin
255     while true
256       name, type, id = read_field_begin
257       break if type == Types::STOP
258       skip(type)
259       read_field_end
260     end
261     read_struct_end
262   when Types::MAP
263     ktype, vtype, size = read_map_begin
264     size.times do
265       skip(ktype)
266       skip(vtype)
267     end
268     read_map_end
269   when Types::SET
270     etype, size = read_set_begin
271     size.times do
272       skip(etype)
273     end
274     read_set_end
275   when Types::LIST
276     etype, size = read_list_begin
277     size.times do
278       skip(etype)
279     end
280     read_list_end
281   end
282 end
write_bool(bool) click to toggle source
   # File lib/thrift/protocol/base_protocol.rb
93 def write_bool(bool)
94   raise NotImplementedError
95 end
write_byte(byte) click to toggle source
   # File lib/thrift/protocol/base_protocol.rb
97 def write_byte(byte)
98   raise NotImplementedError
99 end
write_double(dub) click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
113 def write_double(dub)
114   raise NotImplementedError
115 end
write_field(name, type, fid, value) click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
185 def write_field(name, type, fid, value)
186   write_field_begin(name, type, fid)
187   write_type(type, value)
188   write_field_end
189 end
write_field_begin(name, type, id) click to toggle source
   # File lib/thrift/protocol/base_protocol.rb
65 def write_field_begin(name, type, id)
66   raise NotImplementedError
67 end
write_field_end() click to toggle source
   # File lib/thrift/protocol/base_protocol.rb
69 def write_field_end; nil; end
write_field_stop() click to toggle source
   # File lib/thrift/protocol/base_protocol.rb
71 def write_field_stop
72   raise NotImplementedError
73 end
write_i16(i16) click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
101 def write_i16(i16)
102   raise NotImplementedError
103 end
write_i32(i32) click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
105 def write_i32(i32)
106   raise NotImplementedError
107 end
write_i64(i64) click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
109 def write_i64(i64)
110   raise NotImplementedError
111 end
write_list_begin(etype, size) click to toggle source
   # File lib/thrift/protocol/base_protocol.rb
81 def write_list_begin(etype, size)
82   raise NotImplementedError
83 end
write_list_end() click to toggle source
   # File lib/thrift/protocol/base_protocol.rb
85 def write_list_end; nil; end
write_map_begin(ktype, vtype, size) click to toggle source
   # File lib/thrift/protocol/base_protocol.rb
75 def write_map_begin(ktype, vtype, size)
76   raise NotImplementedError
77 end
write_map_end() click to toggle source
   # File lib/thrift/protocol/base_protocol.rb
79 def write_map_end; nil; end
write_message_begin(name, type, seqid) click to toggle source
   # File lib/thrift/protocol/base_protocol.rb
53 def write_message_begin(name, type, seqid)
54   raise NotImplementedError
55 end
write_message_end() click to toggle source
   # File lib/thrift/protocol/base_protocol.rb
57 def write_message_end; nil; end
write_set_begin(etype, size) click to toggle source
   # File lib/thrift/protocol/base_protocol.rb
87 def write_set_begin(etype, size)
88   raise NotImplementedError
89 end
write_set_end() click to toggle source
   # File lib/thrift/protocol/base_protocol.rb
91 def write_set_end; nil; end
write_string(str) click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
117 def write_string(str)
118   raise NotImplementedError
119 end
write_struct_begin(name) click to toggle source
   # File lib/thrift/protocol/base_protocol.rb
59 def write_struct_begin(name)
60   raise NotImplementedError
61 end
write_struct_end() click to toggle source
   # File lib/thrift/protocol/base_protocol.rb
63 def write_struct_end; nil; end
write_type(type, value) click to toggle source
    # File lib/thrift/protocol/base_protocol.rb
191 def write_type(type, value)
192   case type
193   when Types::BOOL
194     write_bool(value)
195   when Types::BYTE
196     write_byte(value)
197   when Types::DOUBLE
198     write_double(value)
199   when Types::I16
200     write_i16(value)
201   when Types::I32
202     write_i32(value)
203   when Types::I64
204     write_i64(value)
205   when Types::STRING
206     write_string(value)
207   when Types::STRUCT
208     value.write(self)
209   else
210     raise NotImplementedError
211   end
212 end