Watchdog which continuously calls the specified timeout callback. More...
#include <watchdog.h>
Public Types | |
using | Timeout = const std::chrono::high_resolution_clock::duration |
Public Member Functions | |
void | reset () |
Restarts the watchdog timer. More... | |
Watchdog (const Timeout &timeout, const std::function< void()> &timeout_callback) | |
~Watchdog () | |
Private Member Functions | |
std::cv_status | waitFor (const Timeout &timeout) |
Private Attributes | |
std::condition_variable | cv_ |
std::mutex | cv_m_ |
std::atomic_bool | terminated_ { false } |
util::Barrier | thread_startetd_barrier_ |
std::thread | timer_thread_ |
Watchdog which continuously calls the specified timeout callback.
After the specified timeout time has passed the timeout_callback is called and the timer restarts. This continues as long as the watchdog exists.
Definition at line 39 of file watchdog.h.
using psen_scan_v2_standalone::util::Watchdog::Timeout = const std::chrono::high_resolution_clock::duration |
Definition at line 42 of file watchdog.h.
|
inline |
Definition at line 71 of file watchdog.h.
|
inline |
Definition at line 106 of file watchdog.h.
|
inline |
Restarts the watchdog timer.
Definition at line 101 of file watchdog.h.
|
inlineprivate |
Definition at line 95 of file watchdog.h.
|
private |
Definition at line 66 of file watchdog.h.
|
private |
Definition at line 67 of file watchdog.h.
|
private |
Definition at line 65 of file watchdog.h.
|
private |
Definition at line 64 of file watchdog.h.
|
private |
Definition at line 68 of file watchdog.h.