Atlas  0.7.0
Networking protocol for the Worldforge system.
atlas.codecs.binary2.Binary2Parser Class Reference

def encode_float(self, value): mant, exp = frexp(value) mant = long(mant *2L**20) exp = exp - 20 if mant>=0: if exp>=0: type_str = encode_pos_int(float_pos_pos_type) else: type_str = encode_pos_int(float_pos_neg_type) exp = -exp else: mant = -mant if exp>=0: type_str = encode_pos_int(float_neg_pos_type) else: type_str = encode_pos_int(float_neg_neg_type) exp = -exp return type_str + \ encode_pos_int(mant) + \ encode_pos_int(exp) More...

Inheritance diagram for atlas.codecs.binary2.Binary2Parser:
Collaboration diagram for atlas.codecs.binary2.Binary2Parser:

Public Member Functions

def parse_stream (self, msg)
 
def feed (self, msg)
 
def add_msg (self)
 
def start_value (self, initial_value)
 
def value_done (self)
 
def decode_int_value (self, ch)
 
def init_int_pos (self)
 
def init_int_neg (self)
 
def decode_int (self, ch)
 
def init_float (self, multiplier1, multiplier2)
 
def init_float_pos_pos (self)
 
def init_float_pos_neg (self)
 
def init_float_neg_pos (self)
 
def init_float_neg_neg (self)
 
def decode_float_mantissa (self, ch)
 
def decode_float_exponent (self, ch)
 
def decode_string_length (self, ch)
 
def decode_string_value (self, ch)
 
def init_collection (self, initial_value)
 
def decode_collection_value (self)
 
def decode_list_length (self, ch)
 
def decode_map_length (self, ch)
 

Public Attributes

 stack
 
 msgList
 
 mantissa
 

Static Public Attributes

 init_length = init_int_pos
 
dictionary type2init
 
dictionary type2decoder
 

Detailed Description

def encode_float(self, value): mant, exp = frexp(value) mant = long(mant *2L**20) exp = exp - 20 if mant>=0: if exp>=0: type_str = encode_pos_int(float_pos_pos_type) else: type_str = encode_pos_int(float_pos_neg_type) exp = -exp else: mant = -mant if exp>=0: type_str = encode_pos_int(float_neg_pos_type) else: type_str = encode_pos_int(float_neg_neg_type) exp = -exp return type_str + \ encode_pos_int(mant) + \ encode_pos_int(exp)

Definition at line 74 of file binary2.py.

Member Data Documentation

dictionary atlas.codecs.binary1.Binary1Parser.type2decoder
staticinherited
Initial value:
1 = {encode_pos_int(int_pos_type): decode_int,
2  encode_pos_int(int_neg_type): decode_int,
3  encode_pos_int(float_pos_pos_type): decode_float_mantissa,
4  encode_pos_int(float_pos_neg_type): decode_float_mantissa,
5  encode_pos_int(float_neg_pos_type): decode_float_mantissa,
6  encode_pos_int(float_neg_neg_type): decode_float_mantissa,
7  encode_pos_int(string_type): decode_string_length,
8  encode_pos_int(list_type): decode_list_length,
9  encode_pos_int(map_type): decode_map_length,
10  encode_pos_int(variable_string_type): decode_string_length,
11  encode_pos_int(variable_list_type): decode_list_length,
12  encode_pos_int(variable_map_type): decode_map_length}

Definition at line 300 of file binary1.py.

Referenced by atlas.codecs.binary1.Binary1Parser.__init__().

dictionary atlas.codecs.binary1.Binary1Parser.type2init
staticinherited
Initial value:
1 = {encode_pos_int(int_pos_type): init_int_pos,
2  encode_pos_int(int_neg_type): init_int_neg,
3  encode_pos_int(float_pos_pos_type): init_float_pos_pos,
4  encode_pos_int(float_pos_neg_type): init_float_pos_neg,
5  encode_pos_int(float_neg_pos_type): init_float_neg_pos,
6  encode_pos_int(float_neg_neg_type): init_float_neg_neg,
7  encode_pos_int(string_type): init_length,
8  encode_pos_int(list_type): init_length,
9  encode_pos_int(map_type): init_length,
10  encode_pos_int(variable_string_type): init_length,
11  encode_pos_int(variable_list_type): init_length,
12  encode_pos_int(variable_map_type): init_length}

Definition at line 287 of file binary1.py.

Referenced by atlas.codecs.binary1.Binary1Parser.__init__().


The documentation for this class was generated from the following file: