WithinTolerance Filter

template<typename T, T Tolerance>
struct WithinTolerance

Filter that accepts changes within a tolerance threshold.

This filter is the inverse of OutsideTolerance, accepting only small changes that stay within the specified tolerance range.

Since

v0.1.0

// Example: Only propagate if change is within 1.0
Signal<float, 10, WithinTolerance<float, 1.0>> 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

Maximum absolute change allowed to propagate.

Public Functions

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

See Also