Honeycomb
0.1
Component-Model Framework
|
Holds a functor and dependency information, enqueue in a scheduler to run the task. More...
#include <DepTask.h>
Public Types | |
typedef SharedPtr< DepTask_ > | Ptr |
Public Types inherited from honey::DepTask | |
typedef SharedPtr< DepTask > | Ptr |
typedef function< void()> | Func |
typedef DepNode< DepTask * > | DepNode |
typedef DepGraph< DepTask::DepNode > | DepGraph |
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 Id & | getId () const |
DepNode & | deps () |
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 DepTask & | current () |
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 |
Holds a functor and dependency information, enqueue in a scheduler to run the task.
typedef SharedPtr<DepTask_> honey::DepTask_< Result >::Ptr |
|
inline |
f | functor to execute |
id | used for dependency graph and debug output |
|
inlinestatic |
Wrapper for DepTask::current()
|
inline |
Get future from which delayed result can be retrieved.
future::FutureAlreadyRetrieved | if future() has been called more than once per task execution |