ATLAS Offline Software
|
#include <StorageSvc/DbDatabase.h>
Public Member Functions | |
DbDatabase (const DbType &typ=POOL_StorageType) | |
Constructor with initializing arguments. More... | |
DbDatabase (const DbDatabase &cp) | |
Copy constructor. More... | |
DbDatabase (DbDatabaseObj *obj) | |
Constructor. More... | |
virtual | ~DbDatabase () |
Standard destructor. More... | |
DbDatabase & | operator= (const DbDatabase ©) |
Assignment (copy) operator. More... | |
DbDatabase & | operator= (const int) |
Assignment operator to reset handle using 0. More... | |
int | refCount () const |
Access reference counter. More... | |
DbAccessMode | openMode () const |
Access to access mode member. More... | |
const std::string & | name () const |
Access to db name (FID) More... | |
void | setName (const std::string &nam) |
Set db name (FID) after opening in case opening happened by PFN. More... | |
const std::string & | logon () const |
Access to db logon string. More... | |
long long int | size () |
Access the size of the database: May be undefined for some technologies. More... | |
IOODatabase * | db () |
Allow access to the Database implementation. More... | |
const IOODatabase * | db () const |
DbStatus | add (const std::string &name, DbContainerObj *cnt) |
Add domain to session. More... | |
DbStatus | remove (const DbContainerObj *cnt) |
Find domain in session. More... | |
const DbContainerObj * | find (const std::string &nam) const |
Select container object in Database. More... | |
DbContainerObj * | find (const std::string &nam) |
Select container object in Database. More... | |
const Token * | token () const |
Access the token of the database object. More... | |
const DbDomain & | containedIn () const |
Access to domain object. More... | |
DbDomain & | containedIn () |
bool | exist (DbDomain &domH, const std::string &nam) const |
Check for existence of Database within domain. More... | |
DbStatus | open (DbDomain &domH, const std::string &pfn, const std::string &fid, DbAccessMode mode=pool::READ) |
Open Database using given domain. More... | |
DbStatus | reopen (DbAccessMode mode=pool::READ) |
Re-open database with changing access permissions. More... | |
DbStatus | close () |
Close Database. More... | |
DbStatus | retire () |
End database access, but still leave database accessible. More... | |
bool | isOpen () const |
Check if the database was opened. More... | |
DbStatus | transAct (Transaction::Action action) |
Commit/Rollback Database Transaction. More... | |
DbStatus | setOption (const DbOption &refOpt) |
Set options. More... | |
DbStatus | getOption (DbOption &refOpt) |
Access options. More... | |
DbStatus | addParam (const std::string &nam, const std::string &val) |
Add a persistent parameter to the file. More... | |
int | nParam () |
Retrieve the number of user parameters. More... | |
DbStatus | param (const std::string &nam, std::string &val) |
Retrieve existing parameter by name. More... | |
DbStatus | params (Parameters &vals) |
Retrieve all parameters. More... | |
DbStatus | read (const Token &token, ShapeH shape, void **object) |
read an object referenced by the token More... | |
DbStatus | getLink (const Token::OID_t &oid, Token *pTok) |
Expand OID into a full Token, based on the Links table. More... | |
std::string | cntName (Token &token) |
Retrieve container name from link container (using token oid, rather than contID) More... | |
DbStatus | makeLink (Token *pToken, Token::OID_t &linkH) |
Add association link to link container. More... | |
DbStatus | addShape (const DbTypeInfo *pShape) |
Add persistent shape to the Database. More... | |
const DbTypeInfo * | objectShape (const RootType &typeH) |
Retrieve persistent type information by class handle. More... | |
const DbTypeInfo * | objectShape (const Guid &nam) |
Retrieve persistent type information by name. More... | |
const DbTypeInfo * | contShape (const std::string &nam) |
Retrieve persistent type information by container. More... | |
const Token * | cntToken (const std::string &cntName) |
Access local container token (if container exists) More... | |
DbStatus | containers (std::vector< const Token * > &conts, bool intern=false) |
Allow access to all known containers. More... | |
DbStatus | containers (std::vector< IDbContainer * > &conts, bool intern=false) |
DbStatus | associations (std::vector< const Token * > &assocs) |
Allow access to all known associations between containers. More... | |
DbStatus | shapes (std::vector< const DbTypeInfo * > &shaps) |
Allow access to all known shapes used by the database. More... | |
IDbDatabase * | info () |
Let the implementation access the internals. More... | |
const IDbDatabase * | info () const |
void | setAge (int value) |
Update database age. More... | |
int | age () const |
Access age value. More... | |
T * | operator-> () |
Dereference operator. More... | |
const T * | operator-> () const |
bool | operator! () const |
Validity check through operator NOT. More... | |
const T * | ptr () const |
Access to underlying object. More... | |
T * | ptr () |
bool | isValid () const |
Validity check (Objy like) More... | |
const DbType & | type () const |
Inquire storage type of the handle. More... | |
Protected Types | |
typedef std::pair< std::string, std::string > | Parameter |
Parameter definition. More... | |
typedef std::vector< Parameter > | Parameters |
Parameter container definition. More... | |
typedef T | _DataType |
Data type definition. More... | |
typedef DbHandleBase< _DataType > | Base |
Data type definition. More... | |
Protected Member Functions | |
void | switchPtr (DbDatabaseObj *obj) |
Assign transient object properly (including reference counting) More... | |
void | setType (const DbType &typ) |
Set handle type. More... | |
void | setPtr (T *ptr) |
Set data pointer. More... | |
Protected Attributes | |
T * | m_ptr |
Data member: Object pointer. Sub-classes need access on re-assignment. More... | |
DbType | m_type |
Data member: Technology type. Sub-classes need access on re-assignment. More... | |
Description: Handle managing a DbDatabaseObj, a generic Database object.
Definition at line 53 of file DbDatabase.h.
|
protectedinherited |
Data type definition.
Definition at line 37 of file DbHandleBase.h.
|
protectedinherited |
Data type definition.
Definition at line 39 of file DbHandleBase.h.
|
protected |
Parameter definition.
Definition at line 56 of file DbDatabase.h.
|
protected |
Parameter container definition.
Definition at line 58 of file DbDatabase.h.
|
inline |
|
inline |
|
inlinevirtual |
DbStatus pool::DbDatabase::add | ( | const std::string & | name, |
DbContainerObj * | cnt | ||
) |
Add domain to session.
Add a persistent parameter to the file.
DbStatus pool::DbDatabase::addShape | ( | const DbTypeInfo * | pShape | ) |
Add persistent shape to the Database.
int pool::DbDatabase::age | ( | ) | const |
Access age value.
Allow access to all known associations between containers.
DbStatus pool::DbDatabase::close | ( | ) |
Close Database.
std::string pool::DbDatabase::cntName | ( | Token & | token | ) |
Retrieve container name from link container (using token oid, rather than contID)
Access local container token (if container exists)
DbDomain& pool::DbDatabase::containedIn | ( | ) |
Allow access to all known containers.
DbStatus pool::DbDatabase::containers | ( | std::vector< IDbContainer * > & | conts, |
bool | intern = false |
||
) |
const DbTypeInfo* pool::DbDatabase::contShape | ( | const std::string & | nam | ) |
Retrieve persistent type information by container.
IOODatabase* pool::DbDatabase::db | ( | ) |
Allow access to the Database implementation.
const IOODatabase* pool::DbDatabase::db | ( | ) | const |
Check for existence of Database within domain.
DbContainerObj* pool::DbDatabase::find | ( | const std::string & | nam | ) |
Select container object in Database.
const DbContainerObj* pool::DbDatabase::find | ( | const std::string & | nam | ) | const |
Select container object in Database.
DbStatus pool::DbDatabase::getLink | ( | const Token::OID_t & | oid, |
Token * | pTok | ||
) |
Expand OID into a full Token, based on the Links table.
Access options.
refOpt | [IN] Reference to option object. |
IDbDatabase* pool::DbDatabase::info | ( | ) |
Let the implementation access the internals.
const IDbDatabase* pool::DbDatabase::info | ( | ) | const |
bool pool::DbDatabase::isOpen | ( | ) | const |
Check if the database was opened.
|
inlineinherited |
const std::string& pool::DbDatabase::logon | ( | ) | const |
Access to db logon string.
DbStatus pool::DbDatabase::makeLink | ( | Token * | pToken, |
Token::OID_t & | linkH | ||
) |
Add association link to link container.
const std::string& pool::DbDatabase::name | ( | ) | const |
Access to db name (FID)
int pool::DbDatabase::nParam | ( | ) |
Retrieve the number of user parameters.
const DbTypeInfo* pool::DbDatabase::objectShape | ( | const Guid & | nam | ) |
Retrieve persistent type information by name.
const DbTypeInfo* pool::DbDatabase::objectShape | ( | const RootType & | typeH | ) |
Retrieve persistent type information by class handle.
DbStatus pool::DbDatabase::open | ( | DbDomain & | domH, |
const std::string & | pfn, | ||
const std::string & | fid, | ||
DbAccessMode | mode = pool::READ |
||
) |
Open Database using given domain.
domH | [IN] Valid handle to domain object. |
pfn | [IN] Physical file name of the database. |
lfn | [IN] Logical file name of the database. |
mode | [IN] Open mode (Default=READ). |
DbAccessMode pool::DbDatabase::openMode | ( | ) | const |
Access to access mode member.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Definition at line 57 of file DbHandleBase.h.
|
inline |
|
inline |
Assignment operator to reset handle using 0.
Definition at line 80 of file DbDatabase.h.
Retrieve existing parameter by name.
DbStatus pool::DbDatabase::params | ( | Parameters & | vals | ) |
Retrieve all parameters.
|
inlineinherited |
Definition at line 62 of file DbHandleBase.h.
|
inlineinherited |
read an object referenced by the token
int pool::DbDatabase::refCount | ( | ) | const |
Access reference counter.
DbStatus pool::DbDatabase::remove | ( | const DbContainerObj * | cnt | ) |
Find domain in session.
DbStatus pool::DbDatabase::reopen | ( | DbAccessMode | mode = pool::READ | ) |
Re-open database with changing access permissions.
mode | [IN] Open mode (Valid modes are READ, UPDATE). |
DbStatus pool::DbDatabase::retire | ( | ) |
End database access, but still leave database accessible.
void pool::DbDatabase::setAge | ( | int | value | ) |
Update database age.
void pool::DbDatabase::setName | ( | const std::string & | nam | ) |
Set db name (FID) after opening in case opening happened by PFN.
Set options.
refOpt | [IN] Reference to option object. |
|
inlineprotectedinherited |
DbStatus pool::DbDatabase::shapes | ( | std::vector< const DbTypeInfo * > & | shaps | ) |
Allow access to all known shapes used by the database.
long long int pool::DbDatabase::size | ( | ) |
Access the size of the database: May be undefined for some technologies.
|
protected |
Assign transient object properly (including reference counting)
DbStatus pool::DbDatabase::transAct | ( | Transaction::Action | action | ) |
Commit/Rollback Database Transaction.
action | [IN] action to perform |
|
protectedinherited |
Data member: Object pointer. Sub-classes need access on re-assignment.
Definition at line 41 of file DbHandleBase.h.
|
protectedinherited |
Data member: Technology type. Sub-classes need access on re-assignment.
Definition at line 43 of file DbHandleBase.h.