A simple counting filter that allows for some noise.
Definition: filters.hpp:18
bool addValue(T value)
The input stream for this filter.
Definition: filters.hpp:46
size_t filter_threshold_
The filter threshold.
Definition: filters.hpp:85
T current_value_
The current value.
Definition: filters.hpp:91
~ConsecutiveValuesFilter()=default
Destructor for the ConsecutiveValuesFilter.
void reset(T value)
Resets the filter's counter and sets the current value.
Definition: filters.hpp:34
ConsecutiveValuesFilter(T initial_value, size_t filter_threshold=0)
Constructor for the ConsecutiveValuesFilter.
Definition: filters.hpp:24
T new_value_
The new value that is being counted.
Definition: filters.hpp:94
void setFilterThreshold(size_t filter_threshold)
Definition: filters.hpp:39
T getCurrentValue() const
Returns the current value.
Definition: filters.hpp:79
size_t current_count_
The current count of consecutive new values.
Definition: filters.hpp:88
Definition: filesystem.cpp:34