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
-
inline
RPCResultImpl
(RPCTypes::CommHandle handle)¶ C++ constructs - initializes the object.
- Parameters
handle – the handle for the operation.
-
inline RPCTypes::CallbackFunctionSubscriptionToken
addCallback
(CallbackFunctionType callback)¶ Adds a callback to listen method response.
Invoked when response is received.
- Parameters
callback – pointer to function to call.
- Returns
token that can be used to remove callback if needed.
-
bool
completeIfTimedOut
(const chrono::steady_clock::time_point&)¶ Completes the operation if it has been timed out.
- Returns
true if timed out
-
void
completeLinkBroken
()¶ Completes the operation with link broken status.
-
inline void
doComplete
(_T value, int32_t rpcresult = GenericRPCReplyMessage::RPC_RESULT_OK)¶ Completes the RPC result promise.
- Parameters
value – complete value
-
inline _T
getValue
()¶ Gets the value.
Note
can be called only once.
- Returns
the value of the future.
-
inline void
removeCallback
(RPCTypes::CallbackFunctionSubscriptionToken token)¶ Removes callback from the callback array.
- Parameters
token – callback to remove, token returned by addCallback function.
-
inline