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

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

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

Public Member Functions

 UITimer (const std::wstring &id, const TimePeriod &tickPeriod)
 Constructor. More...
 
virtual ~UITimer (void)
 Destructor. More...
 
void start (void)
 Starts the given ui timer. More...
 
void stop (void)
 Stops the given ui 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 the ui timer state. 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 of the ui timer. More...
 

Friends

class UITimerHelper
 

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 by the UI thread. So when you use this timer, you can access data belonging to the ui thread without taking care of synchronization issues and race conditions.

Constructor & Destructor Documentation

◆ UITimer()

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

Constructor.

Parameters
idIdentifier of the timer
tickPeriodTickperiod of the timer

◆ ~UITimer()

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

Destructor.

Member Function Documentation

◆ addTimerListener()

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

Listener that get notified when a timer tick occurs.

Parameters
listenerListener to add.

◆ getId()

const std::wstring& imt::base::os::winec7::UITimer::getId ( void  ) const

Get identification of the ui timer.

Returns
Identifier of the ui timer.

◆ getPeriod()

const TimePeriod& imt::base::os::winec7::UITimer::getPeriod ( void  ) const

Returns the interval in ms.

Returns
Interval in ms.

◆ isRunning()

bool imt::base::os::winec7::UITimer::isRunning ( void  ) const

Returns the ui timer state.

Returns
True if timer is running, else false.

◆ removeTimerListener()

void imt::base::os::winec7::UITimer::removeTimerListener ( const TimerListenerIfc listener)

Removes the given listener from the list.

Parameters
listenerListener to remove.

◆ setPeriod()

void imt::base::os::winec7::UITimer::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::UITimer::start ( void  )

Starts the given ui timer.

◆ stop()

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

Stops the given ui timer.

Friends And Related Function Documentation

◆ UITimerHelper

friend class UITimerHelper
friend

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