Skip to main content

AddComponentCommand Struct Template

Deferred command that adds a component of type TComponent to an entity. More...

Declaration

template <typename TComponent> struct helios::ecs::commands::AddComponentCommand<TComponent> { ... }

Public Member Typedefs Index

template <typename TComponent>
usingHandle_type = TComponent::Handle_type

Handle type derived from the component. More...

template <typename TComponent>
usingComponent_type = TComponent

The component type being added. More...

Public Constructors Index

template <typename TComponent>
AddComponentCommand (Handle_type handle)

Constructs the command with a default-initialised component. More...

template <typename ... TArgs>
AddComponentCommand (Handle_type handle, TArgs &&...args)

Constructs the command and forwards arguments to the component constructor. More...

Public Member Attributes Index

template <typename TComponent>
Handle_typehandle

Handle of the target entity. More...

template <typename TComponent>
TComponentcomponent

Component instance that will be attached. More...

Description

Deferred command that adds a component of type TComponent to an entity.

Intended to be queued and processed by a command consumer (e.g. a system or entity manager) rather than applied immediately, keeping structural ECS mutations out of hot iteration loops.

Template Parameters
TComponent

Component type to attach. Must expose Handle_type.

Definition at line 24 of file AddComponentCommand.ixx.

Public Member Typedefs

Component_type

template <typename TComponent>
using helios::ecs::commands::AddComponentCommand< TComponent >::Component_type = TComponent

The component type being added.

Definition at line 30 of file AddComponentCommand.ixx.

30 using Component_type = TComponent;

Handle_type

template <typename TComponent>
using helios::ecs::commands::AddComponentCommand< TComponent >::Handle_type = TComponent::Handle_type

Handle type derived from the component.

Definition at line 27 of file AddComponentCommand.ixx.

27 using Handle_type = TComponent::Handle_type;

Public Constructors

AddComponentCommand()

template <typename TComponent>
helios::ecs::commands::AddComponentCommand< TComponent >::AddComponentCommand (Handle_type handle)
inline explicit

Constructs the command with a default-initialised component.

Parameters
handle

Target entity handle.

Definition at line 43 of file AddComponentCommand.ixx.

44 requires std::default_initializable<TComponent>
45 : handle(handle), component() {}

AddComponentCommand()

template <typename ... TArgs>
helios::ecs::commands::AddComponentCommand< TComponent >::AddComponentCommand (Handle_type handle, TArgs &&... args)
inline explicit

Constructs the command and forwards arguments to the component constructor.

Template Parameters
TArgs

Component constructor argument types.

Parameters
handle

Target entity handle.

args

Arguments forwarded to TComponent.

Definition at line 56 of file AddComponentCommand.ixx.

56 explicit AddComponentCommand(Handle_type handle, TArgs&& ...args)
57 : handle(handle), component(std::forward<TArgs>(args)...) {}

Public Member Attributes

component

template <typename TComponent>
TComponent helios::ecs::commands::AddComponentCommand< TComponent >::component

Component instance that will be attached.

Definition at line 36 of file AddComponentCommand.ixx.

36 TComponent component;

handle

template <typename TComponent>
Handle_type helios::ecs::commands::AddComponentCommand< TComponent >::handle

Handle of the target entity.

Definition at line 33 of file AddComponentCommand.ixx.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.