Essentia  2.1-beta6-dev
Algorithm Class Referenceabstract

#include <algorithm.h>

Inheritance diagram for Algorithm:
Configurable

Public Types

typedef OrderedMap< InputBaseInputMap
 
typedef OrderedMap< OutputBaseOutputMap
 

Public Member Functions

virtual ~Algorithm ()
 
const InputMapinputs () const
 
const OutputMapoutputs () const
 
InputBaseinput (const std::string &name)
 
OutputBaseoutput (const std::string &name)
 
std::vector< std::string > inputNames () const
 
std::vector< std::string > outputNames () const
 
virtual void compute ()=0
 
virtual void reset ()
 
std::vector< const std::type_info * > inputTypes () const
 
std::vector< const std::type_info * > outputTypes () const
 
- Public Member Functions inherited from Configurable
virtual ~Configurable ()
 
const std::string & name () const
 
void setName (const std::string &name)
 
virtual void declareParameters ()=0
 
virtual void setParameters (const ParameterMap &params)
 
virtual void configure (const ParameterMap &params)
 
virtual void configure ()
 
const ParameterMapdefaultParameters () const
 
const Parameterparameter (const std::string &key) const
 

Public Attributes

DescriptionMap inputDescription
 
DescriptionMap outputDescription
 
- Public Attributes inherited from Configurable
DescriptionMap parameterDescription
 
DescriptionMap parameterRange
 

Static Public Attributes

static const std::string processingMode
 

Protected Member Functions

void declareInput (InputBase &input, const std::string &name, const std::string &desc)
 
void declareOutput (OutputBase &output, const std::string &name, const std::string &desc)
 
- Protected Member Functions inherited from Configurable
void declareParameter (const std::string &name, const std::string &desc, const std::string &range, const Parameter &defaultValue)
 

Protected Attributes

InputMap _inputs
 
OutputMap _outputs
 
- Protected Attributes inherited from Configurable
std::string _name
 
ParameterMap _params
 
ParameterMap _defaultParams
 

Member Typedef Documentation

◆ InputMap

◆ OutputMap

Constructor & Destructor Documentation

◆ ~Algorithm()

virtual ~Algorithm ( )
inlinevirtual

Empty virtual destructor, needed because we have some virtual functions.

Member Function Documentation

◆ compute()

virtual void compute ( )
pure virtual

Do the actual computation once that everything is set and configured. The recommended use for this function is to first get the inputs and outputs into local ref variables (const for the inputs) and then do the processing. This allow you also to write a "classic" function call with parameters which you would just wrap with the parameterless function.

◆ declareInput()

void declareInput ( InputBase input,
const std::string &  name,
const std::string &  desc 
)
protected

◆ declareOutput()

void declareOutput ( OutputBase output,
const std::string &  name,
const std::string &  desc 
)
protected

◆ input()

InputBase& input ( const std::string &  name)

Return the input wrapper associated with the given name.

◆ inputNames()

std::vector<std::string> inputNames ( ) const
inline

Return the names of all the inputs that have been defined for this object.

◆ inputs()

const InputMap& inputs ( ) const
inline

◆ inputTypes()

std::vector<const std::type_info*> inputTypes ( ) const

◆ output()

OutputBase& output ( const std::string &  name)

Return the output wrapper associated with the given name.

◆ outputNames()

std::vector<std::string> outputNames ( ) const
inline

Return the names of all the outputs that have been defined for this object.

◆ outputs()

const OutputMap& outputs ( ) const
inline

◆ outputTypes()

std::vector<const std::type_info*> outputTypes ( ) const

◆ reset()

virtual void reset ( )
inlinevirtual

This function will be called when doing batch computations between each file that is processed. That is, if your algorithm is some sort of state machine, it allows you to reset it to its original state to process another file without having to delete and reinstantiate it.

Referenced by StreamingAlgorithmWrapper::reset().

Member Data Documentation

◆ _inputs

InputMap _inputs
protected

◆ _outputs

OutputMap _outputs
protected

◆ inputDescription

DescriptionMap inputDescription

◆ outputDescription

DescriptionMap outputDescription

◆ processingMode

const std::string processingMode
static

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