27 #include "../common/Translator.h"
31 #include <boost/format.hpp>
35 std::pair<int, int> mapping(src, dst);
37 std::map<std::pair<int, int>,
DataTypeConverter>::iterator it = m_convMap.find(mapping);
38 if(it != m_convMap.end())
39 throw Exception((boost::format(
TR_DATATYPE(
"There is already a converter registered for the data type conversion: %1% -> %2%.")) % src % dst).str());
41 m_convMap[mapping] = conv;
46 std::map<std::pair<int, int>,
DataTypeConverter>::iterator it = m_convMap.find(typeMap);
47 if(it == m_convMap.end())
48 throw Exception((boost::format(
TR_DATATYPE(
"There is not a converter registered for the data type conversion: %1% -> %2%.")) % typeMap.first % typeMap.second).str());
#define TR_DATATYPE(message)
It marks a string in order to get translated. This is a special mark used in the DataAccess module of...
void add(int src, int dst, DataTypeConverter conv)
It adds a converter to the list of known data type mappings.
~DataConverterManager()
Destructor.
A singleton for managing the data type converter available in the system.
const DataTypeConverter & get(int src, int dst)
It returns a data type converter for the given source and destination data types. ...
boost::function1< AbstractData *, AbstractData * > DataTypeConverter
The definition of the data type converter.
DataConverterManager()
Constructor.