Inherited by Eaagles::Basic::LcDownTimer, and Eaagles::Basic::LcUpTimer.
Inheritance diagram for Eaagles::Basic::LcTimer:


Public Types | |
| enum | { UP, DOWN } |
Public Member Functions | |
| LcTimer (int direction, LCreal rtime=0.0f) | |
| LcTimer () | |
| LCreal | time () const |
| void | start () |
| void | stop () |
| void | reset () |
| void | reset (const LCreal rtime) |
| void | restart () |
| void | restart (const LCreal rtime) |
| void | update (const LCreal dt) |
| bool | alarm () const |
| bool | alarm (const LCreal atime) |
| bool | isRunning () const |
| bool | isNotRunning () const |
| bool | freeze () const |
| virtual bool | setSlotTimerValue (const LcTime *const msg) |
| virtual bool | setSlotTimerActive (const LcNumber *const msg) |
Static Public Member Functions | |
| static bool | freeze (const bool ff) |
| static void | updateTimers (const LCreal dt) |
Static Private Member Functions | |
| static void | addToTimerList (LcTimer *timer) |
| static void | removeFromTimerList (LcTimer *timer) |
Private Attributes | |
| LCreal | ctime |
| LCreal | alarmTime |
| LCreal | timerValue |
| bool | active |
| int | dir |
Static Private Attributes | |
| static bool | frz |
| static LcList | timers |
General purpose up/down timer.
Slots:
timerValue <LcTimer> Timer interval (LcTime)
active <LcNumber> Sets timer active (running) flag
| Eaagles::Basic::LcTimer::LcTimer | ( | int | direction, | |
| LCreal | rtime = 0.0f | |||
| ) |
Constructor; general purpuse up/down timer. The direction can be either LcTimer::up or LcTimer::down. The timer is preset to rtime or zero.
| Eaagles::Basic::LcTimer::LcTimer | ( | ) |
| LCreal Eaagles::Basic::LcTimer::time | ( | ) | const [inline] |
Returns the current value of this timer.
| void Eaagles::Basic::LcTimer::start | ( | ) | [inline] |
Starts this timer.
| void Eaagles::Basic::LcTimer::stop | ( | ) | [inline] |
Stops this timer.
| void Eaagles::Basic::LcTimer::reset | ( | ) | [inline] |
Resets this timer to rtime seconds and it is stopped. If rtime is not given, the rtime from the constructor is used.
| void Eaagles::Basic::LcTimer::reset | ( | const LCreal | rtime | ) | [inline] |
| void Eaagles::Basic::LcTimer::restart | ( | ) | [inline] |
Resets this timer to the timer value. If 'rtime' is given, the timer value is first set to rtime. The timer is left active (running).
| void Eaagles::Basic::LcTimer::restart | ( | const LCreal | rtime | ) | [inline] |
| void Eaagles::Basic::LcTimer::update | ( | const LCreal | dt | ) | [inline] |
Updates this timer. Usually called by updateTimers().
| bool Eaagles::Basic::LcTimer::alarm | ( | ) | const [inline] |
Sets an alarm to atime seconds. Returns true if the timer is active and one of the following conditions is met. direction == up and timer >= atime direction == down and timer <= atime
| bool Eaagles::Basic::LcTimer::alarm | ( | const LCreal | atime | ) | [inline] |
| bool Eaagles::Basic::LcTimer::isRunning | ( | ) | const [inline] |
Return true of the timer is active.
| bool Eaagles::Basic::LcTimer::isNotRunning | ( | ) | const [inline] |
Return true of the timer is not active.
| bool Eaagles::Basic::LcTimer::freeze | ( | const bool | ff | ) | [inline, static] |
When the state of the freeze flag is true, ALL timers are frozen. Function freeze() returns the current state of the freeze flag. If 'ff' is given, the freeze flag is set to the value of 'ff' and the previous value of the freeze flag is returned.
| bool Eaagles::Basic::LcTimer::freeze | ( | ) | const [inline] |
Returns the value of freeze flag.
| void Eaagles::Basic::LcTimer::updateTimers | ( | const LCreal | dt | ) | [static] |
Updates all of the instances of LcTimer. Called by the main application routine.
| bool Eaagles::Basic::LcTimer::setSlotTimerValue | ( | const LcTime *const | msg | ) | [virtual] |
Sets the timer value.
| bool Eaagles::Basic::LcTimer::setSlotTimerActive | ( | const LcNumber *const | msg | ) | [virtual] |
Sets the timer active (running) flag.
| void Eaagles::Basic::LcTimer::addToTimerList | ( | LcTimer * | timer | ) | [inline, static, private] |
Handle timer list.
| void Eaagles::Basic::LcTimer::removeFromTimerList | ( | LcTimer * | timer | ) | [inline, static, private] |
LCreal Eaagles::Basic::LcTimer::ctime [private] |
Current time (seconds).
LCreal Eaagles::Basic::LcTimer::alarmTime [private] |
Alarm time (seconds).
LCreal Eaagles::Basic::LcTimer::timerValue [private] |
Timer value (seconds).
bool Eaagles::Basic::LcTimer::active [private] |
Active flag.
int Eaagles::Basic::LcTimer::dir [private] |
Direction up/down.
bool Eaagles::Basic::LcTimer::frz [static, private] |
Freeze all timers (freeze time).
LcList Eaagles::Basic::LcTimer::timers [static, private] |
List of timers.
1.5.0