CppTimer
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
CppTimer Class Referenceabstract

#include <CppTimer.h>

Public Member Functions

virtual void startns (long nanosecs, cppTimerType_t t=PERIODIC)
 
virtual void startms (long millisecs, cppTimerType_t t=PERIODIC)
 
virtual void stop ()
 
virtual ~CppTimer ()
 

Protected Member Functions

virtual void timerEvent ()=0
 

Detailed Description

Timer class which repeatedly fires. It's wrapper around the POSIX per-process timer.

Constructor & Destructor Documentation

◆ ~CppTimer()

virtual CppTimer::~CppTimer ( )
inlinevirtual

Destructor disarms the timer, deletes it and disconnect the signal handler.

Member Function Documentation

◆ startms()

virtual void CppTimer::startms ( long  millisecs,
cppTimerType_t  t = PERIODIC 
)
inlinevirtual

Starts the timer. The timer fires first after the specified time in milliseconds and then at that interval in PERIODIC mode. In ONESHOT mode the timer fires once after the specified time in milliseconds.

Parameters
millisecsTime in milliseconds
typeEither PERIODIC or ONESHOT

◆ startns()

virtual void CppTimer::startns ( long  nanosecs,
cppTimerType_t  t = PERIODIC 
)
inlinevirtual

Starts the timer. The timer fires first after the specified time in nanoseconds and then at that interval in PERIODIC mode. In ONESHOT mode the timer fires once after the specified time in nanoseconds.

Parameters
nanosecsTime in nanoseconds
typeEither PERIODIC or ONESHOT

◆ stop()

virtual void CppTimer::stop ( )
inlinevirtual

Stops the timer by disarming it. It can be re-started with start().

◆ timerEvent()

virtual void CppTimer::timerEvent ( )
protectedpure virtual

Abstract function which needs to be implemented by the children. This is called every time the timer fires.


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