SoftFilters  0.1.0
Arduino framework and library of software data filters.
LambdaFilter< IN_T, OUT_T > Class Template Reference

A lambda filter that uses a client-supplied filter function. More...

#include <SoftFilters.h>

Inheritance diagram for LambdaFilter< IN_T, OUT_T >:
Collaboration diagram for LambdaFilter< IN_T, OUT_T >:

Public Member Functions

 LambdaFilter (bool(*f)(IN_T const &, OUT_T &))
 Create a lambda filter using the given function. More...
 
- Public Member Functions inherited from Filter
bool push (void const *const input, void *const output)
 Push a new data through the filter. More...
 

Protected Member Functions

virtual bool update (void const *const input) override
 In a lambda filter, the update function simply calls the client-supplied filter function.
 
- Protected Member Functions inherited from BaseFilter< IN_T, OUT_T >
virtual void const *const get_output_val_ptr () final
 Push a new data through the filter. More...
 
virtual void copy_to_client (void *const output) final
 Copy the output to client memory.
 

Private Attributes

bool(* lambda )(IN_T const &, OUT_T &)
 

Additional Inherited Members

- Protected Attributes inherited from BaseFilter< IN_T, OUT_T >
OUT_T out_val
 Internally managed storage of the output value.
 

Detailed Description

template<typename IN_T, typename OUT_T>
class LambdaFilter< IN_T, OUT_T >

A lambda filter that uses a client-supplied filter function.

Template Parameters
IN_Ttype of input data
OUT_Ttype of output data

Constructor & Destructor Documentation

◆ LambdaFilter()

template<typename IN_T , typename OUT_T >
LambdaFilter< IN_T, OUT_T >::LambdaFilter ( bool(*)(IN_T const &, OUT_T &)  f)
inline

Create a lambda filter using the given function.

Parameters
fA function with the same signature as the BaseFilter::push function.

The documentation for this class was generated from the following file: