Public Member Functions | Public Attributes

Executor Class Reference

specification to enable chunkwise execution a process. More...

Inheritance diagram for Executor:
SequentialTask Task NamedObject CallBacker ExecutorGroup

List of all members.

Public Member Functions

 Executor (const char *nm)
virtual ~Executor ()
virtual int doStep ()
virtual bool execute (std::ostream *log=0, bool isfirst=true, bool islast=true, int delaybetwnstepsinms=0)

Public Attributes

Notifier< Executorprestep
Notifier< Executorpoststep
 Only when MoreToDo will be returned.

Detailed Description

specification to enable chunkwise execution a process.

Interface enabling separation of the control of execution of any process from what actually is going on. The work is done by calling the doStep() method until either ErrorOccurred or Finished is returned. To enable logging and/or communication with the user, two types of info can be made available (the methods will be called before the step is executed). Firstly, a message. Secondly, info on the progress. It is common that Executors are combined to a new Executor object. This is the most common reason why totalNr() can change.

If doStep returns -1 (Failure) the error message should be in message().

The execute() utility executes the process while logging message() etc. to a stream. Useful in batch situations.


Constructor & Destructor Documentation

Executor::Executor ( const char *  nm  )  [inline]
virtual Executor::~Executor (  )  [inline, virtual]

Member Function Documentation

virtual int Executor::doStep (  )  [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().

Reimplemented from SequentialTask.

virtual bool Executor::execute ( std::ostream *  log = 0,
bool  isfirst = true,
bool  islast = true,
int  delaybetwnstepsinms = 0 
) [virtual]

Member Data Documentation

Only when MoreToDo will be returned.