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::SystemFactory Class Referencefinal

Meta factory for creating systems. More...

#include <SystemFactory.hpp>

Collaboration diagram for galaxy::SystemFactory:

Public Member Functions

 SystemFactory () noexcept=default
 Constructor.
 ~SystemFactory () noexcept=default
 Destructor.
template<meta::valid_component _System>
void register_system (const std::string &name)
 Registers a system into the engine.
void create_system (const std::string &name, SystemStack &stack)
 Create a system using the factory.

Private Attributes

ankerl::unordered_dense::map< std::uint64_t, std::move_only_function< void(SystemStack &)> > m_factory
 Lets us construct a system class from a string representation.

Detailed Description

Meta factory for creating systems.

Definition at line 28 of file SystemFactory.hpp.

Constructor & Destructor Documentation

◆ SystemFactory()

galaxy::SystemFactory::SystemFactory ( )
defaultnoexcept

Constructor.

Here is the caller graph for this function:

◆ ~SystemFactory()

galaxy::SystemFactory::~SystemFactory ( )
defaultnoexcept

Destructor.

Here is the call graph for this function:

Member Function Documentation

◆ register_system()

template<meta::valid_component _System>
void galaxy::SystemFactory::register_system ( const std::string & name)
inline

Registers a system into the engine.

Template Parameters
_SystemMust be a class that is move constructable and assignable.
Parameters
nameName of system class in string format.

Definition at line 67 of file SystemFactory.hpp.

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

◆ create_system()

void galaxy::SystemFactory::create_system ( const std::string & name,
SystemStack & stack )

Create a system using the factory.

Parameters
nameName of system class in string format.
stackSystem stack where the systems are created in.

Definition at line 12 of file SystemFactory.cpp.

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

Member Data Documentation

◆ m_factory

ankerl::unordered_dense::map<std::uint64_t, std::move_only_function<void(SystemStack&)> > galaxy::SystemFactory::m_factory
private

Lets us construct a system class from a string representation.

Definition at line 63 of file SystemFactory.hpp.


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