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

Used to serialize elements into a std::streambuf. More...

#include <StreamManager.h>

Inheritance diagram for MsgPack::Serializer:
MsgPack::StreamManager

Public Member Functions

 Serializer (std::streambuf *_streamBuffer)
 
std::streamsize serialize (PullCallback pullElement, std::streamsize bytes=0)
 
std::streamsize serialize (std::unique_ptr< Element > &element, std::streamsize bytes=0)
 
Serializeroperator<< (std::unique_ptr< Element > &element)
 
Serializeroperator<< (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 serialize elements into a std::streambuf.

Constructor & Destructor Documentation

◆ Serializer()

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

Constructs the Serializer

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

Member Function Documentation

◆ operator<<() [1/2]

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

Tries to serialize one MsgPack::Element into the streamBuffer

Parameters
elementstd::unique_ptr containing the element

◆ operator<<() [2/2]

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

Tries to serialize one MsgPack::Element into the streamBuffer

Parameters
elementstd::unique_ptr containing the element

◆ serialize() [1/2]

std::streamsize MsgPack::Serializer::serialize ( PullCallback  pullElement,
std::streamsize  bytes = 0 
)

Pulls elements and writes them into the streamBuffer

Parameters
pullElementCallback which will be called to get the next element
bytesLimit of bytes to write or 0 to write as much as possible

◆ serialize() [2/2]

std::streamsize MsgPack::Serializer::serialize ( std::unique_ptr< Element > &  element,
std::streamsize  bytes = 0 
)

Tries to serialize one MsgPack::Element into the streamBuffer

Parameters
elementstd::unique_ptr containing the element
bytesLimit of bytes to write or 0 to write as much as possible

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