MsgPack::MapHeader representing the header and the content of a map.
More...
#include <Container.h>
|
| Map (std::vector< std::unique_ptr< Element > > &&elements) |
| Initialize from element vector (move semantic)
|
|
| Map (std::map< std::string, std::unique_ptr< Element > > &&elements) |
|
std::unique_ptr< Element > | copy () const |
| Creates a deep copy of this element.
|
|
void | toJSON (std::ostream &stream) const |
| Writes a human readable JSON-like string into the given stream.
|
|
uint32_t | getSizeInBytes () const |
| Returns the size in bytes this MsgPack::Element takes if completely serialized.
|
|
std::vector< std::unique_ptr< Element > > * | getElementsVector () |
| Returns a raw pointer to the element vector of a container.
|
|
std::map< std::string, Element * > | getElementsMap () const |
|
std::pair< String *, Element * > | getEntry (uint32_t index) const |
| Returns the entry pair at the index or nullptr if out of bounds.
|
|
String * | getKey (uint32_t index) const |
| Returns the key at the index or nullptr if out of bounds.
|
|
Element * | getValue (uint32_t index) const |
| Returns the value at the index or nullptr if out of bounds.
|
|
virtual std::unique_ptr< Element > | copy () const =0 |
| Creates a deep copy of this element.
|
|
virtual void | toJSON (std::ostream &stream) const =0 |
| Writes a human readable JSON-like string into the given stream.
|
|
virtual Type | getType () const =0 |
| Returns the MsgPack::Type.
|
|
virtual uint32_t | getSizeInBytes () const |
| Returns the size in bytes this MsgPack::Element takes if completely serialized.
|
|
|
bool | containerDeserialized () |
| Returns true if the header of a container is deserialized and reserves the necessary space for its element vector.
|
|
virtual int64_t | startSerialize () |
| Returns the initial serializer position in bytes (negative value if there is a header)
|
|
virtual int64_t | startDeserialize (uint8_t firstByte)=0 |
| Reads in one byte and returns the initial deserializer position in bytes (negative value if there is a header)
|
|
virtual std::streamsize | serialize (int64_t &pos, std::basic_streambuf< char > *streamBuffer, std::streamsize bytes)=0 |
| Serializes bytes at the given serializer position pos into streamBuffer.
|
|
virtual std::streamsize | deserialize (int64_t &pos, std::basic_streambuf< char > *streamBuffer, std::streamsize bytes) |
| Deserializes bytes at the given deserializer position pos from streamBuffer.
|
|
virtual bool | containerDeserialized () |
| Returns true if the header of a container is deserialized and reserves the necessary space for its element vector.
|
|
virtual std::vector< std::unique_ptr< Element > > * | getElementsVector () |
| Returns a raw pointer to the element vector of a container.
|
|
virtual int64_t | getEndPos () const =0 |
| Returns the first invalid (de)serializer position.
|
|
|
std::vector< std::unique_ptr< Element > > | elements |
| Element vector is key/value interlaced.
|
|
|
class | Serializer |
|
class | Deserializer |
|
MsgPack::MapHeader representing the header and the content of a map.
◆ containerDeserialized()
bool MsgPack::Map::containerDeserialized |
( |
| ) |
|
|
protectedvirtual |
Returns true if the header of a container is deserialized and reserves the necessary space for its element vector.
Reimplemented from MsgPack::Element.
◆ copy()
std::unique_ptr< Element > MsgPack::Map::copy |
( |
| ) |
const |
|
virtual |
◆ getElementsMap()
std::map< std::string, Element * > MsgPack::Map::getElementsMap |
( |
| ) |
const |
Generates a map of the element vector
- Warning
- Life time of return value depends on this object
◆ getElementsVector()
std::vector< std::unique_ptr< Element > > * MsgPack::Map::getElementsVector |
( |
| ) |
|
|
virtual |
Returns a raw pointer to the element vector of a container.
Reimplemented from MsgPack::Element.
◆ getSizeInBytes()
uint32_t MsgPack::Map::getSizeInBytes |
( |
| ) |
const |
|
virtual |
◆ toJSON()
void MsgPack::Map::toJSON |
( |
std::ostream & |
stream | ) |
const |
|
virtual |
Writes a human readable JSON-like string into the given stream.
Implements MsgPack::Element.
The documentation for this class was generated from the following files: