This class implements a timer that sends ticks in regular intervals to the attached timer listeners.
More...
#include <Imt.Base.OS.WinEC7/Timer.h>
This class implements a timer that sends ticks in regular intervals to the attached timer listeners.
The ticks of this timer are executed in a separate timer thread. So you have to pay attention when accessing shared data to ommit race conditions.
◆ Timer()
imt::base::os::winec7::Timer::Timer |
( |
const std::wstring & |
id, |
|
|
const TimePeriod & |
tickPeriod |
|
) |
| |
|
explicit |
Constructor.
- Parameters
-
id | Identifier of the timer. |
tickPeriod | Tickperiod of the timer. |
◆ ~Timer()
virtual imt::base::os::winec7::Timer::~Timer |
( |
void |
| ) |
|
|
virtual |
◆ addTimerListener()
void imt::base::os::winec7::Timer::addTimerListener |
( |
TimerListenerIfc & |
listener | ) |
|
Listener that get notified when a timer tick occurs.
- Parameters
-
◆ getId()
const std::wstring& imt::base::os::winec7::Timer::getId |
( |
void |
| ) |
const |
Get identification.
- Returns
- Identifier of the timer.
◆ getPeriod()
const TimePeriod& imt::base::os::winec7::Timer::getPeriod |
( |
void |
| ) |
const |
Returns the interval in ms.
- Returns
- Interval in ms.
◆ isRunning()
bool imt::base::os::winec7::Timer::isRunning |
( |
void |
| ) |
const |
Returns true if the timer is running.
- Returns
- True if timer is running, else false.
◆ removeTimerListener()
void imt::base::os::winec7::Timer::removeTimerListener |
( |
const TimerListenerIfc & |
listener | ) |
|
Removes the given listener from the list.
- Parameters
-
listener | Listener to remove. |
◆ setPeriod()
void imt::base::os::winec7::Timer::setPeriod |
( |
const TimePeriod & |
tickPeriod | ) |
|
Sets the interval to the given tick period.
This method may stop and restart the timer to change the period.
- Parameters
-
tickPeriod | tick period of the timer. |
◆ start()
void imt::base::os::winec7::Timer::start |
( |
void |
| ) |
|
◆ stop()
void imt::base::os::winec7::Timer::stop |
( |
void |
| ) |
|
The documentation for this class was generated from the following file:
- D:/_Work/10/s/Imt.Base/Imt.Base.OS.WinEC7/Timer.h