NumericValueComponent Class Template
Generic numeric value component with dirty-state tracking. More...
Declaration
Public Constructors Index
template <typename TDomainTag, typename THandle, typename TNumericType> | |
| NumericValueComponent ()=default | |
template <typename TDomainTag, typename THandle, typename TNumericType> | |
| NumericValueComponent (const TNumericType value) | |
|
Constructs the component with an initial scalar value. More... | |
template <typename TDomainTag, typename THandle, typename TNumericType> | |
| NumericValueComponent (const NumericValueComponent &other) | |
|
Copy constructor. More... | |
template <typename TDomainTag, typename THandle, typename TNumericType> | |
| NumericValueComponent (NumericValueComponent &&) noexcept=default | |
|
Default move constructor. More... | |
Public Operators Index
template <typename TDomainTag, typename THandle, typename TNumericType> | |
| NumericValueComponent & | operator= (const NumericValueComponent &)=default |
|
Default copy assignment. More... | |
template <typename TDomainTag, typename THandle, typename TNumericType> | |
| NumericValueComponent & | operator= (NumericValueComponent &&) noexcept=default |
|
Default move assignment. More... | |
Public Member Functions Index
template <typename TDomainTag, typename THandle, typename TNumericType> | |
| void | onAcquire () noexcept |
|
Lifecycle hook called when the component is acquired. More... | |
template <typename TDomainTag, typename THandle, typename TNumericType> | |
| void | onRelease () noexcept |
|
Lifecycle hook called when the component is released. More... | |
template <typename TDomainTag, typename THandle, typename TNumericType> | |
| void | clearDirty () noexcept |
|
Clears the dirty flag after dependent systems consumed updates. More... | |
template <typename TDomainTag, typename THandle, typename TNumericType> | |
| bool | isDirty () const noexcept |
|
Returns whether the component requires a refresh pass. More... | |
template <typename TDomainTag, typename THandle, typename TNumericType> | |
| TNumericType | value () noexcept |
|
Returns the current value. More... | |
template <typename TDomainTag, typename THandle, typename TNumericType> | |
| TNumericType | value () const noexcept |
template <typename TDomainTag, typename THandle, typename TNumericType> | |
| void | setValue (const 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> | |
| TNumericType | value_ {} |
template <typename TDomainTag, typename THandle, typename TNumericType> | |
| bool | isDirty_ = true |
Description
Generic numeric value component with dirty-state tracking.
- Template Parameters
-
TDomainTag Semantic domain tag.
THandle Owning entity handle type.
TNumericType Scalar type for stored numeric values.
Definition at line 28 of file NumericValueComponent.ixx.
Public Constructors
NumericValueComponent()
| default |
Definition at line 36 of file NumericValueComponent.ixx.
NumericValueComponent()
| inline explicit |
Constructs the component with an initial scalar value.
- Parameters
-
value Initial numeric value.
Definition at line 44 of file NumericValueComponent.ixx.
NumericValueComponent()
| 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 54 of file NumericValueComponent.ixx.
NumericValueComponent()
| noexcept default |
Default move constructor.
Definition at line 61 of file NumericValueComponent.ixx.
Public Operators
operator=()
| default |
Default copy assignment.
Definition at line 59 of file NumericValueComponent.ixx.
operator=()
| noexcept default |
Default move assignment.
Definition at line 63 of file NumericValueComponent.ixx.
Public Member Functions
clearDirty()
| inline noexcept |
Clears the dirty flag after dependent systems consumed updates.
Definition at line 86 of file NumericValueComponent.ixx.
isDirty()
| inline noexcept |
onAcquire()
| inline noexcept |
Lifecycle hook called when the component is acquired.
Marks the component dirty to trigger downstream recomputation.
Definition at line 70 of file NumericValueComponent.ixx.
onRelease()
| inline noexcept |
Lifecycle hook called when the component is released.
Marks the component dirty to trigger downstream recomputation.
Definition at line 79 of file NumericValueComponent.ixx.
setValue()
| inline noexcept |
Updates the value and marks the component dirty on change.
Integral types use exact comparison. Floating-point types use helios::math::EPSILON_LENGTH to suppress insignificant updates.
- Parameters
-
value New scalar value.
Definition at line 120 of file NumericValueComponent.ixx.
References helios::registerComponents and helios::engine::core::components::NumericValueComponent< TDomainTag, THandle, TNumericType >::value.
value()
| inline noexcept |
Returns the current value.
- Returns
Current value.
Definition at line 104 of file NumericValueComponent.ixx.
Referenced by helios::engine::core::components::NumericValueComponent< TDomainTag, THandle, TNumericType >::setValue.
value()
| inline noexcept |
Definition at line 108 of file NumericValueComponent.ixx.
Private Member Attributes
isDirty_
|
Definition at line 32 of file NumericValueComponent.ixx.
value_
|
Definition at line 30 of file NumericValueComponent.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.