Honeycomb  0.1
Component-Model Framework
Classes | Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
honey::Future< R > Class Template Reference

Unique future, guarantees sole access to a future function result. More...

#include <Future.h>

Inheritance diagram for honey::Future< R >:
Inheritance graph
[legend]
Collaboration diagram for honey::Future< R >:
Collaboration graph
[legend]

Public Types

typedef R Result
 
typedef future::priv::State< R > State
 
- Public Types inherited from honey::FutureBase
typedef future::priv::StateBase StateBase
 

Public Member Functions

 Future ()
 
 Future (Future &&rhs) noexcept
 
Future & operator= (Future &&rhs)
 
SharedFuture< R > share ()
 Share the future between multiple future objects. This future is rendered invalid. More...
 
R get ()
 Get the future result, waiting if necessary. Throws any exception stored in the result. More...
 
State & __state () const
 Get the shared state. More...
 
template<>
void get ()
 
- Public Member Functions inherited from honey::FutureBase
bool valid () const
 Check if this instance has state and can be used. State can be transferred out to another instance through move-assignment. More...
 
bool ready () const
 Check if result is ready. More...
 
void wait () const
 Wait until result is ready. More...
 
template<class Rep , class Period >
future::Status wait (Duration< Rep, Period > time) const
 Wait until result is ready or until an amount of time has passed. More...
 
template<class Clock , class Dur >
future::Status wait (TimePoint< Clock, Dur > time) const
 Wait until result is ready or until a certain time. More...
 
StateBase & __stateBase () const
 Get the shared state. More...
 
- Public Member Functions inherited from honey::FutureCommon< Future< R >, R >
Future< typename std::result_of< Func(Future< R >)>::type > then (Sched &&sched, Func &&f)
 Append a continuation function that will be called when this future is ready. The ready future is passed in (no wait on future.get()). More...
 
Future< typename std::result_of< Func(Future< R >)>::type > then (Func &&f)
 
Future< R2 > unwrap ()
 For wrapped futures Future<Future<R>>, returns a proxy Future<R> that will be ready when the inner future is ready. More...
 

Protected Member Functions

virtual StateBase * stateBase () const
 

Friends

template<class >
class Promise
 
template<class , class >
class FutureCommon
 
template<class >
class Future
 
template<class >
class SharedFuture
 

Detailed Description

template<class R>
class honey::Future< R >

Unique future, guarantees sole access to a future function result.

Member Typedef Documentation

template<class R>
typedef R honey::Future< R >::Result
template<class R>
typedef future::priv::State<R> honey::Future< R >::State

Constructor & Destructor Documentation

template<class R>
honey::Future< R >::Future ( )
inline
template<class R>
honey::Future< R >::Future ( Future< R > &&  rhs)
inlinenoexcept

Member Function Documentation

template<class R>
State& honey::Future< R >::__state ( ) const
inline

Get the shared state.

template<class R >
R honey::Future< R >::get ( )

Get the future result, waiting if necessary. Throws any exception stored in the result.

Exceptions
future::NoStateif the result has been retrieved with get() more than once
template<>
void honey::Future< void >::get ( )
inline
template<class R>
Future& honey::Future< R >::operator= ( Future< R > &&  rhs)
inline
template<class R>
SharedFuture<R> honey::Future< R >::share ( )
inline

Share the future between multiple future objects. This future is rendered invalid.

template<class R>
virtual StateBase* honey::Future< R >::stateBase ( ) const
inlineprotectedvirtual

Implements honey::FutureBase.

Friends And Related Function Documentation

template<class R>
template<class >
friend class Future
friend
template<class R>
template<class , class >
friend class FutureCommon
friend
template<class R>
template<class >
friend class Promise
friend
template<class R>
template<class >
friend class SharedFuture
friend

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