Kanzi Connect  1.1.10
Kanzi Connect C++ API
kanzi::connect::RPCResult< void > Class Template Reference

#include <rpcresult.hpp>

Public Member Functions

RPCTypes::CallbackFunctionSubscriptionToken addCallback (typename RPCResultImpl< void >::CallbackFunctionType callback)
 Add callback. More...
 
RPCTypes::CallbackFunctionSubscriptionToken addCallbackEx (RPCResultObserver< void > *callback)
 Add callback. More...
 
bool complete (int32_t rpcresult=GenericRPCReplyMessage::RPC_RESULT_OK)
 Completes the object. More...
 
int32_t getRPCCallResult () const
 Retrieve low level rpc status of the method call. More...
 
void getValue () const
 Return the value of a call. Will block calling thread if remote-call is not complete yet. More...
 
void invalidate ()
 Releases all the referenced resources. After calling this it is not safe to access any other methods except the valid(). More...
 
bool isComplete () const
 Check has call completed. More...
 
bool isLinkBroken () const
 Has the link been broken and caused the RPC call to terminate. More...
 
bool isTimedOut () const
 Has the request been timed out. More...
 
void removeCallback (RPCTypes::CallbackFunctionSubscriptionToken token)
 Remove a callback. More...
 
 RPCResult ()
 Default c++ constructor. More...
 
void setTimeout (int ms)
 Sets the timeout after which the operation is completed locally with timed-out status. More...
 
bool valid () const
 is object OK More...
 
bool waitComplete (int32_t ms) const
 Wait until complete. More...
 

Static Public Member Functions

static RPCResult< void > create (RPCTypes::CommHandle handle)
 Factory function to create a pending RPC Result object with handle provided. More...
 

Protected Member Functions

shared_ptr< RPCResultImpl< void > > object ()
 Gets access to contained object. More...
 
 RPCResult (shared_ptr< RPCResultImpl< void > > object)
 C++ constructor - initialize the object. More...
 

Friends

class RPCCallStore
 
class RPCResultImpl< void >
 

Constructor & Destructor Documentation

◆ RPCResult() [1/2]

kanzi::connect::RPCResult< void >::RPCResult ( shared_ptr< RPCResultImpl< void > >  object)
inlineprotected

C++ constructor - initialize the object.

Parameters
objectobject that implements the result.

◆ RPCResult() [2/2]

kanzi::connect::RPCResult< void >::RPCResult ( )
inline

Default c++ constructor.

Member Function Documentation

◆ addCallback()

RPCTypes::CallbackFunctionSubscriptionToken kanzi::connect::RPCResult< void >::addCallback ( typename RPCResultImpl< void >::CallbackFunctionType  callback)
inline

Add callback.

Parameters
callbackto be called when ready.
Returns
subscription handle.

◆ addCallbackEx()

RPCTypes::CallbackFunctionSubscriptionToken kanzi::connect::RPCResult< void >::addCallbackEx ( RPCResultObserver< void > *  callback)
inline

Add callback.

Parameters
callbackto be called when ready.
Returns
subscription handle.

◆ complete()

bool kanzi::connect::RPCResult< void >::complete ( int32_t  rpcresult = GenericRPCReplyMessage::RPC_RESULT_OK)
inline

Completes the object.

Normally this is not meant to be used by RPC users but completion is done internally by the Kanzi Connect framework.

Parameters
rpcresultthe RPC level completion value.
Returns
If completion is done, true. If completion has already been completed, false.

◆ create()

static RPCResult<void> kanzi::connect::RPCResult< void >::create ( RPCTypes::CommHandle  handle)
inlinestatic

Factory function to create a pending RPC Result object with handle provided.

Parameters
handlethe handle for the object.
Returns
newly created RPCResult instance.

◆ getRPCCallResult()

int32_t kanzi::connect::RPCResult< void >::getRPCCallResult ( ) const
inline

Retrieve low level rpc status of the method call.

Returns
RPC status.

◆ getValue()

void kanzi::connect::RPCResult< void >::getValue ( ) const
inline

Return the value of a call. Will block calling thread if remote-call is not complete yet.

◆ invalidate()

void kanzi::connect::RPCResult< void >::invalidate ( )
inline

Releases all the referenced resources. After calling this it is not safe to access any other methods except the valid().

◆ isComplete()

bool kanzi::connect::RPCResult< void >::isComplete ( ) const
inline

Check has call completed.

Returns
true if completed.

◆ isLinkBroken()

bool kanzi::connect::RPCResult< void >::isLinkBroken ( ) const
inline

Has the link been broken and caused the RPC call to terminate.

Returns
true if link was broken and caused the operation to fail because if that.

◆ isTimedOut()

bool kanzi::connect::RPCResult< void >::isTimedOut ( ) const
inline

Has the request been timed out.

Returns
true if timed out.

◆ object()

shared_ptr<RPCResultImpl<void> > kanzi::connect::RPCResult< void >::object ( )
inlineprotected

Gets access to contained object.

In general there should be no need to access the object directly.

Returns
Implementation object.

◆ removeCallback()

void kanzi::connect::RPCResult< void >::removeCallback ( RPCTypes::CallbackFunctionSubscriptionToken  token)
inline

Remove a callback.

Parameters
tokensubscription to remove.

◆ setTimeout()

void kanzi::connect::RPCResult< void >::setTimeout ( int  ms)
inline

Sets the timeout after which the operation is completed locally with timed-out status.

Parameters
msmilliseconds.

◆ valid()

bool kanzi::connect::RPCResult< void >::valid ( ) const
inline

is object OK

Returns
true if ok.

◆ waitComplete()

bool kanzi::connect::RPCResult< void >::waitComplete ( int32_t  ms) const
inline

Wait until complete.

Parameters
msmaximum amount of milliseconds to wait.
Returns
true if call became ready. false if still pending.

Friends And Related Function Documentation

◆ RPCCallStore

friend class RPCCallStore
friend

◆ RPCResultImpl< void >

friend class RPCResultImpl< void >
friend

The documentation for this class was generated from the following file: