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 );
Definition MRAsyncTimer.h:56
the object to set timer from any thread and wait for alert time from another thread
Definition MRAsyncTimer.h:24
MRVIEWER_API void requestIfNotSet(const Time &time, Command command)
MRVIEWER_API void request(const Time &time, Command command)
MRVIEWER_API void reset()
clears command
std::chrono::time_point< std::chrono::system_clock > Time
Definition MRAsyncTimer.h:20
MRVIEWER_API void setTime(const Time &time)
sets alert time, forgetting about previous time
std::function< void()> Command
Definition MRAsyncTimer.h:60
MRVIEWER_API AsyncRequest()
MRVIEWER_API ~AsyncRequest()
MRVIEWER_API void resetTime()
reset the timer
MRVIEWER_API Event waitBlocking()
MRVIEWER_API bool setTimeIfNotSet(const Time &time)
Event
to call from waiter thread
Definition MRAsyncTimer.h:38
MRVIEWER_API void terminate()
orders the waiter thread to stop
only for bindings generation
Definition MRCameraOrientationPlugin.h:8