MessageContainer

class kanzi::connect::MessageContainer

Public Functions

MessageContainer()

Constructor.

virtual ~MessageContainer()

Destructor.

virtual bool addMessage(const MessagePackage *message)

Add one message to container.

Return

True if the message was successfully added.

Parameters
  • message: The message to be added.

virtual unsigned int byteSize() const

Get the byte size of this package.

Return

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.

Return

The contained messages as MessageArray.

virtual MessageArray getMessages(int clientId) const

Get all messages contained in this package.

Return

The contained messages as MessageArray.

Parameters
  • clientId: Update client identifier of message with the given value.

virtual bool initialize(const string &buffer, bool isBinary)

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

Return

True if initialization was successful.

Parameters
  • buffer: Serialized message container.

  • isBinary: If true, the string is to be interpreted as binary, JSON otherwise.

virtual string serializeAsString(bool asBinary) const

Serialize message container to a string.

Return

Contents of the message container serialized as a string.

Parameters
  • asBinary: If true, the output string is to be produced as binary, JSON otherwise.

virtual size_t size() const

Get count of the messages in this package.

Return

The count of the messages.