guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
guillaume::ecs::ComponentRegistryFiller< ComponentTypes > Class Template Reference

A ComponentRegistry whose storages for a fixed list of component types exist from construction. More...

#include <headers/guillaume/ecs/component_registry_filler.hpp>

Inheritance diagram for guillaume::ecs::ComponentRegistryFiller< ComponentTypes >:
Collaboration diagram for guillaume::ecs::ComponentRegistryFiller< ComponentTypes >:

Public Member Functions

 ComponentRegistryFiller (void)
 Create the registry with one empty storage per listed component type.
virtual ~ComponentRegistryFiller (void)=default
 Destroy the registry and every component it stores.
Public Member Functions inherited from guillaume::ecs::ComponentRegistry
 ComponentRegistry (void)=default
 Create a registry that holds no component.
 ~ComponentRegistry (void)=default
 Destroy the registry and every component it stores.
template<InheritFromComponent... NeededComponentTypes>
void registerComponentsForEntity (const Entity::Identifier &entityIdentifier)
 Give an entity one default-constructed component of each listed type.
template<InheritFromComponent ComponentType, typename... Args>
ComponentType & addComponent (const Entity::Identifier &entityIdentifier, Args &&...args)
 Construct a component for an entity, replacing the one it already has, if any.
template<InheritFromComponent ComponentType>
bool hasComponent (const Entity::Identifier &entityIdentifier) const
 Tell whether an entity has a component of a given type.
template<InheritFromComponent ComponentType>
void removeComponent (const Entity::Identifier &entityIdentifier)
 Delete one component of an entity. Does nothing when the entity does not have it.
void removeEntity (const Entity::Identifier &entityIdentifier)
 Delete every component of an entity, of every type.
bool hasChanged (const Entity::Identifier &entityIdentifier) const
 Tell whether at least one component of an entity was modified since the flags were last reset.
void resetChangedFlags (void)
 Mark every component of every entity as unchanged.
template<InheritFromComponent ComponentType>
ComponentType & getComponent (const Entity::Identifier &entityIdentifier)
 Get a component of an entity, to read or modify it.
template<InheritFromComponent ComponentType>
const ComponentType & getComponent (const Entity::Identifier &entityIdentifier) const
 Get a component of an entity, read-only.

Additional Inherited Members

Protected Member Functions inherited from guillaume::ecs::ComponentRegistry
template<InheritFromComponent ComponentType>
void registerNewComponentType (void)
 Create the (empty) storage of a component type ahead of its first use.

Detailed Description

template<InheritFromComponent... ComponentTypes>
class guillaume::ecs::ComponentRegistryFiller< ComponentTypes >

A ComponentRegistry whose storages for a fixed list of component types exist from construction.

It behaves exactly like ComponentRegistry afterwards. Preparing the storages is optional, since a ComponentRegistry creates the storage of a type on its first use; no component is created for any entity.

registry;
A ComponentRegistry whose storages for a fixed list of component types exist from construction.
Template Parameters
ComponentTypesThe component types to prepare storage for.
See also
ComponentRegistry

Definition at line 47 of file component_registry_filler.hpp.


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