A timer which calls a callback every interval on a separate thread.
More...
#include <timer.h>
A timer which calls a callback every interval on a separate thread.
Definition at line 40 of file timer.h.
◆ Timer() [1/3]
tesseract_common::Timer::Timer |
( |
| ) |
|
|
default |
◆ ~Timer()
tesseract_common::Timer::~Timer |
( |
| ) |
|
◆ Timer() [2/3]
tesseract_common::Timer::Timer |
( |
const Timer & |
| ) |
|
|
delete |
◆ Timer() [3/3]
tesseract_common::Timer::Timer |
( |
Timer && |
| ) |
|
|
delete |
◆ operator=() [1/2]
Timer& tesseract_common::Timer::operator= |
( |
const Timer & |
| ) |
|
|
delete |
◆ operator=() [2/2]
Timer& tesseract_common::Timer::operator= |
( |
Timer && |
| ) |
|
|
delete |
◆ start()
void tesseract_common::Timer::start |
( |
const std::function< void()> & |
callback, |
|
|
std::chrono::steady_clock::duration |
interval |
|
) |
| |
Start the timer with a callback function and a std::chrono::duration interval.
- Parameters
-
callback | The callback called every time the timer expires |
interval | The interval at which the timer triggers |
Definition at line 33 of file timer.cpp.
◆ stop()
void tesseract_common::Timer::stop |
( |
| ) |
|
Stop the timer.
Definition at line 46 of file timer.cpp.
◆ running_
std::atomic<bool> tesseract_common::Timer::running_ { false } |
|
private |
◆ timer_thread_
std::thread tesseract_common::Timer::timer_thread_ |
|
private |
The documentation for this class was generated from the following files: