OutsideTolerance Filter

template<typename T, T Tolerance>
struct OutsideTolerance

Filter that accepts changes exceeding a tolerance threshold.

This filter is useful for ignoring minor fluctuations in sensor readings or measurements.

Since

v0.1.0

// Example: Only propagate if change exceeds 2.5
Signal<float, 10, OutsideTolerance<float, 2.5>> sensor(0.0);

Warning

  • Only accepts arithmetic types (integral and floating-point).

  • Tolerance must be a positive value.

Template Parameters:
typename T

Arithmetic type.

T Tolerance

Minimum absolute change required to propagate.

Public Functions

inline bool operator()(const T &old_value, const T &new_value) const

See Also