27 #include "../../core/translator/Translator.h" 28 #include "../Exception.h" 33 #include <boost/format.hpp> 37 std::map<std::string, AttributeConverter>::iterator it =
m_converters.find(name);
40 throw Exception((boost::format(
TE_TR(
"There is already a converter registered with the given name %1%.")) % name).str());
47 std::map<std::string, AttributeConverter>::iterator it =
m_converters.find(name);
50 throw Exception((boost::format(
TE_TR(
"There is no converter registered with the given name %1%.")) % name).str());
57 std::map<std::string, AttributeConverter>::const_iterator it =
m_converters.begin();
61 names.push_back(it->first);
Base exception class for plugin module.
void addConverter(const std::string &name, AttributeConverter converter)
A singleton to keep all the registered Attribute Converter.
#define TE_TR(message)
It marks a string in order to get translated.
boost::function3< te::dt::AbstractData *, DataSet *, const std::vector< std::size_t > &, int > AttributeConverter
The type of attribute converter functions.
Definition of attribute converter and a set of them.
void getConverters(std::vector< std::string > &names) const
AttributeConverter getConverter(const std::string &name)
std::map< std::string, AttributeConverter > m_converters