| # Gaudi Framework, version v21r8 |

Home |  | Generated: 17 Mar 2010

# PoolDbLinkManager.cpp

Go to the documentation of this file.

    00001 // $Id: PoolDbLinkManager.cpp,v 1.4 2008/01/17 13:20:51 marcocle Exp $
    00002 //====================================================================
    00003 //      PoolDbLinkManager implementation
    00004 //--------------------------------------------------------------------
    00005 //
    00006 //      Package    : System ( The LHCb Offline System)
    00007 //
    00008 //  Description: Link Manager for POOL objects
    00009 //
    00010 //      Author     : M.Frank
    00011 //====================================================================
    00012
    00013 // Framework include files
    00014 #include "GaudiPoolDb/PoolDbLinkManager.h"
    00015 #include "StorageSvc/DbInstanceCount.h"
    00016 #include "POOLCore/Token.h"
    00017
    00018 static pool::DbInstanceCount::Counter* counter() {
    00019   static pool::DbInstanceCount::Counter* s_count = 0;
    00020   if ( 0 == s_count )  {
    00021     s_count = pool::DbInstanceCount::getCounter(typeid(PoolDbLinkManager));
    00022   }
    00023   return s_count;
    00024 }
    00025
    00026 // Standard constructor
    00027 PoolDbLinkManager::PoolDbLinkManager()
    00028 {
    00029   static pool::DbInstanceCount::Counter* c = counter();
    00030   c->increment();
    00031 }
    00032
    00033 // Standard destructor
    00034 PoolDbLinkManager::~PoolDbLinkManager()
    00035 {
    00036   static pool::DbInstanceCount::Counter* c = counter();
    00037   c->decrement();
    00038   for (std::vector<pool::Token*>::iterator i = m_refs.begin(); i != m_refs.end(); ++i )  {
    00039     if ( *i )  {
    00040       (*i)->release();
    00041     }
    00042   }
    00043   m_links.clear();
    00044   m_refs.clear();
    00045 }