class DtScheduler
More...
Protected Member Functions |
| void | doPendingResorts () |
| | Calls reSort() for any timer for which resortPending() returns true.
|
| void | moveToEnd (DtTimer *timer) |
| | Removes timer from its current position and adds it to the end.
|
Detailed Description
class DtScheduler
Instances of class DtScheduler maintain a list of DtTimer objects. It ticks all timer objects each time it is ticked. When it finds a It maintains the DtTimers as a sorted list in order of time to fire, so that once a timer is found that is not ready to fire, none of the others will need to be ticked.
Constructor & Destructor Documentation
| DtScheduler::DtScheduler |
( |
| ) |
|
constructors A pointer to the simManager is needed to obtain the DtExerciseClock.
| virtual DtScheduler::~DtScheduler |
( |
| ) |
|
|
virtual |
Member Function Documentation
| virtual void DtScheduler::tick |
( |
| ) |
|
|
virtual |
Iterates through list of DtTimers.
DtTimers are maintained in chronological order of fire time (sooner to later). If resortIsPending() for a given timer, skips the timer (to be resorted at the end of the tick), otherwise calls the timer's tick() function. If a given timer fires and timer should be deleted upon firing, removes and deletes the timer. At the end of the tick, calls doPendingResorts() to re-sort any timers that require it.
| virtual void DtScheduler::addTimer |
( |
DtTimer * |
timer | ) |
|
|
virtual |
None of the DtTimer * arguments are const, since all of these routines may modify the timerMgrEntry field of a DtTimer.
Adds a given timer to the scheduler. Sets a pointer to the instance of the scehduler in the given timer, adds the timer, and then calls resort().
| virtual void DtScheduler::removeTimer |
( |
DtTimer * |
timer | ) |
|
|
virtual |
If the given timer is non-null and is managed, looks up and removes the timer, and sets the scheduler to null in the timer.
| virtual void DtScheduler::reset |
( |
bool |
clearAll = false | ) |
|
|
virtual |
Removes and deletes out 'deleteAfterFire' timers if clearAll is false.
If clearAll is true, removes and deletes 'all' timers.
| void DtScheduler::reSort |
( |
DtTimer * |
timer | ) |
|
Moves timers that have fired to the end of the list of timers.
Sorts timers in order of sooner to later fire time.
| void DtScheduler::doPendingResorts |
( |
| ) |
|
|
protected |
Calls reSort() for any timer for which resortPending() returns true.
| void DtScheduler::moveToEnd |
( |
DtTimer * |
timer | ) |
|
|
protected |
Removes timer from its current position and adds it to the end.
Member Data Documentation
| bool DtScheduler::myInTick |
|
protected |
If in tick, ReSort() does NOT resort.
Instead, it marks the timer as resortPending. These timers will be resorted at the end of the tick function.
The documentation for this class was generated from the following file:
- /exports/nfedora7-1/nightly/docs/vrforcesDevelopment.vrf4-3-branch/include/vrfcore/scheduler.h