|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Holds every component of one type, indexed by entity identifier. More...
#include <headers/guillaume/ecs/component_storage.hpp>


Public Types | |
| using | Storage = std::unordered_map<Entity::Identifier, ComponentType> |
| The container: one component per entity identifier. | |
Public Member Functions | |
| ComponentStorage (void)=default | |
| Create an empty storage. | |
| ~ComponentStorage (void) override=default | |
| Destroy the storage and every component it holds. | |
| template<typename... Args> | |
| ComponentType & | emplace (const Entity::Identifier &entityIdentifier, Args &&...args) |
| Construct a component for an entity, replacing the one it already has, if any. | |
| ComponentType * | find (const Entity::Identifier &entityIdentifier) |
| Look up the component of an entity. | |
| const ComponentType * | find (const Entity::Identifier &entityIdentifier) const |
| Look up the component of an entity, read-only. | |
| void | remove (const Entity::Identifier &entityIdentifier) override |
| Delete the component stored for an entity. Does nothing when the entity has none. | |
| bool | has (const Entity::Identifier &entityIdentifier) const override |
| Tell whether a component is stored for an entity. | |
| bool | hasChanged (const Entity::Identifier &entityIdentifier) const override |
| Tell whether the component stored for an entity is marked as changed. | |
| void | resetChangedFlags (void) override |
| Mark every component of this storage as unchanged. | |
| Public Member Functions inherited from guillaume::ecs::IComponentStorage | |
| virtual | ~IComponentStorage (void)=default |
| Virtual destructor. | |
Holds every component of one type, indexed by entity identifier.
ComponentRegistry creates one storage per component type the first time that type is used. Application code goes through the registry and does not use this class directly.
| ComponentType | The component type stored. |
Definition at line 94 of file component_storage.hpp.
| using guillaume::ecs::ComponentStorage< ComponentType >::Storage = std::unordered_map<Entity::Identifier, ComponentType> |
The container: one component per entity identifier.
Definition at line 101 of file component_storage.hpp.
| ComponentType & guillaume::ecs::ComponentStorage< ComponentType >::emplace | ( | const Entity::Identifier & | entityIdentifier, |
| Args &&... | args ) |
Construct a component for an entity, replacing the one it already has, if any.
| Args | The types of the constructor arguments. |
| entityIdentifier | The identifier of the entity. |
| args | Arguments forwarded to the constructor of ComponentType; none builds a default component. |
| ComponentType * guillaume::ecs::ComponentStorage< ComponentType >::find | ( | const Entity::Identifier & | entityIdentifier | ) |
Look up the component of an entity.
| entityIdentifier | The identifier of the entity. |
| const ComponentType * guillaume::ecs::ComponentStorage< ComponentType >::find | ( | const Entity::Identifier & | entityIdentifier | ) | const |
Look up the component of an entity, read-only.
| entityIdentifier | The identifier of the entity. |
|
overridevirtual |
Tell whether a component is stored for an entity.
| entityIdentifier | The identifier of the entity. |
Implements guillaume::ecs::IComponentStorage.
|
overridevirtual |
Tell whether the component stored for an entity is marked as changed.
| entityIdentifier | The identifier of the entity. |
Implements guillaume::ecs::IComponentStorage.
|
overridevirtual |
Delete the component stored for an entity. Does nothing when the entity has none.
| entityIdentifier | The identifier of the entity. |
Implements guillaume::ecs::IComponentStorage.
|
overridevirtual |
Mark every component of this storage as unchanged.
Implements guillaume::ecs::IComponentStorage.