Kanzi Connect  3.9.9
Kanzi Connect C++ API
kanzi::connect::MessageContainer Class Reference

#include <message_container.hpp>

Public Member Functions

virtual bool addMessage (const MessagePackage *message)
 Add one message to container. More...
 
virtual unsigned int byteSize () const
 Get the byte size of this package. More...
 
virtual void clear ()
 Purge the contents of the package. More...
 
virtual MessageArray getMessages () const
 Get all messages contained in this package. More...
 
virtual MessageArray getMessages (int clientId) const
 Get all messages contained in this package. More...
 
virtual bool initialize (const string &buffer, bool isBinary)
 Parse the given string and convert it to internal message structure. More...
 
 MessageContainer ()
 Constructor. More...
 
virtual string serializeAsString (bool asBinary) const
 Serialize message container to a string. More...
 
virtual size_t size () const
 Get count of the messages in this package. More...
 
virtual ~MessageContainer ()
 Destructor. More...
 

Protected Attributes

unique_ptr< MessageContainerData > m_data
 

Constructor & Destructor Documentation

◆ MessageContainer()

kanzi::connect::MessageContainer::MessageContainer ( )

Constructor.

◆ ~MessageContainer()

virtual kanzi::connect::MessageContainer::~MessageContainer ( )
virtual

Destructor.

Member Function Documentation

◆ addMessage()

virtual bool kanzi::connect::MessageContainer::addMessage ( const MessagePackage message)
virtual

Add one message to container.

Parameters
messageThe message to be added.
Returns
True if the message was successfully added.

◆ byteSize()

virtual unsigned int kanzi::connect::MessageContainer::byteSize ( ) const
virtual

Get the byte size of this package.

Returns
The byte size of this package.

◆ clear()

virtual void kanzi::connect::MessageContainer::clear ( )
virtual

Purge the contents of the package.

◆ getMessages() [1/2]

virtual MessageArray kanzi::connect::MessageContainer::getMessages ( ) const
virtual

Get all messages contained in this package.

Returns
The contained messages as MessageArray.

◆ getMessages() [2/2]

virtual MessageArray kanzi::connect::MessageContainer::getMessages ( int  clientId) const
virtual

Get all messages contained in this package.

Parameters
clientIdUpdate client identifier of message with the given value.
Returns
The contained messages as MessageArray.

◆ initialize()

virtual bool kanzi::connect::MessageContainer::initialize ( const string &  buffer,
bool  isBinary 
)
virtual

Parse the given string and convert it to internal message structure.

Parameters
bufferSerialized message container.
isBinaryIf true, the string is to be interpreted as binary, JSON otherwise.
Returns
True if initialization was successful.

◆ serializeAsString()

virtual string kanzi::connect::MessageContainer::serializeAsString ( bool  asBinary) const
virtual

Serialize message container to a string.

Parameters
asBinaryIf true, the output string is to be produced as binary, JSON otherwise.
Returns
Contents of the message container serialized as a string.

◆ size()

virtual size_t kanzi::connect::MessageContainer::size ( ) const
virtual

Get count of the messages in this package.

Returns
The count of the messages.

Member Data Documentation

◆ m_data

unique_ptr<MessageContainerData> kanzi::connect::MessageContainer::m_data
protected

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