Class: Thrift::BaseProtocol

### Home Classes Methods

### In Files

- lib/thrift/protocol/base_protocol.rb

### Parent

Object

### Methods

- ::new
- #native?
- #read_bool
- #read_byte
- #read_double
- #read_field_begin
- #read_field_end
- #read_i16
- #read_i32
- #read_i64
- #read_list_begin
- #read_list_end
- #read_map_begin
- #read_map_end
- #read_message_begin
- #read_message_end
- #read_set_begin
- #read_set_end
- #read_string
- #read_struct_begin
- #read_struct_end
- #read_type
- #skip
- #write_bool
- #write_byte
- #write_double
- #write_field
- #write_field_begin
- #write_field_end
- #write_field_stop
- #write_i16
- #write_i32
- #write_i64
- #write_list_begin
- #write_list_end
- #write_map_begin
- #write_map_end
- #write_message_begin
- #write_message_end
- #write_set_begin
- #write_set_end
- #write_string
- #write_struct_begin
- #write_struct_end
- #write_type

### Files

- CHANGELOG
- README
- Makefile

### Class/Module Index

Quicksearch

- Thrift
- Thrift::ApplicationException
- Thrift::BaseProtocol
- Thrift::BaseProtocolFactory
- Thrift::BaseServer
- Thrift::BaseServerTransport
- Thrift::BaseTransport
- Thrift::BaseTransportFactory
- Thrift::BinaryProtocol
- Thrift::BinaryProtocolAcceleratedFactory
- Thrift::BinaryProtocolFactory
- Thrift::BufferedTransport
- Thrift::BufferedTransportFactory
- Thrift::Client
- Thrift::CompactProtocol
- Thrift::CompactProtocol::CompactTypes
- Thrift::CompactProtocolFactory
- Thrift::Deserializer
- Thrift::Exception
- Thrift::FramedTransport
- Thrift::FramedTransportFactory
- Thrift::HTTPClientTransport
- Thrift::IOStreamTransport
- Thrift::MemoryBufferTransport
- Thrift::MessageTypes
- Thrift::MongrelHTTPServer
- Thrift::MongrelHTTPServer::Handler
- Thrift::NonblockingServer
- Thrift::Processor
- Thrift::ProtocolException
- Thrift::Serializer
- Thrift::ServerSocket
- Thrift::SimpleServer
- Thrift::Socket
- Thrift::Struct
- Thrift::Struct_Union
- Thrift::ThreadPoolServer
- Thrift::ThreadedServer
- Thrift::TransportException
- Thrift::TransportUtils
- Thrift::TypeError
- Thrift::Types
- Thrift::UNIXServerSocket
- Thrift::UNIXSocket
- Thrift::Union
- Fixnum

No matching classes.

# Thrift::BaseProtocol

### Attributes

trans[R]

### Public Class Methods

new(trans) click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 44
    def initialize(trans)
      @trans = trans
    end

### Public Instance Methods

native?() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 48
    def native?
      puts "wrong method is being called!"
      false
    end

read_bool() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 157
    def read_bool
      raise NotImplementedError
    end

read_byte() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 161
    def read_byte
      raise NotImplementedError
    end

read_double() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 177
    def read_double
      raise NotImplementedError
    end

read_field_begin() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 133
    def read_field_begin
      raise NotImplementedError
    end

read_field_end() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 137
    def read_field_end; nil; end

read_i16() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 165
    def read_i16
      raise NotImplementedError
    end

read_i32() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 169
    def read_i32
      raise NotImplementedError
    end

read_i64() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 173
    def read_i64
      raise NotImplementedError
    end

read_list_begin() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 145
    def read_list_begin
      raise NotImplementedError
    end

read_list_end() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 149
    def read_list_end; nil; end

read_map_begin() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 139
    def read_map_begin
      raise NotImplementedError
    end

read_map_end() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 143
    def read_map_end; nil; end

read_message_begin() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 121
    def read_message_begin
      raise NotImplementedError
    end

read_message_end() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 125
    def read_message_end; nil; end

read_set_begin() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 151
    def read_set_begin
      raise NotImplementedError
    end

read_set_end() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 155
    def read_set_end; nil; end

read_string() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 181
    def read_string
      raise NotImplementedError
    end

read_struct_begin() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 127
    def read_struct_begin
      raise NotImplementedError
    end

read_struct_end() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 131
    def read_struct_end; nil; end

read_type(type) click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 214
    def read_type(type)
      case type
      when Types::BOOL
        read_bool
      when Types::BYTE
        read_byte
      when Types::DOUBLE
        read_double
      when Types::I16
        read_i16
      when Types::I32
        read_i32
      when Types::I64
        read_i64
      when Types::STRING
        read_string
      else
        raise NotImplementedError
      end
    end

skip(type) click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 235
    def skip(type)
      case type
      when Types::STOP
        nil
      when Types::BOOL
        read_bool
      when Types::BYTE
        read_byte
      when Types::I16
        read_i16
      when Types::I32
        read_i32
      when Types::I64
        read_i64
      when Types::DOUBLE
        read_double
      when Types::STRING
        read_string
      when Types::STRUCT
        read_struct_begin
        while true
          name, type, id = read_field_begin
          break if type == Types::STOP
          skip(type)
          read_field_end
        end
        read_struct_end
      when Types::MAP
        ktype, vtype, size = read_map_begin
        size.times do
          skip(ktype)
          skip(vtype)
        end
        read_map_end
      when Types::SET
        etype, size = read_set_begin
        size.times do
          skip(etype)
        end
        read_set_end
      when Types::LIST
        etype, size = read_list_begin
        size.times do
          skip(etype)
        end
        read_list_end
      end
    end

write_bool(bool) click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 93
    def write_bool(bool)
      raise NotImplementedError
    end

write_byte(byte) click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 97
    def write_byte(byte)
      raise NotImplementedError
    end

write_double(dub) click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 113
    def write_double(dub)
      raise NotImplementedError
    end

write_field(name, type, fid, value) click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 185
    def write_field(name, type, fid, value)
      write_field_begin(name, type, fid)
      write_type(type, value)
      write_field_end
    end

write_field_begin(name, type, id) click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 65
    def write_field_begin(name, type, id)
      raise NotImplementedError
    end

write_field_end() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 69
    def write_field_end; nil; end

write_field_stop() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 71
    def write_field_stop
      raise NotImplementedError
    end

write_i16(i16) click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 101
    def write_i16(i16)
      raise NotImplementedError
    end

write_i32(i32) click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 105
    def write_i32(i32)
      raise NotImplementedError
    end

write_i64(i64) click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 109
    def write_i64(i64)
      raise NotImplementedError
    end

write_list_begin(etype, size) click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 81
    def write_list_begin(etype, size)
      raise NotImplementedError
    end

write_list_end() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 85
    def write_list_end; nil; end

write_map_begin(ktype, vtype, size) click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 75
    def write_map_begin(ktype, vtype, size)
      raise NotImplementedError
    end

write_map_end() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 79
    def write_map_end; nil; end

write_message_begin(name, type, seqid) click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 53
    def write_message_begin(name, type, seqid)
      raise NotImplementedError
    end

write_message_end() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 57
    def write_message_end; nil; end

write_set_begin(etype, size) click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 87
    def write_set_begin(etype, size)
      raise NotImplementedError
    end

write_set_end() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 91
    def write_set_end; nil; end

write_string(str) click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 117
    def write_string(str)
      raise NotImplementedError
    end

write_struct_begin(name) click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 59
    def write_struct_begin(name)
      raise NotImplementedError
    end

write_struct_end() click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 63
    def write_struct_end; nil; end

write_type(type, value) click to toggle source

    # File lib/thrift/protocol/base_protocol.rb, line 191
    def write_type(type, value)
      case type
      when Types::BOOL
        write_bool(value)
      when Types::BYTE
        write_byte(value)
      when Types::DOUBLE
        write_double(value)
      when Types::I16
        write_i16(value)
      when Types::I32
        write_i32(value)
      when Types::I64
        write_i64(value)
      when Types::STRING
        write_string(value)
      when Types::STRUCT
        value.write(self)
      else
        raise NotImplementedError
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.