26 #ifndef __TERRALIB_DATAACCESS_INTERNAL_DATASOURCEMANAGER_H
27 #define __TERRALIB_DATAACCESS_INTERNAL_DATASOURCEMANAGER_H
30 #include "../../common/Comparators.h"
31 #include "../../common/Singleton.h"
32 #include "../../common/ThreadingPolicies.h"
41 namespace core {
class URI; }
63 ::boost::recursive_mutex,
64 ::boost::lock_guard< ::boost::recursive_mutex>,
65 ::boost::lock_guard< ::boost::recursive_mutex> >,
73 typedef std::map<std::string, DataSourcePtr>::iterator
iterator;
88 DataSourcePtr make(
const std::string&
id,
const std::string& dsType,
const std::string& connInfo);
120 DataSourcePtr open(
const std::string&
id,
const std::string& dsType,
const std::string& connInfo);
154 DataSourcePtr get(
const std::string&
id,
const std::string& dsType,
const std::string& connInfo);
180 std::size_t size()
const;
283 std::map<std::string, DataSourcePtr>
m_dss;
293 return m_dss.begin();
298 return m_dss.begin();
This policy assures an object-level locking scheme for a derived class.
Template support for singleton pattern.
A class to store the proxy information that must be used to access data located in URIs.
This is a singleton for managing all data source instances available in the system.
DataSourcePtr get(const std::string &id, const std::string &dsType, const std::string &connInfo)
It searches for an opened data source with the given id or it opens a new one if it doesn't exists.
const_iterator end() const
It returns an iterator to the end of the conteiner.
DataSourcePtr open(const std::string &id, const std::string &dsType, const std::string &connInfo)
It opens the data source, makes it ready for use, stores a reference to it in the manager and returns...
std::map< std::string, DataSourcePtr >::const_iterator const_iterator
std::size_t size() const
It returns the number of data sources that the manager are keeping track of.
void insert(const DataSourcePtr &ds)
It stores the data source in the manager.
DataSourcePtr make(const std::string &id, const std::string &dsType, const te::core::URI &connInfo)
It creates a new data source, stores a reference to it in the manager and then returns a pointer to i...
void detachAll(const std::string &dsType)
All data sources of the specified type are detached from the manager.
const_iterator begin() const
It returns an iterator to the beginning of the conteiner.
DataSourcePtr make(const std::string &id, const std::string &dsType, const std::string &connInfo)
It creates a new data source, stores a reference to it in the manager and then returns a pointer to i...
void detach(const DataSourcePtr &ds)
It changes the ownership of the data source to the caller.
std::map< std::string, DataSourcePtr >::iterator iterator
DataSourcePtr get(const std::string &id, const std::string &dsType, const te::core::URI &connInfo)
It searches for an opened data source with the given id or it opens a new one if it doesn't exists.
DataSourcePtr open(const std::string &id, const std::string &dsType, const te::core::URI &connInfo)
It opens the data source, makes it ready for use, stores a reference to it in the manager and returns...
DataSourcePtr detach(const std::string &id)
It changes the ownership of the data source with the given identifier to the caller.
DataSourceManager()
It initializes the singleton instance of the data source manager.
void detachAll()
All data sources are detached from the manager.
DataSourcePtr find(const std::string &id) const
It returns the data source identified by the given id.
~DataSourceManager()
Singleton destructor.
std::map< std::string, DataSourcePtr > m_dss
The data sources kept in the manager.
boost::shared_ptr< DataSource > DataSourcePtr
#define TEDATAACCESSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Data Source for WS OGC WMS.