6#include <condition_variable>
56 MRVIEWER_API
static bool empty();
63 CommandLoop() =
default;
66 static CommandLoop& instance_();
91 bool queueClosed_{
false };
92 std::thread::id mainThreadId_;
93 std::queue<std::shared_ptr<Command>> commands_;
bool done
Definition MRCommandLoop.h:83
StartPosition
Specify execution in specific time of application start.
Definition MRCommandLoop.h:24
static bool empty()
Return true if loop is empty.
std::thread::id threadId
Definition MRCommandLoop.h:77
CommandFunc func
Definition MRCommandLoop.h:74
std::function< void()> CommandFunc
Definition MRCommandLoop.h:20
static void setMainThreadId(const std::thread::id &id)
This function setups main thread id, it should be called before any command.
static void processCommands()
Execute all commands from loop.
void skipFramesAfterInput()
tl::expected< T, E > Expected
Definition MRExpected.h:31
StartPosition state
Definition MRCommandLoop.h:75
static std::thread::id getMainThreadId()
std::condition_variable callerThreadCV
Definition MRCommandLoop.h:76
bool dropped
set under CommandLoop::mutex_ in removeCommands: done, but never executed
Definition MRCommandLoop.h:85
static void runCommandFromGUIThread(CommandFunc func)
static void setState(StartPosition state)
Update state of command loop, only can rise.
static void appendCommand(CommandFunc func, StartPosition state=StartPosition::BeforeWindowAppear)
bool started
Definition MRCommandLoop.h:80
static void removeCommands(bool closeLoop)
@ AfterPluginInit
executes after splash appeared
Definition MRCommandLoop.h:27
@ BeforeWindowAppear
executes during splash, after plugins init)
Definition MRCommandLoop.h:28
@ AfterWindowAppear
executes after splash is going to close, and just before main window is shown and have valid main win...
Definition MRCommandLoop.h:29
@ AfterSplashAppear
executes right after window is initialized
Definition MRCommandLoop.h:26
@ AfterWindowInit
Definition MRCommandLoop.h:25
only for bindings generation
Definition MRCameraOrientationPlugin.h:8