Class CTimer

Class Documentation

class CTimer

eCAL timer class.

The CTimer class is used to realize simple time triggered callbacks.

Public Functions

ECAL_API CTimer()

Constructor.

ECAL_API CTimer(int timeout_, const TimerCallbackT &callback_, int delay_ = 0)

Constructor.

Parameters:
  • timeout_ – Timer callback loop time in ms.

  • callback_ – The callback function.

  • delay_ – Timer callback delay for first call in ms.

virtual ECAL_API ~CTimer()

Destructor.

CTimer(const CTimer&) = delete
CTimer &operator=(const CTimer&) = delete
CTimer(CTimer &&rhs) = delete
CTimer &operator=(CTimer &&rhs) = delete
ECAL_API bool Start (int timeout_, const TimerCallbackT &callback_, int delay_=0)

Start the timer.

Parameters:
  • timeout_ – Timer callback loop time in ms.

  • callback_ – The callback function.

  • delay_ – Timer callback delay for first call in ms.

Returns:

True if timer could be started.

ECAL_API bool Stop ()

Stop the timer.

Returns:

True if timer could be stopped.

Protected Attributes

std::unique_ptr<CTimerImpl> m_timer