i6engine  1.0
Core
Collaboration diagram for Core:

Namespaces

 i6e
 
 i6e::core
 
 boost
 
 boost::serialization
 
 i6e::core::messages
 

Classes

struct  i6e::core::Scheduler< ClockUpdater >::Job
 this struct represents a single timer event More...
 
class  i6e::core::Scheduler< ClockUpdater >
 
class  i6e::core::Timer
 This class provides gametime-synchronized Timers. They are controlled by the Scheduler. More...
 
class  i6e::core::EngineCoreController
 this class is used as an abstraction layer More...
 
class  i6e::core::IPKey::Hash
 
class  i6e::core::IPKey
 
class  i6e::core::Message
 Class representing a message to be sent. More...
 
struct  i6e::core::MessageStruct
 
struct  i6e::core::ReceivedMessage
 a received message within a MessageSubscriber More...
 
class  i6e::core::MessageSubscriber
 Interface for every class that wants to subscribe to the messaging system. More...
 
class  i6e::core::MessagingController
 Central controller for messaging between subsystems and subsystems of different clients. More...
 
class  i6e::core::ModuleController
 Part of the Subsystem that keeps the whole module running. More...
 
struct  i6e::core::QueuedModule
 
class  i6e::core::SubSystemController
 This class is used as an abstraction layer. More...
 

Enumerations

enum  i6e::core::JobPriorities { i6e::core::Prio_Subsystem, i6e::core::Prio_High, i6e::core::Prio_Medium, i6e::core::Prio_Low }
 
enum  i6e::core::Subsystem {
  i6e::core::Subsystem::Unknown, i6e::core::Subsystem::Application, i6e::core::Subsystem::Audio, i6e::core::Subsystem::Graphic,
  i6e::core::Subsystem::GUI, i6e::core::Subsystem::Input, i6e::core::Subsystem::Network, i6e::core::Subsystem::Object,
  i6e::core::Subsystem::Physic, i6e::core::Subsystem::Scripting
}
 
enum  i6e::core::Method : uint8_t { i6e::core::Method::Create, i6e::core::Method::Update, i6e::core::Method::Delete }
 
enum  i6e::core::IDStatus : uint16_t { i6e::core::IDStatus::NONE, i6e::core::IDStatus::CREATED, i6e::core::IDStatus::DELETED }
 Status of an ID. More...
 
enum  i6e::core::messages::MessageTypes { i6e::core::messages::SubsystemMessageType, i6e::core::messages::MessageTypesCount }
 
enum  i6e::core::messages::SubsystemMessage { i6e::core::messages::SubsystemReset, i6e::core::messages::SubsystemFinish }
 
enum  i6e::core::SubsystemType { i6e::core::SubsystemType::Ticking, i6e::core::SubsystemType::Waiting }
 

Detailed Description

The core is the part of the engine that controlles the whole enginge.

EngineCoreController

This EngineCoreController is the Object the Game communicates with most of the time. After creation, it initialises the SubSystemController and than starts with its main loop. Within this MainLoop, it just updates the Clock every 5 milliseconds. After the MainLoop has finished, the EngineCoreController sends all SubSystems the shutdown command and waits for their termination. Than the whole Engine ends. To be precise, the game developer creates an EngineHandle object that should be used for communicating, but currently it only offers the function modules::EngineModulesController& getEngineController(). This EngineModuleController is an abstraction layer for the EngineCoreController.
The whole initialising processlooks like this: Game -> EngineHandle -> EngineModuleController -> EngineCoreController -> SubSystemController -> SubSystems

Messaging System

Creating a Message

a thread creates a Message and specifies a type for this Message
the thread can add several variables to that Message
than the thread sends the message to the MessageProcessor

Whenever the Tick() method of the MessageProcessor is executed, it takes all arrived Messages, determinds all MessageSubscribers that registered for this kind of Message and delivers the Message.

The MessageSubscriber again buffers all Messages until the method processMessages() is called by the underlying thread.
Than it loops over all stored Messages and calls the methods, that are specified for that type of Message.

Message

All components in the GameEngine communicate via Messages. A message must derive from the class Message defined in Message.h Each Message has a Typ and a list of Pairs (Key, Value), where Key must be unique and Value can be a any primitive type or a std::string

MessageSubscriber

The MessageSubscriber manages all incoming Messages for a certain SubSystem. It is registered at the MessageProcessor for a certain type of Message. Whenever processMessages() is called, for every arrived Message, the method specified for this type of Message is called.

MessageProcessor

The MessageProcessor buffers all incoming Messages and whenever Tick() is called, it delivers the Messages to all registered MessageSubscribers.

To register for such a Messagetyp, use the macro

ISIXE_REGISTERMESSAGETYPE("type", method[, parameter])
// to unsubsribe for a specific Type, use the macro
Core_Messaging.png

SubSystems

SubsystemController

The SubSystemController manages all SubSystems and notifies them of any possible operations like Initialize, Start or Shutdown. To create a SubSystem just derive it from this class. As the SubSystemController is a subclass of the MessagingController, all SubSystems automatically are able to send Messages. The functions OnThreadStart(), Tick() and Shutdown() have to be implemented by all SubSystems. The RunLoop() is executed until the SubSystemController notified a shutdown. Otherwise, within the loop, all incoming Messages need to be processed and afterwards the System can do its own work. Finally the Thread sleeps until it gets another Timer-Interupt.

Subsystem

For the future, all SubSystems should have this structure:

Core Overview

Core_Overview.png
The core is the part of the engine that controlles the whole enginge.
It consists of a EngineCoreController as the super controller, a SubsystemController for all the various SubSystems, the Messaging System the SubSystems use for communication and a page_clock for ensuring a specific frame rate and synchronizing the SubSystems

Enumeration Type Documentation

enum i6e::core::IDStatus : uint16_t
strong

Status of an ID.

Enumerator
NONE 
CREATED 

unknown (most likely not created yet)

DELETED 

created

deleted (but it already existed)

Definition at line 44 of file MessageSubscriber.h.

Enumerator
Prio_Subsystem 

Highest priority, used only internally for ticking of subsystems, don't use this one.

Prio_High 

High job priority, use this if this task should be preferred for running before other tasks.

Prio_Medium 

Task can wait, but shouldn't wait to long.

Prio_Low 

Task can wait really long, isn't that important.

Definition at line 31 of file JobPriorities.h.

Enumerator
SubsystemMessageType 
MessageTypesCount 

Definition at line 32 of file MessageTypes.h.

enum i6e::core::Method : uint8_t
strong
Enumerator
Create 
Update 
Delete 

Definition at line 41 of file Message.h.

enum i6e::core::Subsystem
strong
Enumerator
Unknown 
Application 
Audio 
Graphic 
GUI 
Input 
Network 
Object 
Physic 
Scripting 

Definition at line 31 of file SubsystemConfig.h.

Enumerator
SubsystemReset 
SubsystemFinish 

Definition at line 37 of file MessageTypes.h.

Enumerator
Ticking 
Waiting 

Definition at line 51 of file ModuleController.h.