Skip to main content

BindingComponent Class Template

Generic component that stores a handle reference to another entity. More...

Declaration

template <typename TOwnerHandle, typename TTargetHandle> class helios::ecs::components::BindingComponent<TOwnerHandle, TTargetHandle> { ... }

Public Constructors Index

template <typename TOwnerHandle, typename TTargetHandle>
BindingComponent (const TTargetHandle targetHandle)

Creates a binding from an explicit target handle. More...

template <typename TTargetEntity>
BindingComponent (const TTargetEntity targetEntity)

Creates a binding from a target entity instance. More...

Public Member Functions Index

template <typename TOwnerHandle, typename TTargetHandle>
TTargetHandletargetHandle () const noexcept

Returns the bound target handle. More...

Private Member Attributes Index

template <typename TOwnerHandle, typename TTargetHandle>
TTargetHandletargetHandle_ {}

Description

Generic component that stores a handle reference to another entity.

BindingComponent models a directed relationship from an owner entity to a target entity via the target's handle type. It is used as a lightweight link primitive for higher-level components such as scene, camera, and viewport bindings.

Template Parameters
TOwnerHandle

Handle type of the entity owning this component.

TTargetHandle

Handle type of the referenced target entity.

Definition at line 21 of file BindingComponent.ixx.

Public Constructors

BindingComponent()

template <typename TOwnerHandle, typename TTargetHandle>
helios::ecs::components::BindingComponent< TOwnerHandle, TTargetHandle >::BindingComponent (const TTargetHandle targetHandle)
inline explicit

Creates a binding from an explicit target handle.

Parameters
targetHandle

Handle of the referenced target entity.

Definition at line 32 of file BindingComponent.ixx.

32 explicit BindingComponent(const TTargetHandle targetHandle) : targetHandle_(targetHandle) {};

BindingComponent()

template <typename TTargetEntity>
helios::ecs::components::BindingComponent< TOwnerHandle, TTargetHandle >::BindingComponent (const TTargetEntity targetEntity)
inline explicit

Creates a binding from a target entity instance.

This constructor is enabled only if the entity's Handle_type matches TTargetHandle.

Template Parameters
TTargetEntity

Entity type exposing Handle_type and handle().

Parameters
targetEntity

Referenced target entity.

Definition at line 45 of file BindingComponent.ixx.

45 explicit BindingComponent(const TTargetEntity targetEntity) : targetHandle_(targetEntity.handle()) {};

Public Member Functions

targetHandle()

template <typename TOwnerHandle, typename TTargetHandle>
TTargetHandle helios::ecs::components::BindingComponent< TOwnerHandle, TTargetHandle >::targetHandle ()
inline noexcept

Returns the bound target handle.

Returns

Handle of the referenced target entity.

Definition at line 52 of file BindingComponent.ixx.

52 [[nodiscard]] TTargetHandle targetHandle() const noexcept {
53 return targetHandle_;
54 }

Private Member Attributes

targetHandle_

template <typename TOwnerHandle, typename TTargetHandle>
TTargetHandle helios::ecs::components::BindingComponent< TOwnerHandle, TTargetHandle >::targetHandle_ {}

Definition at line 23 of file BindingComponent.ixx.

23 TTargetHandle targetHandle_{};

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.