Unravel Engine C++ Reference
|
Class for collecting and managing time-series sample data. Maintains a rolling buffer of samples with automatic statistics calculation. More...
#include <statistics_utils.h>
Public Member Functions | |
sample_data () | |
Constructor that initializes all samples to zero. | |
auto | reset (float value) -> void |
Reset all samples to a specific value. | |
auto | push_sample (float value) -> void |
Add a new sample to the rolling buffer. Automatically updates min, max, and average statistics. | |
auto | get_values () const -> const float * |
Get the raw sample values array. | |
auto | get_offset () const -> int32_t |
Get the current offset in the rolling buffer. | |
auto | get_min () const -> float |
Get the minimum value in the current sample set. | |
auto | get_max () const -> float |
Get the maximum value in the current sample set. | |
auto | get_average () const -> float |
Get the average value of the current sample set. | |
Static Public Attributes | |
static constexpr uint32_t | NUM_SAMPLES = 500 |
Class for collecting and managing time-series sample data. Maintains a rolling buffer of samples with automatic statistics calculation.
Definition at line 15 of file statistics_utils.h.
unravel::statistics_utils::sample_data::sample_data | ( | ) |
Constructor that initializes all samples to zero.
Definition at line 16 of file statistics_utils.cpp.
|
inline |
Get the average value of the current sample set.
Definition at line 94 of file statistics_utils.h.
|
inline |
Get the maximum value in the current sample set.
Definition at line 83 of file statistics_utils.h.
|
inline |
Get the minimum value in the current sample set.
Definition at line 72 of file statistics_utils.h.
|
inline |
Get the current offset in the rolling buffer.
Definition at line 61 of file statistics_utils.h.
|
inline |
Get the raw sample values array.
Definition at line 50 of file statistics_utils.h.
auto unravel::statistics_utils::sample_data::push_sample | ( | float | value | ) | -> void |
Add a new sample to the rolling buffer. Automatically updates min, max, and average statistics.
value | The new sample value |
Definition at line 33 of file statistics_utils.cpp.
auto unravel::statistics_utils::sample_data::reset | ( | float | value | ) | -> void |
Reset all samples to a specific value.
value | The value to reset all samples to |
Definition at line 21 of file statistics_utils.cpp.
|
staticconstexpr |
Definition at line 18 of file statistics_utils.h.