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

Collection of utility functions related to message handling. More...

#include <messageutil.hpp>

Static Public Member Functions

template<class _T >
static shared_ptr< _T > buildPtrReplyTo (const MessagePackage &source)
 Builds a reply message to the provided message package. More...
 
template<class _T >
static _T buildReplyTo (const MessagePackage &source)
 Builds a reply message to provided package. More...
 
template<class _T >
static void buildReplyTo (const MessagePackage &source, _T &messageObject)
 Builds a reply message to the provided package. More...
 
static bool matchEventToMessage (const string &service, const string &eventname, const MessagePackage &package)
 Matches an event name (as written to xml interface definition) into a message package. More...
 
static bool matchMethodToMessage (const string &service, const string &methodname, const MessagePackage &package)
 Matches a method name (as written to xml interface definition) into a message package. More...
 
static bool matchPropertySetterToMessage (const string &service, const string &pathtodata, const MessagePackage &package)
 Matches a write request to a writable service property into a message package. More...
 
static MessagePackageSharedPtr packageMessage (MessagePackage &message)
 Inserts a given message inside a message package. More...
 
static void packageMessage (MessagePackage &message, MessagePackage &to)
 Inserts a given message inside a given message package. More...
 

Detailed Description

Collection of utility functions related to message handling.

Member Function Documentation

◆ buildPtrReplyTo()

template<class _T >
static shared_ptr<_T> kanzi::connect::MessageUtil::buildPtrReplyTo ( const MessagePackage source)
inlinestatic

Builds a reply message to the provided message package.

Parameters
sourceThe message package.
Returns
The allocated message.

◆ buildReplyTo() [1/2]

template<class _T >
static _T kanzi::connect::MessageUtil::buildReplyTo ( const MessagePackage source)
inlinestatic

Builds a reply message to provided package.

Parameters
sourcesource message package.
Returns
new message - passed by value.

◆ buildReplyTo() [2/2]

template<class _T >
static void kanzi::connect::MessageUtil::buildReplyTo ( const MessagePackage source,
_T &  messageObject 
)
inlinestatic

Builds a reply message to the provided package.

Parameters
sourceSource message package.
messageObjectTarget message object.

◆ matchEventToMessage()

static bool kanzi::connect::MessageUtil::matchEventToMessage ( const string &  service,
const string &  eventname,
const MessagePackage package 
)
static

Matches an event name (as written to xml interface definition) into a message package.

Parameters
serviceThe name of the service. For example, "Media".
eventnameThe name of the event as it is written to XML. For example, "play_state_changed"
packageThe message in package to match.
Returns
If the event name matches a message package, true, otherwise false.

◆ matchMethodToMessage()

static bool kanzi::connect::MessageUtil::matchMethodToMessage ( const string &  service,
const string &  methodname,
const MessagePackage package 
)
static

Matches a method name (as written to xml interface definition) into a message package.

Parameters
serviceThe name of the service. For example, "Media".
methodnameThe name of the method as it is written to XML. For example, "play_track".
packageThe message in package to match.
Returns
If the method name matches a message package, true, otherwise false.

◆ matchPropertySetterToMessage()

static bool kanzi::connect::MessageUtil::matchPropertySetterToMessage ( const string &  service,
const string &  pathtodata,
const MessagePackage package 
)
static

Matches a write request to a writable service property into a message package.

Parameters
serviceThe name of the service. For example, "Cluster".
pathtodataDotted path to data to be written. For example, "Engine.gear".
packageThe message in package to match.
Returns
If the write reques matches a message package, true, otherwise false.

◆ packageMessage() [1/2]

static MessagePackageSharedPtr kanzi::connect::MessageUtil::packageMessage ( MessagePackage message)
static

Inserts a given message inside a message package.

Parameters
messageThe message to insert into the package
Returns
Packaged message returned by value.

◆ packageMessage() [2/2]

static void kanzi::connect::MessageUtil::packageMessage ( MessagePackage message,
MessagePackage to 
)
static

Inserts a given message inside a given message package.

Parameters
messageThe message to incsert into the package.
toThe package container into which to insert the message.

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