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

Base class of the widget builders: remembers in which registries the entities it creates go. More...

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

Inheritance diagram for guillaume::ecs::EntityBuilder:

Public Member Functions

 EntityBuilder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
 Create a builder working on a pair of registries, normally those of one scene.
virtual ~EntityBuilder (void)=default
 Virtual destructor.
virtual void reset (void)=0
 Forget the configuration accumulated for the entity being built, so the builder is ready for the next one.

Protected Member Functions

ComponentRegistry & getComponentRegistry (void)
 Get the registry in which the builder creates components.
EntityRegistry & getEntityRegistry (void)
 Get the registry in which the builder registers the entities it creates.

Detailed Description

Base class of the widget builders: remembers in which registries the entities it creates go.

A builder is the comfortable way to create a widget in a scene: it is configured with fluent calls or a makeXxx() preset, creates the entity with its components in the component registry, and registers it in the entity registry. Each widget has its own builder (entities::Button::Builder, ...), derived from entities::EntityBuilderBase, which adds the creation step. A Scene holds one builder per widget type in its EntityBuilderManager.

This base class only stores the two registries and declares reset(). Both registries must outlive the builder.

See also
EntityBuilderManager
guillaume::entities::EntityBuilderBase

Definition at line 52 of file entity_builder.hpp.

Constructor & Destructor Documentation

◆ EntityBuilder()

guillaume::ecs::EntityBuilder::EntityBuilder ( ecs::ComponentRegistry & componentRegistry,
ecs::EntityRegistry & entityRegistry )

Create a builder working on a pair of registries, normally those of one scene.

Parameters
componentRegistryThe registry that receives the components of the built entities. It must outlive the builder.
entityRegistryThe registry that owns the built entities. It must outlive the builder.

Definition at line 27 of file entity_builder.cpp.

Member Function Documentation

◆ getComponentRegistry()

ComponentRegistry & guillaume::ecs::EntityBuilder::getComponentRegistry ( void )
protected

Get the registry in which the builder creates components.

Returns
Reference to the component registry given to the constructor.

Definition at line 34 of file entity_builder.cpp.

Here is the caller graph for this function:

◆ getEntityRegistry()

EntityRegistry & guillaume::ecs::EntityBuilder::getEntityRegistry ( void )
protected

Get the registry in which the builder registers the entities it creates.

Returns
Reference to the entity registry given to the constructor.

Definition at line 39 of file entity_builder.cpp.

◆ reset()

virtual void guillaume::ecs::EntityBuilder::reset ( void )
pure virtual

Forget the configuration accumulated for the entity being built, so the builder is ready for the next one.

Implemented by each widget builder, which restores its options to their defaults. entities::EntityBuilderBase::registerEntity calls it after every build.

Implemented in guillaume::entities::AppBar::Builder, guillaume::entities::Badge::Builder, guillaume::entities::Button::Builder, guillaume::entities::Card::Builder, guillaume::entities::Checkbox::Builder, guillaume::entities::Chip::Builder, guillaume::entities::Dialog::Builder, guillaume::entities::Divider::Builder, guillaume::entities::ExtendedFloatingActionButton::Builder, guillaume::entities::FloatingActionButton::Builder, guillaume::entities::FloatingActionButtonMenu::Builder, guillaume::entities::Icon::Builder, guillaume::entities::IconButton::Builder, guillaume::entities::Image::Builder, guillaume::entities::List::Builder, guillaume::entities::LoadingIndicator::Builder, guillaume::entities::Menu::Builder, guillaume::entities::Mesh::Builder, guillaume::entities::NavigationBar::Builder, guillaume::entities::NavigationDrawer::Builder, guillaume::entities::ProgressIndicator::Builder, guillaume::entities::RadioButton::Builder, guillaume::entities::RadioGroup::Builder, guillaume::entities::Search::Builder, guillaume::entities::SegmentedButton::Builder, guillaume::entities::Snackbar::Builder, guillaume::entities::Surface::Builder, guillaume::entities::Switch::Builder, guillaume::entities::Text::Builder, guillaume::entities::TextField::Builder, guillaume::entities::Tooltip::Builder, and guillaume::entities::View::Builder.


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