#include <CompoundTask.h>
Public Member Functions | |
Constructors & destructor | |
CompoundTask () | |
virtual | ~CompoundTask () |
Executing the subtasks | |
virtual bool | execute () |
Task handling | |
void | add_task (Task *task) |
Protected Member Functions | |
Execution control | |
virtual bool | prepare () |
virtual bool | finish () |
CompoundTask takes ownership of the task objects associated with it and will automatically free them on destruction.
CompoundTask | ( | ) |
Default constructor. Creates a new compound task without subtasks.
~CompoundTask | ( | ) | [virtual] |
Destructor. Deletes all subtasks associated with this compound task and destroys the instance.
void add_task | ( | Task * | task | ) |
Add a subtask. The compound task will take ownership of the given task and release it on destruction.
Note that a single task can not be added to multiple CompoundTasks. However, it is save to append a task object to a single CompoundTask multiple times.
task | Task object to be added |
bool execute | ( | ) | [virtual] |
bool finish | ( | ) | [protected, virtual] |
The finish() callback method is called after the execution of the subtasks finishes. It can be overwritten in derived classes to perform necessary postprocessing after execution. It will only be called if all subtasks executed successfully.
The default implementation does nothing and returns successfully.
bool prepare | ( | ) | [protected, virtual] |
The prepare() callback method is called before execution of the subtasks starts. It can be overwritten in derived classes to perform any necessary initialization steps before executing the subtasks.
The default implementation does nothing and returns successfully.
![]() |
Copyright © 1998–2009 Forschungszentrum Jülich, Jülich Supercomputing Centre |