MessageContainer

class kanzi::connect::MessageContainer

Public Functions

MessageContainer()

Constructor.

~MessageContainer()

Destructor.

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.

unsigned int byteSize() const

Get the byte size of this package.

Return

The byte size of this package.

void clear()

Purge the contents of the package.

MessageArray getMessages() const

Get all messages contained in this package.

Return

The contained messages as MessageArray.

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.

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.

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.

size_t size() const

Get count of the messages in this package.

Return

The count of the messages.