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.
|
// -----------------------------------------------------------------------------
|
|
// Last Filter
|
|
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
|
|
// -----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "BaseFilter.h"
|
|
|
|
class LastFilter : public BaseFilter {
|
|
public:
|
|
void update(double value) override {
|
|
_value = value;
|
|
}
|
|
|
|
size_t capacity() const override {
|
|
return 1;
|
|
}
|
|
|
|
void reset() override {
|
|
_value = 0;
|
|
}
|
|
|
|
double value() const override {
|
|
return _value;
|
|
}
|
|
|
|
private:
|
|
double _value = 0;
|
|
bool _status = false;
|
|
};
|