guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
guillaume::ecs::IComponentStorage Class Referenceabstract

What ComponentRegistry can do with a component storage without knowing which component type it holds. More...

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

Inheritance diagram for guillaume::ecs::IComponentStorage:

Public Member Functions

virtual ~IComponentStorage (void)=default
 Virtual destructor.
virtual void remove (const Entity::Identifier &entityIdentifier)=0
 Delete the component stored for an entity. Does nothing when the entity has none.
virtual bool has (const Entity::Identifier &entityIdentifier) const =0
 Tell whether a component is stored for an entity.
virtual bool hasChanged (const Entity::Identifier &entityIdentifier) const =0
 Tell whether the component stored for an entity is marked as changed.
virtual void resetChangedFlags (void)=0
 Mark every component of this storage as unchanged.

Detailed Description

What ComponentRegistry can do with a component storage without knowing which component type it holds.

The registry keeps one ComponentStorage per component type behind this interface, which lets it remove an entity or reset the changed flags across all types in one loop.

See also
ComponentStorage

Definition at line 43 of file component_storage.hpp.

Member Function Documentation

◆ has()

virtual bool guillaume::ecs::IComponentStorage::has ( const Entity::Identifier & entityIdentifier) const
pure virtual

Tell whether a component is stored for an entity.

Parameters
entityIdentifierThe identifier of the entity.
Returns
True when the entity has a component in this storage.

Implemented in guillaume::ecs::ComponentStorage< ComponentType >.

◆ hasChanged()

virtual bool guillaume::ecs::IComponentStorage::hasChanged ( const Entity::Identifier & entityIdentifier) const
pure virtual

Tell whether the component stored for an entity is marked as changed.

Parameters
entityIdentifierThe identifier of the entity.
Returns
True when the component exists and is marked as changed; false when it is unchanged or the entity has none.

Implemented in guillaume::ecs::ComponentStorage< ComponentType >.

◆ remove()

virtual void guillaume::ecs::IComponentStorage::remove ( const Entity::Identifier & entityIdentifier)
pure virtual

Delete the component stored for an entity. Does nothing when the entity has none.

Parameters
entityIdentifierThe identifier of the entity.

Implemented in guillaume::ecs::ComponentStorage< ComponentType >.

◆ resetChangedFlags()

virtual void guillaume::ecs::IComponentStorage::resetChangedFlags ( void )
pure virtual

Mark every component of this storage as unchanged.

Implemented in guillaume::ecs::ComponentStorage< ComponentType >.


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