8#ifndef GALAXY_META_SYSTEMFACTORY_HPP_
9#define GALAXY_META_SYSTEMFACTORY_HPP_
11#include <ankerl/unordered_dense.h>
48 template<meta::valid_component _System>
66 template<meta::valid_component _System>
73 for (
auto&& sys : stack)
75 if (sys->id() == name)
82 auto ptr = std::make_shared<_System>(name);
83 stack.push_back(std::static_pointer_cast<System>(ptr));
#define GALAXY_LOG(level, msg,...)
Meta factory for creating systems.
SystemFactory() noexcept=default
Constructor.
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.
void create_system(const std::string &name, SystemStack &stack)
Create a system using the factory.
void register_system(const std::string &name)
Registers a system into the engine.
constexpr bits fnv1a(const char *const str, const bits value=fnv_1a_params< bits >::offset) noexcept
Convert string to hash.
std::vector< std::shared_ptr< System > > SystemStack
System stack typedef.