Honeycomb  0.1
Component-Model Framework
Public Member Functions | Friends | List of all members
honey::PackagedTask< R(Param...)> Class Template Reference

#include <PackagedTask.h>

Inheritance diagram for honey::PackagedTask< R(Param...)>:
Inheritance graph
[legend]
Collaboration diagram for honey::PackagedTask< R(Param...)>:
Collaboration graph
[legend]

Public Member Functions

 PackagedTask ()
 
template<class F >
 PackagedTask (F &&f)
 
template<class F , class Alloc >
 PackagedTask (F &&f, Alloc &&a)
 
 PackagedTask (PackagedTask &&rhs) noexcept
 
PackagedTaskoperator= (PackagedTask &&rhs)
 
Future< R > future ()
 Get future from which delayed result can be retrieved. More...
 
template<class... Args>
void operator() (Args &&...args)
 Invoke stored function to evaluate result for associated future. More...
 
template<class... Args>
void invoke_delayedReady (Args &&...args)
 Same as operator() except don't make future ready. User is responsible to call setReady() afterwards. More...
 
void setReady (bool reset=false)
 Signal to future that result is ready for retrieval, and optionally reset task before signalling. Call only after invoke_delayedReady(). More...
 
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...
 
void reset ()
 Reset the task so it can be invoked again, a new future is created for the next result. More...
 
function< R(Param...)> & getFunc ()
 Get function that will be invoked. More...
 
template<class F >
void setFunc (F &&f)
 Set function to be invoked. More...
 

Friends

template<class , class >
class FutureCommon
 

Constructor & Destructor Documentation

template<class R , class... Param>
honey::PackagedTask< R(Param...)>::PackagedTask ( )
inline
template<class R , class... Param>
template<class F >
honey::PackagedTask< R(Param...)>::PackagedTask ( F &&  f)
inline
template<class R , class... Param>
template<class F , class Alloc >
honey::PackagedTask< R(Param...)>::PackagedTask ( F &&  f,
Alloc &&  a 
)
inline
template<class R , class... Param>
honey::PackagedTask< R(Param...)>::PackagedTask ( PackagedTask< R(Param...)> &&  rhs)
inlinenoexcept

Member Function Documentation

template<class R , class... Param>
Future<R> honey::PackagedTask< R(Param...)>::future ( )
inline

Get future from which delayed result can be retrieved.

Exceptions
future::FutureAlreadyRetrievedif future() has been called more than once.
template<class R , class... Param>
function<R (Param...)>& honey::PackagedTask< R(Param...)>::getFunc ( )
inline

Get function that will be invoked.

template<class R , class... Param>
template<class... Args>
void honey::PackagedTask< R(Param...)>::invoke_delayedReady ( Args &&...  args)
inline

Same as operator() except don't make future ready. User is responsible to call setReady() afterwards.

template<class R , class... Param>
template<class... Args>
void honey::PackagedTask< R(Param...)>::operator() ( Args &&...  args)
inline

Invoke stored function to evaluate result for associated future.

Exceptions
future::AlreadySatisfiedif the function has already been invoked
future::NoStateif invalid
template<class R , class... Param>
PackagedTask& honey::PackagedTask< R(Param...)>::operator= ( PackagedTask< R(Param...)> &&  rhs)
inline
template<class R , class... Param>
void honey::PackagedTask< R(Param...)>::reset ( )
inline

Reset the task so it can be invoked again, a new future is created for the next result.

template<class R , class... Param>
template<class F >
void honey::PackagedTask< R(Param...)>::setFunc ( F &&  f)
inline

Set function to be invoked.

template<class R , class... Param>
void honey::PackagedTask< R(Param...)>::setReady ( bool  reset = false)
inline

Signal to future that result is ready for retrieval, and optionally reset task before signalling. Call only after invoke_delayedReady().

template<class R , class... Param>
bool honey::PackagedTask< R(Param...)>::valid ( ) const
inline

Check if this instance has state and can be used. State can be transferred out to another instance through move-assignment.

Friends And Related Function Documentation

template<class R , class... Param>
template<class , class >
friend class FutureCommon
friend

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