Essentia  2.1-beta6-dev
StreamingAlgorithmWrapper Class Reference

#include <streamingalgorithmwrapper.h>

Inheritance diagram for StreamingAlgorithmWrapper:
Algorithm Configurable

Public Member Functions

 StreamingAlgorithmWrapper ()
 
 ~StreamingAlgorithmWrapper ()
 
void declareInput (SinkBase &sink, NumeralType type, const std::string &name)
 
void declareInput (SinkBase &sink, NumeralType type, int n, const std::string &name)
 
void declareOutput (SourceBase &source, NumeralType type, const std::string &name)
 
void declareOutput (SourceBase &source, NumeralType type, int n, const std::string &name)
 
void synchronizeInput (const std::string &name)
 
void synchronizeOutput (const std::string &name)
 
void synchronizeIO ()
 
void declareAlgorithm (const std::string &name)
 
void configure (const ParameterMap &params)
 
void configure ()
 
void reset ()
 
void setParameters (const ParameterMap &params)
 
void declareParameters ()
 
AlgorithmStatus process ()
 
- Public Member Functions inherited from Algorithm
 Algorithm ()
 
virtual ~Algorithm ()
 
SinkBaseinput (const std::string &name)
 
SourceBaseoutput (const std::string &name)
 
SinkBaseinput (int idx)
 
SourceBaseoutput (int idx)
 
const InputMapinputs () const
 
const OutputMapoutputs () const
 
std::vector< std::string > inputNames () const
 
std::vector< std::string > outputNames () const
 
virtual void shouldStop (bool stop)
 
virtual bool shouldStop () const
 
void disconnectAll ()
 
AlgorithmStatus acquireData ()
 
void releaseData ()
 
- Public Member Functions inherited from Configurable
virtual ~Configurable ()
 
const std::string & name () const
 
void setName (const std::string &name)
 
const ParameterMapdefaultParameters () const
 
const Parameterparameter (const std::string &key) const
 

Protected Types

typedef EssentiaMap< std::string, NumeralTypeNumeralTypeMap
 

Protected Attributes

NumeralTypeMap _inputType
 
NumeralTypeMap _outputType
 
standard::Algorithm_algorithm
 
int _streamSize
 
- Protected Attributes inherited from Algorithm
bool _shouldStop
 
OutputMap _outputs
 
InputMap _inputs
 
int nProcess
 
- Protected Attributes inherited from Configurable
std::string _name
 
ParameterMap _params
 
ParameterMap _defaultParams
 

Additional Inherited Members

- Public Types inherited from Algorithm
typedef OrderedMap< SinkBaseInputMap
 
typedef OrderedMap< SourceBaseOutputMap
 
- Public Attributes inherited from Algorithm
DescriptionMap inputDescription
 
DescriptionMap outputDescription
 
- Public Attributes inherited from Configurable
DescriptionMap parameterDescription
 
DescriptionMap parameterRange
 
- Static Public Attributes inherited from Algorithm
static const std::string processingMode
 
- Protected Member Functions inherited from Algorithm
void declareInput (SinkBase &sink, const std::string &name, const std::string &desc)
 
void declareInput (SinkBase &sink, int n, const std::string &name, const std::string &desc)
 
void declareInput (SinkBase &sink, int acquireSize, int releaseSize, const std::string &name, const std::string &desc)
 
void declareOutput (SourceBase &source, const std::string &name, const std::string &desc)
 
void declareOutput (SourceBase &source, int n, const std::string &name, const std::string &desc)
 
void declareOutput (SourceBase &source, int acquireSize, int releaseSize, 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)
 

Member Typedef Documentation

◆ NumeralTypeMap

typedef EssentiaMap<std::string, NumeralType> NumeralTypeMap
protected

Constructor & Destructor Documentation

◆ StreamingAlgorithmWrapper()

◆ ~StreamingAlgorithmWrapper()

Member Function Documentation

◆ configure() [1/2]

void configure ( )
inlinevirtual

This function will be automatically called after some parameters have been set. This is the place where you should write your specific code which needs to be called when configuring this object.

You can access the newly set parameters using the parameter() method.

Reimplemented from Configurable.

References StreamingAlgorithmWrapper::_algorithm, and Configurable::configure().

◆ configure() [2/2]

void configure ( const ParameterMap params)
inlinevirtual

Set the given parameters as the current ones and reconfigure the object.

See also
setParameters

Reimplemented from Configurable.

References StreamingAlgorithmWrapper::_algorithm, Configurable::configure(), and StreamingAlgorithmWrapper::setParameters().

◆ declareAlgorithm()

void declareAlgorithm ( const std::string &  name)

◆ declareInput() [1/2]

void declareInput ( SinkBase sink,
NumeralType  type,
const std::string &  name 
)

◆ declareInput() [2/2]

void declareInput ( SinkBase sink,
NumeralType  type,
int  n,
const std::string &  name 
)

◆ declareOutput() [1/2]

void declareOutput ( SourceBase source,
NumeralType  type,
const std::string &  name 
)

◆ declareOutput() [2/2]

void declareOutput ( SourceBase source,
NumeralType  type,
int  n,
const std::string &  name 
)

◆ declareParameters()

void declareParameters ( )
inlinevirtual

Declare the parameters that this Configurable can accept. You have to implement this method in derived classes, even though you don't need any parameters. In that case, just define it as empty.

In this method you should only be calling the declareParameter method, once for each parameter, with optional default values.

Implements Configurable.

References StreamingAlgorithmWrapper::_algorithm, Configurable::_defaultParams, Configurable::_params, Configurable::declareParameters(), Configurable::defaultParameters(), Configurable::parameterDescription, and Configurable::parameterRange.

◆ process()

AlgorithmStatus process ( )
virtual

Implements Algorithm.

◆ reset()

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. This function should not be called directly. Use resetNetwork instead to reset a network of connected Algorithms.

Reimplemented from Algorithm.

References StreamingAlgorithmWrapper::_algorithm, E_DEBUG, essentia::EAlgorithm, Configurable::name(), and Algorithm::reset().

◆ setParameters()

void setParameters ( const ParameterMap params)
inlinevirtual

Set the given parameters as the current ones. Parameters which are not redefined will keep their old values, while this method will throw an EssentiaException if passing it an unknown parameter (i.e.: not declared using declareParameters() ). As a general rule, it is better to use the configure(const ParameterMap&) method, but in certain cases you may want to set parameters without reconfiguring the object.

Reimplemented from Configurable.

References StreamingAlgorithmWrapper::_algorithm, and Configurable::setParameters().

Referenced by StreamingAlgorithmWrapper::configure().

◆ synchronizeInput()

void synchronizeInput ( const std::string &  name)

◆ synchronizeIO()

void synchronizeIO ( )

◆ synchronizeOutput()

void synchronizeOutput ( const std::string &  name)

Member Data Documentation

◆ _algorithm

◆ _inputType

NumeralTypeMap _inputType
protected

◆ _outputType

NumeralTypeMap _outputType
protected

◆ _streamSize

int _streamSize
protected

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