galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages Concepts
galaxy::meta::SystemFactory Class Referencefinal

Meta factory for creating system objects. More...

#include <SystemFactory.hpp>

+ Collaboration diagram for galaxy::meta::SystemFactory:

Public Member Functions

 SystemFactory () noexcept=default
 Constructor.
 
 ~SystemFactory () noexcept=default
 Destructor.
 
template<valid_component System>
void register_system (const std::string &name)
 Registers a system definition.
 
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 system objects.

Definition at line 31 of file SystemFactory.hpp.

Constructor & Destructor Documentation

◆ SystemFactory()

galaxy::meta::SystemFactory::SystemFactory ( )
defaultnoexcept

Constructor.

◆ ~SystemFactory()

galaxy::meta::SystemFactory::~SystemFactory ( )
defaultnoexcept

Destructor.

Member Function Documentation

◆ register_system()

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

Registers a system definition.

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

Definition at line 70 of file SystemFactory.hpp.

+ Here is the call graph for this function:

◆ create_system()

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

Create a system using the factory.

Parameters
nameName of system class in string format.
storageStorage map to create the system in.

Definition at line 14 of file SystemFactory.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_factory

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

Lets us construct a system class from a string representation.

Definition at line 66 of file SystemFactory.hpp.


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