5#include <condition_variable>
20using Time = std::chrono::time_point<std::chrono::system_clock>;
46 std::condition_variable cvar_;
47 std::optional<Time> time_;
48 bool terminating_ =
false;
73 std::thread listenerThread_;
77 void storeCommand_(
Command command );
the object to set timer from any thread and wait for alert time from another thread
Definition MRAsyncTimer.h:24
void resetTime()
reset the timer
std::chrono::time_point< std::chrono::system_clock > Time
Definition MRAsyncTimer.h:20
void terminate()
orders the waiter thread to stop
std::function< void()> Command
Definition MRAsyncTimer.h:60
bool setTimeIfNotSet(const Time &time)
void requestIfNotSet(const Time &time, Command command)
void reset()
clears command
void setTime(const Time &time)
sets alert time, forgetting about previous time
void request(const Time &time, Command command)
Event
to call from waiter thread
Definition MRAsyncTimer.h:38
@ Terminate
Definition MRAsyncTimer.h:40
@ AlertTimeReached
Definition MRAsyncTimer.h:39
only for bindings generation
Definition MRCameraOrientationPlugin.h:8