Kanzi Connect  3.9.8
Kanzi Connect C++ API
kanzi::connect::MessagePackage Class Reference

#include <message_package.hpp>

Inheritance diagram for kanzi::connect::MessagePackage:
kanzi::connect::P2PLinkEstablishedMessage kanzi::connect::StreamNewBlobEvent kanzi::connect::StreamReceiveEncoderParameterEvent kanzi::connect::StreamReceiveStreamInfoEvent kanzi::connect::StreamRemoveSubscriptionMethod kanzi::connect::StreamRequestEncoderParameterMethod kanzi::connect::StreamRequestStreamInfoMethod kanzi::connect::StreamRestartEncoderMethod kanzi::connect::StreamSetEncoderParameterMethod kanzi::connect::StreamSetStreamContentMethod kanzi::connect::StreamSubscribeBlobsMethod kanzi::connect::StreamSubscriptionResultEvent

Public Types

enum  AttributeType {
  ATTRIBUTE_VALUE_TYPE_UNKNOWN = 0, ATTRIBUTE_VALUE_TYPE_INTEGER = 1, ATTRIBUTE_VALUE_TYPE_FLOAT = 2, ATTRIBUTE_VALUE_TYPE_BOOL = 3,
  ATTRIBUTE_VALUE_TYPE_STRING = 4, ATTRIBUTE_VALUE_TYPE_BINARY = 5, ATTRIBUTE_VALUE_TYPE_PACKAGE = 6, ATTRIBUTE_VALUE_TYPE_INTEGER64 = 7,
  ATTRIBUTE_VALUE_TYPE_DOUBLE = 8, ATTRIBUTE_VALUE_TYPE_UNSIGNED_INTEGER = 9, ATTRIBUTE_VALUE_TYPE_UNSIGNED_INTEGER64 = 10, ATTRIBUTE_VALUE_TYPE_VOID = 11
}
 
enum  CongestionControl { CONGESTION_CONTROL_NONE = 0, CONGESTION_CONTROL_KEEP_LAST = 1, CONGESTION_CONTROL_ARRAY_ATTRIBUTES = 2 }
 
enum  FixedAttributeKeys {
  ATTRIBUTE_KEY_UNKNOWN = 0, ATTRIBUTE_KEY_NAME = 1, ATTRIBUTE_KEY_EXPECTED_RETURNVALUE_TYPE = 2, ATTRIBUTE_KEY_RETURNVALUE = 3,
  ATTRIBUTE_KEY_ARGUMENT_COUNT = 4, ATTRIBUTE_KEY_CLIENTID = 5, ATTRIBUTE_KEY_SESSIONID = 6, ATTRIBUTE_KEY_INTERFACEID = 7,
  ATTRIBUTE_KEY_TO_JSON = 8, ATTRIBUTE_KEY_MESSAGETYPE = 9, ATTRIBUTE_KEY_VERSION = 10, ATTRIBUTE_KEY_WRAPPED_MESSAGE = 11,
  ATTRIBUTE_KEY_P2P_CLIENT_ID = 12, ATTRIBUTE_KEY_REMOTESERVICE_CLIENT_PROTOCOL = 13, ATTRIBUTE_KEY_REMOTESERVICE_CLIENT_ADDRESS = 14, ATTRIBUTE_KEY_REMOTESERVICE_CLIENT_NAME = 15,
  ATTRIBUTE_KEY_REMOTESERVICE_CLIENT_IDENTIFIER = 16, ATTRIBUTE_KEY_P2P_SERVER_CLIENT_ID = 17, ATTRIBUTE_KEY_CONGESTION_CONTROL = 18, ATTRIBUTE_KEY_INVOKE_NAME = 19,
  ATTRIBUTE_KEY_ARGUMENT_1 = 20, ATTRIBUTE_KEY_ARGUMENT_101 = 120, ATTRIBUTE_KEY_LAST_RESERVED = 127, ATTRIBUTE_KEY_RPC_CALL_HANDLE = -128,
  ATTRIBUTE_KEY_RPC_STATUS = -129, ATTRIBUTE_KEY_TYPE_DETAILS = -130, ARRIBUTE_KEYS_BEGIN_EXTENDED_RANGE = 227
}
 
enum  MessageType {
  MESSAGETYPE_UNSPECIFIED = 0, MESSAGETYPE_METHOD = 1, MESSAGETYPE_ROUTED_METHOD = 2, MESSAGETYPE_EVENT = 3,
  MESSAGETYPE_ROUTED_EVENT = 4, MESSAGETYPE_METHOD_RETURN = 5, MESSAGETYPE_ROUTED_METHOD_RETURN = 6, MESSAGETYPE_INVALID_ARGUMENTS_RESPONSE = 7,
  MESSAGETYPE_ATTRIBUTE_IS_SETTER = 32, MESSAGETYPE_ATTRIBUTE_IS_GETTER = 33, MESSAGETYPE_ATTRIBUTE_IS_NOTIFY = 34
}
 
enum  SerializationFormat { SerializationFormatBinary = 1, SerializationFormatJson, SerializationFormatCompressedBinary }
 

Public Member Functions

bool addBinaryAttribute (int key, const string &value)
 Add a binary string value to an attribute. More...
 
bool addBinaryAttributeEx (int key, const unsigned char *blob, size_t size)
 Add a binary data t to an attribute. More...
 
bool addBoolAttribute (int key, bool value)
 Add a boolean value to an attribute. More...
 
bool addDoubleAttribute (int key, double value)
 Add a double value to an attribute. More...
 
bool addFloatAttribute (int key, float value)
 Add a floating point value to an attribute. More...
 
bool addInt64Attribute (int key, int64_t value)
 Add 64bit integer value to an attribute. More...
 
bool addIntAttribute (int key, int value)
 Add a integer value to an attribute. More...
 
bool addPackageAttribute (int key, const MessagePackage &value)
 Add a child message package to an attribute. More...
 
bool addStringAttribute (int key, const string &value)
 Add a string value to an attribute. More...
 
bool addUInt64Attribute (int key, uint64_t value)
 Add 64-bit integer value to an attribute. More...
 
bool addUIntAttribute (int key, unsigned int value)
 Add a integer value to an attribute. More...
 
unsigned int byteSize () const
 Get binary size for the message. More...
 
virtual void clear ()
 Purge the contents of the package. More...
 
void eraseAttribute (int key)
 Erase attribute array i.e. More...
 
string getAttributeKeyString (int key) const
 Get attribute key string for an attribute. More...
 
AttributeType getAttributeType (int key) const
 Get the type of an attribute. More...
 
size_t getAttributeValuesCount (int key) const
 Get the size of values array for an . More...
 
string getBinaryAttribute (int key, size_t index) const
 Get the binary string value of an attribute. More...
 
bool getBoolAttribute (int key, size_t index) const
 Get the boolean value of an attribute. More...
 
int getClientIdentifier () const
 Get client identifier. More...
 
double getDoubleAttribute (int key, size_t index) const
 Get the double value of an attribute. More...
 
float getFloatAttribute (int key, size_t index) const
 Get the floating point value of an attribute. More...
 
uint32_t getHandle () const
 
int64_t getInt64Attribute (int key, size_t index) const
 Get the integer value of an attribute. More...
 
int getIntAttribute (int key, size_t index) const
 Get the integer value of an attribute. More...
 
string getInterfaceIdentifier () const
 Get interface identifier. More...
 
string getInvokeName () const
 Get invoke name. More...
 
MessageType getMessageType () const
 Get message type. More...
 
MessagePackage getPackageAttribute (int key, size_t index) const
 Get the child message package of an attribute. More...
 
bool getPackageAttributeTo (int key, size_t index, MessagePackage *to) const
 Get the child message package of an attribute. More...
 
int getSessionIdentifier () const
 Get session identifier. More...
 
string getSourceClientAddress () const
 Retrieve configured client address. More...
 
int getSourceClientIdentifier () const
 Retrieve source client identifier. More...
 
string getSourceClientName () const
 Retrieve configure client name. More...
 
string getSourceClientProtocol () const
 Retrieve configured client protocol. More...
 
string getStringAttribute (int key, size_t index) const
 Get the string value of an attribute. More...
 
virtual string getType () const
 Get identity of this message. More...
 
uint64_t getUInt64Attribute (int key, size_t index) const
 Get the 64-bit unsigned integer value of an attribute. More...
 
unsigned int getUIntAttribute (int key, size_t index) const
 Get the unsigned integer value of an attribute. More...
 
virtual bool initialize (const string &buffer, bool isBinary)
 
 MessagePackage ()
 
 MessagePackage (MessagePackage &&package)
 
 MessagePackage (const MessagePackage &package)
 
MessagePackageoperator= (const MessagePackage &package)
 
virtual string serializeAsString () const
 Serialize message container to a string. More...
 
bool setAttributeKeyString (int key, const string &keyString)
 Set attribute key string for an attribute. More...
 
bool setClientIdentifier (int identifier)
 Set client identifier for the message package. More...
 
bool setHandle (uint32_t handle)
 
bool setInterfaceIdentifier (const string &identifier)
 Set interface identifier for the message package. More...
 
bool setInvokeName (const string &invokeName)
 Set invoke name for the message package. More...
 
bool setMessageType (MessageType type)
 Set message type. More...
 
bool setSessionIdentifier (int identifier)
 Set session identifier for the message package. More...
 
bool setSourceClientAddress (const string &address)
 Sets a client address. More...
 
bool setSourceClientIdentifier (int identifier)
 Sets a client identifier. More...
 
bool setSourceClientName (const string &name)
 Sets a client name. More...
 
bool setSourceClientProtocol (const string &protocol)
 Sets a client protocol. More...
 
virtual bool setType (const string &type)
 Set identity for this message. More...
 
virtual ~MessagePackage ()
 

Public Attributes

unique_ptr< MessagePackageData > m_data
 

Member Enumeration Documentation

◆ AttributeType

Enumerator
ATTRIBUTE_VALUE_TYPE_UNKNOWN 
ATTRIBUTE_VALUE_TYPE_INTEGER 
ATTRIBUTE_VALUE_TYPE_FLOAT 
ATTRIBUTE_VALUE_TYPE_BOOL 
ATTRIBUTE_VALUE_TYPE_STRING 
ATTRIBUTE_VALUE_TYPE_BINARY 
ATTRIBUTE_VALUE_TYPE_PACKAGE 
ATTRIBUTE_VALUE_TYPE_INTEGER64 
ATTRIBUTE_VALUE_TYPE_DOUBLE 
ATTRIBUTE_VALUE_TYPE_UNSIGNED_INTEGER 
ATTRIBUTE_VALUE_TYPE_UNSIGNED_INTEGER64 
ATTRIBUTE_VALUE_TYPE_VOID 

◆ CongestionControl

Enumerator
CONGESTION_CONTROL_NONE 
CONGESTION_CONTROL_KEEP_LAST 
CONGESTION_CONTROL_ARRAY_ATTRIBUTES 

◆ FixedAttributeKeys

Enumerator
ATTRIBUTE_KEY_UNKNOWN 
ATTRIBUTE_KEY_NAME 
ATTRIBUTE_KEY_EXPECTED_RETURNVALUE_TYPE 
ATTRIBUTE_KEY_RETURNVALUE 
ATTRIBUTE_KEY_ARGUMENT_COUNT 
ATTRIBUTE_KEY_CLIENTID 
ATTRIBUTE_KEY_SESSIONID 
ATTRIBUTE_KEY_INTERFACEID 
ATTRIBUTE_KEY_TO_JSON 
ATTRIBUTE_KEY_MESSAGETYPE 
ATTRIBUTE_KEY_VERSION 
ATTRIBUTE_KEY_WRAPPED_MESSAGE 
ATTRIBUTE_KEY_P2P_CLIENT_ID 
ATTRIBUTE_KEY_REMOTESERVICE_CLIENT_PROTOCOL 
ATTRIBUTE_KEY_REMOTESERVICE_CLIENT_ADDRESS 
ATTRIBUTE_KEY_REMOTESERVICE_CLIENT_NAME 
ATTRIBUTE_KEY_REMOTESERVICE_CLIENT_IDENTIFIER 
ATTRIBUTE_KEY_P2P_SERVER_CLIENT_ID 

Specifies the client identifier number as its seen by the server.

ATTRIBUTE_KEY_CONGESTION_CONTROL 
ATTRIBUTE_KEY_INVOKE_NAME 
ATTRIBUTE_KEY_ARGUMENT_1 
ATTRIBUTE_KEY_ARGUMENT_101 
ATTRIBUTE_KEY_LAST_RESERVED 
ATTRIBUTE_KEY_RPC_CALL_HANDLE 
ATTRIBUTE_KEY_RPC_STATUS 
ATTRIBUTE_KEY_TYPE_DETAILS 
ARRIBUTE_KEYS_BEGIN_EXTENDED_RANGE 

◆ MessageType

Enumerator
MESSAGETYPE_UNSPECIFIED 
MESSAGETYPE_METHOD 
MESSAGETYPE_ROUTED_METHOD 
MESSAGETYPE_EVENT 
MESSAGETYPE_ROUTED_EVENT 
MESSAGETYPE_METHOD_RETURN 
MESSAGETYPE_ROUTED_METHOD_RETURN 
MESSAGETYPE_INVALID_ARGUMENTS_RESPONSE 
MESSAGETYPE_ATTRIBUTE_IS_SETTER 
MESSAGETYPE_ATTRIBUTE_IS_GETTER 
MESSAGETYPE_ATTRIBUTE_IS_NOTIFY 

◆ SerializationFormat

Enumerator
SerializationFormatBinary 

Binary format that preserves bandwidth, for low-latency purposes.

SerializationFormatJson 

JSON format which is more verbose, mainly for REST.

SerializationFormatCompressedBinary 

Constructor & Destructor Documentation

◆ MessagePackage() [1/3]

kanzi::connect::MessagePackage::MessagePackage ( )

◆ ~MessagePackage()

virtual kanzi::connect::MessagePackage::~MessagePackage ( )
virtual

◆ MessagePackage() [2/3]

kanzi::connect::MessagePackage::MessagePackage ( MessagePackage &&  package)

◆ MessagePackage() [3/3]

kanzi::connect::MessagePackage::MessagePackage ( const MessagePackage package)

Member Function Documentation

◆ addBinaryAttribute()

bool kanzi::connect::MessagePackage::addBinaryAttribute ( int  key,
const string &  value 
)

Add a binary string value to an attribute.

Parameters
keyKey identifying the attribute.
valueNew value for the attribute.
Returns
True on success.

◆ addBinaryAttributeEx()

bool kanzi::connect::MessagePackage::addBinaryAttributeEx ( int  key,
const unsigned char *  blob,
size_t  size 
)

Add a binary data t to an attribute.

Parameters
keythe identifier for binary data
blobthe binary content
sizethe size of the binary data.

◆ addBoolAttribute()

bool kanzi::connect::MessagePackage::addBoolAttribute ( int  key,
bool  value 
)

Add a boolean value to an attribute.

Parameters
keyKey identifying the attribute.
valueNew value for the attribute.
Returns
True on success.

◆ addDoubleAttribute()

bool kanzi::connect::MessagePackage::addDoubleAttribute ( int  key,
double  value 
)

Add a double value to an attribute.

Parameters
keyKey identifying the attribute.
valueNew value for the attribute.
Returns
True on success.

◆ addFloatAttribute()

bool kanzi::connect::MessagePackage::addFloatAttribute ( int  key,
float  value 
)

Add a floating point value to an attribute.

Parameters
keyKey identifying the attribute.
valueNew value for the attribute.
Returns
True on success.

◆ addInt64Attribute()

bool kanzi::connect::MessagePackage::addInt64Attribute ( int  key,
int64_t  value 
)

Add 64bit integer value to an attribute.

Parameters
keythe key identifying the attribute.
valuethe new value
Returns
true on success.

◆ addIntAttribute()

bool kanzi::connect::MessagePackage::addIntAttribute ( int  key,
int  value 
)

Add a integer value to an attribute.

Parameters
keyKey identifying the attribute.
valueNew value for the attribute.
Returns
True on success.

◆ addPackageAttribute()

bool kanzi::connect::MessagePackage::addPackageAttribute ( int  key,
const MessagePackage value 
)

Add a child message package to an attribute.

Parameters
keyKey identifying the attribute.
valueNew value for the attribute.
Returns
True on success.

◆ addStringAttribute()

bool kanzi::connect::MessagePackage::addStringAttribute ( int  key,
const string &  value 
)

Add a string value to an attribute.

Parameters
keyKey identifying the attribute.
valueNew value for the attribute.
Returns
True on success.

◆ addUInt64Attribute()

bool kanzi::connect::MessagePackage::addUInt64Attribute ( int  key,
uint64_t  value 
)

Add 64-bit integer value to an attribute.

Parameters
keythe key identifying the attribute.
valuethe new value
Returns
true on success.

◆ addUIntAttribute()

bool kanzi::connect::MessagePackage::addUIntAttribute ( int  key,
unsigned int  value 
)

Add a integer value to an attribute.

Parameters
keyKey identifying the attribute.
valueNew value for the attribute.
Returns
True on success.

◆ byteSize()

unsigned int kanzi::connect::MessagePackage::byteSize ( ) const

Get binary size for the message.

Returns
The byte size of package.

◆ clear()

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

Purge the contents of the package.

◆ eraseAttribute()

void kanzi::connect::MessagePackage::eraseAttribute ( int  key)

Erase attribute array i.e.

clear all values for the given identifier.

Parameters
keyKey identifying the attribute.

◆ getAttributeKeyString()

string kanzi::connect::MessagePackage::getAttributeKeyString ( int  key) const

Get attribute key string for an attribute.

See setAttributeKeyString().

Parameters
keyKey identifying the attribute.
Returns
Attribute key string for the given attribute. Empty if the attribute is not found.

◆ getAttributeType()

AttributeType kanzi::connect::MessagePackage::getAttributeType ( int  key) const

Get the type of an attribute.

Parameters
keyKey identifying the attribute.
Returns
The type of the attribute. See MessagePackage::AttributeType. MessagePackage::ATTRIBUTE_VALUE_TYPE_UNKNOWN if attribute was not found.

◆ getAttributeValuesCount()

size_t kanzi::connect::MessagePackage::getAttributeValuesCount ( int  key) const

Get the size of values array for an .

key Key of the attribute index.

Returns
The count of the message attribute array items.

◆ getBinaryAttribute()

string kanzi::connect::MessagePackage::getBinaryAttribute ( int  key,
size_t  index 
) const

Get the binary string value of an attribute.

Parameters
keyKey identifying the attribute.
Returns
The integer value of the attribute. 0 if attribute was not found.

◆ getBoolAttribute()

bool kanzi::connect::MessagePackage::getBoolAttribute ( int  key,
size_t  index 
) const

Get the boolean value of an attribute.

Parameters
keyKey identifying the attribute.
Returns
The integer value of the attribute. 0 if attribute was not found.

◆ getClientIdentifier()

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

Returns
Identifier of the client bound to the message package.

◆ getDoubleAttribute()

double kanzi::connect::MessagePackage::getDoubleAttribute ( int  key,
size_t  index 
) const

Get the double value of an attribute.

Parameters
keyKey identifying the attribute.
Returns
The integer value of the attribute. 0 if attribute was not found.

◆ getFloatAttribute()

float kanzi::connect::MessagePackage::getFloatAttribute ( int  key,
size_t  index 
) const

Get the floating point value of an attribute.

Parameters
keyKey identifying the attribute.
Returns
The integer value of the attribute. 0 if attribute was not found.

◆ getHandle()

uint32_t kanzi::connect::MessagePackage::getHandle ( ) const

◆ getInt64Attribute()

int64_t kanzi::connect::MessagePackage::getInt64Attribute ( int  key,
size_t  index 
) const

Get the integer value of an attribute.

Parameters
keyKey identifying the attribute.
indexIndex of the attribute value. See getAttributeValuesCount().
Returns
The 64bit integer value of the attribute. 0 if attribute was not found.

◆ getIntAttribute()

int kanzi::connect::MessagePackage::getIntAttribute ( int  key,
size_t  index 
) const

Get the integer value of an attribute.

Parameters
keyKey identifying the attribute.
indexIndex of the attribute value. See getAttributeValuesCount().
Returns
The integer value of the attribute. 0 if attribute was not found.

◆ getInterfaceIdentifier()

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

Returns
Identifier of the interface bound to the message package.

◆ getInvokeName()

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

Returns
Identifier of the interface bound to the message package.

◆ getMessageType()

MessageType kanzi::connect::MessagePackage::getMessageType ( ) const

Get message type.

Returns
The type of the message package. See MessagePackage::MessageType.

◆ getPackageAttribute()

MessagePackage kanzi::connect::MessagePackage::getPackageAttribute ( int  key,
size_t  index 
) const

Get the child message package of an attribute.

Parameters
keyKey identifying the attribute.
Returns
The integer value of the attribute. 0 if attribute was not found.

◆ getPackageAttributeTo()

bool kanzi::connect::MessagePackage::getPackageAttributeTo ( int  key,
size_t  index,
MessagePackage to 
) const

Get the child message package of an attribute.

Parameters
keyKey identifying the attribute.
indexthe index of the package in case multiple.
totarget package where to store the package from attribute.
Returns
true if success, false otherwise.

◆ getSessionIdentifier()

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

Returns
Identifier of the session bound to the message package.

◆ getSourceClientAddress()

string kanzi::connect::MessagePackage::getSourceClientAddress ( ) const

Retrieve configured client address.

Used with remote services.

Returns
client address

◆ getSourceClientIdentifier()

int kanzi::connect::MessagePackage::getSourceClientIdentifier ( ) const

Retrieve source client identifier.

Used with remote services.

Returns
client identifier.

◆ getSourceClientName()

string kanzi::connect::MessagePackage::getSourceClientName ( ) const

Retrieve configure client name.

Used with remote services.

Returns
client name

◆ getSourceClientProtocol()

string kanzi::connect::MessagePackage::getSourceClientProtocol ( ) const

Retrieve configured client protocol.

Used with remote services.

Returns
client protocol

◆ getStringAttribute()

string kanzi::connect::MessagePackage::getStringAttribute ( int  key,
size_t  index 
) const

Get the string value of an attribute.

Parameters
keyKey identifying the attribute.
Returns
The integer value of the attribute. 0 if attribute was not found.

◆ getType()

virtual string kanzi::connect::MessagePackage::getType ( ) const
virtual

Get identity of this message.

ToDo: To be renamed to getName() or alike

Returns
Type name for the message.

Reimplemented in kanzi::connect::P2PLinkEstablishedMessage.

◆ getUInt64Attribute()

uint64_t kanzi::connect::MessagePackage::getUInt64Attribute ( int  key,
size_t  index 
) const

Get the 64-bit unsigned integer value of an attribute.

Parameters
keyKey identifying the attribute.
indexIndex of the attribute value. See getAttributeValuesCount().
Returns
The 64bit integer value of the attribute. 0 if attribute was not found.

◆ getUIntAttribute()

unsigned int kanzi::connect::MessagePackage::getUIntAttribute ( int  key,
size_t  index 
) const

Get the unsigned integer value of an attribute.

Parameters
keyKey identifying the attribute.
indexIndex of the attribute value. See getAttributeValuesCount().
Returns
The integer value of the attribute. 0 if attribute was not found.

◆ initialize()

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

◆ operator=()

MessagePackage& kanzi::connect::MessagePackage::operator= ( const MessagePackage package)

◆ serializeAsString()

virtual string kanzi::connect::MessagePackage::serializeAsString ( ) const
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.

Returns
Contents of the message container serialized as a string.

◆ setAttributeKeyString()

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.

Parameters
keyKey identifying the attribute.
keyStringThe string to be attached to key.
Returns
True on success.

◆ setClientIdentifier()

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

Parameters
identifierIdentifier of a client.
Returns
True on success.

◆ setHandle()

bool kanzi::connect::MessagePackage::setHandle ( uint32_t  handle)

◆ setInterfaceIdentifier()

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

Parameters
identifierIdentifier of the client.
Returns
True on success.

◆ setInvokeName()

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

Parameters
identifierIdentifier of the client.
Returns
True on success.

◆ setMessageType()

bool kanzi::connect::MessagePackage::setMessageType ( MessageType  type)

Set message type.

Parameters
typeThe type of the message package. See MessagePackage::MessageType.
Returns
True on success.

◆ setSessionIdentifier()

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

Parameters
identifierIdentifier of a client.
Returns
True on success.

◆ setSourceClientAddress()

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.

Parameters
addressthe address (IP usually, but can be anything) to set.
Returns
true if ok

◆ setSourceClientIdentifier()

bool kanzi::connect::MessagePackage::setSourceClientIdentifier ( int  identifier)

Sets a client identifier.

Used in remote service communication to hold the client identifier at the server.

Parameters
identifierthe identifier number.
Returns
true if ok

◆ setSourceClientName()

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.

Parameters
namethe client name.
Returns
true if ok

◆ setSourceClientProtocol()

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.

Parameters
protocolthe communications protocol used.
Returns
true if ok

◆ setType()

virtual bool kanzi::connect::MessagePackage::setType ( const string &  type)
virtual

Set identity for this message.

ToDo: To be renamed to setName() or alike

Parameters
typeType name for the message.
Returns
True on success.

Member Data Documentation

◆ m_data

unique_ptr<MessagePackageData> kanzi::connect::MessagePackage::m_data

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