i6engine  1.0
i6e::core::ModuleController Class Referenceabstract

Part of the Subsystem that keeps the whole module running. More...

#include <D:/Projekte/i6engine/libs/i6engine-core/include/i6engine/core/subsystem/ModuleController.h>

Public Member Functions

 ModuleController (Subsystem sub)
 Constructs a new ModuleController with the given subsystem type. More...
 
virtual ~ModuleController ()
 Destructor. More...
 
void startThreadTicking (const uint32_t lngFrameTime)
 Starts the thread synchronously of the subsystem and tells the SubSystemController about completion. More...
 
void startThreadWaiting (const std::set< Subsystem > &waitingFor)
 Starts the thread synchronously of the subsystem and tells the SubSystemController about completion. More...
 
uint32_t getFrameTime () const
 Gets the frametime of this Subsystem. More...
 
void setController (SubSystemController *ssc, EngineCoreController *ecc, MessagingController *mc)
 registers necessary controllers for this Subsystem More...
 
virtual void OnThreadStart ()=0
 Called just after the Controller got created. More...
 
virtual void Tick ()=0
 Called repeatedly according to the frametime. More...
 
virtual void ShutDown ()=0
 Called to Shutdown the Module. More...
 
Subsystem getSubsystem () const
 
- Public Member Functions inherited from i6e::core::MessageSubscriber
 MessageSubscriber ()
 Standard constructor. More...
 
virtual ~MessageSubscriber ()
 Destructor. More...
 
void receiveMessage (const Message::Ptr &msg)
 This method is called from the MessagingController. It stores incoming messages in a local buffer. More...
 
void notifyNewID (const int64_t id)
 This method notifies the MessagingController that Messages waiting for this id can now be delivered. More...
 
void buffer (const ReceivedMessagePtr &msg)
 Calls deliverMessageInternal if the message should be delivered now, buffers it if not. More...
 
void reset ()
 todo More...
 
void addMethod (uint16_t msgType, const boost::function< void(const Message::Ptr &)> &ptrMessageMethod)
 adds a method for given message type where messages shall be delivered More...
 
void removeMethod (uint16_t msgType)
 removes method for given message type More...
 

Protected Member Functions

void processMessages () override
 override of processMessages of MessageSubscriber for waiting subsystems More...
 
- Protected Member Functions inherited from i6e::core::MessageSubscriber
void swapMessageBuffer ()
 This method will swap the double message buffer. For synchronization reasons. More...
 
bool updateBuffer ()
 This method delivers all waiting Messages that can now be delivered. More...
 

Protected Attributes

Subsystem _subsystem
 the Subsystem More...
 
uint32_t _frameTime
 the frame time of the Subsystem More...
 
MessagingController_messagingController
 pointer to MessagingController More...
 
- Protected Attributes inherited from i6e::core::MessageSubscriber
boost::mutex _objMessageVectorMutex
 
MessageVector _objMessageVectorA
 
MessageVector _objMessageVectorB
 
MessageVector_objActiveMessageVector
 
MessageVector_objInActiveMessageVector
 
std::map< uint16_t, boost::function< void(const Message::Ptr &)> > _ptrMessageMethod
 

Friends

class SubSystemController
 

Detailed Description

Part of the Subsystem that keeps the whole module running.

Definition at line 59 of file ModuleController.h.

Constructor & Destructor Documentation

i6e::core::ModuleController::ModuleController ( Subsystem  sub)

Constructs a new ModuleController with the given subsystem type.

virtual i6e::core::ModuleController::~ModuleController ( )
virtual

Destructor.

Member Function Documentation

uint32_t i6e::core::ModuleController::getFrameTime ( ) const
inline

Gets the frametime of this Subsystem.

Returns
Frametime.

Definition at line 91 of file ModuleController.h.

Subsystem i6e::core::ModuleController::getSubsystem ( ) const
inline

Definition at line 119 of file ModuleController.h.

virtual void i6e::core::ModuleController::OnThreadStart ( )
pure virtual

Called just after the Controller got created.

Implemented in i6e::modules::InputController.

void i6e::core::ModuleController::processMessages ( )
overrideprotectedvirtual

override of processMessages of MessageSubscriber for waiting subsystems

Reimplemented from i6e::core::MessageSubscriber.

void i6e::core::ModuleController::setController ( SubSystemController ssc,
EngineCoreController ecc,
MessagingController mc 
)
inline

registers necessary controllers for this Subsystem

Definition at line 98 of file ModuleController.h.

virtual void i6e::core::ModuleController::ShutDown ( )
pure virtual

Called to Shutdown the Module.

Implemented in i6e::api::Application, and i6e::modules::InputController.

void i6e::core::ModuleController::startThreadTicking ( const uint32_t  lngFrameTime)

Starts the thread synchronously of the subsystem and tells the SubSystemController about completion.

Parameters
lngFrameTimeCurrent frametime.
void i6e::core::ModuleController::startThreadWaiting ( const std::set< Subsystem > &  waitingFor)

Starts the thread synchronously of the subsystem and tells the SubSystemController about completion.

Parameters
waitingForCurrent frametime.
virtual void i6e::core::ModuleController::Tick ( )
pure virtual

Called repeatedly according to the frametime.

Implemented in i6e::api::Application, and i6e::modules::InputController.

Friends And Related Function Documentation

friend class SubSystemController
friend

Definition at line 60 of file ModuleController.h.

Member Data Documentation

uint32_t i6e::core::ModuleController::_frameTime
protected

the frame time of the Subsystem

Definition at line 132 of file ModuleController.h.

MessagingController* i6e::core::ModuleController::_messagingController
protected

pointer to MessagingController

Definition at line 137 of file ModuleController.h.

Subsystem i6e::core::ModuleController::_subsystem
protected

the Subsystem

Definition at line 127 of file ModuleController.h.


The documentation for this class was generated from the following file: