Mirror of espurna firmware for wireless switches and more
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
836 B

// -----------------------------------------------------------------------------
// Base Filter (other filters inherit from this)
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#pragma once
#include <cstddef>
class BaseFilter {
public:
virtual ~BaseFilter() = default;
// Reset internal state to default
virtual void reset() {
}
// Defaults to false aka filter is not initialized
virtual bool status() const {
return false;
}
// Resize the backing storage (when it is available) and reset internal state
virtual void resize(size_t) {
}
// Store reading
virtual void update(double value) = 0;
// Return filtered value
virtual double value() const = 0;
};