25 #ifndef __I6ENGINE_CORE_MODULECONTROLLER_H__
26 #define __I6ENGINE_CORE_MODULECONTROLLER_H__
28 #include <condition_variable>
44 class EngineCoreController;
45 class MessagingController;
46 class SubSystemController;
78 void startThreadTicking(
const uint32_t lngFrameTime);
85 void startThreadWaiting(
const std::set<Subsystem> & waitingFor);
99 _subsystemController = ssc;
101 _messagingController = mc;
107 virtual void OnThreadStart() = 0;
112 virtual void Tick() = 0;
117 virtual void ShutDown() = 0;
142 void processMessages()
override;
149 inline void setTimer(
Timer * ptrTimer) {
150 _ptrTimer = ptrTimer;
157 inline Timer * getTimer()
const {
164 void runLoopTicking();
165 void runLoopWaiting();
170 EngineCoreController * _ctrl;
185 SubSystemController * _subsystemController;
195 std::set<Subsystem> _waitingSubsystems;
200 std::set<Subsystem> _notifiedSubsystems;
205 std::map<Subsystem, std::vector<Message::Ptr>> _waitingMessages;
210 std::vector<Message::Ptr> _messages;
212 mutable std::mutex _lock;
213 std::condition_variable _conditionVariable;
215 #ifdef ISIXE_WITH_PROFILING
229 uint16_t _expectedFps;
235 inline void setRunning(
bool b) {
242 inline bool getRunning()
const {
249 std::unique_lock<std::mutex> ul(_lock);
250 _conditionVariable.notify_one();
256 ModuleController(
const ModuleController &) =
delete;
261 ModuleController & operator=(
const ModuleController &) =
delete;
Subsystem getSubsystem() const
MessagingController * _messagingController
pointer to MessagingController
Part of the Subsystem that keeps the whole module running.
uint32_t getFrameTime() const
Gets the frametime of this Subsystem.
Interface for every class that wants to subscribe to the messaging system.
Central controller for messaging between subsystems and subsystems of different clients.
this class is used as an abstraction layer
void setController(SubSystemController *ssc, EngineCoreController *ecc, MessagingController *mc)
registers necessary controllers for this Subsystem
Subsystem _subsystem
the Subsystem
boost::shared_ptr< ReceivedMessage > ReceivedMessagePtr
uint32_t _frameTime
the frame time of the Subsystem
This class is used as an abstraction layer.
This class provides gametime-synchronized Timers. They are controlled by the Scheduler.