27 #include "../../../../common/STLUtils.h"
28 #include "../../../../common/Translator.h"
29 #include "../../Exception.h"
37 #include <boost/foreach.hpp>
38 #include <boost/format.hpp>
48 throw Exception(
TR_QT_WIDGETS(
"Can not insert a NULL data source type into the manager!"));
51 throw Exception((boost::format(
TR_QT_WIDGETS(
"There is already a data source type with the given id (%1%) in data source manager!")) % dst->
getName()).str());
53 m_datasourceTypeMap[dst->
getName()] = dst;
58 iterator it = m_datasourceTypeMap.find(name);
60 if(it == m_datasourceTypeMap.end())
65 m_datasourceTypeMap.erase(it);
70 return m_datasourceTypeMap.size();
75 return m_datasourceTypeMap.begin();
80 return m_datasourceTypeMap.begin();
85 return m_datasourceTypeMap.end();
90 return m_datasourceTypeMap.end();
const DataSourceType * get(const std::string &name) const
A base class for the suppported types of data source.
std::map< std::string, DataSourceType * > m_datasourceTypeMap
const_iterator begin() const
const_iterator end() const
std::map< std::string, DataSourceType * >::iterator iterator
#define TR_QT_WIDGETS(message)
It marks a string in order to get translated. This is a special mark used in the TerraLib Qt Widgets ...
std::map< std::string, DataSourceType * >::const_iterator const_iterator
void add(DataSourceType *dst)
virtual std::string getName() const =0
void remove(const std::string &name)
V * GetPValue(const std::map< K, V * > &m, const K &k)
It finds for a given key in the map and returns a pointer if something is found or NULL otherwise...