#include <TaskTypes.h>
Public Member Functions | |
| unsigned long | microsFromNow () |
| void | initialise (sched_t when, TimerUnit unit, TimerFn execCallback, bool repeating) |
| void | initialise (sched_t when, TimerUnit unit, Executable *executable, bool deleteWhenDone, bool repeating) |
| void | initialiseEvent (BaseEvent *event, bool deleteWhenDone) |
| void | handleScheduling (sched_t when, TimerUnit unit, bool repeating) |
| bool | isInUse () |
| bool | isRepeating () const |
| void | clear () |
| bool | allocateIfPossible () |
| void | markRunning () |
| void | clearRunning () |
| bool | isRunning () const |
| bool | isEvent () |
| TimerTask * | getNext () |
| void | setNext (TimerTask *nextTask) |
| void | execute () |
| void | processEvent () |
| bool | isMicrosSchedule () |
| bool | isMillisSchedule () |
| bool | isEnabled () |
| void | setEnabled (bool ena) |
Internal class that represents a single task slot. You should never have to deal with this class in user code.
Represents a single task or event that will be processed at some point in time. It stores the last evaluation time and also the execution parameters. EG execute every 100 millis.
| unsigned long TimerTask::microsFromNow | ( | ) |
Initialise a task slot with execution information
| executionInfo | the time of execution |
| unit | the unit of time measurement |
| execCallback | the function to call back |
| void TimerTask::initialise | ( | sched_t | when, |
| TimerUnit | unit, | ||
| Executable * | executable, | ||
| bool | deleteWhenDone, | ||
| bool | repeating ) |
Initialise a task slot with execution information
| executionInfo | the time of execution |
| unit | the unit of time measurement |
| executable | the class instance to call back |
| deleteWhenDone | indicates taskmanager owns this memory and should delete it when clear is called. |
| void TimerTask::initialiseEvent | ( | BaseEvent * | event, |
| bool | deleteWhenDone ) |
Initialise an event structure, which will call the event immediately to get the next poll time
| event | the event object reference |
| deleteWhenDone | if task manager owns it, if true, it will be deleted when clear is called. |
| void TimerTask::handleScheduling | ( | sched_t | when, |
| TimerUnit | unit, | ||
| bool | repeating ) |
Called by all the initialise methods to actually do the initial scheduling.
| when | when the task is to take place. |
| unit | the time unit upon which it will occur. |
|
inline |
Atomically checks if the task is in use at the moment.
| bool TimerTask::isRepeating | ( | ) | const |
Checks if this task is a repeating task.
| void TimerTask::clear | ( | ) |
Take a task out of use and clear down all it's fields. Clears the in use flag last for thread safety
|
inline |
Checks if it is possible to allocaate this task, IE that it is presently not in use.
|
inline |
Marks the task as in a running condition, this prevents the task being re-entered if it yields.
|
inline |
Clears the running state of the task, thus allowing it to be scheduled again.
|
inline |
|
inline |
|
inline |
Task manager holds a linked list of TimerTask, linked by the next field. It is atomically referenced
|
inline |
Task manager holds a linked list of TimerTask, linked by the next field. It is atomically referenced
| nextTask | the new next pointer |
| void TimerTask::execute | ( | ) |
actually does the execution of the task, or in the case of an event, it runs through the processEvent method.
| void TimerTask::processEvent | ( | ) |
This method processes an event in full.
|
inline |
|
inline |
|
inline |
|
inline |
Set the task aspi either enabled or disabled. When enabled it is scheduled, otherwise it is not scheduled.
| ena | the enablement status |