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. More... | |
| ExternalClientAdapter (ClientConnector &connector, const string &identifier) | |
| Constructor. More... | |
| bool | hasSession () const |
| Determines whether client is functional and has a session to be used in communication. More... | |
| virtual void | onMessageReceived (const MessagePackage &message) |
| Notification that interface has received a message. More... | |
| virtual void | onSessionRunning () |
| Notification that interface/session entered running state. More... | |
| virtual void | onSessionStopped () |
| Notification that interface/session got stopped for a reason or another. More... | |
| void | sendMessage (MessagePackage &message) |
| Sends a provided message to the corresponding service without expecting any returnvalues. More... | |
| RPCResult< bool > | sendMessageBool (MessagePackage &message) |
| Sends a message that expects bool returnvalue. More... | |
| RPCResult< float > | sendMessageFloat (MessagePackage &message) |
| Sends a message that expects float returnvalue. More... | |
| RPCResult< int32_t > | sendMessageInt (MessagePackage &message) |
| Sends a message that expects integer returnvalue. More... | |
| RPCResult< string > | sendMessageString (MessagePackage &message) |
| Sends a message that expects string returnvalue. More... | |
| RPCResult< void > | sendMessageVoid (MessagePackage &message) |
| Sends a message that expects void returnvalue. More... | |
| virtual | ~ExternalClientAdapter () |
| Destructor. More... | |
Public Member Functions inherited from kanzi::connect::AbstractServiceClient | |
| AbstractServiceClient () | |
| Constructor. More... | |
| 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. More... | |
| bool | transmit (const MessagePackage &message) |
| virtual void | work () |
| Carry out asynchronous work bound to Kanzi Connect client main thread. More... | |
| virtual | ~AbstractServiceClient () |
| Destructor. More... | |
Public Member Functions inherited from kanzi::connect::InterfaceObserver | |
| virtual | ~InterfaceObserver () |
| Destructor. More... | |
Protected Member Functions | |
| string | getIdentifier () const |
| Returns the type of the service. More... | |
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 |
Notification that interface/session entered running state.
Reimplemented from kanzi::connect::InterfaceObserver.
|
virtual |
Notification that interface/session got stopped for a reason or another.
Reimplemented from kanzi::connect::InterfaceObserver.
| 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 |