RPCResultImpl¶
-
template<class
_T>
classkanzi::connect::RPCResultImpl: public kanzi::connect::RPCResultBase<_T>, public enable_shared_from_this<RPCResultImpl<_T>>¶ Base template class for non-void RPC results.
Public Functions
-
RPCResultImpl(RPCTypes::CommHandle handle)¶ C++ constructs - initializes the object.
- Parameters
handle: the handle for the operation.
-
RPCTypes::CallbackFunctionSubscriptionToken
addCallback(CallbackFunctionType callback)¶ Adds a callback to listen method response.
Invoked when response is received.
- Return
token that can be used to remove callback if needed.
- Parameters
callback: pointer to function to call.
-
bool
completeIfTimedOut(const chrono::steady_clock::time_point&)¶ Completes the operation if it has been timed out.
- Return
true if timed out
-
void
completeLinkBroken()¶ Completes the operation with link broken status.
-
void
doComplete(_T value, int32_t rpcresult = GenericRPCReplyMessage::RPC_RESULT_OK)¶ Completes the RPC result promise.
- Parameters
value: complete value
-
void
removeCallback(RPCTypes::CallbackFunctionSubscriptionToken token)¶ Removes callback from the callback array.
- Parameters
token: callback to remove, token returned by addCallback function.
-