Atlas  0.7.0
Networking protocol for the Worldforge system.
Atlas::Codecs::Packed Class Reference
Inheritance diagram for Atlas::Codecs::Packed:
Collaboration diagram for Atlas::Codecs::Packed:

Public Member Functions

 Packed (std::istream &in, std::ostream &out, Atlas::Bridge &b)
 
void poll () override
 
void streamBegin () override
 
void streamMessage () override
 
void streamEnd () override
 
void mapMapItem (std::string name) override
 
void mapListItem (std::string name) override
 
void mapIntItem (std::string name, std::int64_t) override
 
void mapFloatItem (std::string name, double) override
 
void mapStringItem (std::string name, std::string) override
 
void mapNoneItem (std::string name) override
 
void mapEnd () override
 
void listMapItem () override
 
void listListItem () override
 
void listIntItem (std::int64_t) override
 
void listFloatItem (double) override
 
void listStringItem (std::string) override
 
void listNoneItem () override
 
void listEnd () override
 

Protected Types

enum  State {
  PARSE_NOTHING, PARSE_STREAM, PARSE_MAP, PARSE_LIST,
  PARSE_MAP_BEGIN, PARSE_LIST_BEGIN, PARSE_INT, PARSE_FLOAT,
  PARSE_STRING, PARSE_NAME
}
 

Protected Member Functions

void parsingBegins (char)
 
void parseStream (char)
 
void parseMap (char)
 
void parseList (char)
 
void parseMapBegin (char)
 
void parseListBegin (char)
 
void parseInt (char)
 
void parseFloat (char)
 
void parseString (char)
 
void parseName (char)
 
std::string hexEncode (std::string data)
 
std::string hexDecode (std::string data)
 

Protected Attributes

std::istream & m_istream
 
std::ostream & m_ostream
 
Bridgem_bridge
 
std::stack< State > m_state
 
std::string m_name
 
std::string m_data
 
std::string m_encoded
 
std::string m_decoded
 

Detailed Description

Definition at line 40 of file Packed.h.

Member Function Documentation

void Atlas::Codecs::Packed::listEnd ( )
overridevirtual

Ends the currently streamed list.

Implements Atlas::Bridge.

Definition at line 415 of file Packed.cpp.

void Atlas::Codecs::Packed::listFloatItem ( double  )
overridevirtual

Adds a float to the currently streamed list.

Implements Atlas::Bridge.

Definition at line 402 of file Packed.cpp.

void Atlas::Codecs::Packed::listIntItem ( std::int64_t  )
overridevirtual

Adds an integer to the currently streamed list.

Implements Atlas::Bridge.

Definition at line 398 of file Packed.cpp.

void Atlas::Codecs::Packed::listListItem ( )
overridevirtual

Starts a list object in the currently streamed list.

Implements Atlas::Bridge.

Definition at line 394 of file Packed.cpp.

void Atlas::Codecs::Packed::listMapItem ( )
overridevirtual

Starts a map object in the currently streamed list.

Implements Atlas::Bridge.

Definition at line 390 of file Packed.cpp.

void Atlas::Codecs::Packed::listNoneItem ( )
overridevirtual

Adds an empty item to the currently streamed list.

Implements Atlas::Bridge.

Definition at line 410 of file Packed.cpp.

void Atlas::Codecs::Packed::listStringItem ( std::string  )
overridevirtual

Adds a string to the currently streamed list.

Implements Atlas::Bridge.

Definition at line 406 of file Packed.cpp.

void Atlas::Codecs::Packed::mapEnd ( )
overridevirtual

Ends the currently streamed map.

Implements Atlas::Bridge.

Definition at line 386 of file Packed.cpp.

void Atlas::Codecs::Packed::mapFloatItem ( std::string  name,
double   
)
overridevirtual

Adds a float to the currently streamed map.

Implements Atlas::Bridge.

Definition at line 374 of file Packed.cpp.

void Atlas::Codecs::Packed::mapIntItem ( std::string  name,
std::int64_t   
)
overridevirtual

Adds an integer to the currently streamed map.

Implements Atlas::Bridge.

Definition at line 370 of file Packed.cpp.

void Atlas::Codecs::Packed::mapListItem ( std::string  name)
overridevirtual

Starts a list object to the currently streamed map.

Implements Atlas::Bridge.

Definition at line 366 of file Packed.cpp.

void Atlas::Codecs::Packed::mapMapItem ( std::string  name)
overridevirtual

Starts a map object to the currently streamed map.

Implements Atlas::Bridge.

Definition at line 362 of file Packed.cpp.

void Atlas::Codecs::Packed::mapNoneItem ( std::string  name)
overridevirtual

Adds a none item to the currently streamed map.

Implements Atlas::Bridge.

Definition at line 382 of file Packed.cpp.

void Atlas::Codecs::Packed::mapStringItem ( std::string  name,
std::string   
)
overridevirtual

Adds a string to the currently streamed map.

Implements Atlas::Bridge.

Definition at line 378 of file Packed.cpp.

void Atlas::Codecs::Packed::streamBegin ( )
overridevirtual

Begin an Atlas stream.

Implements Atlas::Bridge.

Definition at line 350 of file Packed.cpp.

void Atlas::Codecs::Packed::streamEnd ( )
overridevirtual

Ends the Atlas stream.

Implements Atlas::Bridge.

Definition at line 358 of file Packed.cpp.

void Atlas::Codecs::Packed::streamMessage ( )
overridevirtual

Start a message in an Atlas stream.

Implements Atlas::Bridge.

Definition at line 354 of file Packed.cpp.

Member Data Documentation

std::string Atlas::Codecs::Packed::m_decoded
protected

Preallocated to increase performance.

Definition at line 112 of file Packed.h.

std::string Atlas::Codecs::Packed::m_encoded
protected

Preallocated to increase performance.

Definition at line 108 of file Packed.h.


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