class mola::FilterBase


Base class for filters: get observations via onNewObservation(), and immediately send them to a worker thread that works on it, possibly publishing the output via sendObservationsToFrontEnds().

#include <FilterBase.h>

class FilterBase:
    public mola::RawDataSourceBase,
    private mola::RawDataConsumer
    // methods

    virtual CObservation::Ptr doFilter(const CObservation::Ptr& o) = 0;
    virtual void spinOnce();
    virtual void onNewObservation(const CObservation::Ptr& o);

Inherited Members

    // structs

    struct SensorViewerImpl;

    // methods

    virtual void initialize(const Yaml& cfg) = 0;


virtual CObservation::Ptr doFilter(const CObservation::Ptr& o) = 0

To be called for each incoming observation. Process it and return the modified observation.

virtual void spinOnce()

Runs any required action on a timely manner

virtual void onNewObservation(const CObservation::Ptr& o)

To be called whenever a new observation arrives. It should return as fast as possible, enqueuing the data for processing in another thread.