MIRA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 ( )
inline
RPCFutureCommon ( AbstractRPCClient client,
const std::string &  callId 
)
inline
~RPCFutureCommon ( )
inline

Member Function Documentation

const std::string& callId ( )
inline

query call ID

bool isReady ( ) const
inline

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

bool hasException ( ) const
inline

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

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.

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.

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.
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.
void swap ( RPCFutureCommon< R > &  other)
inline

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

Member Data Documentation

AbstractRPCClient* mClient
protected
std::string mCallId
protected
boost::unique_future<R> mFuture
protected

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