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

CdbRooDb Class Reference

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

#include <CdbRooDb.hh>

Inheritance diagram for CdbRooDb:

CdbSQLApi Cdb List of all members.

Public Member Functions

 CdbRooDb ()
 The default constructor.

virtual ~CdbRooDb ()
 The destructor.

virtual const char * technologyName () const
 Get the technology name of this instance.

virtual const char * implementationName () const
 Get the implementation name of this instance.

virtual void initialize ()
 Initialize the API.

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

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

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

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

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

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

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

virtual CdbStatus createObject (CdbObjectPtr &theObjectPtr, const CdbConditionPtr &theParentConditionPtr, const BdbTime &theOriginalValidityBeginTime, const BdbTime &theOriginalValidityEndTime, const BdbTime &theVisibleValidityBeginTime, const BdbTime &theVisibleValidityEndTime, const BdbTime &theDurationBeginTime, const BdbTime &theDurationEndTime, const BdbTime &theInsertionTime, const CdbSQLObjectId &theObjectId)
 Create a metadata object of a right type.

virtual CdbStatus storeObject (CdbObjectPtr &theObjectPtr, CdbObjectFactoryBase &theObjectFactory, CdbCPtr< CdbSQLCondition > &thePersistentConditionPtr, CdbCPtr< CdbSQLPartition > &thePersistentPartitionPtr, const CdbConditionPtr &theParentConditionPtr, const BdbTime &theOriginalValidityBeginTime, const BdbTime &theOriginalValidityEndTime)
 Create a persistent object (in the specified context) and store it in a database.


Protected Member Functions

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


Detailed Description

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

This implementation of the CDB API provides full access to serialized ROOT objects stored in MySQL database.

This implementation supports only one installation whose parameters (host, location, etc.) are specified either implicitly through a special environment variable:

CDB_DATABASE_PATH = "[host=[,user=[,database=[,port=]]]]"

or explicitly using the CdbEnvironment class.

The default is:

host = 'localhost' user = 'cdb' database = 'cdb' port = '3306'

DESIGN NOTE: Please, not from which base this class is deriving from. We do it in this way in order to provide the generic API implementation at the level of CdbSQl package with a mechanism of creating CdbObject-s of the right type (which is CdbRooDbObject). See the "::createObject()" below.

See also:
Cdb

CdbEnvironment

CdbSQLApi

CdbSQLApi::::createObject()

Definition at line 45 of file CdbRooDb.hh.


Constructor & Destructor Documentation

CdbRooDb::CdbRooDb  
 

The default constructor.

More details...

Definition at line 69 of file CdbRooDb.cc.

References CDB_DEBUG_STREAM, CdbRooDatabase::implementation(), Cdb::set(), and CdbRooDatabase::technology().

CdbRooDb::~CdbRooDb   [virtual]
 

The destructor.

More details...

Definition at line 94 of file CdbRooDb.cc.


Member Function Documentation

CdbStatus CdbRooDb::createObject CdbObjectPtr   theObjectPtr,
const CdbConditionPtr   theParentConditionPtr,
const BdbTime   theOriginalValidityBeginTime,
const BdbTime   theOriginalValidityEndTime,
const BdbTime   theVisibleValidityBeginTime,
const BdbTime   theVisibleValidityEndTime,
const BdbTime   theDurationBeginTime,
const BdbTime   theDurationEndTime,
const BdbTime   theInsertionTime,
const CdbSQLObjectId   theObjectId
[virtual]
 

Create a metadata object of a right type.

Implements the corresponding method from the base class or interface.

See also:
CdbSQLApi::createObject()

Implements CdbSQLApi.

Definition at line 433 of file CdbRooDb.cc.

References isInitialized(), CdbCPtr< CdbCondition, CdbAlwaysClosePolicy< CdbCondition > >::isNull(), CdbSQLObjectId::isValid(), and CdbStatus::Success.

Referenced by storeObject().

CdbStatus CdbRooDb::databaseIterator CdbDatabaseItr   theItr [virtual]
 

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

Implements the corresponding method from the base class or interface.

See also:
Cdb::databaseIterator()

Implements Cdb.

Definition at line 399 of file CdbRooDb.cc.

References CdbDatabaseItr, CdbStatus::Error, Cdb::get(), implementationName(), isInitialized(), CdbStatus::Success, and technologyName().

CdbStatus CdbRooDb::findDatabase CdbDatabasePtr   thePtr,
const char *    theName = 0
[virtual]
 

Find the specified Database.

Implements the corresponding method from the base class or interface.

See also:
Cdb::findDatabase()

Implements Cdb.

Definition at line 327 of file CdbRooDb.cc.

References CdbStatus::Error, Cdb::get(), getDefaultDatabase(), implementationName(), isInitialized(), CdbStatus::Success, and technologyName().

CdbStatus CdbRooDb::getDefaultDatabase std::string &    theDatabaseName [virtual]
 

Get default database name.

Implements the corresponding method from the base class or interface.

See also:
Cdb::getDefaultDatabase()

Implements Cdb.

Definition at line 157 of file CdbRooDb.cc.

References isInitialized(), and CdbStatus::Success.

Referenced by findDatabase().

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

Get default view name.

Implements the corresponding method from the base class or interface.

See also:
Cdb::getDefaultView()

Implements Cdb.

Definition at line 167 of file CdbRooDb.cc.

References isInitialized(), CdbStatus::NotFound, and CdbStatus::Success.

const char * CdbRooDb::implementationName   const [virtual]
 

Get the implementation name of this instance.

Implements the corresponding method from the base class or interface.

See also:
CdbAPIBase::implementationName()

Implements Cdb.

Definition at line 104 of file CdbRooDb.cc.

References CdbRooDatabase::implementation().

Referenced by databaseIterator(), and findDatabase().

void CdbRooDb::initialize   [virtual]
 

Initialize the API.

Implements the corresponding method from the base class or interface.

See also:
CdbAPIBase::initialize()

Implements Cdb.

Definition at line 110 of file CdbRooDb.cc.

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

bool CdbRooDb::isInitialized   [virtual]
 

Check if the API is initialized.

Implements the corresponding method from the base class or interface.

See also:
CdbAPIBase::isInitialized()

Implements Cdb.

Definition at line 151 of file CdbRooDb.cc.

Referenced by createObject(), databaseIterator(), findDatabase(), getDefaultDatabase(), getDefaultView(), setDefaultDatabase(), and setDefaultView().

CdbStatus CdbRooDb::setDefaultDatabase const char *    theDatabaseName [virtual]
 

Set default database name.

Implements the corresponding method from the base class or interface.

See also:
Cdb::setDefaultDatabase()

Implements Cdb.

Definition at line 204 of file CdbRooDb.cc.

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

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

Set default view name.

Implements the corresponding method from the base class or interface.

See also:
Cdb::setDefaultView()

Implements Cdb.

Definition at line 269 of file CdbRooDb.cc.

References isInitialized(), CdbStatus::NotFound, and CdbStatus::Success.

CdbStatus CdbRooDb::storeObject CdbObjectPtr   theObjectPtr,
CdbObjectFactoryBase   theObjectFactory,
CdbCPtr< CdbSQLCondition > &    thePersistentConditionPtr,
CdbCPtr< CdbSQLPartition > &    thePersistentPartitionPtr,
const CdbConditionPtr   theParentConditionPtr,
const BdbTime   theOriginalValidityBeginTime,
const BdbTime   theOriginalValidityEndTime
[virtual]
 

Create a persistent object (in the specified context) and store it in a database.

Implements the corresponding method from the base class or interface.

See also:
CdbSQLApi::storeObject()

Implements CdbSQLApi.

Definition at line 482 of file CdbRooDb.cc.

References CdbObjectFactoryBase::create(), createObject(), CdbStatus::Error, CdbCPtr< P, CLOSE_POLICY >::get(), CdbCPtr< P, CLOSE_POLICY >::isNull(), CdbCPtr< CdbObject, CdbDoNotClosePolicy< CdbObject > >::isNull(), CdbRooObjectFactory::persistentObjectPtr(), and CdbStatus::Success.

const char * CdbRooDb::technologyName   const [virtual]
 

Get the technology name of this instance.

Implements the corresponding method from the base class or interface.

See also:
CdbAPIBase::technologyName()

Implements Cdb.

Definition at line 98 of file CdbRooDb.cc.

References CdbRooDatabase::technology().

Referenced by databaseIterator(), and findDatabase().

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

Get the transaction manager and start new transaction if needed.

Implements the corresponding method from the base class or interface.

See also:
Cdb::transaction()

Implements Cdb.

Definition at line 427 of file CdbRooDb.cc.


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