galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
galaxy::SystemManager Class Referencefinal

Manages the systems assigned to it. More...

#include <SystemManager.hpp>

Inheritance diagram for galaxy::SystemManager:
Collaboration diagram for galaxy::SystemManager:

Public Member Functions

 SystemManager () noexcept
 Constructor.
 SystemManager (SystemManager &&) noexcept
 Move constructor.
SystemManager & operator= (SystemManager &&) noexcept
 Move assignment operator.
 ~SystemManager () noexcept
 Destructor.
void add_system (const std::string &system)
 Add a system to operate on entities in this scene.
void update (EntityManager &em, Scene *scene)
 Process all systems.
void suspend () noexcept
 Suspend all running systems.
void resume () noexcept
 Resume all systems.
void clear ()
 Remove all systems.
SystemStack & stack () noexcept
 Get list of systems.
bool is_suspended () const noexcept
 Check if systems are suspended.
nlohmann::json serialize () override
 Serializes object.
void deserialize (const nlohmann::json &json) override
 Deserializes from object.
Public Member Functions inherited from galaxy::Serializable
virtual ~Serializable ()
 Destructor.
virtual Serializable & operator= (Serializable &&) noexcept=default
 Move assignment operator.
virtual Serializable & operator= (const Serializable &) noexcept=default
 Copy assignment operator.

Private Member Functions

SystemManager & operator= (const SystemManager &)=delete
 Copy assignment operator.
 SystemManager (const SystemManager &)=delete
 Copy constructor.

Private Attributes

SystemStack m_systems
 List of systems to process.
bool m_suspended
 Are systems allowed to run.

Additional Inherited Members

Protected Member Functions inherited from galaxy::Serializable
 Serializable () noexcept=default
 Constructor.
 Serializable (Serializable &&) noexcept=default
 Move constructor.
 Serializable (const Serializable &) noexcept=default
 Copy constructor.

Detailed Description

Manages the systems assigned to it.

A system belongs to a scene and operates on it and the shared entities.

Definition at line 23 of file SystemManager.hpp.

Constructor & Destructor Documentation

◆ SystemManager() [1/3]

galaxy::SystemManager::SystemManager ( )
noexcept

Constructor.

Definition at line 14 of file SystemManager.cpp.

Here is the caller graph for this function:

◆ SystemManager() [2/3]

galaxy::SystemManager::SystemManager ( SystemManager && sm)
noexcept

Move constructor.

Definition at line 19 of file SystemManager.cpp.

Here is the call graph for this function:

◆ ~SystemManager()

galaxy::SystemManager::~SystemManager ( )
noexcept

Destructor.

Definition at line 36 of file SystemManager.cpp.

◆ SystemManager() [3/3]

galaxy::SystemManager::SystemManager ( const SystemManager & )
privatedelete

Copy constructor.

Here is the call graph for this function:

Member Function Documentation

◆ operator=() [1/2]

SystemManager & galaxy::SystemManager::operator= ( SystemManager && sm)
noexcept

Move assignment operator.

Definition at line 25 of file SystemManager.cpp.

Here is the call graph for this function:

◆ add_system()

void galaxy::SystemManager::add_system ( const std::string & system)

Add a system to operate on entities in this scene.

Scene is called in order of adding. So i.e. if you add anim then render, systems are called in that order.

Parameters
systemName of system to add to this scene.

Definition at line 40 of file SystemManager.cpp.

Here is the caller graph for this function:

◆ update()

void galaxy::SystemManager::update ( EntityManager & em,
Scene * scene )

Process all systems.

Parameters
emEntities to process.
sceneScene this system belongs to.

Definition at line 46 of file SystemManager.cpp.

Here is the caller graph for this function:

◆ suspend()

void galaxy::SystemManager::suspend ( )
noexcept

Suspend all running systems.

Definition at line 57 of file SystemManager.cpp.

Here is the caller graph for this function:

◆ resume()

void galaxy::SystemManager::resume ( )
noexcept

Resume all systems.

Definition at line 62 of file SystemManager.cpp.

Here is the caller graph for this function:

◆ clear()

void galaxy::SystemManager::clear ( )

Remove all systems.

Definition at line 67 of file SystemManager.cpp.

Here is the caller graph for this function:

◆ stack()

SystemStack & galaxy::SystemManager::stack ( )
nodiscardnoexcept

Get list of systems.

Returns
System stack.

Definition at line 72 of file SystemManager.cpp.

Here is the caller graph for this function:

◆ is_suspended()

bool galaxy::SystemManager::is_suspended ( ) const
nodiscardnoexcept

Check if systems are suspended.

Returns
True if suspended.

Definition at line 77 of file SystemManager.cpp.

Here is the caller graph for this function:

◆ serialize()

nlohmann::json galaxy::SystemManager::serialize ( )
nodiscardoverridevirtual

Serializes object.

Returns
JSON object containing data to be serialized.

Implements galaxy::Serializable.

Definition at line 82 of file SystemManager.cpp.

Here is the caller graph for this function:

◆ deserialize()

void galaxy::SystemManager::deserialize ( const nlohmann::json & json)
overridevirtual

Deserializes from object.

Parameters
jsonJson object to retrieve data from.

Implements galaxy::Serializable.

Definition at line 99 of file SystemManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [2/2]

SystemManager & galaxy::SystemManager::operator= ( const SystemManager & )
privatedelete

Copy assignment operator.

Here is the call graph for this function:

Member Data Documentation

◆ m_systems

SystemStack galaxy::SystemManager::m_systems
private

List of systems to process.

Definition at line 123 of file SystemManager.hpp.

◆ m_suspended

bool galaxy::SystemManager::m_suspended
private

Are systems allowed to run.

Definition at line 128 of file SystemManager.hpp.


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