RPC Function result for void return value. More...
#include <rpcresult.hpp>
Public Types | |
typedef function< void(RPCResult< void > &) | CallbackFunctionType) |
Callback type. | |
Public Member Functions | |
RPCTypes::CallbackFunctionSubscriptionToken | addCallback (CallbackFunctionType callback) |
Add callback. | |
bool | completeIfTimedOut (const chrono::steady_clock::time_point &now) |
Completes the operation if it has been timed out. | |
void | completeLinkBroken () |
Completes RPC with link broken status. | |
void | doComplete (int32_t rpcresult=GenericRPCReplyMessage::RPC_RESULT_OK) |
Completes the RPC result promise. | |
void | getValue () |
Gets the value. | |
void | removeCallback (RPCTypes::CallbackFunctionSubscriptionToken token) |
Removes callback from the callback array. | |
RPCResultImpl (RPCTypes::CommHandle handle) | |
C++ constructs - initializes the object. | |
![]() | |
RPCTypes::CommHandle | getHandle () const |
Retrieve the communication handle. | |
int32_t | getRPCCallResult () const |
Returns the low level RPC result. | |
void | invalidate () |
Invalidates the object. | |
bool | isComplete () const |
Checks whether RPC call is complete. | |
RPCResultBase () | |
C++ constructor - initialize the object. | |
bool | testIsTimedOut (const chrono::steady_clock::time_point &now) const |
Tests whether operation has timed out. | |
bool | valid () const |
Determines whether the RPC Result is still valid. | |
bool | waitComplete (int msToWait) const |
Checks whether RPC call is complete. | |
Protected Member Functions | |
void | invokeCallbacks () |
Invokes all callbacks. | |
![]() | |
void | setHandle (RPCTypes::CommHandle handle) |
Attach a handle to this object. | |
void | setTimeout (int ms) |
Sets the timeout for a RPC operation. | |
Additional Inherited Members | |
![]() | |
optional< chrono::steady_clock::time_point > | m_expires |
std::shared_future< void > | m_future |
RPCTypes::CommHandle | m_handle |
shared_ptr< std::promise< void > > | m_promise |
int32_t | m_rpcresult |
RPC Function result for void return value.
typedef function<void(RPCResult<void>&) kanzi::connect::RPCResultImpl< void >::CallbackFunctionType) |
Callback type.
|
inline |
C++ constructs - initializes the object.
handle | the handle for the operation. |
|
inline |
Add callback.
callback | to be called when value is available. |
|
inline |
Completes the operation if it has been timed out.
|
inline |
Completes RPC with link broken status.
|
inline |
Completes the RPC result promise.
rpcresult | low level rpc return value. |
|
inline |
Gets the value.
|
inlineprotected |
Invokes all callbacks.
There can be any number of them configured for a single RPC call completion.
allow callback to get removed from callback itself. If new callback is added from callback it won't be called.
|
inline |
Removes callback from the callback array.
token | callback to remove, token returned by addCallback function. |