|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Decides in which order the entities of a scene are visited. More...
#include <headers/guillaume/ecs/entity_tree_traveler.hpp>

Public Member Functions | |
| virtual | ~EntityTreeTraveler (void)=default |
| Virtual destructor. | |
| virtual std::vector< std::shared_ptr< Entity > > | travel (EntityRegistry &entityRegistry) const =0 |
| List every entity below a registry, in this traveler's order. | |
| virtual std::vector< std::shared_ptr< const Entity > > | travel (const EntityRegistry &entityRegistry) const =0 |
| List every entity below a registry, in this traveler's order, read-only. | |
Decides in which order the entities of a scene are visited.
A traveler turns the ownership tree of an EntityRegistry (the scene, the entities it owns, the entities those own, ...) into a flat list. System::routine walks that list and calls System::update on each entity that matches the system. The order matters because a system often needs the result it computed for a parent or for the children:
"Parent" and "child" here follow ownership (who called EntityRegistry::addEntity), not Entity::setParent. An entity created through a widget Builder is owned by the scene even when it has a parent: it is ordered among the entities of the scene, by creation order.
Each phase is tied to its traveler in system_phase.hpp. A traveler has no state and can be shared.
Definition at line 61 of file entity_tree_traveler.hpp.
|
pure virtual |
List every entity below a registry, in this traveler's order, read-only.
| entityRegistry | The registry to start from, usually the scene. Entities owned by nested registries are included. |
Implemented in guillaume::ecs::LevelOrderTraveler, and guillaume::ecs::ReverseLevelOrderTraveler.
|
pure virtual |
List every entity below a registry, in this traveler's order.
| entityRegistry | The registry to start from, usually the scene. Entities owned by nested registries are included. |
Implemented in guillaume::ecs::LevelOrderTraveler, and guillaume::ecs::ReverseLevelOrderTraveler.
