ExternalClientAdapter¶
-
class
kanzi::connect::ExternalClientAdapter: public AbstractServiceClient, public InterfaceObserver¶ External client adapter that will represent a kanzi connect client on external language bindings.
Public Functions
-
ExternalClientAdapter(Client &client, const string &identifier)¶ Constructor.
- Parameters
client: the client instance.identifier: service identitifier this client connects to.
-
ExternalClientAdapter(ClientConnector &connector, const string &identifier)¶ Constructor.
- Parameters
connector: Client connector instance this client is connected to.identifier: service identitifier this client connects to.
-
~ExternalClientAdapter()¶ Destructor.
-
bool
hasSession() const¶ Determines whether client is functional and has a session to be used in communication.
- Return
true if session exists and communication is possible.
-
void
onMessageReceived(const MessagePackage &message)¶ Notification that interface has received a message.
- Parameters
message: Message that was received.
-
void
onSessionRunning()¶ Notification that interface/session entered running state.
-
void
onSessionStopped()¶ Notification that interface/session got stopped for a reason or another.
-
void
sendMessage(MessagePackage &message)¶ Sends a provided message to the corresponding service without expecting any returnvalues.
- Parameters
message: message to send. Might get modified along the way.
-
RPCResult<bool>
sendMessageBool(MessagePackage &message)¶ Sends a message that expects bool returnvalue.
- Return
Waitable RPC result
- Parameters
message: the message to be sent
-
RPCResult<float>
sendMessageFloat(MessagePackage &message)¶ Sends a message that expects float returnvalue.
- Return
Waitable RPC result
- Parameters
message: the message to be sent
-
RPCResult<int32_t>
sendMessageInt(MessagePackage &message)¶ Sends a message that expects integer returnvalue.
- Return
Waitable RPC result
- Parameters
message: the message to be sent
-
RPCResult<string>
sendMessageString(MessagePackage &message)¶ Sends a message that expects string returnvalue.
- Return
Waitable RPC result
- Parameters
message: the message to be sent
-
RPCResult<void>
sendMessageVoid(MessagePackage &message)¶ Sends a message that expects void returnvalue.
- Return
Waitable RPC result
- Parameters
message: the message to be sent
-