Dataflow Runtime API  3.0.3.0
Public Member Functions | List of all members
imt::base::os::winec7::Timer Class Reference

This class implements a timer that sends ticks in regular intervals to the attached timer listeners. More...

#include <Imt.Base.OS.WinEC7/Timer.h>

Public Member Functions

 Timer (const std::wstring &id, const TimePeriod &tickPeriod)
 Constructor. More...
 
virtual ~Timer (void)
 Destructor. More...
 
void start (void)
 Starts the given timer. More...
 
void stop (void)
 Stops the given timer. More...
 
void setPeriod (const TimePeriod &tickPeriod)
 Sets the interval to the given tick period. More...
 
const TimePeriodgetPeriod (void) const
 Returns the interval in ms. More...
 
bool isRunning (void) const
 Returns true if the timer is running. More...
 
void addTimerListener (TimerListenerIfc &listener)
 Listener that get notified when a timer tick occurs. More...
 
void removeTimerListener (const TimerListenerIfc &listener)
 Removes the given listener from the list. More...
 
const std::wstring & getId (void) const
 Get identification. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Timer()

imt::base::os::winec7::Timer::Timer ( const std::wstring &  id,
const TimePeriod tickPeriod 
)
explicit

Constructor.

Parameters
idIdentifier of the timer.
tickPeriodTickperiod of the timer.

◆ ~Timer()

virtual imt::base::os::winec7::Timer::~Timer ( void  )
virtual

Destructor.

Member Function Documentation

◆ addTimerListener()

void imt::base::os::winec7::Timer::addTimerListener ( TimerListenerIfc listener)

Listener that get notified when a timer tick occurs.

Parameters
listenerListener to add.

◆ 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
listenerListener 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
tickPeriodtick period of the timer.

◆ start()

void imt::base::os::winec7::Timer::start ( void  )

Starts the given timer.

◆ stop()

void imt::base::os::winec7::Timer::stop ( void  )

Stops the given timer.


The documentation for this class was generated from the following file: