External client adapter that will represent a kanzi connect client on external language bindings. More...
#include <externalclientadapter.hpp>
Public Member Functions | |
| ExternalClientAdapter (Client &client, const string &identifier) | |
| Constructor. | |
| ExternalClientAdapter (ClientConnector &connector, const string &identifier) | |
| Constructor. | |
| bool | hasSession () const |
| Determines whether client is functional and has a session to be used in communication. | |
| virtual void | onMessageReceived (const MessagePackage &message) |
| Notification that interface has received a message. | |
| virtual void | onSessionRunning () |
| virtual void | onSessionStopped () |
| void | sendMessage (MessagePackage &message) |
| Sends a provided message to the corresponding service without expecting any returnvalues. | |
| RPCResult< bool > | sendMessageBool (MessagePackage &message) |
| Sends a message that expects bool returnvalue. | |
| RPCResult< float > | sendMessageFloat (MessagePackage &message) |
| Sends a message that expects float returnvalue. | |
| RPCResult< int32_t > | sendMessageInt (MessagePackage &message) |
| Sends a message that expects integer returnvalue. | |
| RPCResult< string > | sendMessageString (MessagePackage &message) |
| Sends a message that expects string returnvalue. | |
| RPCResult< void > | sendMessageVoid (MessagePackage &message) |
| Sends a message that expects void returnvalue. | |
| virtual | ~ExternalClientAdapter () |
| Destructor. | |
Public Member Functions inherited from kanzi::connect::AbstractServiceClient | |
| AbstractServiceClient () | |
| Constructor. | |
| AbstractSession::MessageSubscriptionToken | addMessageSubscription (const string &messageType, AbstractSession::MessageReceivedFunction function) |
| SessionRunningSubscriptionToken | addSessionRunningSubscription (SessionRunningFunction function) |
| SessionRunningSubscriptionToken | addSessionStoppedSubscription (SessionStoppedFunction function) |
| optional< int > | getActiveSessionIdentifier () |
| optional< const AbstractSession::ServiceAttributes > | getServiceAttributes () |
| void | removeMessageSubscription (const string &messageType, AbstractSession::MessageSubscriptionToken token) |
| void | removeSessionRunningSubscription (SessionRunningSubscriptionToken token) |
| void | removeSessionStoppedSubscription (SessionRunningSubscriptionToken token) |
| void | setEnabledState (bool newEnabledState) |
| Enable/disable the service by allowing or blocking traffic between client and server. | |
| bool | transmit (const MessagePackage &message) |
| virtual void | work () |
| Carry out asynchronous work bound to Kanzi Connect client main thread. | |
| virtual | ~AbstractServiceClient () |
| Destructor. | |
Public Member Functions inherited from kanzi::connect::InterfaceObserver | |
| virtual | ~InterfaceObserver () |
| Destructor. | |
Protected Member Functions | |
| string | getIdentifier () const |
| Returns the type of the service. | |
Protected Member Functions inherited from kanzi::connect::AbstractServiceClient | |
| virtual AbstractSessionSharedPtr | getSession () |
Additional Inherited Members | |
Public Types inherited from kanzi::connect::AbstractServiceClient | |
| typedef function< void(void)> | SessionRunningFunction |
| typedef shared_ptr< void > | SessionRunningSubscriptionToken |
| typedef function< void(void)> | SessionStoppedFunction |
Protected Types inherited from kanzi::connect::AbstractServiceClient | |
| enum | SessionState { INITIALIZED = 0 , RUNNING = 1 , STOPPED = 2 } |
Protected Attributes inherited from kanzi::connect::AbstractServiceClient | |
| SessionState | m_sessionState |
External client adapter that will represent a kanzi connect client on external language bindings.
| kanzi::connect::ExternalClientAdapter::ExternalClientAdapter | ( | Client & | client, |
| const string & | identifier ) |
Constructor.
| client | the client instance. |
| identifier | service identitifier this client connects to. |
| kanzi::connect::ExternalClientAdapter::ExternalClientAdapter | ( | ClientConnector & | connector, |
| const string & | identifier ) |
Constructor.
| connector | Client connector instance this client is connected to. |
| identifier | service identitifier this client connects to. |
|
inlinevirtual |
Destructor.
|
protectedvirtual |
Returns the type of the service.
Implements kanzi::connect::AbstractServiceClient.
| bool kanzi::connect::ExternalClientAdapter::hasSession | ( | ) | const |
Determines whether client is functional and has a session to be used in communication.
|
virtual |
Notification that interface has received a message.
| message | Message that was received. |
Reimplemented from kanzi::connect::InterfaceObserver.
|
virtual |
Reimplemented from kanzi::connect::AbstractServiceClient.
|
virtual |
Reimplemented from kanzi::connect::AbstractServiceClient.
| void kanzi::connect::ExternalClientAdapter::sendMessage | ( | MessagePackage & | message | ) |
Sends a provided message to the corresponding service without expecting any returnvalues.
| message | message to send. Might get modified along the way. |
| RPCResult< bool > kanzi::connect::ExternalClientAdapter::sendMessageBool | ( | MessagePackage & | message | ) |
Sends a message that expects bool returnvalue.
| message | the message to be sent |
| RPCResult< float > kanzi::connect::ExternalClientAdapter::sendMessageFloat | ( | MessagePackage & | message | ) |
Sends a message that expects float returnvalue.
| message | the message to be sent |
| RPCResult< int32_t > kanzi::connect::ExternalClientAdapter::sendMessageInt | ( | MessagePackage & | message | ) |
Sends a message that expects integer returnvalue.
| message | the message to be sent |
| RPCResult< string > kanzi::connect::ExternalClientAdapter::sendMessageString | ( | MessagePackage & | message | ) |
Sends a message that expects string returnvalue.
| message | the message to be sent |
| RPCResult< void > kanzi::connect::ExternalClientAdapter::sendMessageVoid | ( | MessagePackage & | message | ) |
Sends a message that expects void returnvalue.
| message | the message to be sent |