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
SystemFactory.cpp
Go to the documentation of this file.
1
7
8
#include "
SystemFactory.hpp
"
9
10
namespace
galaxy
11
{
12
namespace
meta
13
{
14
void
SystemFactory::create_system
(
const
std::string& name,
SystemStack
& stack)
15
{
16
const
auto
hash =
math::fnv1a
(name.c_str());
17
if
(
m_factory
.contains(hash))
18
{
19
m_factory
[hash](stack);
20
}
21
else
22
{
23
GALAXY_LOG
(
GALAXY_ERROR
,
"System {0} doesnt exist in factory."
, name);
24
}
25
}
26
}
// namespace meta
27
}
// namespace galaxy
GALAXY_LOG
#define GALAXY_LOG(level, msg,...)
Definition
Log.hpp:29
GALAXY_ERROR
#define GALAXY_ERROR
Definition
Log.hpp:25
SystemFactory.hpp
galaxy::meta::SystemFactory::create_system
void create_system(const std::string &name, SystemStack &stack)
Create a system using the factory.
Definition
SystemFactory.cpp:14
galaxy::meta::SystemFactory::m_factory
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.
Definition
SystemFactory.hpp:66
galaxy::math::fnv1a
constexpr bits fnv1a(const char *const str, const bits value=fnv_1a_params< bits >::offset) noexcept
Convert string to hash.
Definition
FNV1a.hpp:64
galaxy::meta::SystemStack
std::vector< std::unique_ptr< systems::System > > SystemStack
Definition
SystemFactory.hpp:26
galaxy
Timer.hpp galaxy.
Definition
Async.hpp:17
galaxy
src
galaxy
meta
SystemFactory.cpp
Generated on Sat Mar 1 2025 14:49:36 for galaxy by
1.12.0