ATLAS Offline Software
|
#include <StorageSvc/DbContainer.h>
Public Member Functions | |
DbContainer (const DbType &typ=POOL_StorageType) | |
Constructor with initializing arguments. More... | |
DbContainer (const DbContainer &c) | |
Copy constructor. More... | |
DbContainer (DbContainerObj *ptr) | |
Constructor taking transient object. More... | |
virtual | ~DbContainer () |
Standard Destructor. More... | |
DbContainer & | operator= (const DbContainer ©) |
Assignment operator. More... | |
DbContainer & | operator= (const int) |
Assignment operator to reset the handle easily using 0. More... | |
int | refCount () const |
Access reference counter. More... | |
const std::string & | name () const |
Name of the container the handle is supposed to point to. More... | |
DbAccessMode | openMode () const |
Mode of the handle (READ,WRITE,...) More... | |
uint64_t | size () |
Access to the size of the container. More... | |
DbDatabase & | containedIn () |
Access to the Database the container resides in. More... | |
IOODatabase * | db () |
Allow access to the Database implementation. More... | |
const IDbContainer * | info () const |
Let the implementation access the internals. More... | |
IDbContainer * | info () |
const DbTypeInfo * | objectShape (const Guid &nam) |
Retrieve persistent type information by name. More... | |
const Token * | token () const |
Access the token of the container object. More... | |
DbStatus | close () |
Close the container the handle points to. More... | |
DbStatus | open (DbDatabase &dbH, const std::string &nam, const DbTypeInfo *typ, const DbType &dbtyp, DbAccessMode mod) |
Open the container residing in <file> with given name and access mode. More... | |
bool | isOpen () const |
Check if the container was opened. More... | |
DbStatus | transAct (Transaction::Action action) |
Execute Database Transaction Action. More... | |
DbStatus | setOption (const DbOption &refOpt) |
Pass options to the implementation. More... | |
DbStatus | getOption (DbOption &refOpt) |
Access options. More... | |
DbStatus | destroy (DbSelect &sel) |
Access objects through select staements. More... | |
DbStatus | update (DbSelect &sel) |
Perform UPDATE statement. More... | |
DbStatus | select (DbSelect &sel) |
Perform selection. The statement belongs to the container afterwards. More... | |
DbStatus | fetch (DbSelect &sel) |
Fetch next object address of the selection to set token. More... | |
DbStatus | allocate (const void *object, ShapeH shape, Token::OID_t &oid) |
Access objects using pointer and shape. More... | |
DbStatus | save (const void *object, ShapeH shape, Token::OID_t &linkH) |
Save new object in the container and return its handle. More... | |
DbStatus | update (const void *object, ShapeH shape, const Token::OID_t &linkH) |
Update an object to the container identified by its handle. More... | |
DbStatus | destroy (const Token::OID_t &linkH) |
Destroy an existing persistent object identified by its handle. More... | |
DbStatus | load (void **ptr, ShapeH shape, const Token::OID_t &lH) |
Select object in the container identified by its handle. More... | |
void * | allocate (unsigned long siz, const DbTypeInfo *typ) |
Access objects by handle directly. More... | |
DbStatus | free (void *ptr) |
In place free of raw memory. More... | |
template<class T > | |
DbStatus | remove (const DbObjectHandle< T > &objH) |
Remove the transient representation of the object from memory. More... | |
template<class T > | |
DbStatus | destroy (const DbObjectHandle< T > &objH) |
Destroy the persistent representation of the object. More... | |
template<class T > | |
DbStatus | save (DbObjectHandle< T > &objH, const DbTypeInfo *typ) |
Add an object to the container identified by its handle. More... | |
template<class T > | |
DbStatus | update (const DbObjectHandle< T > &objH, const DbTypeInfo *typ) |
Update an object to the container identified by its handle. More... | |
template<class T > | |
DbStatus | load (DbObjectHandle< T > &objH, const Token::OID_t &linkH, const DbTypeInfo *typ) |
Load object in the container identified by its handle. More... | |
template<class T > | |
DbStatus | loadNext (DbObjectHandle< T > &objH, Token::OID_t &linkH, const DbTypeInfo *typ) |
Load object in the container identified by its handle. 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 T | _DataType |
Data type definition. More... | |
typedef DbHandleBase< _DataType > | Base |
Data type definition. More... | |
Protected Member Functions | |
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... | |
Private Member Functions | |
void | switchPtr (DbContainerObj *obj) |
Assign transient object properly (including reference counting) More... | |
DbStatus | _load (DbObjectHandle< DbObject > &objH, const Token::OID_t &linkH, const DbTypeInfo *typ, bool any_next) |
Load object in the container identified by its link handle. More... | |
DbStatus | _loadNext (DbObjectHandle< DbObject > &objH, Token::OID_t &linkH, const DbTypeInfo *typ) |
Load next object in the container identified by its link handle. More... | |
DbStatus | _save (DbObjectHandle< DbObject > &objH, const DbTypeInfo *typ) |
Internal add of an object entry identified by its handle. More... | |
DbStatus | _update (const DbObjectHandle< DbObject > &handle, const DbTypeInfo *typ) |
Add object to the container. More... | |
DbStatus | _remove (DbObjectHandle< DbObject > &objH) |
Remove the transient representation of the object from memory. More... | |
DbStatus | _destroy (DbObjectHandle< DbObject > &objH) |
Destroy the persistent representation of the object. More... | |
Description: Definition of the object describing a database container Handle managing a DbContainerObj, which is a container of persistent objects.
Definition at line 51 of file DbContainer.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.
|
inline |
|
inline |
Constructor taking transient object.
Definition at line 81 of file DbContainer.h.
|
inlinevirtual |
|
private |
Destroy the persistent representation of the object.
|
private |
Load object in the container identified by its link handle.
|
private |
Load next object in the container identified by its link handle.
|
private |
Remove the transient representation of the object from memory.
|
private |
Internal add of an object entry identified by its handle.
|
private |
Add object to the container.
DbStatus pool::DbContainer::allocate | ( | const void * | object, |
ShapeH | shape, | ||
Token::OID_t & | oid | ||
) |
Access objects using pointer and shape.
In place allocation of object location
void* pool::DbContainer::allocate | ( | unsigned long | siz, |
const DbTypeInfo * | typ | ||
) |
Access objects by handle directly.
This is the generic "direct" object access. In place allocation of raw memory
DbStatus pool::DbContainer::close | ( | ) |
Close the container the handle points to.
DbDatabase& pool::DbContainer::containedIn | ( | ) |
Access to the Database the container resides in.
IOODatabase* pool::DbContainer::db | ( | ) |
Allow access to the Database implementation.
|
inline |
DbStatus pool::DbContainer::destroy | ( | const Token::OID_t & | linkH | ) |
Destroy an existing persistent object identified by its handle.
Access objects through select staements.
This access type is ideal for relational Databases. Other technologies only have very limited support for this interface. Perform DELETE statement
Fetch next object address of the selection to set token.
DbStatus pool::DbContainer::free | ( | void * | ptr | ) |
In place free of raw memory.
IDbContainer* pool::DbContainer::info | ( | ) |
const IDbContainer* pool::DbContainer::info | ( | ) | const |
Let the implementation access the internals.
bool pool::DbContainer::isOpen | ( | ) | const |
Check if the container was opened.
|
inlineinherited |
|
inline |
Load object in the container identified by its handle.
Definition at line 198 of file DbContainer.h.
DbStatus pool::DbContainer::load | ( | void ** | ptr, |
ShapeH | shape, | ||
const Token::OID_t & | lH | ||
) |
Select object in the container identified by its handle.
|
inline |
Load object in the container identified by its handle.
Definition at line 203 of file DbContainer.h.
const std::string& pool::DbContainer::name | ( | ) | const |
Name of the container the handle is supposed to point to.
const DbTypeInfo* pool::DbContainer::objectShape | ( | const Guid & | nam | ) |
Retrieve persistent type information by name.
DbStatus pool::DbContainer::open | ( | DbDatabase & | dbH, |
const std::string & | nam, | ||
const DbTypeInfo * | typ, | ||
const DbType & | dbtyp, | ||
DbAccessMode | mod | ||
) |
Open the container residing in <file> with given name and access mode.
dbH | [IN] Valid handle to database object |
nam | [IN] Name of the container to be opened. |
typ | [IN] Type information in the event the container must be created. |
dbtyp | [IN] Database type (including minor type) |
mod | [IN] Access mode. |
DbAccessMode pool::DbContainer::openMode | ( | ) | const |
Mode of the handle (READ,WRITE,...)
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Definition at line 57 of file DbHandleBase.h.
|
inline |
|
inline |
Assignment operator to reset the handle easily using 0.
Definition at line 93 of file DbContainer.h.
|
inlineinherited |
Definition at line 62 of file DbHandleBase.h.
|
inlineinherited |
int pool::DbContainer::refCount | ( | ) | const |
Access reference counter.
|
inline |
Remove the transient representation of the object from memory.
Definition at line 184 of file DbContainer.h.
DbStatus pool::DbContainer::save | ( | const void * | object, |
ShapeH | shape, | ||
Token::OID_t & | linkH | ||
) |
Save new object in the container and return its handle.
|
inline |
Add an object to the container identified by its handle.
Definition at line 190 of file DbContainer.h.
Perform selection. The statement belongs to the container afterwards.
Pass options to the implementation.
|
inlineprotectedinherited |
uint64_t pool::DbContainer::size | ( | ) |
Access to the size of the container.
|
private |
Assign transient object properly (including reference counting)
DbStatus pool::DbContainer::transAct | ( | Transaction::Action | action | ) |
Execute Database Transaction Action.
|
inline |
Update an object to the container identified by its handle.
Definition at line 194 of file DbContainer.h.
DbStatus pool::DbContainer::update | ( | const void * | object, |
ShapeH | shape, | ||
const Token::OID_t & | linkH | ||
) |
Update an object to the container identified by its handle.
|
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.