5#include <condition_variable>
50 MRVIEWER_API
static bool empty();
75 bool queueClosed_{
false };
76 std::thread::id mainThreadId_;
77 std::queue<std::shared_ptr<Command>> commands_;
Additional command loop for external app control.
Definition MRCommandLoop.h:17
static MRVIEWER_API void runCommandFromGUIThread(CommandFunc func)
StartPosition
Specify execution in specific time of application start.
Definition MRCommandLoop.h:23
static MRVIEWER_API void processCommands()
Execute all commands from loop.
std::thread::id threadId
Definition MRCommandLoop.h:69
CommandFunc func
Definition MRCommandLoop.h:66
static MRVIEWER_API bool empty()
Return true if loop is empty.
std::function< void()> CommandFunc
Definition MRCommandLoop.h:19
static MRVIEWER_API void setMainThreadId(const std::thread::id &id)
This function setups main thread id, it should be called before any command.
StartPosition state
Definition MRCommandLoop.h:67
static MRVIEWER_API void setState(StartPosition state)
Update state of command loop, only can rise.
std::condition_variable callerThreadCV
Definition MRCommandLoop.h:68
static MRVIEWER_API std::thread::id getMainThreadId()
static MRVIEWER_API void appendCommand(CommandFunc func, StartPosition state=StartPosition::BeforeWindowAppear)
static MRVIEWER_API void removeCommands(bool closeLoop)
@ AfterPluginInit
executes after splash appeared
@ BeforeWindowAppear
executes during splash, after plugins init)
@ AfterWindowAppear
executes after splash is going to close, and just before main window is shown and have valid main win...
@ AfterSplashAppear
executes right after window is initialized
only for bindings generation
Definition MRCameraOrientationPlugin.h:8