The Timer class Provides a generic timer.
More...
#include <Driver/MessageProcessing/Timer.h>
The Timer class Provides a generic timer.
Definition at line 13 of file Timer.h.
◆ Timer()
◆ isRunning()
bool Timer::isRunning |
( |
| ) |
const |
isRunning Checks if the timer is running
- Returns
- returns true if the timer is running
Definition at line 21 of file Timer.cpp.
◆ process()
process Call periodically to run the timer
Definition at line 33 of file Timer.cpp.
◆ setCallback()
void Timer::setCallback |
( |
const std::function< void()> & |
callback | ) |
|
setCallback Sets callback that is called when timeout is reached
- Parameters
-
callback | callback to call when timeout is reached |
Definition at line 17 of file Timer.cpp.
◆ setSingleShot()
void Timer::setSingleShot |
( |
bool |
singleShot | ) |
|
setSingleShot Sets if this is a singleshot timer
- Parameters
-
singleShot | sets if this is a single shot timer |
Definition at line 48 of file Timer.cpp.
◆ setTimeout()
void Timer::setTimeout |
( |
const uint64_t & |
timeout | ) |
|
setTimeout Sets the timeout in milliseconds
- Parameters
-
timeout | the timeout in milliseconds |
Definition at line 29 of file Timer.cpp.
◆ singleShot()
bool Timer::singleShot |
( |
| ) |
const |
singleShot Check if this is a single shot timer
- Returns
- returns true if this is a single shot timer
Definition at line 43 of file Timer.cpp.
◆ start() [1/2]
start Starts or resets the timer;
Definition at line 7 of file Timer.cpp.
◆ start() [2/2]
void Timer::start |
( |
uint64_t |
timeout | ) |
|
start Starts or resets the timer
- Parameters
-
timeout | sets timeout for timer |
Definition at line 12 of file Timer.cpp.
◆ stop()
◆ timeout()
uint64_t Timer::timeout |
( |
| ) |
const |
timeout Gets the timeout in milliseconds
- Returns
- The timeout in milliseconds
Definition at line 25 of file Timer.cpp.
◆ m_callback
std::function<void(void)> Timer::m_callback |
|
private |
◆ m_nextTimeout
std::chrono::system_clock::time_point Timer::m_nextTimeout |
|
private |
◆ m_running
◆ m_singleShot
◆ m_timeout
uint64_t Timer::m_timeout |
|
private |