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

Visits owners before what they own: the entities owned by the scene first, then the entities those own, and so on. More...

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

Inheritance diagram for guillaume::ecs::LevelOrderTraveler:
Collaboration diagram for guillaume::ecs::LevelOrderTraveler:

Public Member Functions

std::vector< std::shared_ptr< Entity > > travel (EntityRegistry &entityRegistry) const override
 List every entity below a registry, parents before children.
std::vector< std::shared_ptr< const Entity > > travel (const EntityRegistry &entityRegistry) const override
 List every entity below a registry, parents before children, read-only.
Public Member Functions inherited from guillaume::ecs::EntityTreeTraveler
virtual ~EntityTreeTraveler (void)=default
 Virtual destructor.

Detailed Description

Visits owners before what they own: the entities owned by the scene first, then the entities those own, and so on.

For a scene owning A and B, where A owns A1 and A2 and B owns B1, the order is A, B, A1, A2, B1. Used by the Layout and Render phases, where a parent must be placed before its children.

See also
ReverseLevelOrderTraveler
LayoutPhase
RenderPhase

Definition at line 42 of file level_order_traveler.hpp.

Member Function Documentation

◆ travel() [1/2]

std::vector< std::shared_ptr< const Entity > > guillaume::ecs::LevelOrderTraveler::travel ( const EntityRegistry & entityRegistry) const
overridevirtual

List every entity below a registry, parents before children, read-only.

Parameters
entityRegistryThe registry to start from, usually the scene.
Returns
The entities level by level, each level in insertion order; empty when the registry owns nothing.

Implements guillaume::ecs::EntityTreeTraveler.

Definition at line 37 of file level_order_traveler.cpp.

Here is the call graph for this function:

◆ travel() [2/2]

std::vector< std::shared_ptr< Entity > > guillaume::ecs::LevelOrderTraveler::travel ( EntityRegistry & entityRegistry) const
overridevirtual

List every entity below a registry, parents before children.

Parameters
entityRegistryThe registry to start from, usually the scene.
Returns
The entities level by level, each level in insertion order; empty when the registry owns nothing.

Implements guillaume::ecs::EntityTreeTraveler.

Definition at line 31 of file level_order_traveler.cpp.

Here is the call graph for this function:

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