NumericValueComponent.ixx File
Generic scalar component with dirty-state tracking. More...
Included Headers
#include <cassert>
#include <algorithm>
#include <cmath>
#include <helios.math>
Namespaces Index
| namespace | helios |
| namespace | engine |
| namespace | core |
| namespace | components |
Classes Index
| class | NumericValueComponent<TDomainTag, TNumericType, Args> |
|
Generic numeric value component with dirty-state tracking. More... | |
Description
Generic scalar component with dirty-state tracking.
File Listing
The file content with the documentation metadata removed is:
17export namespace helios::engine::core::components {
26 template<typename TDomainTag, typename TNumericType, typename ... Args>
27 requires IsNumeric<TNumericType>
28 class NumericValueComponent {
30 TNumericType value_{};
36 NumericValueComponent() = default;
44 explicit NumericValueComponent(const TNumericType value) : value_(value){}
54 NumericValueComponent(const NumericValueComponent& other) :
55 value_(other.value_),
56 isDirty_(true) {}
59 NumericValueComponent& operator=(const NumericValueComponent&) = default;
86 void clearDirty() noexcept {
104 [[nodiscard]] TNumericType value() noexcept {
120 void setValue(const TNumericType value) noexcept {
123 if (std::abs(value_ - value) <= static_cast<TNumericType>(helios::math::EPSILON_LENGTH)) {
127 if (value_ == value) {
133 value_ = value;
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.