RSC
0.17.1
|
A specialization of Task that executes a task in a periodic manner by providing an special implementation of continueExec. More...
#include <PeriodicTask.h>
Public Member Functions | |
PeriodicTask (const unsigned int &ms, bool accountProcTime=true) | |
Constructs a new periodic task with a fixed wait time after each iteration. More... | |
virtual | ~PeriodicTask () |
virtual bool | continueExec () |
Implements a waiting logic for the continuation of the repetitive task. More... | |
Public Member Functions inherited from rsc::threading::RepetitiveTask | |
RepetitiveTask () | |
virtual | ~RepetitiveTask () |
virtual void | pre () |
A method called before each iteration of the task. More... | |
virtual void | execute ()=0 |
This method is invoked to perform the real work of the task. More... | |
virtual void | post () |
A method called after each iteration of the task. More... | |
virtual void | cancel () |
Interrupts the task. More... | |
virtual bool | isCancelRequested () |
Tells whether the task was interrupted by a call to cancel. More... | |
void | run () |
Performs the real task work orchestrating the iterative loop with the different hook methods and so on. More... | |
virtual void | waitDone () |
Waits for the execution of this task to finish. More... | |
virtual bool | isDone () |
Indicates whether the task finished execution, either through being canceled or through successfully ending. More... | |
Public Member Functions inherited from rsc::threading::Task | |
virtual | ~Task () |
Private Attributes | |
unsigned int | cycleTime |
rsc::logging::LoggerPtr | logger |
bool | fixedScheduling |
boost::uint64_t | nextProcessingStart |
Additional Inherited Members | |
Protected Attributes inherited from rsc::threading::RepetitiveTask | |
boost::recursive_mutex | doneMutex |
boost::condition | doneCondition |
A specialization of Task that executes a task in a periodic manner by providing an special implementation of continueExec.
A fixed interval is guaranteed.
Definition at line 47 of file PeriodicTask.h.
rsc::threading::PeriodicTask::PeriodicTask | ( | const unsigned int & | ms, |
bool | accountProcTime = true |
||
) |
Constructs a new periodic task with a fixed wait time after each iteration.
ms | time to wait between iterations. No overall-fixed interval is guaranteed by the implementation. Time is in milliseconds. |
accountProcTime | subtracts the processing time from sleep time in order to guarantee a fixed scheduling interval |
Definition at line 34 of file PeriodicTask.cpp.
|
virtual |
Definition at line 40 of file PeriodicTask.cpp.
|
virtual |
Implements a waiting logic for the continuation of the repetitive task.
Reimplemented from rsc::threading::RepetitiveTask.
Definition at line 44 of file PeriodicTask.cpp.
References rsc::misc::currentTimeMicros(), cycleTime, fixedScheduling, rsc::threading::RepetitiveTask::isCancelRequested(), logger, nextProcessingStart, RSCTRACE, and RSCWARN.
|
private |
Definition at line 72 of file PeriodicTask.h.
Referenced by continueExec().
|
private |
Definition at line 74 of file PeriodicTask.h.
Referenced by continueExec().
|
private |
Definition at line 73 of file PeriodicTask.h.
Referenced by continueExec(), and ~PeriodicTask().
|
private |
Definition at line 75 of file PeriodicTask.h.
Referenced by continueExec().