Honeycomb  0.1
Component-Model Framework
Public Types | Public Member Functions | Static Public Member Functions | List of all members
honey::DepTask_< Result > Class Template Reference

Holds a functor and dependency information, enqueue in a scheduler to run the task. More...

#include <DepTask.h>

Inheritance diagram for honey::DepTask_< Result >:
Inheritance graph
[legend]
Collaboration diagram for honey::DepTask_< Result >:
Collaboration graph
[legend]

Public Types

typedef SharedPtr< DepTask_Ptr
 
- Public Types inherited from honey::DepTask
typedef SharedPtr< DepTaskPtr
 
typedef function< void()> Func
 
typedef DepNode< DepTask * > DepNode
 
typedef DepGraph< DepTask::DepNodeDepGraph
 

Public Member Functions

template<class Func >
 DepTask_ (Func &&f, const Id &id=idnull)
 
Future< Result > future ()
 Get future from which delayed result can be retrieved. More...
 
- Public Member Functions inherited from honey::DepTask
virtual ~DepTask ()
 
bool active () const
 Check if task is in queue or executing. More...
 
void interrupt (const Exception::ConstPtr &e=new thread::Interrupted)
 Request an interrupt in the executing task's thread. More...
 
bool interruptRequested ()
 Check whether an interrupt has been requested for the executing task's thread. More...
 
void setPriority (int priority)
 Set task's thread execution scheduling priority. More...
 
int getPriority () const
 Get task's thread execution scheduling priority. More...
 
void setId (const Id &id)
 Set id used for dependency graph and debug output. More...
 
const IdgetId () const
 
DepNodedeps ()
 Get dependency node. Upstream and downstream tasks can be specified through the node. More...
 
 operator const Id & () const
 Get id. More...
 
String info () const
 Get task info for prepending to a log record. More...
 
- Public Member Functions inherited from honey::SharedObj< DepTask >
 SharedObj (Alloc &&a=Alloc()) debug_if(
 Construct with allocator that is called to deallocate this shared object when all references have been released. More...
 

Static Public Member Functions

static DepTask_current ()
 Wrapper for DepTask::current() More...
 
- Static Public Member Functions inherited from honey::DepTask
static DepTaskcurrent ()
 Get the current task object. Must be called from a task functor. More...
 

Additional Inherited Members

- Protected Types inherited from honey::DepTask
enum  State {
  State::idle, State::queued, State::depUpWait, State::exec,
  State::depDownWait
}
 
- Protected Member Functions inherited from honey::DepTask
 DepTask (const Id &id)
 
void bindDirty ()
 
void operator() ()
 
void finalize_ ()
 Clean up task after execution. More...
 
virtual void trace (const String &file, int line, const String &msg) const
 
virtual bool traceEnabled () const
 
- Protected Member Functions inherited from honey::SharedObj< DepTask >
void finalize ()
 Destroys object. Called when strong reference count reaches 0. May be overridden to prevent destruction. More...
 
- Protected Attributes inherited from honey::DepTask
DepNode _depNode
 
Mutex _lock
 
Atomic< State_state
 
int _regCount
 
DepSched_sched
 
WeakPtr< DepTask_root
 
int _bindId
 
bool _bindDirty
 
int _depUpWaitInit
 
Atomic< int > _depUpWait
 
int _depDownWaitInit
 
Atomic< int > _depDownWait
 
DepGraph::Vertex_vertex
 
bool _onStack
 
Thread_thread
 
int _priority
 

Detailed Description

template<class Result>
class honey::DepTask_< Result >

Holds a functor and dependency information, enqueue in a scheduler to run the task.

See also
DepSched

Member Typedef Documentation

template<class Result>
typedef SharedPtr<DepTask_> honey::DepTask_< Result >::Ptr

Constructor & Destructor Documentation

template<class Result>
template<class Func >
honey::DepTask_< Result >::DepTask_ ( Func &&  f,
const Id id = idnull 
)
inline
Parameters
ffunctor to execute
idused for dependency graph and debug output

Member Function Documentation

template<class Result>
static DepTask_& honey::DepTask_< Result >::current ( )
inlinestatic

Wrapper for DepTask::current()

template<class Result>
Future<Result> honey::DepTask_< Result >::future ( )
inline

Get future from which delayed result can be retrieved.

Exceptions
future::FutureAlreadyRetrievedif future() has been called more than once per task execution

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