Guillaume 1.0.0
Guillaume.
Loading...
Searching...
No Matches
Container Class Reference

Specialized component to group other components. More...

#include <container.hpp>

Inheritance diagram for Container:
Collaboration diagram for Container:

Public Member Functions

 Container (void)
 Constructs a Container object.
 
 Container (const Properties &properties)
 Constructs a Container object with properties.
 
 ~Container (void) override=default
 Destroys the Container object.
 
std::shared_ptr< Componentrender (void) override
 Renders the container and its children recursively.
 
void onEvent (const Event &event) override
 Handles events for the container.
 
- Public Member Functions inherited from Component
 Component (void)
 Constructs a Component object.
 
 Component (const Properties &properties)
 Constructs a Component object with properties.
 
virtual ~Component (void)=default
 Destroy the Component object.
 
ComponentID getID (void) const
 Get the ID object.
 
virtual void addChild (const std::shared_ptr< Component > &child)
 Add a child component.
 
virtual void addPrimitive (const std::shared_ptr< Primitive > &primitive)
 Add a primitive for rendering.
 
StategetState (void)
 Gets the component's state.
 
const PropertiesgetProperties (void) const
 Gets the component's properties.
 
const std::vector< std::shared_ptr< Component > > & getChildren (void) const
 Gets the component's children.
 
std::shared_ptr< ComponentgetParent (void) const
 Gets the component's parent.
 
const std::vector< std::shared_ptr< Primitive > > & getPrimitives (void) const
 Gets the component's primitives.
 

Additional Inherited Members

- Protected Member Functions inherited from Component
void setParent (const std::shared_ptr< Component > &parent)
 Set the Parent object.
 
- Protected Attributes inherited from Component
State _state
 The component's state.
 
Properties _properties
 The component's properties.
 
std::shared_ptr< Component_parent
 Pointer to the parent component.
 
std::vector< std::shared_ptr< Component > > _children
 Vector of child components.
 
std::vector< std::shared_ptr< Primitive > > _primitives
 Vector of primitives for rendering.
 

Detailed Description

Specialized component to group other components.

The Container class manages the hierarchy and recursive rendering of children.

Constructor & Destructor Documentation

◆ Container()

Container::Container ( const Properties properties)
inline

Constructs a Container object with properties.

Parameters
propertiesThe properties for the container

Member Function Documentation

◆ onEvent()

void Container::onEvent ( const Event event)
inlineoverridevirtual

Handles events for the container.

Events are propagated to children if needed.

Parameters
eventThe event to handle

Reimplemented from Component.

◆ render()

std::shared_ptr< Component > Container::render ( void  )
inlineoverridevirtual

Renders the container and its children recursively.

Returns
std::shared_ptr<Component> Pointer to the rendered component

Reimplemented from Component.


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