#include <arstimer.h>
Collaboration diagram for Ars::Timer:

Public Member Functions | |
| Timer (MessageClient *pOwner=0) | |
| virtual | ~Timer (void) |
| Standard destructor. | |
| void | StartTimer (unsigned long int Interval, bool bAutoRestart=false) |
| void | StopTimer (void) |
| Stops the running timer. | |
| bool | IsRunning (void) |
| true is the timer is currently running | |
| long int | GetCount (void) const |
| The count of times the timer has fired. | |
| void | ResetCount (void) |
| Resets the internal counter to zero. | |
| Uint32 | TimerHit (Uint32 Interval) |
Protected Attributes | |
| SDL_TimerID | m_TimerID |
| The ID of the SDL timer used. | |
| bool | m_bAutoRestart |
| If this is true, the timer will restart as soon as it expires. | |
| long int | m_iCounter |
| A simple counter that increments each time the timer fires. | |
| MessageClient * | m_pOwner |
| A pointer the the timer's owner. this is where messages are destined. | |
Definition at line 14 of file arstimer.h.
|
|
Standard constructor
Definition at line 11 of file arstimer.cpp.
00011 : 00012 m_TimerID(0), 00013 m_bAutoRestart(false), 00014 m_iCounter(0), 00015 m_pOwner(pOwner) 00016 { 00017 00018 } |
|
|
Standard destructor.
Definition at line 21 of file arstimer.cpp. References StopTimer().
00022 {
00023 StopTimer();
00024 }
|
|
|
The count of times the timer has fired.
Definition at line 36 of file arstimer.h. References m_iCounter.
00036 { return m_iCounter; }
|
|
|
true is the timer is currently running
Definition at line 33 of file arstimer.h. References m_TimerID.
00033 { return m_TimerID != 0; }
|
|
|
Resets the internal counter to zero.
Definition at line 39 of file arstimer.h. References m_iCounter.
00039 { m_iCounter = 0; }
|
|
||||||||||||
|
Start the timer. When the timer expires, it will post an CTRL_TIMER message
Definition at line 27 of file arstimer.cpp. References m_bAutoRestart, m_TimerID, and Ars::TimerCallback(). Referenced by Ars::XToolTip::evMouseMove().
00028 {
00029 m_bAutoRestart = bAutoRestart;
00030 if (!m_TimerID)
00031 m_TimerID = SDL_AddTimer(Interval, &TimerCallback, this);
00032 }
|
|
|
Stops the running timer.
Definition at line 35 of file arstimer.cpp. References m_TimerID. Referenced by Ars::XToolTip::evMouseMove(), TimerHit(), and ~Timer().
|
|
|
For internal use only For internal use only. This is where the SDL timer calls back to, and should not be used elsewhere Definition at line 45 of file arstimer.cpp. References ArsSendMessage, m_bAutoRestart, m_iCounter, m_pOwner, and StopTimer().
00046 {
00047 m_iCounter++;
00048 ArsSendMessage( CtrlMessage( Message::CTRL_TIMER, m_pOwner, this, m_iCounter ) );
00049 if (!m_bAutoRestart)
00050 StopTimer();
00051
00052 return Interval;
00053 }
|
|
|
If this is true, the timer will restart as soon as it expires.
Definition at line 50 of file arstimer.h. Referenced by StartTimer(), and TimerHit(). |
|
|
A simple counter that increments each time the timer fires.
Definition at line 53 of file arstimer.h. Referenced by GetCount(), ResetCount(), and TimerHit(). |
|
|
A pointer the the timer's owner. this is where messages are destined.
Definition at line 56 of file arstimer.h. Referenced by TimerHit(). |
|
|
The ID of the SDL timer used.
Definition at line 47 of file arstimer.h. Referenced by IsRunning(), StartTimer(), and StopTimer(). |
1.3.3