#include <ArmarXCore/core/ArmarXManager.h>
The periodic task executes one thread method repeatedly using the time period specified in the constructor.
Definition at line 70 of file ArmarXManager.h.
◆ method_type
typedef void(T::* method_type(void) |
Typedef for the periodic method.
Thread methods need to follow the template void methodName(void). Parameter passing is not used since methods are members of the class.
Definition at line 62 of file PeriodicTask.h.
◆ pointer_type
Shared pointer type for convenience.
Definition at line 67 of file PeriodicTask.h.
◆ PeriodicTask()
PeriodicTask |
( |
T * |
parent, |
|
|
method_type |
periodicFn, |
|
|
int |
periodMs, |
|
|
bool |
assureMeanInterval = false , |
|
|
std::string |
name = "" , |
|
|
bool |
forceSystemTime = true |
|
) |
| |
|
inline |
Constructs a periodic task within the class parent which calls the peridoicFn in a new thread.
- Parameters
-
parent | the class wheter periodicFn is member |
peridicFn | reference to the periodic function implementation |
periodMs | period time in milliseconds |
assureMeanInterval | If set to TRUE, the scheduler tries to compensate timeslot exceedings overtime and not only on the next interval |
name | of this thread, that describes what it is doing |
forceSystemTime | If set to false, the Timeserver will be used for timing (if available) |
Definition at line 82 of file PeriodicTask.h.
◆ ~PeriodicTask()
Destructor stops the thread and waits for completion.
Definition at line 130 of file PeriodicTask.h.
◆ changeInterval()
void changeInterval |
( |
unsigned int |
intervalInMs | ) |
|
|
inline |
changeInterval changes the interval at which the task is executed.
The execution starts the first time again after the duration specified in the parameter OR if the task is currently executed after this task
- the interval specified - cycleDuration.
- Parameters
-
intervalInMs | new execution interval in milliseconds. |
Definition at line 215 of file PeriodicTask.h.
◆ getInterval()
IceUtil::Int64 getInterval |
( |
| ) |
const |
|
inline |
- Returns
- The scheduling interval of the thread instance in milliseconds
Definition at line 193 of file PeriodicTask.h.
◆ getStatistics()
const PeriodicTaskIceBase& getStatistics |
( |
| ) |
const |
|
inline |
◆ isFunctionExecuting()
bool isFunctionExecuting |
( |
| ) |
const |
|
inline |
Return the execution state of the thread function.
- Returns
- PeriodicTask::functionExecuting
Definition at line 266 of file PeriodicTask.h.
◆ isRunning()
Retrieve running state of the thread.
- Returns
- whether thread is running
Definition at line 256 of file PeriodicTask.h.
◆ setDelayWarningTolerance()
void setDelayWarningTolerance |
( |
int |
newToleranceInMilliSeconds = 5 | ) |
|
|
inline |
- Returns
- Set the tolerance value for delay warnings. If the tasks takes longer than (scheduling interval + tolerance), a warning is issued.
- Parameters
-
newToleranceInMilliSeconds | The tolerance, in milliseconds. |
Definition at line 203 of file PeriodicTask.h.
◆ setName()
void setName |
( |
std::string |
name | ) |
|
|
inline |
◆ setThreadList()
This method sets threadList
as PeriodicTask::customThreadList and appends this
to the list.
- Parameters
-
Definition at line 158 of file PeriodicTask.h.
◆ start()
Starts the thread.
Only has effect if the task has not been started. After completion of the task, it can be started again (see isRunning()).
Definition at line 170 of file PeriodicTask.h.
◆ stop()
Stops the thread.
Only has effect if the task has been started.
Definition at line 235 of file PeriodicTask.h.
The documentation for this class was generated from the following files: