MIRA
Public Member Functions | Protected Attributes | List of all members
RPCFutureCommon< R > Class Template Reference

Wrapper for boost::unique_future that is specialized for RPC processing. More...

#include <rpc/RPCFuture.h>

Inheritance diagram for RPCFutureCommon< R >:
Inheritance graph
[legend]

Public Member Functions

 RPCFutureCommon ()
 
 RPCFutureCommon (AbstractRPCClient *client, const std::string &callId)
 
 ~RPCFutureCommon ()
 
const std::string & callId ()
 query call ID More...
 
bool isReady () const
 Checks to see if the result of the RPC call associated with this future is set. More...
 
bool hasException () const
 Returns true if the RPC call associated with this future has finished with an exception rather than a return value. More...
 
bool hasValue () const
 Returns true if the RPC call associated with this future has finished with a return value value rather than an exception. More...
 
void wait () const
 Waits and blocks the current thread until the result of the associated RPC call is ready. More...
 
template<typename Duration >
bool timedWait (Duration const &relTime) const
 Waits and blocks the current thread until the result of the associated RPC call is ready, or the time duration specified by waitDuration has elapsed. More...
 
bool timedWaitUntil (boost::system_time const &absTime) const
 Waits and blocks the current thread until the result of the associated RPC call is ready, or the time point specified by waitDuration has passed. More...
 
void swap (RPCFutureCommon< R > &other)
 Swaps ownership of the asynchronous results associated with other and *this. More...
 

Protected Attributes

AbstractRPCClientmClient
 
std::string mCallId
 
boost::unique_future< R > mFuture
 

Detailed Description

template<typename R>
class mira::RPCFutureCommon< R >

Wrapper for boost::unique_future that is specialized for RPC processing.

This is a base class for the concrete derived RPCFuture classes.

Constructor & Destructor Documentation

◆ RPCFutureCommon() [1/2]

RPCFutureCommon ( )
inline

◆ RPCFutureCommon() [2/2]

RPCFutureCommon ( AbstractRPCClient client,
const std::string &  callId 
)
inline

◆ ~RPCFutureCommon()

~RPCFutureCommon ( )
inline

Member Function Documentation

◆ callId()

const std::string& callId ( )
inline

query call ID

◆ isReady()

bool isReady ( ) const
inline

Checks to see if the result of the RPC call associated with this future is set.

◆ hasException()

bool hasException ( ) const
inline

Returns true if the RPC call associated with this future has finished with an exception rather than a return value.

◆ hasValue()

bool hasValue ( ) const
inline

Returns true if the RPC call associated with this future has finished with a return value value rather than an exception.

◆ wait()

void wait ( ) const
inline

Waits and blocks the current thread until the result of the associated RPC call is ready.

This is an interruption point.

◆ timedWait()

bool timedWait ( Duration const &  relTime) const
inline

Waits and blocks the current thread until the result of the associated RPC call is ready, or the time duration specified by waitDuration has elapsed.

This is an interruption point.

Returns
false if the call is returning because the time specified was reached, true otherwise.

◆ timedWaitUntil()

bool timedWaitUntil ( boost::system_time const &  absTime) const
inline

Waits and blocks the current thread until the result of the associated RPC call is ready, or the time point specified by waitDuration has passed.

This is an interruption point.

Returns
false if the call is returning because the time specified was reached, true otherwise.

◆ swap()

void swap ( RPCFutureCommon< R > &  other)
inline

Swaps ownership of the asynchronous results associated with other and *this.

Member Data Documentation

◆ mClient

AbstractRPCClient* mClient
protected

◆ mCallId

std::string mCallId
protected

◆ mFuture

boost::unique_future<R> mFuture
protected

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