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 Member Typedefs Index​

template <typename TOwnerHandle, typename TTargetHandle>
usingHandle_type = TOwnerHandle

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 Member Typedefs​

Handle_type​

template <typename TOwnerHandle, typename TTargetHandle>
using helios::ecs::components::BindingComponent< TOwnerHandle, TTargetHandle >::Handle_type = TOwnerHandle

Definition at line 27 of file BindingComponent.ixx.

27 using Handle_type = TOwnerHandle;

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 33 of file BindingComponent.ixx.

33 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 46 of file BindingComponent.ixx.

46 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 53 of file BindingComponent.ixx.

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

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.