This is a singleton for managing all the data source catalog instances available in the system. More...
#include <DataSourceCatalogManager.h>
Public Types | |
typedef std::map< DataSourcePtr, DataSourceCatalogPtr >::const_iterator | const_iterator |
typedef std::map< DataSourcePtr, DataSourceCatalogPtr >::iterator | iterator |
typedef ObjectLevelLockingPolicy< ::boost::lock_guard< ::boost::recursive_mutex > > | LockRead |
typedef ObjectLevelLockingPolicy< ::boost::lock_guard< ::boost::recursive_mutex > > | LockWrite |
typedef volatile DataSourceCatalogManager | VolatileType |
Public Member Functions | |
const_iterator | begin () const |
It returns an iterator to the beginning of the container. More... | |
iterator | begin () |
It returns an iterator to the beginning of the container. More... | |
DataSourceCatalogPtr | create (DataSourcePtr ds) |
It creates a catalog for the given data source, loads their sequences and the information about the schemas of the datasets contained in the data source. The catalog created is registered into the manager and it is returned to the caller. More... | |
void | detach (DataSourceCatalogPtr catalog) |
It changes the ownership of the data source catalog to the caller. More... | |
DataSourceCatalogPtr | detach (const DataSourcePtr &ds) |
It changes the ownership of the data source catalog associated to the given data source. More... | |
void | detachAll (const std::string &dsType) |
All the catalogs whose data sources are of the specified type are detached from the manager. More... | |
void | detachAll () |
All the catalogs are detached from the manager. More... | |
const_iterator | end () const |
It returns an iterator to the end of the container. More... | |
iterator | end () |
It returns an iterator to the end of the container. More... | |
bool | find (const DataSourcePtr &ds) const |
It tries to find the catalog associated to the given data source. More... | |
DataSourceCatalogPtr | get (DataSourcePtr ds) |
It gets the catalog associated to the given data source. If there is no catalog registered in the manager, a catalog is created and registered in the manager. More... | |
void | insert (const DataSourceCatalogPtr &catalog) |
It inserts the data source catalog into the manager. The catalog must have a data source in order to be inserted. More... | |
std::size_t | size () const |
It returns the number of data source catalogs that the manager are keeping track of. More... | |
Static Public Member Functions | |
static DataSourceCatalogManager & | getInstance () |
It returns a reference to the singleton instance. More... | |
Protected Member Functions | |
DataSourceCatalogManager () | |
It initializes the singleton instance of the data source catalog manager. More... | |
~DataSourceCatalogManager () | |
Singleton destructor. More... | |
Private Attributes | |
std::map< DataSourcePtr, DataSourceCatalogPtr > | m_catalogs |
The catalogs registered in the manager. More... | |
Friends | |
class | te::common::Singleton< DataSourceCatalogManager > |
This is a singleton for managing all the data source catalog instances available in the system.
Definition at line 53 of file DataSourceCatalogManager.h.
typedef std::map<DataSourcePtr, DataSourceCatalogPtr>::const_iterator te::da::DataSourceCatalogManager::const_iterator |
Definition at line 63 of file DataSourceCatalogManager.h.
typedef std::map<DataSourcePtr, DataSourceCatalogPtr>::iterator te::da::DataSourceCatalogManager::iterator |
Definition at line 64 of file DataSourceCatalogManager.h.
|
inherited |
Definition at line 205 of file ThreadingPolicies.h.
|
inherited |
Definition at line 206 of file ThreadingPolicies.h.
|
inherited |
Definition at line 204 of file ThreadingPolicies.h.
|
protected |
It initializes the singleton instance of the data source catalog manager.
|
protected |
Singleton destructor.
|
inline |
It returns an iterator to the beginning of the container.
Definition at line 209 of file DataSourceCatalogManager.h.
References m_catalogs.
|
inline |
It returns an iterator to the beginning of the container.
Definition at line 214 of file DataSourceCatalogManager.h.
References m_catalogs.
DataSourceCatalogPtr te::da::DataSourceCatalogManager::create | ( | DataSourcePtr | ds | ) |
It creates a catalog for the given data source, loads their sequences and the information about the schemas of the datasets contained in the data source. The catalog created is registered into the manager and it is returned to the caller.
ds | The data source whose catalog will be created. |
Exception | It throws an exception if there is already a catalog to the given data source. |
void te::da::DataSourceCatalogManager::detach | ( | DataSourceCatalogPtr | catalog | ) |
It changes the ownership of the data source catalog to the caller.
The memory used by the given data source catalog will NOT BE released. In other words, you will take the ownership of the data source catalog.
ds | The data source catalog to be detached. |
DataSourceCatalogPtr te::da::DataSourceCatalogManager::detach | ( | const DataSourcePtr & | ds | ) |
It changes the ownership of the data source catalog associated to the given data source.
ds | The data source. |
void te::da::DataSourceCatalogManager::detachAll | ( | const std::string & | dsType | ) |
All the catalogs whose data sources are of the specified type are detached from the manager.
void te::da::DataSourceCatalogManager::detachAll | ( | ) |
All the catalogs are detached from the manager.
|
inline |
It returns an iterator to the end of the container.
Definition at line 219 of file DataSourceCatalogManager.h.
References m_catalogs.
|
inline |
It returns an iterator to the end of the container.
Definition at line 224 of file DataSourceCatalogManager.h.
References m_catalogs.
bool te::da::DataSourceCatalogManager::find | ( | const DataSourcePtr & | ds | ) | const |
It tries to find the catalog associated to the given data source.
ds | The data source whose catalog is to be found. |
DataSourceCatalogPtr te::da::DataSourceCatalogManager::get | ( | DataSourcePtr | ds | ) |
It gets the catalog associated to the given data source. If there is no catalog registered in the manager, a catalog is created and registered in the manager.
ds | The data source whose catalog is to be retrieved. |
|
staticinherited |
It returns a reference to the singleton instance.
void te::da::DataSourceCatalogManager::insert | ( | const DataSourceCatalogPtr & | catalog | ) |
It inserts the data source catalog into the manager. The catalog must have a data source in order to be inserted.
catalog | The catalog to be inserted into the manager. |
Exception | It throws an exception, if already exists a catalog for the data source of the given catalog. |
|
inline |
It returns the number of data source catalogs that the manager are keeping track of.
Definition at line 204 of file DataSourceCatalogManager.h.
References m_catalogs.
|
friend |
Definition at line 59 of file DataSourceCatalogManager.h.
|
private |
The catalogs registered in the manager.
Definition at line 201 of file DataSourceCatalogManager.h.