Skip to main content

Vec2Component Class Template

Generic 2D value component with dirty-state tracking. More...

Declaration

template <typename TDomainTag, typename THandle, typename TNumericType> class helios::engine::core::components::Vec2Component<TDomainTag, THandle, TNumericType> { ... }

Public Constructors Index

template <typename TDomainTag, typename THandle, typename TNumericType>
Vec2Component ()=default
template <typename TDomainTag, typename THandle, typename TNumericType>
Vec2Component (const vec2< TNumericType > value)

Constructs the component with an initial value. More...

template <typename TDomainTag, typename THandle, typename TNumericType>
Vec2Component (const Vec2Component &other)

Copy constructor. More...

template <typename TDomainTag, typename THandle, typename TNumericType>
Vec2Component (Vec2Component &&) noexcept=default

Default move constructor. More...

Public Operators Index

template <typename TDomainTag, typename THandle, typename TNumericType>
Vec2Component &operator= (const Vec2Component &)=default

Default copy assignment. More...

template <typename TDomainTag, typename THandle, typename TNumericType>
Vec2Component &operator= (Vec2Component &&) noexcept=default

Default move assignment. More...

Public Member Functions Index

template <typename TDomainTag, typename THandle, typename TNumericType>
voidonAcquire () noexcept

Lifecycle hook called when the component is acquired. More...

template <typename TDomainTag, typename THandle, typename TNumericType>
voidonRelease () noexcept

Lifecycle hook called when the component is released. More...

template <typename TDomainTag, typename THandle, typename TNumericType>
voidclearDirty () noexcept

Clears the dirty flag after dependent systems consumed updates. More...

template <typename TDomainTag, typename THandle, typename TNumericType>
boolisDirty () const noexcept

Returns whether the component requires a refresh pass. More...

template <typename TDomainTag, typename THandle, typename TNumericType>
auto value () noexcept -> vec2< TNumericType >

Returns the current value. More...

template <typename TDomainTag, typename THandle, typename TNumericType>
auto value () const noexcept -> vec2< TNumericType >
template <typename TDomainTag, typename THandle, typename TNumericType>
voidsetValue (const vec2< TNumericType > value) noexcept

Updates the value and marks the component dirty on change. More...

Private Member Attributes Index

template <typename TDomainTag, typename THandle, typename TNumericType>
helios::math::vec2< TNumericType >value_ {}
template <typename TDomainTag, typename THandle, typename TNumericType>
boolisDirty_ = true

Description

Generic 2D value component with dirty-state tracking.

Template Parameters
TDomainTag

Semantic domain tag.

THandle

Owning entity handle type.

TNumericType

Scalar type for vector values.

Definition at line 24 of file Vec2Component.ixx.

Public Constructors

Vec2Component()

template <typename TDomainTag, typename THandle, typename TNumericType>
helios::engine::core::components::Vec2Component< TDomainTag, THandle, TNumericType >::Vec2Component ()
default

Definition at line 32 of file Vec2Component.ixx.

Vec2Component()

template <typename TDomainTag, typename THandle, typename TNumericType>
helios::engine::core::components::Vec2Component< TDomainTag, THandle, TNumericType >::Vec2Component (const vec2< TNumericType > value)
inline explicit

Constructs the component with an initial value.

Parameters
value

Initial value vector.

Definition at line 39 of file Vec2Component.ixx.

39 explicit Vec2Component(const vec2<TNumericType> value) : value_(value){}

Vec2Component()

template <typename TDomainTag, typename THandle, typename TNumericType>
helios::engine::core::components::Vec2Component< TDomainTag, THandle, TNumericType >::Vec2Component (const Vec2Component & other)
inline

Copy constructor.

Copies the value and forces the copied component into a dirty state to ensure dependent systems refresh cached data.

Parameters
other

The component to copy from.

Definition at line 49 of file Vec2Component.ixx.

50 value_(other.value_),
51 isDirty_(true) {}

Vec2Component()

template <typename TDomainTag, typename THandle, typename TNumericType>
helios::engine::core::components::Vec2Component< TDomainTag, THandle, TNumericType >::Vec2Component (Vec2Component &&)
noexcept default

Default move constructor.

Definition at line 56 of file Vec2Component.ixx.

Public Operators

operator=()

template <typename TDomainTag, typename THandle, typename TNumericType>
Vec2Component & helios::engine::core::components::Vec2Component< TDomainTag, THandle, TNumericType >::operator= (const Vec2Component &)
default

Default copy assignment.

Definition at line 54 of file Vec2Component.ixx.

operator=()

template <typename TDomainTag, typename THandle, typename TNumericType>
Vec2Component & helios::engine::core::components::Vec2Component< TDomainTag, THandle, TNumericType >::operator= (Vec2Component &&)
noexcept default

Default move assignment.

Definition at line 58 of file Vec2Component.ixx.

Public Member Functions

clearDirty()

template <typename TDomainTag, typename THandle, typename TNumericType>
void helios::engine::core::components::Vec2Component< TDomainTag, THandle, TNumericType >::clearDirty ()
inline noexcept

Clears the dirty flag after dependent systems consumed updates.

Definition at line 81 of file Vec2Component.ixx.

82 isDirty_ = false;
83 }

isDirty()

template <typename TDomainTag, typename THandle, typename TNumericType>
bool helios::engine::core::components::Vec2Component< TDomainTag, THandle, TNumericType >::isDirty ()
inline noexcept

Returns whether the component requires a refresh pass.

Returns

true if value changed or lifecycle hooks marked dirty.

Definition at line 90 of file Vec2Component.ixx.

91 return isDirty_;
92 }

onAcquire()

template <typename TDomainTag, typename THandle, typename TNumericType>
void helios::engine::core::components::Vec2Component< TDomainTag, THandle, TNumericType >::onAcquire ()
inline noexcept

Lifecycle hook called when the component is acquired.

Marks the component dirty to trigger downstream recomputation.

Definition at line 65 of file Vec2Component.ixx.

66 isDirty_ = true;
67 }

onRelease()

template <typename TDomainTag, typename THandle, typename TNumericType>
void helios::engine::core::components::Vec2Component< TDomainTag, THandle, TNumericType >::onRelease ()
inline noexcept

Lifecycle hook called when the component is released.

Marks the component dirty to trigger downstream recomputation.

Definition at line 74 of file Vec2Component.ixx.

75 isDirty_ = true;
76 }

setValue()

template <typename TDomainTag, typename THandle, typename TNumericType>
void helios::engine::core::components::Vec2Component< TDomainTag, THandle, TNumericType >::setValue (const vec2< TNumericType > value)
inline noexcept

Updates the value and marks the component dirty on change.

Parameters
value

New value vector.

Definition at line 112 of file Vec2Component.ixx.

112 void setValue(const vec2<TNumericType> value) noexcept {
113
114 if (value_.same(value)) {
115 return;
116 }
117
118 value_ = value;
119 isDirty_ = true;
120 };

Reference helios::engine::core::components::Vec2Component< TDomainTag, THandle, TNumericType >::value.

value()

template <typename TDomainTag, typename THandle, typename TNumericType>
vec2< TNumericType > helios::engine::core::components::Vec2Component< TDomainTag, THandle, TNumericType >::value ()
inline noexcept

Returns the current value.

Returns

Current 2D vector value.

Definition at line 99 of file Vec2Component.ixx.

100 return value_;
101 }

Referenced by helios::engine::core::components::Vec2Component< TDomainTag, THandle, TNumericType >::setValue.

value()

template <typename TDomainTag, typename THandle, typename TNumericType>
vec2< TNumericType > helios::engine::core::components::Vec2Component< TDomainTag, THandle, TNumericType >::value ()
inline noexcept

Definition at line 103 of file Vec2Component.ixx.

104 return value_;
105 }

Private Member Attributes

isDirty_

template <typename TDomainTag, typename THandle, typename TNumericType>
bool helios::engine::core::components::Vec2Component< TDomainTag, THandle, TNumericType >::isDirty_ = true

Definition at line 28 of file Vec2Component.ixx.

28 bool isDirty_ = true;

value_

template <typename TDomainTag, typename THandle, typename TNumericType>
helios::math::vec2<TNumericType> helios::engine::core::components::Vec2Component< TDomainTag, THandle, TNumericType >::value_ {}

Definition at line 26 of file Vec2Component.ixx.

26 helios::math::vec2<TNumericType> value_{};

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.