#include <message_package.hpp>
Public Member Functions | |
bool | addBinaryAttribute (int key, const string &value) |
Add a binary string value to an attribute. | |
bool | addBinaryAttributeEx (int key, const unsigned char *blob, size_t size) |
Add a binary data t to an attribute. | |
bool | addBoolAttribute (int key, bool value) |
Add a boolean value to an attribute. | |
bool | addDoubleAttribute (int key, double value) |
Add a double value to an attribute. | |
bool | addFloatAttribute (int key, float value) |
Add a floating point value to an attribute. | |
bool | addInt64Attribute (int key, int64_t value) |
Add 64bit integer value to an attribute. | |
bool | addIntAttribute (int key, int value) |
Add a integer value to an attribute. | |
bool | addPackageAttribute (int key, const MessagePackage &value) |
Add a child message package to an attribute. | |
bool | addStringAttribute (int key, const string &value) |
Add a string value to an attribute. | |
bool | addUInt64Attribute (int key, uint64_t value) |
Add 64-bit integer value to an attribute. | |
bool | addUIntAttribute (int key, unsigned int value) |
Add a integer value to an attribute. | |
unsigned int | byteSize () const |
Get binary size for the message. | |
virtual void | clear () |
Purge the contents of the package. | |
void | eraseAttribute (int key) |
Erase attribute array i.e. | |
string | getAttributeKeyString (int key) const |
Get attribute key string for an attribute. | |
AttributeType | getAttributeType (int key) const |
Get the type of an attribute. | |
size_t | getAttributeValuesCount (int key) const |
Get the size of values array for an . | |
string | getBinaryAttribute (int key, size_t index) const |
Get the binary string value of an attribute. | |
bool | getBoolAttribute (int key, size_t index) const |
Get the boolean value of an attribute. | |
int | getClientIdentifier () const |
Get client identifier. | |
double | getDoubleAttribute (int key, size_t index) const |
Get the double value of an attribute. | |
float | getFloatAttribute (int key, size_t index) const |
Get the floating point value of an attribute. | |
uint32_t | getHandle () const |
int64_t | getInt64Attribute (int key, size_t index) const |
Get the integer value of an attribute. | |
int | getIntAttribute (int key, size_t index) const |
Get the integer value of an attribute. | |
string | getInterfaceIdentifier () const |
Get interface identifier. | |
string | getInvokeName () const |
Get invoke name. | |
MessageType | getMessageType () const |
Get message type. | |
MessagePackage | getPackageAttribute (int key, size_t index) const |
Get the child message package of an attribute. | |
bool | getPackageAttributeTo (int key, size_t index, MessagePackage *to) const |
Get the child message package of an attribute. | |
int | getSessionIdentifier () const |
Get session identifier. | |
string | getSourceClientAddress () const |
Retrieve configured client address. | |
int | getSourceClientIdentifier () const |
Retrieve source client identifier. | |
string | getSourceClientName () const |
Retrieve configure client name. | |
string | getSourceClientProtocol () const |
Retrieve configured client protocol. | |
string | getStringAttribute (int key, size_t index) const |
Get the string value of an attribute. | |
virtual string | getType () const |
Get identity of this message. | |
uint64_t | getUInt64Attribute (int key, size_t index) const |
Get the 64-bit unsigned integer value of an attribute. | |
unsigned int | getUIntAttribute (int key, size_t index) const |
Get the unsigned integer value of an attribute. | |
virtual bool | initialize (const string &buffer, bool isBinary) |
MessagePackage () | |
MessagePackage (const MessagePackage &package) | |
MessagePackage (MessagePackage &&package) | |
MessagePackage & | operator= (const MessagePackage &package) |
virtual string | serializeAsString () const |
Serialize message container to a string. | |
bool | setAttributeKeyString (int key, const string &keyString) |
Set attribute key string for an attribute. | |
bool | setClientIdentifier (int identifier) |
Set client identifier for the message package. | |
bool | setHandle (uint32_t handle) |
bool | setInterfaceIdentifier (const string &identifier) |
Set interface identifier for the message package. | |
bool | setInvokeName (const string &invokeName) |
Set invoke name for the message package. | |
bool | setMessageType (MessageType type) |
Set message type. | |
bool | setSessionIdentifier (int identifier) |
Set session identifier for the message package. | |
bool | setSourceClientAddress (const string &address) |
Sets a client address. | |
bool | setSourceClientIdentifier (int identifier) |
Sets a client identifier. | |
bool | setSourceClientName (const string &name) |
Sets a client name. | |
bool | setSourceClientProtocol (const string &protocol) |
Sets a client protocol. | |
virtual bool | setType (const string &type) |
Set identity for this message. | |
virtual | ~MessagePackage () |
Public Attributes | |
unique_ptr< MessagePackageData > | m_data |
kanzi::connect::MessagePackage::MessagePackage | ( | ) |
|
virtual |
kanzi::connect::MessagePackage::MessagePackage | ( | MessagePackage && | package | ) |
kanzi::connect::MessagePackage::MessagePackage | ( | const MessagePackage & | package | ) |
bool kanzi::connect::MessagePackage::addBinaryAttribute | ( | int | key, |
const string & | value ) |
Add a binary string value to an attribute.
key | Key identifying the attribute. |
value | New value for the attribute. |
bool kanzi::connect::MessagePackage::addBinaryAttributeEx | ( | int | key, |
const unsigned char * | blob, | ||
size_t | size ) |
Add a binary data t to an attribute.
key | the identifier for binary data |
blob | the binary content |
size | the size of the binary data. |
bool kanzi::connect::MessagePackage::addBoolAttribute | ( | int | key, |
bool | value ) |
Add a boolean value to an attribute.
key | Key identifying the attribute. |
value | New value for the attribute. |
bool kanzi::connect::MessagePackage::addDoubleAttribute | ( | int | key, |
double | value ) |
Add a double value to an attribute.
key | Key identifying the attribute. |
value | New value for the attribute. |
bool kanzi::connect::MessagePackage::addFloatAttribute | ( | int | key, |
float | value ) |
Add a floating point value to an attribute.
key | Key identifying the attribute. |
value | New value for the attribute. |
bool kanzi::connect::MessagePackage::addInt64Attribute | ( | int | key, |
int64_t | value ) |
Add 64bit integer value to an attribute.
key | the key identifying the attribute. |
value | the new value |
bool kanzi::connect::MessagePackage::addIntAttribute | ( | int | key, |
int | value ) |
Add a integer value to an attribute.
key | Key identifying the attribute. |
value | New value for the attribute. |
bool kanzi::connect::MessagePackage::addPackageAttribute | ( | int | key, |
const MessagePackage & | value ) |
Add a child message package to an attribute.
key | Key identifying the attribute. |
value | New value for the attribute. |
bool kanzi::connect::MessagePackage::addStringAttribute | ( | int | key, |
const string & | value ) |
Add a string value to an attribute.
key | Key identifying the attribute. |
value | New value for the attribute. |
bool kanzi::connect::MessagePackage::addUInt64Attribute | ( | int | key, |
uint64_t | value ) |
Add 64-bit integer value to an attribute.
key | the key identifying the attribute. |
value | the new value |
bool kanzi::connect::MessagePackage::addUIntAttribute | ( | int | key, |
unsigned int | value ) |
Add a integer value to an attribute.
key | Key identifying the attribute. |
value | New value for the attribute. |
unsigned int kanzi::connect::MessagePackage::byteSize | ( | ) | const |
Get binary size for the message.
|
virtual |
Purge the contents of the package.
void kanzi::connect::MessagePackage::eraseAttribute | ( | int | key | ) |
Erase attribute array i.e.
clear all values for the given identifier.
key | Key identifying the attribute. |
string kanzi::connect::MessagePackage::getAttributeKeyString | ( | int | key | ) | const |
Get attribute key string for an attribute.
key | Key identifying the attribute. |
AttributeType kanzi::connect::MessagePackage::getAttributeType | ( | int | key | ) | const |
Get the type of an attribute.
key | Key identifying the attribute. |
size_t kanzi::connect::MessagePackage::getAttributeValuesCount | ( | int | key | ) | const |
Get the size of values array for an .
key Key of the attribute index.
string kanzi::connect::MessagePackage::getBinaryAttribute | ( | int | key, |
size_t | index ) const |
Get the binary string value of an attribute.
key | Key identifying the attribute. |
bool kanzi::connect::MessagePackage::getBoolAttribute | ( | int | key, |
size_t | index ) const |
Get the boolean value of an attribute.
key | Key identifying the attribute. |
int kanzi::connect::MessagePackage::getClientIdentifier | ( | ) | const |
Get client identifier.
For convenience mostly, a client identifier can be accessed directly using getIntAttribute with key ATTRIBUTE_KEY_CLIENTID
double kanzi::connect::MessagePackage::getDoubleAttribute | ( | int | key, |
size_t | index ) const |
Get the double value of an attribute.
key | Key identifying the attribute. |
float kanzi::connect::MessagePackage::getFloatAttribute | ( | int | key, |
size_t | index ) const |
Get the floating point value of an attribute.
key | Key identifying the attribute. |
uint32_t kanzi::connect::MessagePackage::getHandle | ( | ) | const |
int64_t kanzi::connect::MessagePackage::getInt64Attribute | ( | int | key, |
size_t | index ) const |
Get the integer value of an attribute.
key | Key identifying the attribute. |
index | Index of the attribute value. See getAttributeValuesCount(). |
int kanzi::connect::MessagePackage::getIntAttribute | ( | int | key, |
size_t | index ) const |
Get the integer value of an attribute.
key | Key identifying the attribute. |
index | Index of the attribute value. See getAttributeValuesCount(). |
string kanzi::connect::MessagePackage::getInterfaceIdentifier | ( | ) | const |
Get interface identifier.
For convenience mostly, an interface identifier can be accessed directly using getStringAttribute with key ATTRIBUTE_KEY_INTERFACEID
string kanzi::connect::MessagePackage::getInvokeName | ( | ) | const |
Get invoke name.
For convenience mostly, an invoke name can be accessed directly using getStringAttribute with key ATTRIBUTE_KEY_INVOKE_NAME
MessageType kanzi::connect::MessagePackage::getMessageType | ( | ) | const |
Get message type.
MessagePackage kanzi::connect::MessagePackage::getPackageAttribute | ( | int | key, |
size_t | index ) const |
Get the child message package of an attribute.
key | Key identifying the attribute. |
bool kanzi::connect::MessagePackage::getPackageAttributeTo | ( | int | key, |
size_t | index, | ||
MessagePackage * | to ) const |
Get the child message package of an attribute.
key | Key identifying the attribute. |
index | the index of the package in case multiple. |
to | target package where to store the package from attribute. |
int kanzi::connect::MessagePackage::getSessionIdentifier | ( | ) | const |
Get session identifier.
For convenience mostly, a session identifier can be accessed directly using getIntAttribute with key ATTRIBUTE_KEY_SESSIONID
string kanzi::connect::MessagePackage::getSourceClientAddress | ( | ) | const |
Retrieve configured client address.
Used with remote services.
int kanzi::connect::MessagePackage::getSourceClientIdentifier | ( | ) | const |
Retrieve source client identifier.
Used with remote services.
string kanzi::connect::MessagePackage::getSourceClientName | ( | ) | const |
Retrieve configure client name.
Used with remote services.
string kanzi::connect::MessagePackage::getSourceClientProtocol | ( | ) | const |
Retrieve configured client protocol.
Used with remote services.
string kanzi::connect::MessagePackage::getStringAttribute | ( | int | key, |
size_t | index ) const |
Get the string value of an attribute.
key | Key identifying the attribute. |
|
virtual |
Get identity of this message.
ToDo: To be renamed to getName() or alike
Reimplemented in kanzi::connect::P2PLinkEstablishedMessage.
uint64_t kanzi::connect::MessagePackage::getUInt64Attribute | ( | int | key, |
size_t | index ) const |
Get the 64-bit unsigned integer value of an attribute.
key | Key identifying the attribute. |
index | Index of the attribute value. See getAttributeValuesCount(). |
unsigned int kanzi::connect::MessagePackage::getUIntAttribute | ( | int | key, |
size_t | index ) const |
Get the unsigned integer value of an attribute.
key | Key identifying the attribute. |
index | Index of the attribute value. See getAttributeValuesCount(). |
|
virtual |
MessagePackage & kanzi::connect::MessagePackage::operator= | ( | const MessagePackage & | package | ) |
|
virtual |
Serialize message container to a string.
If attribute array contains boolean attribute ATTRIBUTE_KEY_TO_JSON with value true, the output string is to be produced as JSON, binary otherwise.
bool kanzi::connect::MessagePackage::setAttributeKeyString | ( | int | key, |
const string & | keyString ) |
Set attribute key string for an attribute.
Attribute setting and reading is based currently only the numeric value of the key so the key string is just additional information for the other peer.
key | Key identifying the attribute. |
keyString | The string to be attached to key. |
bool kanzi::connect::MessagePackage::setClientIdentifier | ( | int | identifier | ) |
Set client identifier for the message package.
For convenience mostly, client identifier can be modified directly using addIntAttribute with key ATTRIBUTE_KEY_CLIENTID
identifier | Identifier of a client. |
bool kanzi::connect::MessagePackage::setHandle | ( | uint32_t | handle | ) |
bool kanzi::connect::MessagePackage::setInterfaceIdentifier | ( | const string & | identifier | ) |
Set interface identifier for the message package.
For convenience mostly, client identifier can be modified directly using addStringAttribute with key ATTRIBUTE_KEY_INTERFACEID
identifier | Identifier of the client. |
bool kanzi::connect::MessagePackage::setInvokeName | ( | const string & | invokeName | ) |
Set invoke name for the message package.
For convenience mostly, invoke name can be modified directly using addStringAttribute with key ATTRIBUTE_KEY_INVOKE_NAME
identifier | Identifier of the client. |
bool kanzi::connect::MessagePackage::setMessageType | ( | MessageType | type | ) |
Set message type.
type | The type of the message package. See MessagePackage::MessageType. |
bool kanzi::connect::MessagePackage::setSessionIdentifier | ( | int | identifier | ) |
Set session identifier for the message package.
For convenience mostly, a session identifier can be modified directly using addIntAttribute with key ATTRIBUTE_KEY_SESSIONID
identifier | Identifier of a client. |
bool kanzi::connect::MessagePackage::setSourceClientAddress | ( | const string & | address | ) |
Sets a client address.
Used in remote service communication to hold the address of the client that originally contacted server.
address | the address (IP usually, but can be anything) to set. |
bool kanzi::connect::MessagePackage::setSourceClientIdentifier | ( | int | identifier | ) |
Sets a client identifier.
Used in remote service communication to hold the client identifier at the server.
identifier | the identifier number. |
bool kanzi::connect::MessagePackage::setSourceClientName | ( | const string & | name | ) |
Sets a client name.
Used in remote service communication to hold the name of the client that contacted the server.
name | the client name. |
bool kanzi::connect::MessagePackage::setSourceClientProtocol | ( | const string & | protocol | ) |
Sets a client protocol.
Used in remote service communication to hold the protocol used when client contacted server.
protocol | the communications protocol used. |
|
virtual |
Set identity for this message.
ToDo: To be renamed to setName() or alike
type | Type name for the message. |
unique_ptr<MessagePackageData> kanzi::connect::MessagePackage::m_data |