class mola::FilterBase

Overview

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(). More…

#include <FilterBase.h>

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

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

Inherited Members

public:
    // structs

    struct SensorViewerImpl;

    // methods

    virtual void spinOnce() = 0;

Detailed Documentation

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().

Methods

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

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

virtual void initialize(const Yaml& cfg)

This should be reimplemented to read all the required parameters

virtual void onNewObservation(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.