9 #include "imstkEventObject.h" 13 using ModuleDriverStatus = int;
14 #define ModuleDriverRunning 0 15 #define ModuleDriverPaused 1 16 #define ModuleDriverStopped 2 33 virtual void start() = 0;
38 virtual void addModule(std::shared_ptr<Module> module)
40 m_modules.push_back(module);
48 void requestStatus(ModuleDriverStatus status) { simState = status; }
49 ModuleDriverStatus getStatus()
const {
return simState; }
51 std::vector<std::shared_ptr<Module>>& getModules() {
return m_modules; }
59 std::vector<std::shared_ptr<Module>> m_modules;
61 std::atomic<ModuleDriverStatus> simState = { ModuleDriverRunning };
virtual void addModule(std::shared_ptr< Module > module)
Add a module to run.
virtual void clearModules()
Remove all modules.
EventObject is the base class for all objects in iMSTK that can receive and emit events. It supports direct and queued observer functions. Direct observers receive events immediately on the same thread This can either be posted on an object or be a function pointer Queued observers receive events within their queue which they can process whenever they like. These can be connected with the connect/queuedConnect/disconnect functions Lambda recievers cannot be disconnected unless all receivers to a signal are removed.
void waitForInit()
Wait for all modules to init.
Defines the control of modules.