ATLAS Offline Software
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
pool::DbContainer Class Reference

#include <StorageSvc/DbContainer.h>

Inheritance diagram for pool::DbContainer:
Collaboration diagram for pool::DbContainer:

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...
 
DbContaineroperator= (const DbContainer &copy)
 Assignment operator. More...
 
DbContaineroperator= (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...
 
DbDatabasecontainedIn ()
 Access to the Database the container resides in. More...
 
IOODatabasedb ()
 Allow access to the Database implementation. More...
 
const IDbContainerinfo () const
 Let the implementation access the internals. More...
 
IDbContainerinfo ()
 
const DbTypeInfoobjectShape (const Guid &nam)
 Retrieve persistent type information by name. More...
 
const Tokentoken () 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 DbTypetype () const
 Inquire storage type of the handle. More...
 

Protected Types

typedef T _DataType
 Data type definition. More...
 
typedef DbHandleBase< _DataTypeBase
 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...
 

Detailed Description

Description: Definition of the object describing a database container Handle managing a DbContainerObj, which is a container of persistent objects.

Author
M.Frank
Version
1.0

Definition at line 51 of file DbContainer.h.

Member Typedef Documentation

◆ _DataType

typedef T pool::DbHandleBase::_DataType
protectedinherited

Data type definition.

Definition at line 37 of file DbHandleBase.h.

◆ Base

typedef DbHandleBase<_DataType> pool::DbHandleBase::Base
protectedinherited

Data type definition.

Definition at line 39 of file DbHandleBase.h.

Constructor & Destructor Documentation

◆ DbContainer() [1/3]

pool::DbContainer::DbContainer ( const DbType typ = POOL_StorageType)
inline

Constructor with initializing arguments.

Definition at line 77 of file DbContainer.h.

77 { m_type=typ; }

◆ DbContainer() [2/3]

pool::DbContainer::DbContainer ( const DbContainer c)
inline

Copy constructor.

Definition at line 79 of file DbContainer.h.

79 : Base() { switchPtr(c.m_ptr); }

◆ DbContainer() [3/3]

pool::DbContainer::DbContainer ( DbContainerObj ptr)
inline

Constructor taking transient object.

Definition at line 81 of file DbContainer.h.

81 { switchPtr(ptr); }

◆ ~DbContainer()

virtual pool::DbContainer::~DbContainer ( )
inlinevirtual

Standard Destructor.

Definition at line 83 of file DbContainer.h.

83 { switchPtr(0); }

Member Function Documentation

◆ _destroy()

DbStatus pool::DbContainer::_destroy ( DbObjectHandle< DbObject > &  objH)
private

Destroy the persistent representation of the object.

◆ _load()

DbStatus pool::DbContainer::_load ( DbObjectHandle< DbObject > &  objH,
const Token::OID_t linkH,
const DbTypeInfo typ,
bool  any_next 
)
private

Load object in the container identified by its link handle.

◆ _loadNext()

DbStatus pool::DbContainer::_loadNext ( DbObjectHandle< DbObject > &  objH,
Token::OID_t linkH,
const DbTypeInfo typ 
)
private

Load next object in the container identified by its link handle.

◆ _remove()

DbStatus pool::DbContainer::_remove ( DbObjectHandle< DbObject > &  objH)
private

Remove the transient representation of the object from memory.

◆ _save()

DbStatus pool::DbContainer::_save ( DbObjectHandle< DbObject > &  objH,
const DbTypeInfo typ 
)
private

Internal add of an object entry identified by its handle.

◆ _update()

DbStatus pool::DbContainer::_update ( const DbObjectHandle< DbObject > &  handle,
const DbTypeInfo typ 
)
private

Add object to the container.

◆ allocate() [1/2]

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

◆ allocate() [2/2]

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

◆ close()

DbStatus pool::DbContainer::close ( )

Close the container the handle points to.

◆ containedIn()

DbDatabase& pool::DbContainer::containedIn ( )

Access to the Database the container resides in.

◆ db()

IOODatabase* pool::DbContainer::db ( )

Allow access to the Database implementation.

◆ destroy() [1/3]

template<class T >
DbStatus pool::DbContainer::destroy ( const DbObjectHandle< T > &  objH)
inline

Destroy the persistent representation of the object.

Definition at line 187 of file DbContainer.h.

188  { DbObjectHandle<DbObject> oH(objH.ptr()); return _destroy(oH); }

◆ destroy() [2/3]

DbStatus pool::DbContainer::destroy ( const Token::OID_t linkH)

Destroy an existing persistent object identified by its handle.

◆ destroy() [3/3]

DbStatus pool::DbContainer::destroy ( DbSelect sel)

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()

DbStatus pool::DbContainer::fetch ( DbSelect sel)

Fetch next object address of the selection to set token.

◆ free()

DbStatus pool::DbContainer::free ( void *  ptr)

In place free of raw memory.

◆ getOption()

DbStatus pool::DbContainer::getOption ( DbOption refOpt)

Access options.

◆ info() [1/2]

IDbContainer* pool::DbContainer::info ( )

◆ info() [2/2]

const IDbContainer* pool::DbContainer::info ( ) const

Let the implementation access the internals.

◆ isOpen()

bool pool::DbContainer::isOpen ( ) const

Check if the container was opened.

◆ isValid()

bool pool::DbHandleBase::isValid
inlineinherited

Validity check (Objy like)

Definition at line 64 of file DbHandleBase.h.

64 { return 0 != m_ptr; }

◆ load() [1/2]

template<class T >
DbStatus pool::DbContainer::load ( DbObjectHandle< T > &  objH,
const Token::OID_t linkH,
const DbTypeInfo typ 
)
inline

Load object in the container identified by its handle.

Definition at line 198 of file DbContainer.h.

201  { return _load(objH, linkH, typ, false); }

◆ load() [2/2]

DbStatus pool::DbContainer::load ( void **  ptr,
ShapeH  shape,
const Token::OID_t lH 
)

Select object in the container identified by its handle.

◆ loadNext()

template<class T >
DbStatus pool::DbContainer::loadNext ( DbObjectHandle< T > &  objH,
Token::OID_t linkH,
const DbTypeInfo typ 
)
inline

Load object in the container identified by its handle.

Definition at line 203 of file DbContainer.h.

206  { return _loadNext(objH, linkH, typ); }

◆ name()

const std::string& pool::DbContainer::name ( ) const

Name of the container the handle is supposed to point to.

◆ objectShape()

const DbTypeInfo* pool::DbContainer::objectShape ( const Guid nam)

Retrieve persistent type information by name.

◆ open()

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.

Parameters
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.
Returns
Status code indicating success or failure.

◆ openMode()

DbAccessMode pool::DbContainer::openMode ( ) const

Mode of the handle (READ,WRITE,...)

◆ operator!()

bool pool::DbHandleBase::operator!
inlineinherited

Validity check through operator NOT.

Definition at line 59 of file DbHandleBase.h.

59 { return !isValid(); }

◆ operator->() [1/2]

T* pool::DbHandleBase::operator->
inlineinherited

Dereference operator.

Definition at line 56 of file DbHandleBase.h.

56 { return m_ptr; }

◆ operator->() [2/2]

const T* pool::DbHandleBase::operator->
inlineinherited

Definition at line 57 of file DbHandleBase.h.

57 { return m_ptr; }

◆ operator=() [1/2]

DbContainer& pool::DbContainer::operator= ( const DbContainer copy)
inline

Assignment operator.

Definition at line 85 of file DbContainer.h.

85  {
86  if ( &copy != this ) {
87  m_type = copy.m_type;
88  switchPtr( copy.m_ptr );
89  }
90  return *this;
91  }

◆ operator=() [2/2]

DbContainer& pool::DbContainer::operator= ( const int  )
inline

Assignment operator to reset the handle easily using 0.

Definition at line 93 of file DbContainer.h.

93  {
94  switchPtr(0);
95  return *this;
96  }

◆ ptr() [1/2]

T* pool::DbHandleBase::ptr
inlineinherited

Definition at line 62 of file DbHandleBase.h.

62 { return m_ptr; }

◆ ptr() [2/2]

const T* pool::DbHandleBase::ptr
inlineinherited

Access to underlying object.

Definition at line 61 of file DbHandleBase.h.

61 { return m_ptr; }

◆ refCount()

int pool::DbContainer::refCount ( ) const

Access reference counter.

◆ remove()

template<class T >
DbStatus pool::DbContainer::remove ( const DbObjectHandle< T > &  objH)
inline

Remove the transient representation of the object from memory.

Definition at line 184 of file DbContainer.h.

185  { DbObjectHandle<DbObject> oH(objH.ptr()); return _remove(oH); }

◆ save() [1/2]

DbStatus pool::DbContainer::save ( const void *  object,
ShapeH  shape,
Token::OID_t linkH 
)

Save new object in the container and return its handle.

◆ save() [2/2]

template<class T >
DbStatus pool::DbContainer::save ( DbObjectHandle< T > &  objH,
const DbTypeInfo typ 
)
inline

Add an object to the container identified by its handle.

Definition at line 190 of file DbContainer.h.

192  { DbObjectHandle<DbObject> oH(objH.ptr()); return _save(oH, typ); }

◆ select()

DbStatus pool::DbContainer::select ( DbSelect sel)

Perform selection. The statement belongs to the container afterwards.

◆ setOption()

DbStatus pool::DbContainer::setOption ( const DbOption refOpt)

Pass options to the implementation.

◆ setPtr()

void pool::DbHandleBase::setPtr ( T *  ptr)
inlineprotectedinherited

Set data pointer.

Definition at line 52 of file DbHandleBase.h.

52 { m_ptr=ptr; }

◆ setType()

void pool::DbHandleBase::setType ( const DbType typ)
inlineprotectedinherited

Set handle type.

Definition at line 50 of file DbHandleBase.h.

50 { m_type=typ; }

◆ size()

uint64_t pool::DbContainer::size ( )

Access to the size of the container.

◆ switchPtr()

void pool::DbContainer::switchPtr ( DbContainerObj obj)
private

Assign transient object properly (including reference counting)

◆ token()

const Token* pool::DbContainer::token ( ) const

Access the token of the container object.

◆ transAct()

DbStatus pool::DbContainer::transAct ( Transaction::Action  action)

Execute Database Transaction Action.

◆ type()

const DbType& pool::DbHandleBase::type
inlineinherited

Inquire storage type of the handle.

Definition at line 66 of file DbHandleBase.h.

66 { return m_type; }

◆ update() [1/3]

template<class T >
DbStatus pool::DbContainer::update ( const DbObjectHandle< T > &  objH,
const DbTypeInfo typ 
)
inline

Update an object to the container identified by its handle.

Definition at line 194 of file DbContainer.h.

196  { DbObjectHandle<DbObject> oH(objH.ptr()); return _update(oH, typ); }

◆ update() [2/3]

DbStatus pool::DbContainer::update ( const void *  object,
ShapeH  shape,
const Token::OID_t linkH 
)

Update an object to the container identified by its handle.

◆ update() [3/3]

DbStatus pool::DbContainer::update ( DbSelect sel)

Perform UPDATE statement.

Member Data Documentation

◆ m_ptr

T* pool::DbHandleBase::m_ptr
protectedinherited

Data member: Object pointer. Sub-classes need access on re-assignment.

Definition at line 41 of file DbHandleBase.h.

◆ m_type

DbType pool::DbHandleBase::m_type
protectedinherited

Data member: Technology type. Sub-classes need access on re-assignment.

Definition at line 43 of file DbHandleBase.h.


The documentation for this class was generated from the following file:
pool::DbContainer::switchPtr
void switchPtr(DbContainerObj *obj)
Assign transient object properly (including reference counting)
pool::DbContainer::_destroy
DbStatus _destroy(DbObjectHandle< DbObject > &objH)
Destroy the persistent representation of the object.
pool::DbContainer::_save
DbStatus _save(DbObjectHandle< DbObject > &objH, const DbTypeInfo *typ)
Internal add of an object entry identified by its handle.
pool::DbHandleBase< DbContainerObj >::ptr
const T * ptr() const
Access to underlying object.
Definition: DbHandleBase.h:61
pool::DbContainer::_loadNext
DbStatus _loadNext(DbObjectHandle< DbObject > &objH, Token::OID_t &linkH, const DbTypeInfo *typ)
Load next object in the container identified by its link handle.
pool::DbHandleBase< DbContainerObj >::m_type
DbType m_type
Data member: Technology type. Sub-classes need access on re-assignment.
Definition: DbHandleBase.h:43
pool::DbContainer::_remove
DbStatus _remove(DbObjectHandle< DbObject > &objH)
Remove the transient representation of the object from memory.
pool::DbHandleBase< DbContainerObj >::Base
DbHandleBase< _DataType > Base
Data type definition.
Definition: DbHandleBase.h:39
pool::DbHandleBase< DbContainerObj >::m_ptr
T * m_ptr
Data member: Object pointer. Sub-classes need access on re-assignment.
Definition: DbHandleBase.h:41
pool::DbHandleBase< DbContainerObj >::isValid
bool isValid() const
Validity check (Objy like)
Definition: DbHandleBase.h:64
pool::DbContainer::_update
DbStatus _update(const DbObjectHandle< DbObject > &handle, const DbTypeInfo *typ)
Add object to the container.
calibdata.copy
bool copy
Definition: calibdata.py:27
pool::DbContainer::_load
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.
python.compressB64.c
def c
Definition: compressB64.py:93