Public Member Functions | Protected Member Functions | Protected Attributes

ExecutorGroup Class Reference

Executor consisting of other executors. More...

Inheritance diagram for ExecutorGroup:
Executor SequentialTask Task NamedObject CallBacker

List of all members.

Public Member Functions

 ExecutorGroup (const char *nm, bool parallel=false, bool ownsexecs=true)
virtual ~ExecutorGroup ()
virtual void add (Executor *)
virtual const char * message () const
virtual int64_t totalNr () const
virtual int64_t nrDone () const
virtual const char * nrDoneText () const
int nrExecutors ()
ExecutorgetExecutor (int idx)
void setNrDoneText (const char *txt)
 If set, will use this and the counted nrdone.

Protected Member Functions

virtual int nextStep ()
virtual bool goToNextExecutor ()
void findNextSumStop ()

Protected Attributes

int sumstart_
int sumstop_
const bool parallel_
int currentexec_
BufferString nrdonetext_
ObjectSet< Executor > & executors_
TypeSet< int > executorres_
bool ownsexecs_

Detailed Description

Executor consisting of other executors.

Executors may be added on the fly while processing. Depending on the parallel flag, the executors are executed in the order in which they were added or in parallel (but still single-threaded).


Constructor & Destructor Documentation

ExecutorGroup::ExecutorGroup ( const char *  nm,
bool  parallel = false,
bool  ownsexecs = true 
)
virtual ExecutorGroup::~ExecutorGroup (  )  [virtual]

Member Function Documentation

virtual void ExecutorGroup::add ( Executor  )  [virtual]

You will become mine if ownsexecs_ is true!!

void ExecutorGroup::findNextSumStop (  )  [protected]
Executor* ExecutorGroup::getExecutor ( int  idx  )  [inline]
virtual bool ExecutorGroup::goToNextExecutor (  )  [protected, virtual]
virtual const char* ExecutorGroup::message (  )  const [virtual]
Note:
totalNr is only used for displaying progress.

Reimplemented from Task.

virtual int ExecutorGroup::nextStep (  )  [protected, virtual]
Return values:
MoreToDo() Not finished. Call me again.
Finished() Nothing more to do.
ErrorOccurred() Something went wrong.
Note:
if function returns a value greater than cMoreToDo(), it should be interpreted as cMoreToDo().

Implements SequentialTask.

virtual int64_t ExecutorGroup::nrDone (  )  const [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 from Task.

virtual const char* ExecutorGroup::nrDoneText (  )  const [virtual]

Reimplemented from Task.

int ExecutorGroup::nrExecutors (  )  [inline]
void ExecutorGroup::setNrDoneText ( const char *  txt  )  [inline]

If set, will use this and the counted nrdone.

virtual int64_t ExecutorGroup::totalNr (  )  const [virtual]

Reimplemented from Task.


Member Data Documentation

int ExecutorGroup::currentexec_ [protected]
bool ExecutorGroup::ownsexecs_ [protected]
const bool ExecutorGroup::parallel_ [protected]
int ExecutorGroup::sumstart_ [protected]
int ExecutorGroup::sumstop_ [protected]