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

An EntityRegistry that is not itself an entity: the top of an ownership tree. More...

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

Inheritance diagram for guillaume::ecs::EntityRegistryContainer:
Collaboration diagram for guillaume::ecs::EntityRegistryContainer:

Protected Member Functions

std::vector< std::shared_ptr< Entity > > & accessDirectEntities (void) override
 Give access to the list of entities this registry owns directly.
const std::vector< std::shared_ptr< Entity > > & accessDirectEntities (void) const override
 Give read access to the list of entities this registry owns directly.

Additional Inherited Members

Public Member Functions inherited from guillaume::ecs::EntityRegistry
 EntityRegistry (void)=default
 Create a registry.
virtual ~EntityRegistry (void)=default
 Virtual destructor.
void addEntity (std::shared_ptr< Entity > entity)
 Make this registry own an entity, so that it stays alive and systems visit it.
bool removeEntity (Entity::Identifier identifier)
 Remove an entity, with its children and all their components.
void clearEntities (void)
 Remove every entity owned by this registry, with everything they own and all their components.
const std::vector< std::shared_ptr< Entity > > & getEntities (void) const
 Get the entities this registry owns directly.
std::vector< std::shared_ptr< Entity > > getEntitiesBreadthFirst (void)
 List every entity of this registry and of the registries nested in it, level by level.
std::vector< std::shared_ptr< Entity > > getEntitiesBreadthFirst (void) const
 List every entity of this registry and of the registries nested in it, level by level (const overload).
template<InheritFromEntity EntityType>
std::shared_ptr< EntityType > getEntity (Entity::Identifier identifier)
 Find an entity owned directly by this registry, by identifier.
template<InheritFromEntity EntityType>
std::shared_ptr< const EntityType > getEntity (Entity::Identifier identifier) const
 Find an entity owned directly by this registry, by identifier (const overload).
std::vector< Entity::Identifier > getEntityWithSignature (Entity::Signature systemSignature) const
 List the entities that have every component type of a signature, from the root down.
std::vector< Entity::Identifier > getEntityWithSignature (Entity::Signature systemSignature, const EntityTreeTraveler &traveler) const
 List the entities that have every component type of a signature, in the order chosen by a traveler.

Detailed Description

An EntityRegistry that is not itself an entity: the top of an ownership tree.

Scene derives from it to own its root entities. Use it directly to hold entities outside a scene, in a test for instance. An entity that owns children derives from ParentEntity instead.

entities.addEntity(button);
An EntityRegistry that is not itself an entity: the top of an ownership tree.
Widgets: the classes used to create entities with the right components and children.
Definition app_bar.hpp:46
See also
EntityRegistry
ParentEntity

Definition at line 50 of file entity_registry_container.hpp.

Member Function Documentation

◆ accessDirectEntities() [1/2]

const std::vector< std::shared_ptr< Entity > > & guillaume::ecs::EntityRegistryContainer::accessDirectEntities ( void ) const
overrideprotectedvirtual

Give read access to the list of entities this registry owns directly.

Returns
Const reference to the list, in insertion order.

Implements guillaume::ecs::EntityRegistry.

Definition at line 34 of file entity_registry_container.cpp.

◆ accessDirectEntities() [2/2]

std::vector< std::shared_ptr< Entity > > & guillaume::ecs::EntityRegistryContainer::accessDirectEntities ( void )
overrideprotectedvirtual

Give access to the list of entities this registry owns directly.

Returns
Mutable reference to the list, in insertion order.

Implements guillaume::ecs::EntityRegistry.

Definition at line 28 of file entity_registry_container.cpp.


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