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

#include <DbHeap.h>

Collaboration diagram for pool::DbObjectHandle:

Public Member Functions

void _setType (const DbType &type)
 Set handle type. More...
 
template<class T >
void _setObject (T *p)
 Set object value. More...
 
void _setObject (const int)
 
virtual ~DbObjectHandle ()
 Standard destructor. More...
 
 DbObjectHandle ()
 Standard Constructor. More...
 
 DbObjectHandle (const DbType &typ)
 Constructor with storage type. More...
 
 DbObjectHandle (USER *p)
 Constructor with object pointer. More...
 
 DbObjectHandle (const DbObjectHandle< USER > &c)
 Copy constructor. More...
 
 operator const USER * () const
 Generic assignment operator from base class. More...
 
 operator USER * ()
 
DbObjectHandle< USER > & operator= (const int)
 Generic assignment operator. More...
 
DbObjectHandle< USER > & operator= (DbObjectHandle &c)
 
DbObjectHandle< USER > & operator= (USER *obj)
 Generic assignment operator. More...
 
template<typename T >
bool operator== (const DbHandleBase< T > &objH) const
 Equality operator. More...
 
const DbContainercontainedIn () const
 Retrieve hosting container. More...
 
const Token::OID_toid () const
 Access object oid. More...
 
Token::OID_toid ()
 Access object oid. More...
 
DbStatus makeLink ATLAS_NOT_THREAD_SAFE (Token *pToken, Token::OID_t &linkH) const
 Add persistent association entry. More...
 
const T * ptr () const
 Access to underlying object. More...
 
T * ptr ()
 
const DbTypetype () const
 Inquire storage type of the handle. More...
 

Protected Member Functions

template<typename T >
void _set (const T *ptr, const DbType &typ)
 Attach object to handle with type: may be accessed by sub-class only. More...
 

Private Types

using Base = DbHandleBase< USER >
 

Private Member Functions

const USER * makePtr (void *p)
 Pointer conversion. More...
 

Detailed Description

Description: Base class for object handles.

Author
M.Frank
Version
1.0

Definition at line 26 of file DbHeap.h.

Member Typedef Documentation

◆ Base

Definition at line 41 of file DbObjectHandle.h.

Constructor & Destructor Documentation

◆ ~DbObjectHandle()

virtual pool::DbObjectHandle::~DbObjectHandle ( )
inlinevirtual

Standard destructor.

Definition at line 67 of file DbObjectHandle.h.

67 { _setObject(0); }

◆ DbObjectHandle() [1/4]

pool::DbObjectHandle::DbObjectHandle ( )
inline

Standard Constructor.

Definition at line 69 of file DbObjectHandle.h.

69 { }

◆ DbObjectHandle() [2/4]

pool::DbObjectHandle::DbObjectHandle ( const DbType typ)
inline

Constructor with storage type.

Definition at line 71 of file DbObjectHandle.h.

71 { _setType(typ); }

◆ DbObjectHandle() [3/4]

pool::DbObjectHandle::DbObjectHandle ( USER *  p)
inline

Constructor with object pointer.

Definition at line 73 of file DbObjectHandle.h.

73 { _setObject(p); }

◆ DbObjectHandle() [4/4]

pool::DbObjectHandle::DbObjectHandle ( const DbObjectHandle< USER > &  c)
inline

Copy constructor.

Definition at line 76 of file DbObjectHandle.h.

76  : DbHandleBase<USER>()
77  { _set(c.ptr(),c.type()); }

Member Function Documentation

◆ _set()

template<typename T >
void pool::DbObjectHandle::_set ( const T *  ptr,
const DbType typ 
)
inlineprotected

Attach object to handle with type: may be accessed by sub-class only.

Definition at line 46 of file DbObjectHandle.h.

46  {
47  _setObject(ptr);
48  _setType(typ);
49  }

◆ _setObject() [1/2]

void pool::DbObjectHandle::_setObject ( const int  )
inline

Definition at line 61 of file DbObjectHandle.h.

61  {
62  if ( 0 == ptr() ) return;
63  Base::m_ptr = 0;
64  }

◆ _setObject() [2/2]

template<class T >
void pool::DbObjectHandle::_setObject ( T *  p)
inline

Set object value.

Definition at line 57 of file DbObjectHandle.h.

57  {
58  if ( 0 == ptr() && 0 == p ) return;
59  Base::m_ptr = p;
60  }

◆ _setType()

void pool::DbObjectHandle::_setType ( const DbType type)
inline

Set handle type.

Definition at line 55 of file DbObjectHandle.h.

55 { Base::setType(type); }

◆ ATLAS_NOT_THREAD_SAFE()

DbStatus makeLink pool::DbObjectHandle::ATLAS_NOT_THREAD_SAFE ( Token pToken,
Token::OID_t linkH 
) const
inline

Add persistent association entry.

Definition at line 115 of file DbObjectHandle.h.

115  {
116  if( pToken ) {
117  DbDatabase& dbH = containedIn().containedIn();
118  return dbH.makeLink(pToken, linkH);
119  }
120  return Error;
121  }

◆ containedIn()

const DbContainer& pool::DbObjectHandle::containedIn ( ) const
inline

Retrieve hosting container.

Definition at line 103 of file DbObjectHandle.h.

104  { return DbHeap::container(ptr()); }

◆ makePtr()

const USER* pool::DbObjectHandle::makePtr ( void *  p)
inlineprivate

Pointer conversion.

Definition at line 43 of file DbObjectHandle.h.

43 { return (const USER*)(p); }

◆ oid() [1/2]

Token::OID_t& pool::DbObjectHandle::oid ( )
inline

Access object oid.

Definition at line 111 of file DbObjectHandle.h.

112  { return DbHeap::oid(ptr()); }

◆ oid() [2/2]

const Token::OID_t& pool::DbObjectHandle::oid ( ) const
inline

Access object oid.

Definition at line 107 of file DbObjectHandle.h.

108  { return DbHeap::oid(ptr()); }

◆ operator const USER *()

pool::DbObjectHandle::operator const USER * ( ) const
inline

Generic assignment operator from base class.

Definition at line 80 of file DbObjectHandle.h.

80 { return ptr(); }

◆ operator USER *()

pool::DbObjectHandle::operator USER * ( )
inline

Definition at line 81 of file DbObjectHandle.h.

81 { return ptr(); }

◆ operator=() [1/3]

DbObjectHandle<USER>& pool::DbObjectHandle::operator= ( const int  )
inline

Generic assignment operator.

Definition at line 84 of file DbObjectHandle.h.

85  { _setObject(0); return *this; }

◆ operator=() [2/3]

DbObjectHandle<USER>& pool::DbObjectHandle::operator= ( DbObjectHandle c)
inline

Definition at line 87 of file DbObjectHandle.h.

87  {
88  if (&c != this) _set (c.ptr(), c.type());
89  return *this;
90  }

◆ operator=() [3/3]

DbObjectHandle<USER>& pool::DbObjectHandle::operator= ( USER *  obj)
inline

Generic assignment operator.

Definition at line 93 of file DbObjectHandle.h.

93  {
94  if( ptr() != obj ) _setObject(obj);
95  return *this;
96  }

◆ operator==()

template<typename T >
bool pool::DbObjectHandle::operator== ( const DbHandleBase< T > &  objH) const
inline

Equality operator.

Definition at line 99 of file DbObjectHandle.h.

100  { return type() == objH.type() && ptr() == objH.ptr(); }

◆ ptr() [1/2]

T* pool::DbHandleBase< T >::ptr
inline

Definition at line 66 of file DbHandleBase.h.

66 { return m_ptr; }

◆ ptr() [2/2]

const T* pool::DbHandleBase< T >::ptr
inline

Access to underlying object.

Definition at line 65 of file DbHandleBase.h.

65 { return m_ptr; }

◆ type()

const DbType& pool::DbHandleBase< T >::type
inline

Inquire storage type of the handle.

Definition at line 70 of file DbHandleBase.h.

70 { return m_type; }

The documentation for this class was generated from the following files:
pool::DbObjectHandle::containedIn
const DbContainer & containedIn() const
Retrieve hosting container.
Definition: DbObjectHandle.h:103
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
pool::DbHandleBase::m_ptr
T * m_ptr
Data member: Object pointer. Sub-classes need access on re-assignment.
Definition: DbHandleBase.h:38
m_type
TokenType m_type
the type
Definition: TProperty.cxx:44
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
pool::DbObjectHandle::_setType
void _setType(const DbType &type)
Set handle type.
Definition: DbObjectHandle.h:55
pool::DbContainer::containedIn
DbDatabase & containedIn()
Access to the Database the container resides in.
pool::DbObjectHandle::_setObject
void _setObject(T *p)
Set object value.
Definition: DbObjectHandle.h:57
pool::DbHandleBase::setType
void setType(const DbType &typ)
Set handle type.
Definition: DbHandleBase.h:54
pool::DbHeap::oid
static Token::OID_t & oid(DbObject *pObj)
Access the offset of an object.
pool::DbDatabase::makeLink
DbStatus makeLink(Token *pToken, Token::OID_t &linkH)
Add association link to link container.
pool::DbHeap::container
static DbContainer & container(DbObject *pObj)
Access the container of an object.
L1Topo::Error
Error
The different types of error that can be flagged in the L1TopoRDO.
Definition: Error.h:16
pool::DbObjectHandle::_set
void _set(const T *ptr, const DbType &typ)
Attach object to handle with type: may be accessed by sub-class only.
Definition: DbObjectHandle.h:46
python.PyAthena.obj
obj
Definition: PyAthena.py:132
python.compressB64.c
def c
Definition: compressB64.py:93