MessageContainer¶
-
class
kanzi::connect
::
MessageContainer
¶ Public Functions
-
MessageContainer
()¶ Constructor.
-
virtual
~MessageContainer
()¶ Destructor.
-
virtual bool
addMessage
(const MessagePackage *message)¶ Add one message to container.
- Parameters
message – The message to be added.
- Returns
True if the message was successfully added.
-
virtual unsigned int
byteSize
() const¶ Get the byte size of this package.
- Returns
The byte size of this package.
-
virtual void
clear
()¶ Purge the contents of the package.
-
virtual MessageArray
getMessages
() const¶ Get all messages contained in this package.
- Returns
The contained messages as MessageArray.
-
virtual MessageArray
getMessages
(int clientId) const¶ Get all messages contained in this package.
- Parameters
clientId – Update client identifier of message with the given value.
- Returns
The contained messages as MessageArray.
-
virtual bool
initialize
(const string &buffer, bool isBinary)¶ Parse the given string and convert it to internal message structure.
- Parameters
buffer – Serialized message container.
isBinary – If true, the string is to be interpreted as binary, JSON otherwise.
- Returns
True if initialization was successful.
-
virtual string
serializeAsString
(bool asBinary) const¶ Serialize message container to a string.
- Parameters
asBinary – If true, the output string is to be produced as binary, JSON otherwise.
- Returns
Contents of the message container serialized as a string.
-
virtual size_t
size
() const¶ Get count of the messages in this package.
- Returns
The count of the messages.
-