te::da::DataSourceCatalogManager Class Reference

This is a singleton for managing all the data source catalog instances available in the system. More...

#include <DataSourceCatalogManager.h>

Inheritance diagram for te::da::DataSourceCatalogManager:
te::common::ObjectLevelLockable< DataSourceCatalogManager, ::boost::recursive_mutex, ::boost::lock_guard< ::boost::recursive_mutex >, ::boost::lock_guard< ::boost::recursive_mutex > > te::common::Singleton< DataSourceCatalogManager >

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 DataSourceCatalogManagergetInstance ()
 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, DataSourceCatalogPtrm_catalogs
 The catalogs registered in the manager. More...
 

Friends

class te::common::Singleton< DataSourceCatalogManager >
 

Detailed Description

This is a singleton for managing all the data source catalog instances available in the system.

See also
DataSource, DataSourceCatalog, te::common::Singleton

Definition at line 53 of file DataSourceCatalogManager.h.

Member Typedef Documentation

◆ const_iterator

◆ iterator

◆ LockRead

typedef ObjectLevelLockingPolicy<::boost::lock_guard< ::boost::recursive_mutex > > te::common::ObjectLevelLockable< DataSourceCatalogManager , ::boost::recursive_mutex , ::boost::lock_guard< ::boost::recursive_mutex > , ::boost::lock_guard< ::boost::recursive_mutex > >::LockRead
inherited

Definition at line 205 of file ThreadingPolicies.h.

◆ LockWrite

typedef ObjectLevelLockingPolicy<::boost::lock_guard< ::boost::recursive_mutex > > te::common::ObjectLevelLockable< DataSourceCatalogManager , ::boost::recursive_mutex , ::boost::lock_guard< ::boost::recursive_mutex > , ::boost::lock_guard< ::boost::recursive_mutex > >::LockWrite
inherited

Definition at line 206 of file ThreadingPolicies.h.

◆ VolatileType

typedef volatile DataSourceCatalogManager te::common::ObjectLevelLockable< DataSourceCatalogManager , ::boost::recursive_mutex , ::boost::lock_guard< ::boost::recursive_mutex > , ::boost::lock_guard< ::boost::recursive_mutex > >::VolatileType
inherited

Definition at line 204 of file ThreadingPolicies.h.

Constructor & Destructor Documentation

◆ DataSourceCatalogManager()

te::da::DataSourceCatalogManager::DataSourceCatalogManager ( )
protected

It initializes the singleton instance of the data source catalog manager.

◆ ~DataSourceCatalogManager()

te::da::DataSourceCatalogManager::~DataSourceCatalogManager ( )
protected

Singleton destructor.

Member Function Documentation

◆ begin() [1/2]

DataSourceCatalogManager::const_iterator te::da::DataSourceCatalogManager::begin ( ) const
inline

It returns an iterator to the beginning of the container.

Returns
A constant iterator to the beginning of the container.

Definition at line 209 of file DataSourceCatalogManager.h.

References m_catalogs.

◆ begin() [2/2]

DataSourceCatalogManager::iterator te::da::DataSourceCatalogManager::begin ( )
inline

It returns an iterator to the beginning of the container.

Returns
An iterator to the beginning of the container.

Definition at line 214 of file DataSourceCatalogManager.h.

References m_catalogs.

◆ create()

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.

Parameters
dsThe data source whose catalog will be created.
Returns
A pointer to the new data source catalog.
Exceptions
ExceptionIt throws an exception if there is already a catalog to the given data source.
Note
Thread-safe!

◆ detach() [1/2]

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.

Parameters
dsThe data source catalog to be detached.
Note
Thread-safe!

◆ detach() [2/2]

DataSourceCatalogPtr te::da::DataSourceCatalogManager::detach ( const DataSourcePtr ds)

It changes the ownership of the data source catalog associated to the given data source.

Parameters
dsThe data source.
Returns
The catalog associated to the given data source. The caller will take the ownership of this catalog.
Note
Thread-safe!

◆ detachAll() [1/2]

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.

Note
Thread-safe!

◆ detachAll() [2/2]

void te::da::DataSourceCatalogManager::detachAll ( )

All the catalogs are detached from the manager.

Note
Thread-safe!

◆ end() [1/2]

DataSourceCatalogManager::const_iterator te::da::DataSourceCatalogManager::end ( ) const
inline

It returns an iterator to the end of the container.

Returns
An iterator to the beginning of the container.

Definition at line 219 of file DataSourceCatalogManager.h.

References m_catalogs.

◆ end() [2/2]

DataSourceCatalogManager::iterator te::da::DataSourceCatalogManager::end ( )
inline

It returns an iterator to the end of the container.

Returns
An iterator to the beginning of the container.

Definition at line 224 of file DataSourceCatalogManager.h.

References m_catalogs.

◆ find()

bool te::da::DataSourceCatalogManager::find ( const DataSourcePtr ds) const

It tries to find the catalog associated to the given data source.

Parameters
dsThe data source whose catalog is to be found.
Returns
True, if the catalog associated to the data source is found; otherwise, it returns false.
Note
Thread-safe!

◆ get()

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.

Parameters
dsThe data source whose catalog is to be retrieved.
Returns
The catalog associated to the data source.
Note
Thread-safe!

◆ getInstance()

DataSourceCatalogManager & te::common::Singleton< DataSourceCatalogManager >::getInstance ( )
inlinestaticinherited

It returns a reference to the singleton instance.

Returns
A reference to the singleton instance.

Definition at line 126 of file Singleton.h.

◆ insert()

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.

Parameters
catalogThe catalog to be inserted into the manager.
Note
The manager will take the ownership of the catalog.
Exceptions
ExceptionIt throws an exception, if already exists a catalog for the data source of the given catalog.
Note
Thread-safe!

◆ size()

std::size_t te::da::DataSourceCatalogManager::size ( ) const
inline

It returns the number of data source catalogs that the manager are keeping track of.

Returns
The number of tracked data source catalogs.

Definition at line 204 of file DataSourceCatalogManager.h.

References m_catalogs.

Friends And Related Function Documentation

◆ te::common::Singleton< DataSourceCatalogManager >

Definition at line 59 of file DataSourceCatalogManager.h.

Member Data Documentation

◆ m_catalogs

std::map<DataSourcePtr, DataSourceCatalogPtr> te::da::DataSourceCatalogManager::m_catalogs
private

The catalogs registered in the manager.

Definition at line 201 of file DataSourceCatalogManager.h.

Referenced by begin(), end(), and size().


The documentation for this class was generated from the following file: