Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

Task Class Reference

Inheritance diagram for Task:
NamedObject CallBacker ParallelTask SequentialTask TaskGroup ArrayNDGetAll< T > MemCopier< T > MemSetter< T > Executor ExecutorGroup

List of all members.

Public Types

enum  Control { Run, Pause, Stop }

Public Member Functions

virtual ~Task ()
virtual void setProgressMeter (ProgressMeter *)
 Must be called before execute().
virtual void enableNrDoneCounting (bool yn)
virtual int64_t nrDone () const
virtual int64_t totalNr () const
virtual const char * message () const
virtual const char * nrDoneText () const
virtual bool execute ()=0
virtual void enableWorkControl (bool=true)
 Must be called before execute().
virtual void controlWork (Control)
virtual Control getState () const

Protected Member Functions

 Task (const char *nm=0)
virtual bool shouldContinue ()

Protected Attributes

Threads::ConditionVarworkcontrolcondvar_
Task::Control control_

Detailed Description

The generalization of something (e.g. a computation) that needs to be done in multiple steps.


Member Enumeration Documentation

Enumerator:
Run 
Pause 
Stop 

Constructor & Destructor Documentation

virtual Task::~Task (  )  [virtual]
Task::Task ( const char *  nm = 0  )  [protected]

Member Function Documentation

virtual void Task::controlWork ( Control   )  [virtual]

Reimplemented in TaskGroup.

virtual void Task::enableNrDoneCounting ( bool  yn  )  [inline, virtual]

Reimplemented in TaskGroup, and ParallelTask.

virtual void Task::enableWorkControl ( bool  = true  )  [virtual]

Must be called before execute().

Reimplemented in TaskGroup.

virtual bool Task::execute (  )  [pure virtual]

Implemented in TaskGroup, SequentialTask, and ParallelTask.

virtual Control Task::getState (  )  const [virtual]

Reimplemented in TaskGroup.

virtual const char* Task::message (  )  const [inline, virtual]
Note:
totalNr is only used for displaying progress.

Reimplemented in ExecutorGroup, and TaskGroup.

virtual int64_t Task::nrDone (  )  const [inline, virtual]
Note:
nrDone is only used for displaying progress and will be compared to totalNr to show user how large part of the task that is finished.

Reimplemented in ExecutorGroup, TaskGroup, and ParallelTask.

virtual const char* Task::nrDoneText (  )  const [inline, virtual]

Reimplemented in ExecutorGroup, and TaskGroup.

virtual void Task::setProgressMeter ( ProgressMeter  )  [inline, virtual]

Must be called before execute().

Reimplemented in TaskGroup, SequentialTask, and ParallelTask.

virtual bool Task::shouldContinue (  )  [protected, virtual]
Returns:
wether we should continue
virtual int64_t Task::totalNr (  )  const [inline, virtual]

Reimplemented in ExecutorGroup, TaskGroup, and ParallelTask.


Member Data Documentation