Atlas
0.7.0
Networking protocol for the Worldforge system.
|
#include <Decoder.h>
Public Member Functions | |
ObjectsDecoder (const Factories &f) | |
Constructor. More... | |
~ObjectsDecoder () override | |
Default destructor. More... | |
const Factories & | factories () const |
Factories accessor. More... | |
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 { STATE_STREAM, STATE_MAP, STATE_LIST } |
Our current decoding state. More... | |
Protected Member Functions | |
void | messageArrived (Atlas::Message::MapType) override |
Overridden by to retrieve the message from DecoderBase. More... | |
virtual void | objectArrived (Root obj)=0 |
call right object*Arrived method More... | |
Protected Attributes | |
const Factories & | m_factories |
std::stack< State > | m_state |
The state stack. More... | |
std::stack< MapType > | m_maps |
The map stack. More... | |
std::stack< ListType > | m_lists |
The list stack. More... | |
std::stack< std::string > | m_names |
Names for maps and lists. More... | |
Objects hierarchy decoder
This decoder can be bound to a codec, will assemble incoming messages, check their type, convert them into the appropriate instance in the Objects hierarchy and call the relevant member functions, which subclasses can conveniently override to pick up the object.
|
protectedinherited |
Our current decoding state.
Definition at line 71 of file DecoderBase.h.
|
explicit |
Constructor.
Definition at line 14 of file Decoder.cpp.
|
overridedefault |
Default destructor.
|
inline |
|
overridevirtualinherited |
Ends the currently streamed list.
Implements Atlas::Bridge.
Definition at line 167 of file DecoderBase.cpp.
|
overridevirtualinherited |
Adds a float to the currently streamed list.
Implements Atlas::Bridge.
Definition at line 148 of file DecoderBase.cpp.
|
overridevirtualinherited |
Adds an integer to the currently streamed list.
Implements Atlas::Bridge.
Definition at line 141 of file DecoderBase.cpp.
|
overridevirtualinherited |
Starts a list object in the currently streamed list.
Implements Atlas::Bridge.
Definition at line 134 of file DecoderBase.cpp.
|
overridevirtualinherited |
Starts a map object in the currently streamed list.
Implements Atlas::Bridge.
Definition at line 127 of file DecoderBase.cpp.
|
overridevirtualinherited |
Adds an empty item to the currently streamed list.
Implements Atlas::Bridge.
Definition at line 161 of file DecoderBase.cpp.
|
overridevirtualinherited |
Adds a string to the currently streamed list.
Implements Atlas::Bridge.
Definition at line 154 of file DecoderBase.cpp.
|
overridevirtualinherited |
Ends the currently streamed map.
Implements Atlas::Bridge.
Definition at line 88 of file DecoderBase.cpp.
|
overridevirtualinherited |
Adds a float to the currently streamed map.
Implements Atlas::Bridge.
Definition at line 68 of file DecoderBase.cpp.
|
overridevirtualinherited |
Adds an integer to the currently streamed map.
Implements Atlas::Bridge.
Definition at line 61 of file DecoderBase.cpp.
|
overridevirtualinherited |
Starts a list object to the currently streamed map.
Implements Atlas::Bridge.
Definition at line 53 of file DecoderBase.cpp.
|
overridevirtualinherited |
Starts a map object to the currently streamed map.
Implements Atlas::Bridge.
Definition at line 45 of file DecoderBase.cpp.
|
overridevirtualinherited |
Adds a none item to the currently streamed map.
Implements Atlas::Bridge.
Definition at line 82 of file DecoderBase.cpp.
|
overridevirtualinherited |
Adds a string to the currently streamed map.
Implements Atlas::Bridge.
Definition at line 75 of file DecoderBase.cpp.
|
overrideprotectedvirtual |
Overridden by to retrieve the message from DecoderBase.
Implements Atlas::Message::DecoderBase.
Definition at line 20 of file Decoder.cpp.
References objectArrived().
|
protectedpure virtual |
call right object*Arrived method
Referenced by messageArrived().
|
overridevirtualinherited |
|
overridevirtualinherited |
|
overridevirtualinherited |
Start a message in an Atlas stream.
Implements Atlas::Bridge.
Definition at line 31 of file DecoderBase.cpp.
|
protectedinherited |
The list stack.
Definition at line 82 of file DecoderBase.h.
|
protectedinherited |
The map stack.
Definition at line 80 of file DecoderBase.h.
|
protectedinherited |
Names for maps and lists.
Definition at line 84 of file DecoderBase.h.
|
protectedinherited |
The state stack.
Definition at line 78 of file DecoderBase.h.