5#include <condition_variable>
20 std::unique_lock<std::mutex> mLock;
21 std::condition_variable mConditionVariable;
24 std::atomic_bool mSignalFlag;
Time To Live countdown timer.
Definition: ttl_timer.h:17
bool GetRequested() const noexcept
Indicate whether the service client is requested or not.
Definition: ttl_timer.cpp:17
void WaitForSignal()
Wait for a signal from SetRequested or SetOffered.
Definition: ttl_timer.cpp:41
bool GetOffered() const noexcept
Indicate whether the service server is offered or not.
Definition: ttl_timer.cpp:29
void SetOffered(uint32_t ttl) noexcept
Set the service offered status.
Definition: ttl_timer.cpp:34
bool WaitForExpiration()
Wait for the timer to expire or reset.
Definition: ttl_timer.cpp:57
void Dispose() noexcept
Dispose the timer which causes all the waitings return immediately.
Definition: ttl_timer.cpp:85
void SetRequested(bool requested) noexcept
Set the service requested status.
Definition: ttl_timer.cpp:22