OnixS C++ FIX Engine  4.2.0
API Documentation
SharedFuture Class Reference

#include <OnixS/FIXEngine/Threading/Future.h>

Public Member Functions

 SharedFuture ()
 
 SharedFuture (const SharedFuture &other)
 
SharedFutureoperator= (const SharedFuture &other)
 
 ~SharedFuture ()
 
bool valid ()
 
void get () const
 
template<typename ValueType >
ValueType get () const
 
void wait (const int waitInMs=InfiniteTimeout) const
 

Friends

class Promise
 

Detailed Description

SharedFuture is copyable and multiple shared objects may refer to the same shared state.

Note
Access to the same shared state from multiple threads is safe if each thread does it through its own copy of a SharedFuture object.

Definition at line 34 of file Future.h.

Constructor & Destructor Documentation

Constructor.

Constructs a SharedFuture object with no shared state.

SharedFuture ( const SharedFuture other)

Copy constructor.

Share the internal state with other SharedFuture object.

Cleans up internal resources.

Member Function Documentation

void get ( ) const

Returns the result.

If the result is not ready, the method will block. When completes, it either returns or throws an exception. Throws an exception if an exception was stored in the shared state of this SharedFuture object (e.g. via Promise::setException()).

ValueType get ( ) const
inline

Returns the result value.

If the result is not ready, the method will block. When completes, it either returns or throws an exception. Throws an exception if an exception was stored in the shared state of this SharedFuture object (e.g. via Promise::setException()).

Note
The requested value type ('ValueType') should correspond to the stored, by the Promise::setValue(), value type.
Exceptions
std::logic_errorif the stored value type does not correspond to the requested value type ('ValueType').

Definition at line 67 of file Future.h.

SharedFuture& operator= ( const SharedFuture other)

Assignment operator.

Share the internal state with other SharedFuture object.

bool valid ( )

Checks if the future refers to a shared state.

void wait ( const int  waitInMs = InfiniteTimeout) const

Waits for the result to become available during the timeout.

Friends And Related Function Documentation

friend class Promise
friend

Definition at line 162 of file Future.h.


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