RPCResultBase

template<class _T>
class kanzi::connect::RPCResultBase

Subclassed by RPCResultImpl< _T >

Public Functions

RPCResultBase()

C++ constructor - initialize the object.

RPCTypes::CommHandle getHandle() const

Retrieve the communication handle.

Return

handle.

int32_t getRPCCallResult() const

Returns the low level RPC result.

Return

result, oneof RPCResultValue::RESULT_ enumerations. If value differs from RPCResultValue::RESULT_OK then the destination service has not been contacted (at least not just yet if RESULT_INPROGRESS).

void invalidate()

Invalidates the object.

After this, valid() will return false and quering the value will throw an exception.

bool isComplete() const

Checks whether RPC call is complete.

Return

true if call is complete and getValue can be safely called.

bool testIsTimedOut(const chrono::steady_clock::time_point &now) const

Tests whether operation has timed out.

Return

true if operation has timed out.

bool valid() const

Determines whether the RPC Result is still valid.

Return

true if still valid.

bool waitComplete(int msToWait) const

Checks whether RPC call is complete.

Optionally waits for specific amount of time

Return

true if call is complete and getValue can be safely called.

Parameters
  • msToWait: how long to wait for RPC to become complete