Kanzi Connect  3.9.9
Kanzi Connect C++ API
kanzi::connect::ServiceMethodSignature Class Reference

Class to encapsulate a service and method in a manner it can be compared to match the network message. More...

#include <messageutil.hpp>

Public Member Functions

const string & getMangledName () const
 Retrieve mangled name that is calculated. More...
 
bool matchToMessage (const MessagePackage &message) const
 Tries to match this object to a message. More...
 

Static Public Member Functions

static ServiceMethodSignatureSharedPtr createEvent (const string &service, const string &invokableName)
 Factory function to create instance of class. More...
 
static ServiceMethodSignatureSharedPtr createEvent (const string &completeName)
 Factory function to create instance of class. More...
 
static ServiceMethodSignatureSharedPtr createMethod (const string &service, const string &invokableName)
 Factory function to create instance of class. More...
 
static ServiceMethodSignatureSharedPtr createMethod (const string &completeName)
 Factory function to create instance of class. More...
 
static ServiceMethodSignatureSharedPtr createPropertySetter (const string &service, const string &dottedPathToAttribute)
 Factory function to create instance of class. More...
 
static ServiceMethodSignatureSharedPtr createPropertySetter (const string &completeName)
 Factory function to create instance of class. More...
 

Protected Member Functions

void calculateMangledName ()
 Calculates mangled name. More...
 
string toCamelCase (const string &candidate, const string &separator)
 Capitalizes a string. More...
 

Static Protected Member Functions

static void split (const string &completeName, string &service, string &entity)
 Splits a string into parts "Connect.Service.Media.play_track" => service=Media, entity="play_track" "Connect.CoreService.Cluster.engine.rpm" => service=Cluster, entity="engine.rpm" "Media.next" => service=Media, entity="next". More...
 

Detailed Description

Class to encapsulate a service and method in a manner it can be compared to match the network message.

Member Function Documentation

◆ calculateMangledName()

void kanzi::connect::ServiceMethodSignature::calculateMangledName ( )
protected

Calculates mangled name.

◆ createEvent() [1/2]

static ServiceMethodSignatureSharedPtr kanzi::connect::ServiceMethodSignature::createEvent ( const string &  service,
const string &  invokableName 
)
static

Factory function to create instance of class.

Parameters
servicethe service. For example "Cluster"
invokableNamethe name of the event
Returns
newly allocated object.

◆ createEvent() [2/2]

static ServiceMethodSignatureSharedPtr kanzi::connect::ServiceMethodSignature::createEvent ( const string &  completeName)
static

Factory function to create instance of class.

Parameters
completeNamecomplete name to method, i.e. can be like: "Media.playback_state" or "Connect.Service.Media.playback_state" or "Connect.CoreService.Content.notify_result"
Returns
newly allocated object.

◆ createMethod() [1/2]

static ServiceMethodSignatureSharedPtr kanzi::connect::ServiceMethodSignature::createMethod ( const string &  service,
const string &  invokableName 
)
static

Factory function to create instance of class.

Parameters
servicethe service. For example "Cluster"
invokableNamethe name of the method.
Returns
newly allocated object.

◆ createMethod() [2/2]

static ServiceMethodSignatureSharedPtr kanzi::connect::ServiceMethodSignature::createMethod ( const string &  completeName)
static

Factory function to create instance of class.

Parameters
completeNamecomplete name to method, i.e. can be like: "Media.play_track" or "Connect.Service.Media.play_track" or "Connect.CoreService.Media.play_track"
Returns
newly allocated object.

◆ createPropertySetter() [1/2]

static ServiceMethodSignatureSharedPtr kanzi::connect::ServiceMethodSignature::createPropertySetter ( const string &  service,
const string &  dottedPathToAttribute 
)
static

Factory function to create instance of class.

Parameters
servicethe service. For example "Cluster"
dottedPathToAttributedot separated path to attribute that is to be mangled (E.g. engine.gear.value)
Returns
newly allocated object.

◆ createPropertySetter() [2/2]

static ServiceMethodSignatureSharedPtr kanzi::connect::ServiceMethodSignature::createPropertySetter ( const string &  completeName)
static

Factory function to create instance of class.

Parameters
completeNamecomplete name to method, i.e. can be like: "Media.playback.position" or "Connect.Service.Media.playback.position"
Returns
newly allocated object.

◆ getMangledName()

const string& kanzi::connect::ServiceMethodSignature::getMangledName ( ) const

Retrieve mangled name that is calculated.

Returns
mangled name

◆ matchToMessage()

bool kanzi::connect::ServiceMethodSignature::matchToMessage ( const MessagePackage message) const

Tries to match this object to a message.

Parameters
messagethe message to match
Returns
true if matched, false otherwise.

◆ split()

static void kanzi::connect::ServiceMethodSignature::split ( const string &  completeName,
string &  service,
string &  entity 
)
staticprotected

Splits a string into parts "Connect.Service.Media.play_track" => service=Media, entity="play_track" "Connect.CoreService.Cluster.engine.rpm" => service=Cluster, entity="engine.rpm" "Media.next" => service=Media, entity="next".

Parameters
completeNamecomplete name that may include "Connect.Service." or "Connect.CoreService." prefix that will be removed.
servicewill be filled with service information
entitywill be filled with everything after service.

◆ toCamelCase()

string kanzi::connect::ServiceMethodSignature::toCamelCase ( const string &  candidate,
const string &  separator 
)
protected

Capitalizes a string.

E.g. "this_and_that" will become "ThisAndThat" Also "camel" will become "Camel"

Parameters
candidatestring candidate
separatorthe separator character
Returns
camel cased string

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