 |
ATLAS Offline Software
|
Go to the documentation of this file.
15 #ifndef POOL_DBOBJECT_H
16 #define POOL_DBOBJECT_H 1
39 template <
class USER>
class DbObjectHandle :
public DbHandleBase<USER> {
43 const USER*
makePtr(
void*
p) {
return (
const USER*)(
p); }
58 if ( 0 ==
ptr() && 0 ==
p )
return;
62 if ( 0 ==
ptr() )
return;
77 {
_set(
c.ptr(),
c.type()); }
80 operator const USER*()
const {
return ptr(); }
81 operator USER*() {
return ptr(); }
88 if (&
c !=
this)
_set (
c.ptr(),
c.type());
129 #endif // POOL_DBOBJECT_H
const DbContainer & containedIn() const
Retrieve hosting container.
ElementLink< T > makeLink(const SG::View *view, const SG::ReadHandle< T > &handle, size_t index)
Create EL to a collection in view.
DbObjectHandle< USER > & operator=(const int)
Generic assignment operator.
DbObjectHandle< USER > & operator=(USER *obj)
Generic assignment operator.
DbStatus makeLink ATLAS_NOT_THREAD_SAFE(Token *pToken, Token::OID_t &linkH) const
Add persistent association entry.
DbObjectHandle()
Standard Constructor.
This class provides a token that identifies in a unique way objects on the persistent storage.
T * m_ptr
Data member: Object pointer. Sub-classes need access on re-assignment.
bool operator==(const DbHandleBase< T > &objH) const
Equality operator.
const USER * makePtr(void *p)
Pointer conversion.
const T * ptr() const
Access to underlying object.
Token::OID_t & oid()
Access object oid.
void _setType(const DbType &type)
Set handle type.
void _setObject(const int)
DbDatabase & containedIn()
Access to the Database the container resides in.
void _setObject(T *p)
Set object value.
DbObjectHandle< USER > & operator=(DbObjectHandle &c)
void setType(const DbType &typ)
Set handle type.
virtual ~DbObjectHandle()
Standard destructor.
static Token::OID_t & oid(DbObject *pObj)
Access the offset of an object.
DbStatus makeLink(Token *pToken, Token::OID_t &linkH)
Add association link to link container.
static DbContainer & container(DbObject *pObj)
Access the container of an object.
const Token::OID_t & oid() const
Access object oid.
const DbType & type() const
Inquire storage type of the handle.
DbObjectHandle(USER *p)
Constructor with object pointer.
DbObjectHandle(const DbType &typ)
Constructor with storage type.
DbObjectHandle(const DbObjectHandle< USER > &c)
Copy constructor.
void _set(const T *ptr, const DbType &typ)
Attach object to handle with type: may be accessed by sub-class only.
Define macros for attributes used to control the static checker.
This file contains the class definition for the Token class (migrated from POOL).