ATLAS Offline Software
Loading...
Searching...
No Matches
pool::DbContainer Class Reference

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

#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.
 DbContainer (const DbContainer &c)
 Copy constructor.
 DbContainer (DbContainerObj *ptr)
 Constructor taking transient object.
virtual ~DbContainer ()
 Standard Destructor.
DbContaineroperator= (const DbContainer &copy)
 Assignment operator.
DbContaineroperator= (const int)
 Assignment operator to reset the handle easily using 0.
int refCount () const
 Access reference counter.
const std::string & name () const
 Name of the container the handle is supposed to point to.
DbAccessMode openMode () const
 Mode of the handle (READ,WRITE,...)
uint64_t size ()
 Access to the size of the container.
DbDatabasecontainedIn ()
 Access to the Database the container resides in.
const IDbContainerinfo () const
 Let the implementation access the internals.
IDbContainerinfo ()
const DbTypeInfoobjectShape (const Guid &nam)
 Retrieve persistent type information by name.
const Tokentoken () const
 Access the token of the container object.
DbStatus close ()
 Close the container the handle points to.
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.
DbStatus checkAccess (DbDatabase &dbH, const std::string &nam, const DbType &dbtyp)
 Check if we can access the residing in <file> container for reading with the given type.
bool isOpen () const
 Check if the container was opened.
DbStatus transAct (Transaction::Action action)
 Execute Database Transaction Action.
DbStatus setOption (const DbOption &refOpt)
 Pass options to the implementation.
DbStatus getOption (DbOption &refOpt)
 Access options.
DbStatus select (DbSelect &sel)
 Access objects through select staements.
DbStatus fetch (DbSelect &sel)
 Fetch next object address of the selection to set token.
DbStatus allocate (const void *object, ShapeH shape, Token::OID_t &oid)
 Access objects using pointer and shape.
DbStatus load (void **ptr, ShapeH shape, const Token::OID_t &lH)
 Select object in the container identified by its handle.
DbStatus store (const void *object, const DbTypeInfo *typ)
 Access objects by handle directly.
DbContainerObjoperator-> ()
 Dereference operator.
bool operator! () const
 Validity check through operator NOT.
const DbContainerObjptr () const
 Access to underlying object.
bool isValid () const
 Validity check (Objy like)
const DbTypetype () const
 Inquire storage type of the handle.

Protected Types

typedef DbContainerObj _DataType
 Data type definition.
typedef DbHandleBase< _DataTypeBase
 Data type definition.

Protected Member Functions

void setType (const DbType &typ)
 Set handle type.
void setPtr (DbContainerObj *ptr)
 Set data pointer.

Protected Attributes

DbContainerObjm_ptr
 Data member: Object pointer. Sub-classes need access on re-assignment.
DbType m_type
 Data member: Technology type. Sub-classes need access on re-assignment.

Private Member Functions

void switchPtr (DbContainerObj *obj)
 Assign transient object properly (including reference counting)

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 48 of file DbContainer.h.

Member Typedef Documentation

◆ _DataType

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

Data type definition.

Definition at line 34 of file DbHandleBase.h.

◆ Base

Data type definition.

Definition at line 36 of file DbHandleBase.h.

Constructor & Destructor Documentation

◆ DbContainer() [1/3]

pool::DbContainer::DbContainer ( const DbType & typ = POOL_StorageType)
inlineexplicit

Constructor with initializing arguments.

Definition at line 55 of file DbContainer.h.

◆ DbContainer() [2/3]

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

Copy constructor.

Definition at line 57 of file DbContainer.h.

57: Base() { switchPtr(c.m_ptr); }
void switchPtr(DbContainerObj *obj)
Assign transient object properly (including reference counting)
DbHandleBase< _DataType > Base

◆ DbContainer() [3/3]

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

Constructor taking transient object.

Definition at line 59 of file DbContainer.h.

59{ switchPtr(ptr); }
const DbContainerObj * ptr() const

◆ ~DbContainer()

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

Standard Destructor.

Definition at line 61 of file DbContainer.h.

61{ switchPtr(0); }

Member Function Documentation

◆ allocate()

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

◆ checkAccess()

DbStatus pool::DbContainer::checkAccess ( DbDatabase & dbH,
const std::string & nam,
const DbType & dbtyp )

Check if we can access the residing in <file> container for reading with the given type.

Parameters
dbH[IN] Valid handle to database object
nam[IN] Name of the container to be opened.
dbtyp[IN] Database type (including minor type)
Returns
Status code indicating success or failure.

◆ 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.

◆ fetch()

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

Fetch next object address of the selection to set token.

◆ 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< DbContainerObj >::isValid ( ) const
inlineinherited

Validity check (Objy like)

Definition at line 68 of file DbHandleBase.h.

68{ return 0 != m_ptr; }
Description: Definition of the generic database object handle.

◆ load()

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

Select object in the container identified by its handle.

◆ 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< DbContainerObj >::operator! ( ) const
inlineinherited

Validity check through operator NOT.

Definition at line 63 of file DbHandleBase.h.

63{ return !isValid(); }

◆ operator->()

DbContainerObj * pool::DbHandleBase< DbContainerObj >::operator-> ( )
inlineinherited

Dereference operator.

Definition at line 60 of file DbHandleBase.h.

60{ return m_ptr; }

◆ operator=() [1/2]

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

Assignment operator.

Definition at line 63 of file DbContainer.h.

63 {
64 if ( &copy != this ) {
65 m_type = copy.m_type;
66 switchPtr( copy.m_ptr );
67 }
68 return *this;
69 }
bool copy
Definition calibdata.py:26

◆ operator=() [2/2]

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

Assignment operator to reset the handle easily using 0.

Definition at line 71 of file DbContainer.h.

71 {
72 switchPtr(0);
73 return *this;
74 }

◆ ptr()

const DbContainerObj * pool::DbHandleBase< DbContainerObj >::ptr ( ) const
inlineinherited

Access to underlying object.

Definition at line 65 of file DbHandleBase.h.

65{ return m_ptr; }

◆ refCount()

int pool::DbContainer::refCount ( ) const

Access reference counter.

◆ select()

DbStatus pool::DbContainer::select ( 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 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< DbContainerObj >::setPtr ( DbContainerObj * ptr)
inlineprotectedinherited

Set data pointer.

Definition at line 56 of file DbHandleBase.h.

56{ m_ptr=ptr; }

◆ setType()

void pool::DbHandleBase< DbContainerObj >::setType ( const DbType & typ)
inlineprotectedinherited

Set handle type.

Definition at line 54 of file DbHandleBase.h.

54{ m_type=typ; }

◆ size()

uint64_t pool::DbContainer::size ( )

Access to the size of the container.

◆ store()

DbStatus pool::DbContainer::store ( const void * object,
const DbTypeInfo * typ )

Access objects by handle directly.

This is the generic "direct" object access. Store object in location

◆ 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< DbContainerObj >::type ( ) const
inlineinherited

Inquire storage type of the handle.

Definition at line 70 of file DbHandleBase.h.

70{ return m_type; }

Member Data Documentation

◆ m_ptr

DbContainerObj* pool::DbHandleBase< DbContainerObj >::m_ptr
protectedinherited

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

Definition at line 38 of file DbHandleBase.h.

◆ m_type

DbType pool::DbHandleBase< DbContainerObj >::m_type
protectedinherited

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

Definition at line 40 of file DbHandleBase.h.


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