31 #ifndef ACADO_TOOLKIT_EXPORT_ALGORITHM_FACTORY_HPP 32 #define ACADO_TOOLKIT_EXPORT_ALGORITHM_FACTORY_HPP 54 typename AlgorithmType
60 typedef AlgorithmBase* (*exportAlgorithmCreator)(
UserInteraction* _userInteraction,
const std::string &_commonHeaderName);
74 typename idToProductMap::value_type(
id, creator)).second;
95 const std::string& _commonHeaderName,
96 const AlgorithmType&
id)
98 typename idToProductMap::const_iterator it =
associations_.find(
id );
101 return (it->second)(_userInteraction, _commonHeaderName);
104 LOG(
LVL_DEBUG ) <<
"Algorithm is not registered!" << std::endl;
127 #endif // ACADO_TOOLKIT_EXPORT_ALGORITHM_FACTORY_HPP
#define LOG(level)
Just define a handy macro for getting the logger.
Lowest level, the debug level.
Factory for creation of exported algorithms.
bool registerAlgorithm(const AlgorithmType &id, exportAlgorithmCreator creator)
bool unregisterAlgorithm(const AlgorithmType &id)
~ExportAlgorithmFactory()
#define CLOSE_NAMESPACE_ACADO
AlgorithmBase * createAlgorithm(UserInteraction *_userInteraction, const std::string &_commonHeaderName, const AlgorithmType &id)
idToProductMap associations_
std::map< AlgorithmType, exportAlgorithmCreator > idToProductMap
AlgorithmBase *(* exportAlgorithmCreator)(UserInteraction *_userInteraction, const std::string &_commonHeaderName)
Encapsulates all user interaction for setting options, logging data and plotting results.
ExportAlgorithmFactory & operator=(const ExportAlgorithmFactory &)
#define BEGIN_NAMESPACE_ACADO
static ExportAlgorithmFactory & instance()