boost::cmt::future< T > Class Template Reference

placeholder for the result of an asynchronous operation. More...

#include <future.hpp>

List of all members.

Public Types

typedef promise< T >::ptr promise_ptr

Public Member Functions

 future (const promise_ptr &p=promise_ptr())
bool valid () const
bool ready () const
 operator const T & () const
const T & wait (uint64_t timeout=-1)

Detailed Description

template<typename T = void_t>
class boost::cmt::future< T >

placeholder for the result of an asynchronous operation.

A future is constructed with a promise that is created when a new asynchronous task is started. A future behaves like a shared pointer where all copies reffer to the same promise.

When future::wait() is called, the future will block the current task until one of three conditions are met:

If the asynchronous operation threw an exception it will be rethrown from the call to wait().

Automatic waiting on cast.

boost::cmt::future<T> automatically casts to type T when requested. This cast is short hand for boost::cmt::future<T>::wait().


The documentation for this class was generated from the following file:
 All Classes Files Functions Typedefs
Generated on Wed Jul 27 22:26:30 2011 for Boost.CMT - Cooperative Multi-Tasking by  doxygen 1.6.3