cubos::core::ecs::SystemRegistry class

Stores known systems and conditions.

Constructors, destructors, conversion operators

SystemRegistry() defaulted
Constructs.
SystemRegistry(const SystemRegistry&) deleted
Forbid copying.

Public functions

auto operator=(const SystemRegistry&) -> SystemRegistry& deleted
Forbid copy assignment.
void reset()
Removes all systems and conditions.
auto add(std::string name, System<void> system) -> SystemId
Registers the given system.
auto add(std::string name, System<bool> condition) -> ConditionId
Registers the given condition.
void remove(SystemId id)
Unregisters the given system.
void remove(ConditionId id)
Unregisters the given condition.
auto name(SystemId id) const -> const std::string&
Gets the debug name of the given system.
auto name(ConditionId id) const -> const std::string&
Gets the debug name of the given condition.
auto system(SystemId id) -> System<void>&
Gets the system with the given identifier.
auto condition(ConditionId id) -> System<bool>&
Gets the condition with the given identifier.

Function documentation

void cubos::core::ecs::SystemRegistry::reset()

Removes all systems and conditions.

Previously returned identifiers become invalid. This operation is equivalent to constructing a new registry.

SystemId cubos::core::ecs::SystemRegistry::add(std::string name, System<void> system)

Registers the given system.

Parameters
name Debug name.
system System.
Returns System identifier.

ConditionId cubos::core::ecs::SystemRegistry::add(std::string name, System<bool> condition)

Registers the given condition.

Parameters
name Debug name.
condition
Returns Condition identifier.

void cubos::core::ecs::SystemRegistry::remove(SystemId id)

Unregisters the given system.

Parameters
id System identifier.

void cubos::core::ecs::SystemRegistry::remove(ConditionId id)

Unregisters the given condition.

Parameters
id Condition identifier.

const std::string& cubos::core::ecs::SystemRegistry::name(SystemId id) const

Gets the debug name of the given system.

Parameters
id System identifier.
Returns System name.

const std::string& cubos::core::ecs::SystemRegistry::name(ConditionId id) const

Gets the debug name of the given condition.

Parameters
id Condition identifier.
Returns Condition name.

System<void>& cubos::core::ecs::SystemRegistry::system(SystemId id)

Gets the system with the given identifier.

Parameters
id System identifier.

System<bool>& cubos::core::ecs::SystemRegistry::condition(ConditionId id)

Gets the condition with the given identifier.

Parameters
id Condition identifier.