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

Shared future, allows multiple access to a future function result. More...

#include <Future.h>

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

Public Types

typedef std::conditional< mt::isRef< R >::value||std::is_void< R >::value, R, typename mt::addConstRef< R >::type >::type ResultConstRef
 
typedef std::conditional< mt::isRef< R >::value||std::is_void< R >::value, R, typename mt::addRef< R >::type >::type ResultRef
 
typedef future::priv::State< R > State
 
- Public Types inherited from honey::FutureBase
typedef future::priv::StateBase StateBase
 

Public Member Functions

 SharedFuture ()
 
 SharedFuture (Future< R > &&rhs)
 
 SharedFuture (const SharedFuture &rhs)
 
 SharedFuture (SharedFuture &&rhs)
 
SharedFutureoperator= (const SharedFuture &rhs)
 
SharedFutureoperator= (SharedFuture &&rhs)
 
ResultConstRef get () const
 Get the future result, waiting if necessary. Throws any exception stored in the result. The result can be retrieved repeatedly. More...
 
ResultRef get ()
 
State__state () const
 Get the shared state. More...
 
template<>
void get () const
 
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< SharedFuture< R >, R >
Future< typename std::result_of< Func(SharedFuture< 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(SharedFuture< 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 StateBasestateBase () const
 

Friends

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

Detailed Description

template<class R>
class honey::SharedFuture< R >

Shared future, allows multiple access to a future function result.

Member Typedef Documentation

template<class R >
typedef std::conditional<mt::isRef<R>::value || std::is_void<R>::value, R, typename mt::addConstRef<R>::type>::type honey::SharedFuture< R >::ResultConstRef
template<class R >
typedef std::conditional<mt::isRef<R>::value || std::is_void<R>::value, R, typename mt::addRef<R>::type>::type honey::SharedFuture< R >::ResultRef
template<class R >
typedef future::priv::State<R> honey::SharedFuture< R >::State

Constructor & Destructor Documentation

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

Member Function Documentation

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

Get the shared state.

template<class R >
auto honey::SharedFuture< R >::get ( ) const

Get the future result, waiting if necessary. Throws any exception stored in the result. The result can be retrieved repeatedly.

template<class R >
auto honey::SharedFuture< R >::get ( )
template<>
void honey::SharedFuture< void >::get ( ) const
inline
template<>
void honey::SharedFuture< void >::get ( )
inline
template<class R >
SharedFuture& honey::SharedFuture< R >::operator= ( const SharedFuture< R > &  rhs)
inline
template<class R >
SharedFuture& honey::SharedFuture< R >::operator= ( SharedFuture< R > &&  rhs)
inline
template<class R >
virtual StateBase* honey::SharedFuture< 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 SharedFuture
friend

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