27 #include "../../common/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);
49 if(it == m_converters.end())
50 throw Exception((boost::format(
TE_TR(
"There is no converter registered with the given name %1%.")) % name).str());
52 return m_converters[name];
57 std::map<std::string, AttributeConverter>::const_iterator it = m_converters.begin();
59 while(it != m_converters.end())
61 names.push_back(it->first);
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