|
Peano
|
Frequently used implementation for job with a functor. More...
#include <Task.h>


Public Member Functions | |
| TaskWithoutCopyOfFunctor ()=delete | |
| TaskWithoutCopyOfFunctor (const TaskWithoutCopyOfFunctor &)=delete | |
| TaskWithoutCopyOfFunctor (int taskType, int priority, std::function< void()> &taskFunctor) | |
| virtual void | run () override |
| Run the task. | |
Public Member Functions inherited from tarch::multicore::Task | |
| Task (int taskType, int priority) | |
| Construct task. | |
| virtual | ~Task () |
| int | getTaskType () const |
| int | getPriority () const |
| void | setPriority (int priority) |
| Set priority. | |
| virtual bool | canFuse () const |
| virtual void | fuse (const std::vector< Task * > &otherTasks, int targetDevice=Host) |
| Fuse multiple tasks. | |
| virtual std::string | toString () const |
Private Attributes | |
| std::function< void()> & | _taskFunctor |
| See the outer class description for an explanation why this is an attribute, i.e. | |
Additional Inherited Members | |
Static Public Attributes inherited from tarch::multicore::Task | |
| static constexpr int | DefaultPriority = 1024 |
| static constexpr int | Host = -1 |
| static constexpr int | DontFuse = -1 |
Protected Attributes inherited from tarch::multicore::Task | |
| const int | _taskType |
| int | _priority |
Frequently used implementation for job with a functor.
Cousin implementation to TaskWithCopyOfFunctor which does not copy the underlying functor but holds a reference to it. This implies that you have to ensure that the functor remains valid after you have spawned the task.
It can pay off to use this variant for very expensive functors, i.e. functors that internally copy a lot of things. In most cases, you won't need this class. I recommend to start with the copy version always.
Please consult TaskWithCopyOfFunctor for further information on the used attributes.
|
delete |
|
delete |
| tarch::multicore::TaskWithoutCopyOfFunctor::TaskWithoutCopyOfFunctor | ( | int | taskType, |
| int | priority, | ||
| std::function< void()> & | taskFunctor | ||
| ) |
|
overridevirtual |
Run the task.
Implements tarch::multicore::Task.
|
private |