Honeycomb
0.1
Component-Model Framework
|
Shared future, allows multiple access to a future function result. More...
#include <Future.h>
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) | |
SharedFuture & | operator= (const SharedFuture &rhs) |
SharedFuture & | operator= (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 StateBase * | stateBase () const |
Friends | |
template<class , class > | |
class | FutureCommon |
template<class > | |
class | Future |
template<class > | |
class | SharedFuture |
Shared future, allows multiple access to a future function result.
typedef std::conditional<mt::isRef<R>::value || std::is_void<R>::value, R, typename mt::addConstRef<R>::type>::type honey::SharedFuture< R >::ResultConstRef |
typedef std::conditional<mt::isRef<R>::value || std::is_void<R>::value, R, typename mt::addRef<R>::type>::type honey::SharedFuture< R >::ResultRef |
typedef future::priv::State<R> honey::SharedFuture< R >::State |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get the shared state.
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.
auto honey::SharedFuture< R >::get | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprotectedvirtual |
Implements honey::FutureBase.