Go to the documentation of this file.
50 m_lastPing.store( clock::now() );
68 virtual void onPing();
71 virtual void onStart();
74 virtual void onStop();
void ping()
Function to call to notify the watchdog thread that we are still alive.
time_point getLastPing() const
Get the time of latest ping.
void setTimeout(std::chrono::seconds timeout)
Change the duration of the time-out.
std::atomic< time_point > m_lastPing
When the last ping was received.
std::chrono::seconds m_timeout
Number of seconds allowed between pings.
std::promise< void > m_stop_thread
Flag to mark the thread as running/stopped (avoid possible race conditions).
std::chrono::seconds getTimeout() const
Get the current time-out value.
std::thread m_thread
Running thread;.