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

Description: This class is a handle managing access and lifetime for the Container implementation object: DbContainerObj. More...

#include <StorageSvc/DbContainer.h>

Inheritance diagram for DbContainer:
Collaboration diagram for DbContainer:

Public Member Functions

 DbContainer (const DbType &typ=pool::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 ITechContainer * info () const
 Let the implementation access the internals.
ITechContainer * 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, const DbTypeInfo *tinfo, Token::OID_t &oid)
 Access objects using pointer and shape.
StatusCode load (void **ptr, const DbTypeInfo *tinfo, 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: This class is a handle managing access and lifetime for the Container implementation object: DbContainerObj.

Author
M.Frank

Definition at line 31 of file DbContainer.h.

Member Typedef Documentation

◆ _DataType

typedef DbContainerObj DbHandleBase< DbContainerObj >::_DataType
protectedinherited

Data type definition.

Definition at line 20 of file DbHandleBase.h.

◆ Base

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

Data type definition.

Definition at line 22 of file DbHandleBase.h.

Constructor & Destructor Documentation

◆ DbContainer() [1/3]

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

Constructor with initializing arguments.

Definition at line 38 of file DbContainer.h.

◆ DbContainer() [2/3]

DbContainer::DbContainer ( const DbContainer & c)
inline

Copy constructor.

Definition at line 40 of file DbContainer.h.

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

◆ DbContainer() [3/3]

DbContainer::DbContainer ( DbContainerObj * ptr)
inline

Constructor taking transient object.

Definition at line 42 of file DbContainer.h.

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

◆ ~DbContainer()

virtual DbContainer::~DbContainer ( )
inlinevirtual

Standard Destructor.

Definition at line 44 of file DbContainer.h.

44{ switchPtr(0); }

Member Function Documentation

◆ allocate()

StatusCode DbContainer::allocate ( const void * object,
const DbTypeInfo * tinfo,
Token::OID_t & oid )

Access objects using pointer and shape.

In place allocation of object location

◆ checkAccess()

StatusCode 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 DbContainer::close ( )

Close the container the handle points to.

◆ containedIn()

DbDatabase & DbContainer::containedIn ( )

Access to the Database the container resides in.

◆ getOption()

StatusCode DbContainer::getOption ( DbOption & refOpt)

Access options.

◆ info() [1/2]

ITechContainer * DbContainer::info ( )

◆ info() [2/2]

const ITechContainer * DbContainer::info ( ) const

Let the implementation access the internals.

◆ isOpen()

bool DbContainer::isOpen ( ) const

Check if the container was opened.

◆ isValid()

bool DbHandleBase< DbContainerObj >::isValid ( ) const
inlineinherited

Validity check (Objy like).

Definition at line 54 of file DbHandleBase.h.

54{ return 0 != m_ptr; }

◆ load()

StatusCode DbContainer::load ( void ** ptr,
const DbTypeInfo * tinfo,
const Token::OID_t & lH )

Select object in the container identified by its handle.

◆ name()

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

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

◆ next()

StatusCode 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 * DbContainer::objectShape ( const Guid & nam)

Retrieve persistent type information by name.

◆ open()

StatusCode 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 DbContainer::openMode ( ) const

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

◆ operator!()

bool DbHandleBase< DbContainerObj >::operator! ( ) const
inlineinherited

Validity check through operator NOT.

Definition at line 49 of file DbHandleBase.h.

49{ return !isValid(); }

◆ operator->()

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

Dereference operator.

Definition at line 46 of file DbHandleBase.h.

46{ return m_ptr; }

◆ operator=() [1/2]

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

Assignment operator.

Definition at line 46 of file DbContainer.h.

46 {
47 if ( &copy != this ) {
48 m_type = copy.m_type;
49 switchPtr( copy.m_ptr );
50 }
51 return *this;
52 }
bool copy
Definition calibdata.py:26

◆ operator=() [2/2]

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

Assignment operator to reset the handle easily using 0.

Definition at line 54 of file DbContainer.h.

54 {
55 switchPtr(0);
56 return *this;
57 }

◆ ptr()

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

Access to underlying object.

Definition at line 51 of file DbHandleBase.h.

51{ return m_ptr; }

◆ refCount()

int DbContainer::refCount ( ) const

Access reference counter.

◆ setOption()

StatusCode DbContainer::setOption ( const DbOption & refOpt)

Pass options to the implementation.

◆ setPtr()

void DbHandleBase< DbContainerObj >::setPtr ( DbContainerObj * ptr)
inlineprotectedinherited

Set data pointer.

Definition at line 42 of file DbHandleBase.h.

42{ m_ptr=ptr; }

◆ setType()

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

Set handle type.

Definition at line 40 of file DbHandleBase.h.

40{ m_type=typ; }
Description: Definition of the generic database object handle.

◆ size()

uint64_t DbContainer::size ( )

Access to the size of the container.

◆ store()

StatusCode 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 DbContainer::switchPtr ( DbContainerObj * obj)
private

Assign transient object properly (including reference counting).

◆ token()

const Token * DbContainer::token ( ) const

Access the token of the container object.

◆ transAct()

StatusCode DbContainer::transAct ( Transaction::Action action)

Execute Database Transaction Action.

◆ type()

const DbType & DbHandleBase< DbContainerObj >::type ( ) const
inlineinherited

Inquire storage type of the handle.

Definition at line 56 of file DbHandleBase.h.

56{ return m_type; }

Member Data Documentation

◆ m_ptr

DbContainerObj* DbHandleBase< DbContainerObj >::m_ptr
protectedinherited

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

Definition at line 24 of file DbHandleBase.h.

◆ m_type

DbType DbHandleBase< DbContainerObj >::m_type
protectedinherited

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

Definition at line 26 of file DbHandleBase.h.


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