Gaudi Framework, version v20r2

Generated: 18 Jul 2008

PoolDbAddress Class Reference

#include <PoolDb/PoolDbAddress.h>

Inheritance diagram for PoolDbAddress:

Inheritance graph
[legend]
Collaboration diagram for PoolDbAddress:

Collaboration graph
[legend]
List of all members.

Detailed Description

Description:.

Definition of a transient link which is capable of locating an object in the persistent storage.

Author:
M.Frank
Version:
1.0

Definition at line 32 of file PoolDbAddress.h.

Public Member Functions

 PoolDbAddress (pool::Token *aToken)
 Full constructor: all arguments MUST be valid, no checks!
virtual ~PoolDbAddress ()
 Standard Destructor.
pool::DataCallBack * handler () const
 Access to POOL data handler (if present).
void setHandler (pool::DataCallBack *h)
 Set the POOL data handler; releases existing data handler.
pool::Token * token ()
 Cache handle to container object.
bool isValid () const
 Check link for validity.
virtual void setRegistry (IRegistry *pReg)
 Set pointer to directory.
Implementation of IOpaqueAddress interface
virtual unsigned long addRef ()
 Add reference to object.
virtual unsigned long release ()
 Release reference to object.
const CLID & clID () const
 Retrieve class ID of the address.
long svcType () const
 Access : retrieve the storage type of the class id.
virtual const std::string * par () const
 Retrieve string parameters.
virtual const unsigned long * ipar () const
 Retrieve integer parameters.
virtual IRegistry * registry () const
 Pointer to directory.

Protected Attributes

unsigned long m_refCount
 Reference count.
IRegistry * m_pRegistry
 Pointer to corresponding directory.
std::string m_par [3]
 String parameters to be accessed.
unsigned long m_ipar [2]
 Integer (unsignod long) parameters to be accessed.
pool::DataCallBack * m_handler
 Pointer to call handler.
pool::Token * m_token
 Pointer to POOL token structure.


Constructor & Destructor Documentation

PoolDbAddress::PoolDbAddress ( pool::Token *  aToken  ) 

Full constructor: all arguments MUST be valid, no checks!

Definition at line 25 of file PoolDbAddress.cpp.

References pool::Token::addRef(), pool::DbInstanceCount::Counter::increment(), m_token, and s_count.

00026   : m_refCount(0), m_pRegistry(0), m_handler(0), m_token(aToken)
00027 {
00028   s_count->increment();
00029   if ( m_token )  {
00030     m_token->addRef();
00031     return;
00032   }
00033   throw std::runtime_error("Invalid token (NULL) passed to PoolDbAddress");
00034 }

PoolDbAddress::~PoolDbAddress (  )  [virtual]

Standard Destructor.

Definition at line 37 of file PoolDbAddress.cpp.

References clID(), CLID_ColumnWiseTuple, CLID_RowWiseTuple, pool::Token::contID(), std::cout, pool::Token::dbID(), pool::DbInstanceCount::Counter::decrement(), std::endl(), m_handler, m_token, pool::Token::release(), pool::releasePtr(), and s_count.

00038 {
00039   pool::releasePtr(m_handler);
00040   s_count->decrement();
00041   unsigned int cnt = m_token->release();
00042   if ( cnt != 0 ) {
00043     if ( !(m_token->contID() == "/Event" ||
00044            clID() == CLID_RowWiseTuple   ||
00045            clID() == CLID_ColumnWiseTuple ) )  {
00046       std::cout << "PoolDbAddress::~PoolDbAddress> Token: " << cnt 
00047                 << "  " << m_token->dbID() << " :: " 
00048                 << m_token->contID() << std::endl
00049                 << "Possible memory leak." << std::endl;
00050     }
00051   }
00052 }


Member Function Documentation

virtual unsigned long PoolDbAddress::addRef (  )  [inline, virtual]

Add reference to object.

Implements IOpaqueAddress.

Definition at line 56 of file PoolDbAddress.h.

References m_refCount.

00056 { return ++m_refCount;            }

unsigned long PoolDbAddress::release (  )  [virtual]

Release reference to object.

Implements IOpaqueAddress.

Definition at line 55 of file PoolDbAddress.cpp.

References m_refCount.

00056 {
00057   int cnt = --m_refCount;
00058   if ( 0 == cnt )   {
00059     delete this;
00060   }
00061   return cnt;
00062 }

const CLID& PoolDbAddress::clID (  )  const [inline, virtual]

Retrieve class ID of the address.

Implements IOpaqueAddress.

Definition at line 60 of file PoolDbAddress.h.

References pool::Token::classID(), and m_token.

Referenced by ~PoolDbAddress().

00060 { return *(CLID*)&m_token->classID().Data1;}

long PoolDbAddress::svcType (  )  const [inline, virtual]

Access : retrieve the storage type of the class id.

Implements IOpaqueAddress.

Definition at line 62 of file PoolDbAddress.h.

References m_token, and pool::Token::technology().

00062 { return m_token->technology();   }

const std::string * PoolDbAddress::par (  )  const [virtual]

Retrieve string parameters.

Implements IOpaqueAddress.

Definition at line 65 of file PoolDbAddress.cpp.

References pool::Token::contID(), pool::Token::dbID(), m_par, and m_token.

Referenced by PoolDbBaseCnv::createObj().

00066 {
00067   m_par[0] = m_token->dbID();
00068   m_par[1] = m_token->contID();
00069   return m_par;
00070 }

const unsigned long * PoolDbAddress::ipar (  )  const [virtual]

Retrieve integer parameters.

Implements IOpaqueAddress.

Definition at line 73 of file PoolDbAddress.cpp.

References m_ipar, m_token, and pool::Token::oid().

00074 {
00075   m_ipar[0] = m_token->oid().first;
00076   m_ipar[1] = m_token->oid().second;
00077   return m_ipar;
00078 }

virtual IRegistry* PoolDbAddress::registry (  )  const [inline, virtual]

Pointer to directory.

Implements IOpaqueAddress.

Definition at line 68 of file PoolDbAddress.h.

References m_pRegistry.

Referenced by PoolDbCnvSvc::read().

00068 { return m_pRegistry;             }

pool::DataCallBack* PoolDbAddress::handler (  )  const [inline]

Access to POOL data handler (if present).

Definition at line 72 of file PoolDbAddress.h.

References m_handler.

Referenced by PoolDbNTupleCnv::fillRepRefs().

00072 { return m_handler;     }

void PoolDbAddress::setHandler ( pool::DataCallBack *  h  ) 

Set the POOL data handler; releases existing data handler.

Definition at line 80 of file PoolDbAddress.cpp.

References m_handler, and pool::releasePtr().

Referenced by PoolDbNTupleCnv::createObj().

00081 {
00082   pool::releasePtr(m_handler);
00083   m_handler = h;
00084 }

pool::Token* PoolDbAddress::token (  )  [inline]

Cache handle to container object.

Definition at line 76 of file PoolDbAddress.h.

References m_token.

Referenced by PoolDbNTupleCnv::createObj(), PoolDbBaseCnv::createReferences(), PoolDbCnvSvc::markUpdate(), and PoolDbCnvSvc::read().

00076 { return m_token;       }

bool PoolDbAddress::isValid (  )  const

Check link for validity.

Definition at line 86 of file PoolDbAddress.cpp.

References std::pair< _T1, _T2 >::first, m_token, pool::Token::oid(), and std::pair< _T1, _T2 >::second.

00086                                     {
00087   const pool::Token::OID_t& oid = m_token->oid();
00088   return oid.first != -1 && oid.second != -1;  
00089 }

virtual void PoolDbAddress::setRegistry ( IRegistry *  pReg  )  [inline, virtual]

Set pointer to directory.

Implements IOpaqueAddress.

Definition at line 80 of file PoolDbAddress.h.

References m_pRegistry.

00080 { m_pRegistry = pReg;   }


Member Data Documentation

unsigned long PoolDbAddress::m_refCount [protected]

Reference count.

Definition at line 35 of file PoolDbAddress.h.

Referenced by addRef(), and release().

IRegistry* PoolDbAddress::m_pRegistry [protected]

Pointer to corresponding directory.

Definition at line 37 of file PoolDbAddress.h.

Referenced by registry(), and setRegistry().

std::string PoolDbAddress::m_par[3] [mutable, protected]

String parameters to be accessed.

Definition at line 39 of file PoolDbAddress.h.

Referenced by par().

unsigned long PoolDbAddress::m_ipar[2] [mutable, protected]

Integer (unsignod long) parameters to be accessed.

Definition at line 41 of file PoolDbAddress.h.

Referenced by ipar().

pool::DataCallBack* PoolDbAddress::m_handler [protected]

Pointer to call handler.

Definition at line 43 of file PoolDbAddress.h.

Referenced by handler(), setHandler(), and ~PoolDbAddress().

pool::Token* PoolDbAddress::m_token [protected]

Pointer to POOL token structure.

Definition at line 45 of file PoolDbAddress.h.

Referenced by clID(), ipar(), isValid(), par(), PoolDbAddress(), svcType(), token(), and ~PoolDbAddress().


The documentation for this class was generated from the following files:
Generated at Fri Jul 18 12:08:50 2008 for Gaudi Framework, version v20r2 by Doxygen version 1.5.1 written by Dimitri van Heesch, © 1997-2004