Bdb packages | Design docs | Source docs | Guidelines | Recent releases

Search | Site Map .

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

BdbHandleCacheMgr Class Reference
[BdbDomainOODB]

#include <BdbHandleCacheMgr.hh>

List of all members.

Public Methods

 BdbHandleCacheMgr ()
 ~BdbHandleCacheMgr ()
d_Boolean isInCache (const char *dbName) const
d_Boolean isInCache (const char *dbName, const char *cName) const
const char * getMRUDbName () const
const char * getMRUContName () const
const char * getMRUContDbName () const
BdbStatus add (ooHandle(ooDBObj)&dbH)
BdbStatus add (const char *dbName, ooHandle(ooContObj)&contH)
BdbStatus getMRUDbHandle (BdbHandle(BdbDBObj)&db, ooMode openMode, int lockWait)
BdbStatus getMRUContHandle (BdbHandle(BdbContObj)&contH, ooMode openMode, int lockWait)
BdbStatus cleanCache ()

Private Methods

d_Boolean isInCache (BdbHandle(BdbDBObj)&db) const
d_Boolean isInCache (const char *dbName, BdbHandle(BdbContObj)&cont) const

Private Attributes

std::map< std::string, BdbDbHandleCacheEntry * > _dbEntries
std::map< std::string, BdbContHandleCacheEntry * > _contEntries

Static Private Attributes

d_Boolean _useCache = d_True
BdbDbHandleCacheEntry_mruDbEntry = 0
BdbContHandleCacheEntry_mruContEntry = 0


Constructor & Destructor Documentation

BdbHandleCacheMgr::BdbHandleCacheMgr  
 

Definition at line 56 of file BdbHandleCacheMgr.cc.

References _useCache, and d_False.

BdbHandleCacheMgr::~BdbHandleCacheMgr  
 

Definition at line 66 of file BdbHandleCacheMgr.cc.

References cleanCache().


Member Function Documentation

BdbStatus BdbHandleCacheMgr::add const char *    dbName,
ooHandle(ooContObj)&    contH
 

Definition at line 175 of file BdbHandleCacheMgr.cc.

References _contEntries, _useCache, BdbcError, BdbcSuccess, BdbIsNull, and COUT1.

BdbStatus BdbHandleCacheMgr::add ooHandle(ooDBObj)&    dbH
 

Adds the db handle to the cache

Definition at line 137 of file BdbHandleCacheMgr.cc.

References _dbEntries, _useCache, BdbcError, BdbcSuccess, BdbIsNull, COUT1, and dbH.

Referenced by BdbContAccessMgr::createContainer(), BdbContAccessMgr::openContainer(), and BdbDbAccessMgr::openDb().

BdbStatus BdbHandleCacheMgr::cleanCache  
 

Definition at line 451 of file BdbHandleCacheMgr.cc.

References BdbcSuccess, and COUT1.

Referenced by ~BdbHandleCacheMgr().

const char * BdbHandleCacheMgr::getMRUContDbName   const
 

The function returns name of the database which contains the most recently used container in the cache.

Definition at line 116 of file BdbHandleCacheMgr.cc.

References _mruContEntry, and BdbAbsHandleCacheEntry::dbName().

BdbStatus BdbHandleCacheMgr::getMRUContHandle BdbHandle(BdbContObj)&    contH,
ooMode    openMode,
int    lockWait
 

Definition at line 397 of file BdbHandleCacheMgr.cc.

References _mruContEntry, BdbDomainOODB::activeDomainOODB(), BdbcError, BdbContObj, BdbcSuccess, BdbStatus, COUT1, BdbAbsHandleCacheEntry::dbName(), getMRUContName(), BdbAbsHandleCacheEntry::isAlreadyOpen(), BdbDomainOODB::lockWait(), BdbDomainOODB::modeName(), BdbContHandleCacheEntry::setHandle(), BdbDomainOODB::setLockWait(), and BdbAbsHandleCacheEntry::setOpenMode().

Referenced by BdbContAccessMgr::createContainer(), BdbContAccessMgr::openContainer(), and BdbContAccessMgr::openDbAndCont().

const char * BdbHandleCacheMgr::getMRUContName   const
 

The function returns name of the most recently used container in the cache.

Definition at line 100 of file BdbHandleCacheMgr.cc.

References _mruContEntry, and BdbContHandleCacheEntry::contName().

Referenced by getMRUContHandle().

BdbStatus BdbHandleCacheMgr::getMRUDbHandle BdbHandle(BdbDBObj)&    db,
ooMode    openMode,
int    lockWait
 

The function sets the "db" handle to the value from _mruDbEntry. If "openMode" is != oocNoOpen, it also opens the database in the requested mode and updates the cache information.

Definition at line 348 of file BdbHandleCacheMgr.cc.

References _mruDbEntry, BdbDomainOODB::activeDomainOODB(), BdbcError, BdbcSuccess, BdbDBObj, BdbStatus, COUT1, getMRUDbName(), BdbAbsHandleCacheEntry::isAlreadyOpen(), BdbDomainOODB::lockWait(), BdbDomainOODB::modeName(), BdbDbHandleCacheEntry::setHandle(), BdbDomainOODB::setLockWait(), and BdbAbsHandleCacheEntry::setOpenMode().

Referenced by BdbDbAccessMgr::createDb(), and BdbDbAccessMgr::openDb().

const char * BdbHandleCacheMgr::getMRUDbName   const
 

The function returns name of the most recently used database in the cache.

Definition at line 85 of file BdbHandleCacheMgr.cc.

References _mruDbEntry, and BdbAbsHandleCacheEntry::dbName().

Referenced by getMRUDbHandle().

d_Boolean BdbHandleCacheMgr::isInCache const char *    dbName,
const char *    contName
const
 

Finds in the cache entry with a container "cName" in a database "dbName". It returns d_True if the entry is found. The function sets _mruContEntry (or reset it to 0 if entry not found)

Definition at line 288 of file BdbHandleCacheMgr.cc.

References _contEntries, _mruContEntry, and d_False.

d_Boolean BdbHandleCacheMgr::isInCache const char *    dbName const
 

Finds in the cache entry with a database "dbName" It returns d_True if the entry is found. The function sets _mruDbEntry (or reset it to 0 if entry not found)

Definition at line 235 of file BdbHandleCacheMgr.cc.

References _dbEntries, _mruDbEntry, and d_False.

d_Boolean BdbHandleCacheMgr::isInCache const char *    dbName,
BdbHandle(BdbContObj)&    contH
const [private]
 

Returns true if the contaner handle is already in the cache

Definition at line 321 of file BdbHandleCacheMgr.cc.

References _mruContEntry, BdbContObj, BdbIsNull, d_False, and isInCache().

d_Boolean BdbHandleCacheMgr::isInCache BdbHandle(BdbDBObj)&    db const [private]
 

Returns true if the db handle is already in the cache

Definition at line 264 of file BdbHandleCacheMgr.cc.

References _mruDbEntry, BdbDBObj, BdbIsNull, and d_False.

Referenced by BdbContAccessMgr::createContainer(), BdbDbAccessMgr::createDb(), isInCache(), BdbContAccessMgr::openContainer(), BdbDbAccessMgr::openDb(), and BdbContAccessMgr::openDbAndCont().


Member Data Documentation

std::map<std::string,BdbContHandleCacheEntry*> BdbHandleCacheMgr::_contEntries [private]
 

Definition at line 48 of file BdbHandleCacheMgr.hh.

Referenced by add(), and isInCache().

std::map<std::string,BdbDbHandleCacheEntry*> BdbHandleCacheMgr::_dbEntries [private]
 

Definition at line 47 of file BdbHandleCacheMgr.hh.

Referenced by add(), and isInCache().

BdbContHandleCacheEntry * BdbHandleCacheMgr::_mruContEntry = 0 [static, private]
 

Definition at line 53 of file BdbHandleCacheMgr.cc.

Referenced by getMRUContDbName(), getMRUContHandle(), getMRUContName(), and isInCache().

BdbDbHandleCacheEntry * BdbHandleCacheMgr::_mruDbEntry = 0 [static, private]
 

Definition at line 52 of file BdbHandleCacheMgr.cc.

Referenced by getMRUDbHandle(), getMRUDbName(), and isInCache().

d_Boolean BdbHandleCacheMgr::_useCache = d_True [static, private]
 

Definition at line 51 of file BdbHandleCacheMgr.cc.

Referenced by add(), and BdbHandleCacheMgr().


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

 


BaBar Public Site | SLAC | News | Links | Who's Who | Contact Us

Page Owner: Jacek Becla
Last Update: October 04, 2002