specification to enable chunkwise execution a process. More...
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< Executor > | prestep |
| Notifier< Executor > | poststep |
| Only when MoreToDo will be returned. | |
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.
| Executor::Executor | ( | const char * | nm | ) | [inline] |
| virtual Executor::~Executor | ( | ) | [inline, virtual] |
| virtual int Executor::doStep | ( | ) | [virtual] |
| MoreToDo() | Not finished. Call me again. | |
| Finished() | Nothing more to do. | |
| ErrorOccurred() | Something went wrong. |
Reimplemented from SequentialTask.
| virtual bool Executor::execute | ( | std::ostream * | log = 0, |
|
| bool | isfirst = true, |
|||
| bool | islast = true, |
|||
| int | delaybetwnstepsinms = 0 | |||
| ) | [virtual] |
Only when MoreToDo will be returned.
1.7.1