SoftFilters
0.1.0
Arduino framework and library of software data filters.
|
The Filter interface without type checking at compile time. More...
#include <framework.h>
Public Member Functions | |
bool | push (void const *const input, void *const output) |
Push a new data through the filter. More... | |
Protected Member Functions | |
virtual void const *const | get_output_val_ptr ()=0 |
Read-only access to the internal output memory. More... | |
virtual bool | update (void const *const input)=0 |
Internally update the filter output based on the given input. More... | |
virtual void | copy_to_client (void *const output)=0 |
Copy the output to client memory. | |
Friends | |
class | FilterChain |
class | FilterTree |
The Filter interface without type checking at compile time.
|
protectedpure virtual |
Read-only access to the internal output memory.
This member function is mainly used by derived composite filters, which needs to point the output of the previous filter stage to the input of the next fitler stage. See for example the implementation of FilterChain.
Implemented in FilterChain, PassThroughFilter< T >, BaseFilter< IN_T, OUT_T >, BaseFilter< Reading< VAL_T, TS_T >, Reading< VAL_T, TS_T > >, BaseFilter< VAL_T, double >, BaseFilter< VAL_T, Reading< VAL_T, TS_T > >, and BaseFilter< Reading< VAL_T, TS_T >, Reading< Differential< VAL_T >, TS_T > >.
|
inline |
Push a new data through the filter.
A filter is not required to always output a data in response to a new input data. For example, a delay filter might wait for several input data before outputing. This behavior is supported through the boolean return value.
[in] | input | A read-only pointer to the input data. When the input pointer is NULL, this function returns false. |
[out] | output | A pointer to the memory (managed by the client code) where the output data is to be written. |
|
protectedpure virtual |
Internally update the filter output based on the given input.
This method behaves similarly to the public Filter::push method, but without copying the output to the client memory. This method is for internal workings of the filter framework.
Implemented in FlowRateFilter< T, TS_T, time_fun, TICKS_PER_SEC >, LambdaFilter< IN_T, OUT_T >, OneEuroFilter< VAL_T, TS_T >, AdaptiveNormalizationFilter< VAL_T >, WeightedUpdateFilter< IN_T, OUT_T, INTERNAL_T >, FilterChain, PassThroughFilter< T >, CachedFilter< IN_T, OUT_T >, TimestampFilter< VAL_T, TS_T, time_fn >, and DifferentialFilter< VAL_T, TS_T, INTERNAL_T >.