| # Gaudi Framework, version v22r4 |

Home |  | Generated: Fri Sep 2 2011

Public Member Functions | Protected Attributes

# PoolDbAddress Class Reference

Description: More...

`#include <PoolDb/PoolDbAddress.h>`

Inheritance diagram for PoolDbAddress:
[legend]
Collaboration diagram for PoolDbAddress:
[legend]

List of all members.

## 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.

## 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.

## 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.

      : m_refCount(0), m_pRegistry(0), m_handler(0), m_token(aToken)
    {
      s_count->increment();
      m_ipar[0]=m_ipar[1]=0;
      if ( m_token )  {
        m_token->addRef();
        return;
      }
      throw std::runtime_error("Invalid token (NULL) passed to PoolDbAddress");
    }

PoolDbAddress::~PoolDbAddress | ( | ) | `[virtual]`

Standard Destructor.

Standard destructor.

Definition at line 38 of file PoolDbAddress.cpp.

    {
      pool::releasePtr(m_handler);
      s_count->decrement();
      unsigned int cnt = m_token->release();
      if ( cnt != 0 ) {
        if ( !(m_token->contID() == "/Event"      ||
               m_token->contID() == "/FileRecords" ||
               m_token->contID() == "/RunRecords" ||
               clID() == CLID_RowWiseTuple        ||
               clID() == CLID_ColumnWiseTuple ) )  {
          std::cout << "PoolDbAddress::~PoolDbAddress> Token: " << cnt
                    << "  " << m_token->dbID() << " :: "
                    << m_token->contID() << std::endl
                    << "Possible memory leak." << std::endl;
        }
      }
    }

## Member Function Documentation

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

Add reference to object.

Implements IOpaqueAddress.

Definition at line 56 of file PoolDbAddress.h.

    { return ++m_refCount;            }

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

Retrieve class ID of the address.

Implements IOpaqueAddress.

Definition at line 60 of file PoolDbAddress.h.

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

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

Access to POOL data handler (if present)

Definition at line 72 of file PoolDbAddress.h.

    { return m_handler;     }

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

Retrieve integer parameters.

Retrieve string parameters.

Implements IOpaqueAddress.

Definition at line 76 of file PoolDbAddress.cpp.

    {
      m_ipar[0] = m_token->oid().first;
      m_ipar[1] = m_token->oid().second;
      return m_ipar;
    }

bool PoolDbAddress::isValid | ( | ) | const

Check link for validity.

Definition at line 89 of file PoolDbAddress.cpp.

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

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

Retrieve string parameters.

Implements IOpaqueAddress.

Definition at line 68 of file PoolDbAddress.cpp.

    {
      m_par[0] = m_token->dbID();
      m_par[1] = m_token->contID();
      return m_par;
    }

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

Pointer to directory.

Implements IOpaqueAddress.

Definition at line 68 of file PoolDbAddress.h.

    { return m_pRegistry;             }

unsigned long PoolDbAddress::release | ( | ) | `[virtual]`

Release reference to object.

Implements IOpaqueAddress.

Definition at line 58 of file PoolDbAddress.cpp.

    {
      int cnt = --m_refCount;
      if ( 0 == cnt )   {
        delete this;
      }
      return cnt;
    }

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

Set the POOL data handler; releases existing data handler.

Definition at line 83 of file PoolDbAddress.cpp.

    {
      pool::releasePtr(m_handler);
      m_handler = h;
    }

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

Set pointer to directory.

Implements IOpaqueAddress.

Definition at line 80 of file PoolDbAddress.h.

    { m_pRegistry = pReg;   }

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.

    { return m_token->technology();   }

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

Cache handle to container object.

Definition at line 76 of file PoolDbAddress.h.

    { return m_token;       }

## Member Data Documentation

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

Pointer to call handler.

Definition at line 43 of file PoolDbAddress.h.

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

Integer (unsignod long) parameters to be accessed.

Definition at line 41 of file PoolDbAddress.h.

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

String parameters to be accessed.

Definition at line 39 of file PoolDbAddress.h.

IRegistry* PoolDbAddress::m_pRegistry`[protected]`

Pointer to corresponding directory.

Definition at line 37 of file PoolDbAddress.h.

unsigned long PoolDbAddress::m_refCount`[protected]`

Reference count.

Definition at line 35 of file PoolDbAddress.h.

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

Pointer to POOL token structure.

Definition at line 45 of file PoolDbAddress.h.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r4/GaudiPoolDb/GaudiPoolDb/PoolDbAddress.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r4/GaudiPoolDb/src/PoolDbAddress.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines