netLink C++ 11
Loading...
Searching...
No Matches
Public Member Functions | List of all members
MsgPack::Deserializer Class Reference

Used to deserialize elements from a std::streambuf. More...

#include <StreamManager.h>

Inheritance diagram for MsgPack::Deserializer:
MsgPack::StreamManager

Public Member Functions

 Deserializer (std::streambuf *_streamBuffer)
 
std::streamsize deserialize (PushCallback pushElement, bool hierarchy=true, std::streamsize bytes=0)
 
std::streamsize deserialize (std::unique_ptr< Element > &element, bool hierarchy=true, std::streamsize bytes=0)
 
Deserializeroperator>> (std::unique_ptr< Element > &element)
 

Additional Inherited Members

- Protected Types inherited from MsgPack::StreamManager
typedef std::pair< Element *, int64_t > StackElement
 To store the (de)serializer position.
 
- Protected Member Functions inherited from MsgPack::StreamManager
 StreamManager (std::streambuf *_streamBuffer)
 Initalize from stream buffer.
 
- Protected Attributes inherited from MsgPack::StreamManager
std::unique_ptr< ElementrootElement
 The element at the root of the hierarchy.
 
std::vector< StackElementstack
 The element hierarchy stack.
 
std::streambuf * streamBuffer
 

Detailed Description

Used to deserialize elements from a std::streambuf.

Constructor & Destructor Documentation

◆ Deserializer()

MsgPack::Deserializer::Deserializer ( std::streambuf *  _streamBuffer)
inline

Constructs the Deserializer

Parameters
_streamBufferA std::streambuf to be used as target for write operations

Member Function Documentation

◆ deserialize() [1/2]

std::streamsize MsgPack::Deserializer::deserialize ( PushCallback  pushElement,
bool  hierarchy = true,
std::streamsize  bytes = 0 
)

Deserializes elements from the streamBuffer

Parameters
pushElementCallback which will be called when the next element has been deserialized and can return true to stop the deserialization
hierarchyIf false arrays and maps will be deserialized as a flat stream of elements
bytesLimit of bytes to read or 0 to read as much as possible

◆ deserialize() [2/2]

std::streamsize MsgPack::Deserializer::deserialize ( std::unique_ptr< Element > &  element,
bool  hierarchy = true,
std::streamsize  bytes = 0 
)

Deserializes one element from the streamBuffer

Parameters
elementstd::unique_ptr in which the element will be stored
hierarchyIf false arrays and maps will be deserialized as a flat stream of elements
bytesLimit of bytes to read or 0 to read as much as possible

◆ operator>>()

Deserializer & MsgPack::Deserializer::operator>> ( std::unique_ptr< Element > &  element)
inline

Tries to deserialize one MsgPack::Element from the streamBuffer

Parameters
elementstd::unique_ptr in which the element will be stored

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