Method class implementation.
More...
#include <genericserviceclient.hpp>
|
class | CallbackEx |
| Traditional c++ callback interface for external application bindings (Java) More...
|
|
Method class implementation.
◆ InvocationCallback
invocation callback function prototype
◆ InvocationResult
Result of a method invocation.
Enumerator |
---|
InvokeInProgress | Returned from invocation methods when invocation requires asynchronous processing or returns a value in which case the final comletion is through callback.
After invoke returns this value then the final value will be available in the callback.
|
InvokeSucceeded | Method invocation succeeded.
|
InvokeFailedSignatureMismatch | Method could not invoked because either the method name is wrong, or passed in arguments don't mach with method signature.
|
InvokeFailedIntrospectionFailure | Method could not be invoed because method signature introspection failed for some reason.
|
InvokeFailedTimedOut | Method was triggered but returnvalue was not received within specified invocation timeout.
|
InvokeFailedLinkBroken | Method was triggered but invocation overall status is not known since connection got broken.
|
InvokeFailedNoService | returned if service is not available when invoking a method.
|
InvokeFailed | Method invocation failed for unknown reason.
|
◆ Method()
C++ constructor.
This is not intenteded to be used directly, instead use GenericServiceClient::createMethod to factorize methods bound to a service.
- Parameters
-
service | the service method is bound to |
methodName | name of the method. |
◆ ~Method()
kanzi::connect::Method::~Method |
( |
| ) |
|
◆ addArgument() [1/5]
Method & kanzi::connect::Method::addArgument |
( |
const string & | argumentName, |
|
|
bool | argumentValue ) |
add named boolean argument
- Parameters
-
argumentName | the name of the argument |
argumentValue | value for the argument. |
- Returns
- reference to the method to allow chaining setup of arguments.
◆ addArgument() [2/5]
Method & kanzi::connect::Method::addArgument |
( |
const string & | argumentName, |
|
|
const char * | argumentValue ) |
add named string argument
- Parameters
-
argumentName | the name of the argument |
argumentValue | value for the argument. |
- Returns
- reference to the method to allow chaining setup of arguments.
◆ addArgument() [3/5]
Method & kanzi::connect::Method::addArgument |
( |
const string & | argumentName, |
|
|
const string & | argumentValue ) |
Adds named string argument.
- Parameters
-
argumentName | the name of the argument |
argumentValue | value for the argument. |
- Returns
- reference to the method to allow chaining setup of arguments.
◆ addArgument() [4/5]
Method & kanzi::connect::Method::addArgument |
( |
const string & | argumentName, |
|
|
float | argumentValue ) |
add named float argument
- Parameters
-
argumentName | the name of the argument |
argumentValue | value for the argument. |
- Returns
- reference to the method to allow chaining setup of arguments.
◆ addArgument() [5/5]
Method & kanzi::connect::Method::addArgument |
( |
const string & | argumentName, |
|
|
int | argumentValue ) |
add named integer argument
- Parameters
-
argumentName | the name of the argument |
argumentValue | value for the argument. |
- Returns
- reference to the method to allow chaining setup of arguments.
◆ addBinaryArgument()
Method & kanzi::connect::Method::addBinaryArgument |
( |
const string & | argumentName, |
|
|
const string & | argumentValue ) |
add named binary argument
- Parameters
-
argumentName | the name of the argument |
argumentValue | value for the argument. |
- Returns
- reference to the method to allow chaining setup of arguments.
◆ argumentHasType()
bool kanzi::connect::Method::argumentHasType |
( |
const string & | argumentName, |
|
|
int | messagePackageArgumentType ) const |
Check is the argument type correct or not.
- Parameters
-
argumentName | name of the argument to inspect |
messagePackageArgumentType | one of MessagePackage::ATTRIBUTE_VALUE_TYPE_* enumerations. |
- Returns
- true if type matches.
◆ cancel()
bool kanzi::connect::Method::cancel |
( |
| ) |
|
Cancel a method invocation.
Effectivy only if method was invoked in queued manner and it was still waiting for invocation.
- Returns
- true if operation was canceled.
◆ getArgument()
template<class _T >
_T kanzi::connect::Method::getArgument |
( |
const string & | argumentName | ) |
const |
|
inline |
Retrieve typed argument from variant map.
- Parameters
-
argumentName | name of the argument |
◆ getInvocationTimeout()
uint32_t kanzi::connect::Method::getInvocationTimeout |
( |
| ) |
const |
Return configured invocation timeout.
- Returns
- milliseconds
◆ getName()
const string & kanzi::connect::Method::getName |
( |
| ) |
const |
Returns the method name.
- Returns
- the name
◆ hasArgument()
bool kanzi::connect::Method::hasArgument |
( |
const string & | argumentName | ) |
const |
Is the named argument provided.
- Parameters
-
argumentName | name of the argument to inspect |
- Returns
- true if argument with provided name exists.
◆ invoke()
Invokes the method immediately.
If immediate invocation is not possible based on preconditions, then returns false.
- Parameters
-
callback | the callback that is invoked when method invocation is complete or it has failed due the some error. If method returns true then callback will be called at some point. |
- Returns
- true if method invocation was started.
◆ invokeEx()
- See also
- invokeImmediate
- Note
- This is intented for external application bindings (Java)
◆ invokeQueued()
Invokes the method immediately but if that is not possible then invocation is queued and executed later when invocation is possible again.
- Parameters
-
callback | the callback that is invoked when method invocation is complete or it has failed due the some error. If method returns true then callback will be called at some point. |
- Returns
- true if method invocation was started.
◆ invokeQueuedEx()
- See also
- invokeQueued
- Note
- This is intented for external application bindings (Java)
◆ setInvocationTimeout()
void kanzi::connect::Method::setInvocationTimeout |
( |
uint32_t | milliseconds | ) |
|
Configures method invcation timeout.
- Parameters
-
milliseconds | the timeout value. Mimimum accepted value is 100, maximum is INT_MAX. |
◆ GenericServiceClient
The documentation for this class was generated from the following file:
- connect/genericserviceclient.hpp