Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Cdb Class Reference

The starting point for the public API of the Conditions/DB. More...

#include <Cdb.hh>

Inheritance diagram for Cdb:

CdbBdbSCdb CdbBdbWCdb CdbRooRoCdb CdbSQLApi CdbRooDb List of all members.

Public Member Functions

virtual const char * technologyName () const=0
 Return the technology name.

virtual const char * implementationName () const=0
 Return the implementation name.

virtual void initialize ()=0
 Initialize the API.

virtual bool isInitialized ()=0
 Check if the API is initialized.

virtual CdbStatus getDefaultDatabase (std::string &theDatabaseName)=0
 Get default database name.

virtual CdbStatus getDefaultView (std::string &theViewName, const char *theDatabaseName)=0
 Get default view name.

virtual CdbStatus setDefaultDatabase (const char *theDatabaseName)=0
 Set default database name.

virtual CdbStatus setDefaultView (const char *theViewName, const char *theDatabaseName)=0
 Set default view name.

virtual CdbStatus findDatabase (CdbDatabasePtr &thePtr, const char *theDatabaseName=0)=0
 Find the specified Database.

virtual CdbStatus databaseIterator (CdbDatabaseItr &theItr)=0
 Initialize an instance of an iterator for the known databases names.

virtual CdbStatus registerTranslator (CdbObjectTranslator *theTranslatorPtr)
 Register a user defined "persistent-to-transient" translator.

virtual CdbStatus findTranslator (CdbCPtr< CdbObjectTranslator > &theTranslatorPtr, unsigned int theTransientTypeId, const std::string &thePersistentTypeName) const
 Find a user defined "persistent-to-transient" translator.


Static Public Member Functions

CdbPtr instance (const char *theTechnologyName=0, const char *theImplementationName=0)
 The API locator.


Protected Member Functions

 Cdb ()
 The default constructor.

virtual ~Cdb ()
 The destructor.

CdbStatus set (CdbPtr &thePtr)
 Add a new entry to the registry.

CdbStatus get (CdbPtr &thePtr, const char *theTechnologyName, const char *theImplementationName)
 Find an entry matching specified keys in the registry.

virtual CdbTransactionBasetransaction (CdbTransaction::Mode theMode) const=0
 Get the transaction manager and start new transaction if needed.


Friends

class CdbCPtrBase< Cdb >
class CdbTransaction

Detailed Description

The starting point for the public API of the Conditions/DB.

This is an abstract class also providing a factory interface. Its main function is to locate the right instance of the Conditions/DB API.

The second group of functionality is location of persistent databases in the store.

Definition at line 25 of file Cdb.hh.


Constructor & Destructor Documentation

Cdb::Cdb   [protected]
 

The default constructor.

More details...

Definition at line 17 of file Cdb.cc.

Cdb::~Cdb   [protected, virtual]
 

The destructor.

The destructor is protected to prevent clients from deleting objects which may be shared with others.

Definition at line 21 of file Cdb.cc.


Member Function Documentation

virtual CdbStatus Cdb::databaseIterator CdbDatabaseItr   theItr [pure virtual]
 

Initialize an instance of an iterator for the known databases names.

This method is supposed to be implemented by subclasses.

The iterator will be set into a "valid" state upon successfull completion.

See also:
CdbIItr::isValid()

CdbDatabase

CdbDatabaseItr

CdbStatus

Returns:
completion status

Implemented in CdbBdbWCdb, CdbBdbSCdb, CdbRooRoCdb, and CdbRooDb.

virtual CdbStatus Cdb::findDatabase CdbDatabasePtr   thePtr,
const char *    theDatabaseName = 0
[pure virtual]
 

Find the specified Database.

This method is supposed to be implemented by subclasses.

This method initializes a smart pointer to a transient object of the CdbDatabase class representing the found database. It will initialize the smart pointer to point onto 0 and return the corresponding error status when specified object is not found or is not awailable for some other reason.

The database is specified through its name. If the name is not specified then the default database will be found and open.

See also:
CdbDatabase

CdbDatabasePtr

CdbStatus

Returns:
a completion status of the operation
Parameters:
thePtr  a smart pointer to set up
theDatabaseName  the database name

Implemented in CdbBdbWCdb, CdbBdbSCdb, CdbRooRoCdb, and CdbRooDb.

CdbStatus Cdb::findTranslator CdbCPtr< CdbObjectTranslator > &    theTranslatorPtr,
unsigned int    theTransientTypeId,
const std::string &    thePersistentTypeName
const [virtual]
 

Find a user defined "persistent-to-transient" translator.

The method will look for the translator matching the specified transient type identifier and the persistent type. The translator is supposed to be registered for the current technology/implementation of the CDB API using the Cdb::registerTranslator() method.

See also:
class CdbType2Id

Cdb::registerTranslator()

Definition at line 96 of file Cdb.cc.

References CdbCPtr< P, CLOSE_POLICY >::isNull(), CdbStatus::NotFound, and CdbStatus::Success.

CdbStatus Cdb::get CdbPtr   thePtr,
const char *    theTechnologyName,
const char *    theImplementationName
[protected]
 

Find an entry matching specified keys in the registry.

This _proxy_ method is meant to be used by subclasses to find themselves in the dictionary through the dictionary's protected interface.

See also:
CdbEnvironment::get()

Definition at line 31 of file Cdb.cc.

Referenced by CdbRooRoCdb::databaseIterator(), CdbRooDb::databaseIterator(), CdbBdbWCdb::databaseIterator(), CdbBdbSCdb::databaseIterator(), CdbRooRoCdb::findDatabase(), CdbRooDb::findDatabase(), CdbBdbWCdb::findDatabase(), and CdbBdbSCdb::findDatabase().

virtual CdbStatus Cdb::getDefaultDatabase std::string &    theDatabaseName [pure virtual]
 

Get default database name.

This method is supposed to be implemented by subclasses.

Parameters:
theDatabaseName  the database name to be returned

Implemented in CdbBdbWCdb, CdbBdbSCdb, CdbRooRoCdb, and CdbRooDb.

virtual CdbStatus Cdb::getDefaultView std::string &    theViewName,
const char *    theDatabaseName
[pure virtual]
 

Get default view name.

This method is supposed to be implemented by subclasses.

NOTE: 0 pointer is NOT allowed where the database name is expected.

Parameters:
theViewName  the view name to be returned
theDatabaseName  the scope of the operation

Implemented in CdbBdbWCdb, CdbBdbSCdb, CdbRooRoCdb, and CdbRooDb.

virtual const char* Cdb::implementationName   const [pure virtual]
 

Return the implementation name.

This method has to be implemented by subclasses.

Implemented in CdbBdbWCdb, CdbBdbSCdb, CdbRooRoCdb, and CdbRooDb.

virtual void Cdb::initialize   [pure virtual]
 

Initialize the API.

This method needs to be called at least once during the lifetime of the API's implementation to have it properly functioning. The main reason to do this initialization explicitly is to avoid "initialization upon construction", which is not welcome by certain clients of CDB API.

See also:
Cdb::isInitialized()
This method has to be implemented by subclasses.

Implemented in CdbBdbWCdb, CdbBdbSCdb, CdbRooRoCdb, and CdbRooDb.

CdbPtr Cdb::instance const char *    theTechnologyName = 0,
const char *    theImplementationName = 0
[static]
 

The API locator.

Its only parameter is meant to specify which concrete instance is to be returned. If it's ommited then the default value will be used This default is a subject of the job's run-time configuration.

See also:
Cdb::technologyName()

Cdb::implementationName()

Cdb::defaultTechnologyName()

Cdb::defaultImplementationName()

Returns:
a smart pointer to the interface. The 0 is returned in case of errors.
Parameters:
theTechnologyName  a value of the 1-st key
theImplementationName  a value of the 2-d key

Definition at line 41 of file Cdb.cc.

References CdbEnvironment::getDefaultImplementation(), CdbEnvironment::getDefaultTechnology(), and CdbStatus::Success.

Referenced by CdbTransaction::CdbTransaction(), CdbDatabase::instance(), main(), and CdbPayloadUtils::registerTranslator().

virtual bool Cdb::isInitialized   [pure virtual]
 

Check if the API is initialized.

This method can be used to check the current status of an API implementation.

See also:
Cdb::initialize()
This method has to be implemented by subclasses.

Implemented in CdbBdbWCdb, CdbBdbSCdb, CdbRooRoCdb, and CdbRooDb.

CdbStatus Cdb::registerTranslator CdbObjectTranslator   theTranslatorPtr [virtual]
 

Register a user defined "persistent-to-transient" translator.

A non-zero pointer is expected as a value of the method's parameter. Also, note that the method will take an ownership of the passed object.

See also:
class CdbObjectTranslator

Definition at line 90 of file Cdb.cc.

CdbStatus Cdb::set CdbPtr   thePtr [protected]
 

Add a new entry to the registry.

This _proxy_ method is meant to be used by subclasses to register themselves in the dictionary through the dictionary's protected interface.

See also:
CdbEnvironment::set()

Definition at line 25 of file Cdb.cc.

Referenced by CdbBdbSCdb::CdbBdbSCdb(), CdbBdbWCdb::CdbBdbWCdb(), CdbRooDb::CdbRooDb(), and CdbRooRoCdb::CdbRooRoCdb().

virtual CdbStatus Cdb::setDefaultDatabase const char *    theDatabaseName [pure virtual]
 

Set default database name.

NOTE: 0 pointers or empty strings ("") are NOT allowed as values of parameters.

This method is supposed to be implemented by subclasses.

Parameters:
theDatabaseName  the database name to be set

Implemented in CdbBdbWCdb, CdbBdbSCdb, CdbRooRoCdb, and CdbRooDb.

virtual CdbStatus Cdb::setDefaultView const char *    theViewName,
const char *    theDatabaseName
[pure virtual]
 

Set default view name.

NOTE: 0 pointers or empty strings ("") are NOT allowed as values of parameters.

This method is supposed to be implemented by subclasses.

Parameters:
theViewName  the view name to be returned
theDatabaseName  the scope of the operation

Implemented in CdbBdbWCdb, CdbBdbSCdb, CdbRooRoCdb, and CdbRooDb.

virtual const char* Cdb::technologyName   const [pure virtual]
 

Return the technology name.

This method has to be implemented by subclasses.

Implemented in CdbBdbWCdb, CdbBdbSCdb, CdbRooRoCdb, and CdbRooDb.

virtual CdbTransactionBase* Cdb::transaction CdbTransaction::Mode    theMode const [protected, pure virtual]
 

Get the transaction manager and start new transaction if needed.

This method is used by the CdbTransaction class in implementing the technology-neutral transaction management. Calling this method and returning a non-zero object will ensure an existince of transaction of the specified more. The object's ownership is also returned along with the object. When the object gets destroyed then the transaction should return to its previous state (the one before calling this method).

The method is supposed to be implemented by technology-specific implementations of the current class. Any errors during the method's execution should be reported in a form of the 0 pointer.

See also:
class CdbTransactionBase

class CdbTransaction

Implemented in CdbBdbWCdb, CdbBdbSCdb, CdbRooRoCdb, and CdbRooDb.


Friends And Related Function Documentation

friend class CdbCPtrBase< Cdb > [friend]
 

Definition at line 27 of file Cdb.hh.

friend class CdbTransaction [friend]
 

Definition at line 233 of file Cdb.hh.


The documentation for this class was generated from the following files:
Generated on Mon Dec 5 18:22:17 2005 for CDB by doxygen1.3-rc3