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.
DbContainer & operator= (const DbContainer &copy)
 Assignment operator.
DbContainer & operator= (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.
Io::IoFlag openMode () const
 Mode of the handle (READ,WRITE,...).
uint64_t size ()
 Access to the size of the container.
DbDatabase & containedIn ()
 Access to the Database the container resides in.
const IDbContainer * info () const
 Let the implementation access the internals.
IDbContainer * info ()
const DbTypeInfo * objectShape (const Guid &nam)
 Retrieve persistent type information by name.
const Token * token () const
 Access the token of the container object.
StatusCode close ()
 Close the container the handle points to.
StatusCode open (DbDatabase &dbH, const std::string &nam, const DbTypeInfo *typ, const DbType &dbtyp, Io::IoFlag mod)
 Open the container residing in <file> with given name and access mode.
StatusCode 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.
StatusCode transAct (Transaction::Action action)
 Execute Database Transaction Action.
StatusCode setOption (const DbOption &refOpt)
 Pass options to the implementation.
StatusCode getOption (DbOption &refOpt)
 Access options.
StatusCode next (Token::OID_t &linkH)
 Access objects through select staements.
StatusCode allocate (const void *object, ShapeH shape, Token::OID_t &oid)
 Access objects using pointer and shape.
StatusCode load (void **ptr, ShapeH shape, const Token::OID_t &lH)
 Select object in the container identified by its handle.
StatusCode store (const void *object, const DbTypeInfo *typ)
 Access objects by handle directly.
DbContainerObj * operator-> ()
 Dereference operator.
bool operator! () const
 Validity check through operator NOT.
const DbContainerObj * ptr () const
 Access to underlying object.
bool isValid () const
 Validity check (Objy like).
const DbType & type () const
 Inquire storage type of the handle.

Protected Types

typedef DbContainerObj _DataType
 Data type definition.
typedef DbHandleBase< _DataType > Base
 Data type definition.

Protected Member Functions

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

Protected Attributes

DbContainerObj * m_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

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

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

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

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

StatusCode pool::DbContainer::close ( )

Close the container the handle points to.

◆ containedIn()

DbDatabase & pool::DbContainer::containedIn ( )

Access to the Database the container resides in.

◆ getOption()

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

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

◆ next()

StatusCode pool::DbContainer::next ( Token::OID_t & linkH)

Access objects through select staements.


This access type is ideal for relational Databases. Other technologies only have very limited support for this interface. Fetch next object address to set token

◆ objectShape()

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

Retrieve persistent type information by name.

◆ open()

StatusCode pool::DbContainer::open ( DbDatabase & dbH,
const std::string & nam,
const DbTypeInfo * typ,
const DbType & dbtyp,
Io::IoFlag 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()

Io::IoFlag 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.

◆ setOption()

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

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

StatusCode 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: