plugin  0.1.0
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Filter< Tin, Tout > Class Template Referenceabstract

#include <filter.hpp>

Public Member Functions

virtual std::string kind ()=0
 
virtual return_type load_data (Tin &data)=0
 
virtual return_type process (Tout *out)=0
 
virtual void set_params (void *params)
 
virtual std::map< std::string, std::string > info ()=0
 
std::string error ()
 

Static Public Member Functions

static const std::string server_name ()
 

Public Attributes

bool dummy = false
 

Static Public Attributes

static const int version = 2
 

Detailed Description

template<typename Tin = std::vector<double>, typename Tout = std::vector<double>>
class Filter< Tin, Tout >

Base class for filters

This class is the base class for all filters. It defines the interface for loading data and processing it. Derived classes must implement Filter::kind, Filter::load_data and Filter::process methods. Optionally, they can implement the Filter::set_params method to receive parameters as a void pointer.

After deriving the class, remember to call the INSTALL_FILTER_DRIVER(klass, type_in, type_out) macro to enable the plugin to be loaded by the kernel.

Template Parameters
TinInput data type
ToutOutput data type

Member Function Documentation

◆ error()

template<typename Tin = std::vector<double>, typename Tout = std::vector<double>>
std::string Filter< Tin, Tout >::error ( )
inline

Returns the error message

This method returns the error message.

Returns
The error message

◆ info()

template<typename Tin = std::vector<double>, typename Tout = std::vector<double>>
virtual std::map<std::string, std::string> Filter< Tin, Tout >::info ( )
pure virtual

Returns the filter information

This method returns the filter information. It returns a map with keys and values describing the filter.

Returns
The filter information

◆ kind()

template<typename Tin = std::vector<double>, typename Tout = std::vector<double>>
virtual std::string Filter< Tin, Tout >::kind ( )
pure virtual

Returns the kind of filter

This method returns the kind of filter. It is used to identify the filter when loading it from a plugin.

Returns
The kind of filter

◆ load_data()

template<typename Tin = std::vector<double>, typename Tout = std::vector<double>>
virtual return_type Filter< Tin, Tout >::load_data ( Tin &  data)
pure virtual

Loads the input data

This method loads the input data into the filter. It returns true if the data was loaded successfully, and false otherwise.

Parameters
dataThe input data
Returns
True if the data was loaded successfully, and false otherwise

◆ process()

template<typename Tin = std::vector<double>, typename Tout = std::vector<double>>
virtual return_type Filter< Tin, Tout >::process ( Tout *  out)
pure virtual

Processes the input data

This method processes the input data and returns the result. It returns true if the data was processed successfully, and false otherwise.

Parameters
outThe output data
Returns
True if the data was processed successfully, and false otherwise

◆ server_name()

template<typename Tin = std::vector<double>, typename Tout = std::vector<double>>
static const std::string Filter< Tin, Tout >::server_name ( )
inlinestatic

Returns the plugin server name.

◆ set_params()

template<typename Tin = std::vector<double>, typename Tout = std::vector<double>>
virtual void Filter< Tin, Tout >::set_params ( void *  params)
inlinevirtual

Sets the parameters

This method sets the parameters for the filter. It receives a void pointer to the parameters. The child class must cast the pointer to the correct type.

Parameters
paramsThe parameters (typically a pointer to a struct)

Member Data Documentation

◆ dummy

template<typename Tin = std::vector<double>, typename Tout = std::vector<double>>
bool Filter< Tin, Tout >::dummy = false

Set it to true to enable dummy mode

◆ version

template<typename Tin = std::vector<double>, typename Tout = std::vector<double>>
const int Filter< Tin, Tout >::version = 2
static

Returns the plugin protocol version.


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