Essentia  2.1-beta6-dev
algorithmfactory_impl.h File Reference

Go to the source code of this file.

Namespaces

 essentia
 

Macros

#define CREATE_I   template <typename BaseAlgorithm> BaseAlgorithm* EssentiaFactory<BaseAlgorithm>::create_i(const std::string& id
 
#define P(n)   , const std::string& name##n, const Parameter& value##n
 
#define AP(n)   params.add(name##n, value##n);
 
#define CREATE_I_BEG
 
#define CREATE_I_END
 

Macro Definition Documentation

◆ AP

#define AP (   n)    params.add(name##n, value##n);

◆ CREATE_I

#define CREATE_I   template <typename BaseAlgorithm> BaseAlgorithm* EssentiaFactory<BaseAlgorithm>::create_i(const std::string& id

◆ CREATE_I_BEG

#define CREATE_I_BEG
Value:
) const { \
E_DEBUG(EFactory, BaseAlgorithm::processingMode << ": Creating algorithm: " << id); \
typename CreatorMap::const_iterator it = _map.find(id); \
if (it == _map.end()) { \
std::ostringstream msg; \
msg << "Identifier '" << id << "' not found in registry...\n"; \
msg << "Available algorithms:"; \
for (it=_map.begin(); it!=_map.end(); ++it) { \
msg << ' ' << it->first; \
} \
throw EssentiaException(msg); \
} \
E_DEBUG_INDENT; \
BaseAlgorithm* algo = it->second.create(); \
E_DEBUG_OUTDENT; \
algo->setName(id); \
algo->declareParameters(); \
ParameterMap params;
@ EFactory
Definition: debugging.h:44

◆ CREATE_I_END

#define CREATE_I_END
Value:
algo->setParameters(params); \
E_DEBUG(EFactory, BaseAlgorithm::processingMode << ": Configuring " << id << " with default parameters"); \
algo->configure(); \
E_DEBUG(EFactory, BaseAlgorithm::processingMode << ": Creating " << id << " ok!"); \
return algo; \
}

◆ P

#define P (   n)    , const std::string& name##n, const Parameter& value##n