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

#include <StorageSvc/DbObject.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= (const DbObjectHandle &c)
 
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 (const Token *pToken, Token::OID_t &linkH) const
 Add persistent association entry. 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

typedef DbHandleBase< USER > Base
 

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

Member Typedef Documentation

◆ Base

Definition at line 92 of file DbObject.h.

Constructor & Destructor Documentation

◆ ~DbObjectHandle()

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

Standard destructor.

Definition at line 115 of file DbObject.h.

115 { _setObject(0); }

◆ DbObjectHandle() [1/4]

pool::DbObjectHandle::DbObjectHandle ( )
inline

Standard Constructor.

Definition at line 117 of file DbObject.h.

117 { }

◆ DbObjectHandle() [2/4]

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

Constructor with storage type.

Definition at line 119 of file DbObject.h.

119 { _setType(typ); }

◆ DbObjectHandle() [3/4]

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

Constructor with object pointer.

Definition at line 121 of file DbObject.h.

121 { _setObject(p); }

◆ DbObjectHandle() [4/4]

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

Copy constructor.

Definition at line 123 of file DbObject.h.

123  : DbHandleBase<USER>()
124  { _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 97 of file DbObject.h.

97  {
98  _setObject(ptr);
99  _setType(typ);
100  }

◆ _setObject() [1/2]

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

Definition at line 109 of file DbObject.h.

109  {
110  if ( 0 == Base::ptr() ) return;
111  Base::m_ptr = 0;
112  }

◆ _setObject() [2/2]

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

Set object value.

Definition at line 105 of file DbObject.h.

105  {
106  if ( 0 == Base::ptr() && 0 == p ) return;
107  Base::m_ptr = p;
108  }

◆ _setType()

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

Set handle type.

Definition at line 103 of file DbObject.h.

103 { Base::setType(type); }

◆ ATLAS_NOT_THREAD_SAFE()

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

Add persistent association entry.

◆ containedIn()

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

Retrieve hosting container.

Definition at line 205 of file DbObject.h.

◆ makePtr()

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

Pointer conversion.

Definition at line 94 of file DbObject.h.

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

◆ oid() [1/2]

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

Access object oid.

Definition at line 210 of file DbObject.h.

◆ oid() [2/2]

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

Access object oid.

Definition at line 215 of file DbObject.h.

◆ operator const USER *()

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

Generic assignment operator from base class.

Definition at line 126 of file DbObject.h.

126 { return Base::ptr(); }

◆ operator USER *()

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

Definition at line 127 of file DbObject.h.

127 { return Base::ptr(); }

◆ operator=() [1/2]

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

Definition at line 131 of file DbObject.h.

132  {
133  if (&c != this)
134  _set (c.ptr(), c.type());
135  return *this;
136  }

◆ operator=() [2/2]

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

Generic assignment operator.

Definition at line 129 of file DbObject.h.

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

◆ operator==()

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

Equality operator.

Definition at line 138 of file DbObject.h.

139  { return Base::type() == objH.type() && Base::ptr() == objH.ptr(); }

The documentation for this class was generated from the following files:
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
pool::DbObjectAccessor::containedIn
static const DbContainer & containedIn(const DbObject *pObj)
Retrieve hosting container.
pool::DbHandleBase::type
const DbType & type() const
Inquire storage type of the handle.
Definition: DbHandleBase.h:66
pool::DbType::type
int type() const
Access to full type.
Definition: DbType.h:66
pool::DbObjectHandle::_setType
void _setType(const DbType &type)
Set handle type.
Definition: DbObject.h:103
pool::DbHandleBase::ptr
const T * ptr() const
Access to underlying object.
Definition: DbHandleBase.h:61
pool::DbObjectHandle::_setObject
void _setObject(T *p)
Set object value.
Definition: DbObject.h:105
pool::DbHandleBase::setType
void setType(const DbType &typ)
Set handle type.
Definition: DbHandleBase.h:50
pool::DbHandleBase::m_ptr
T * m_ptr
Data member: Object pointer. Sub-classes need access on re-assignment.
Definition: DbHandleBase.h:41
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
pool::DbObjectAccessor::objectOid
static Token::OID_t & objectOid(DbObject *ptr)
Access object oid.
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: DbObject.h:97
python.compressB64.c
def c
Definition: compressB64.py:93