Atlas
0.7.0
Networking protocol for the Worldforge system.
|
#include <QueuedDecoder.h>
Public Member Functions | |
size_t | queueSize () |
Retrieve the current size of the message queue. More... | |
MapType | popMessage () |
Pop an object from the front of the message queue. More... | |
const MapType & | frontMessage () |
Peek at the object at the front of the queue. 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 (MapType obj) override |
This adds a message to the queue. More... | |
Protected Attributes | |
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... | |
Decoder that presents a queue of Atlas::Message::Element.
This message decoder puts arrived objects into a queue and allows the application to pop them off the front of the queue, peek at the front of the queue, as well as checking to see how many objects are currently in the queue.
Definition at line 34 of file QueuedDecoder.h.
|
protectedinherited |
Our current decoding state.
Definition at line 71 of file DecoderBase.h.
|
inline |
Peek at the object at the front of the queue.
Definition at line 51 of file QueuedDecoder.h.
References messageArrived().
|
overridevirtualinherited |
Ends the currently streamed list.
Implements Atlas::Bridge.
Definition at line 167 of file DecoderBase.cpp.
References Atlas::Message::DecoderBase::m_lists, Atlas::Message::DecoderBase::m_maps, Atlas::Message::DecoderBase::m_names, and Atlas::Message::DecoderBase::m_state.
|
overridevirtualinherited |
Adds a float to the currently streamed list.
Implements Atlas::Bridge.
Definition at line 148 of file DecoderBase.cpp.
References Atlas::Message::DecoderBase::m_lists.
|
overridevirtualinherited |
Adds an integer to the currently streamed list.
Implements Atlas::Bridge.
Definition at line 141 of file DecoderBase.cpp.
References Atlas::Message::DecoderBase::m_lists.
|
overridevirtualinherited |
Starts a list object in the currently streamed list.
Implements Atlas::Bridge.
Definition at line 134 of file DecoderBase.cpp.
References Atlas::Message::DecoderBase::m_lists, and Atlas::Message::DecoderBase::m_state.
|
overridevirtualinherited |
Starts a map object in the currently streamed list.
Implements Atlas::Bridge.
Definition at line 127 of file DecoderBase.cpp.
References Atlas::Message::DecoderBase::m_maps, and Atlas::Message::DecoderBase::m_state.
|
overridevirtualinherited |
Adds an empty item to the currently streamed list.
Implements Atlas::Bridge.
Definition at line 161 of file DecoderBase.cpp.
References Atlas::Message::DecoderBase::m_lists.
|
overridevirtualinherited |
Adds a string to the currently streamed list.
Implements Atlas::Bridge.
Definition at line 154 of file DecoderBase.cpp.
References Atlas::Message::DecoderBase::m_lists.
|
overridevirtualinherited |
Ends the currently streamed map.
Implements Atlas::Bridge.
Definition at line 88 of file DecoderBase.cpp.
References Atlas::Message::DecoderBase::m_lists, Atlas::Message::DecoderBase::m_maps, Atlas::Message::DecoderBase::m_names, Atlas::Message::DecoderBase::m_state, and Atlas::Objects::ObjectsDecoder::messageArrived().
|
overridevirtualinherited |
Adds a float to the currently streamed map.
Implements Atlas::Bridge.
Definition at line 68 of file DecoderBase.cpp.
References Atlas::Message::DecoderBase::m_maps.
|
overridevirtualinherited |
Adds an integer to the currently streamed map.
Implements Atlas::Bridge.
Definition at line 61 of file DecoderBase.cpp.
References Atlas::Message::DecoderBase::m_maps.
|
overridevirtualinherited |
Starts a list object to the currently streamed map.
Implements Atlas::Bridge.
Definition at line 53 of file DecoderBase.cpp.
References Atlas::Message::DecoderBase::m_lists, Atlas::Message::DecoderBase::m_names, and Atlas::Message::DecoderBase::m_state.
|
overridevirtualinherited |
Starts a map object to the currently streamed map.
Implements Atlas::Bridge.
Definition at line 45 of file DecoderBase.cpp.
References Atlas::Message::DecoderBase::m_maps, Atlas::Message::DecoderBase::m_names, and Atlas::Message::DecoderBase::m_state.
|
overridevirtualinherited |
Adds a none item to the currently streamed map.
Implements Atlas::Bridge.
Definition at line 82 of file DecoderBase.cpp.
References Atlas::Message::DecoderBase::m_maps.
|
overridevirtualinherited |
Adds a string to the currently streamed map.
Implements Atlas::Bridge.
Definition at line 75 of file DecoderBase.cpp.
References Atlas::Message::DecoderBase::m_maps.
|
overrideprotectedvirtual |
This adds a message to the queue.
Implements Atlas::Message::DecoderBase.
Definition at line 11 of file QueuedDecoder.cpp.
Referenced by frontMessage().
|
inline |
Pop an object from the front of the message queue.
Definition at line 45 of file QueuedDecoder.h.
|
inline |
Retrieve the current size of the message queue.
Definition at line 41 of file QueuedDecoder.h.
|
overridevirtualinherited |
Begin an Atlas stream.
Implements Atlas::Bridge.
Definition at line 25 of file DecoderBase.cpp.
References Atlas::Message::DecoderBase::m_state.
|
overridevirtualinherited |
Ends the Atlas stream.
Implements Atlas::Bridge.
Definition at line 38 of file DecoderBase.cpp.
References Atlas::Message::DecoderBase::m_state.
|
overridevirtualinherited |
Start a message in an Atlas stream.
Implements Atlas::Bridge.
Definition at line 31 of file DecoderBase.cpp.
References Atlas::Message::DecoderBase::m_maps, and Atlas::Message::DecoderBase::m_state.
|
protectedinherited |
The list stack.
Definition at line 82 of file DecoderBase.h.
Referenced by Atlas::Message::DecoderBase::listEnd(), Atlas::Message::DecoderBase::listFloatItem(), Atlas::Message::DecoderBase::listIntItem(), Atlas::Message::DecoderBase::listListItem(), Atlas::Message::DecoderBase::listNoneItem(), Atlas::Message::DecoderBase::listStringItem(), Atlas::Message::DecoderBase::mapEnd(), and Atlas::Message::DecoderBase::mapListItem().
|
protectedinherited |
The map stack.
Definition at line 80 of file DecoderBase.h.
Referenced by Atlas::Message::DecoderBase::listEnd(), Atlas::Message::DecoderBase::listMapItem(), Atlas::Message::DecoderBase::mapEnd(), Atlas::Message::DecoderBase::mapFloatItem(), Atlas::Message::DecoderBase::mapIntItem(), Atlas::Message::DecoderBase::mapMapItem(), Atlas::Message::DecoderBase::mapNoneItem(), Atlas::Message::DecoderBase::mapStringItem(), and Atlas::Message::DecoderBase::streamMessage().
|
protectedinherited |
Names for maps and lists.
Definition at line 84 of file DecoderBase.h.
Referenced by Atlas::Message::DecoderBase::listEnd(), Atlas::Message::DecoderBase::mapEnd(), Atlas::Message::DecoderBase::mapListItem(), and Atlas::Message::DecoderBase::mapMapItem().
|
protectedinherited |
The state stack.
Definition at line 78 of file DecoderBase.h.
Referenced by Atlas::Message::DecoderBase::listEnd(), Atlas::Message::DecoderBase::listListItem(), Atlas::Message::DecoderBase::listMapItem(), Atlas::Message::DecoderBase::mapEnd(), Atlas::Message::DecoderBase::mapListItem(), Atlas::Message::DecoderBase::mapMapItem(), Atlas::Message::DecoderBase::streamBegin(), Atlas::Message::DecoderBase::streamEnd(), and Atlas::Message::DecoderBase::streamMessage().