34 RepetitiveTask::RepetitiveTask() :
35 cancelRequest(false), cancelled(false), done(false), logger(
36 rsc::logging::Logger::getLogger(
"rsc.threading.RepetitiveTask")) {
93 boost::recursive_mutex::scoped_lock lock(
doneMutex);
100 boost::recursive_mutex::scoped_lock lock(
doneMutex);
123 return out <<
"RepetitiveTask[cancelRequest=" << t.
cancelRequest <<
"]";
#define RSCDEBUG(logger, msg)
boost::recursive_mutex doneMutex
ostream & operator<<(ostream &out, const RepetitiveTask &t)
virtual void pre()
A method called before each iteration of the task.
void run()
Performs the real task work orchestrating the iterative loop with the different hook methods and so o...
virtual void waitDone()
Waits for the execution of this task to finish.
virtual void post()
A method called after each iteration of the task.
virtual bool isCancelRequested()
Tells whether the task was interrupted by a call to cancel.
virtual bool isDone()
Indicates whether the task finished execution, either through being canceled or through successfully ...
A task that already provides a base frame for common logic of interruptible tasks.
rsc::logging::LoggerPtr logger
virtual void cancel()
Interrupts the task.
#define RSCTRACE(logger, msg)
virtual ~RepetitiveTask()
virtual bool continueExec()
Tells whether the #exec method shall be called another time.
boost::condition doneCondition
virtual void execute()=0
This method is invoked to perform the real work of the task.
volatile bool cancelRequest