| # Gaudi Framework, version v23r1 |

Home |  | Generated: Wed Feb 29 2012

# RootUtils.h

Go to the documentation of this file.

    00001 #ifndef GAUDIROOTCNV_ROOTUTILS_H
    00002 #define GAUDIROOTCNV_ROOTUTILS_H
    00003
    00004 // Framework include files
    00005 //#include "GaudiKernel/DataObject.h"
    00006
    00007 // Forward declarations
    00008 class DataObject;
    00009
    00010 // Functions imported from GaudiKernel
    00011 namespace GaudiRoot {
    00012   void popCurrentDataObject();
    00013   void pushCurrentDataObject(DataObject** pobjAddr);
    00014 }
    00015
    00016 namespace {
    00018   template<class T> inline void releasePtr(T*& p)  {
    00019     if ( 0 != p )    {
    00020       p->release();
    00021       p = 0;
    00022     }
    00023   }
    00025   template<class T> inline void deletePtr(T*& p)  {
    00026     if ( 0 != p )    {
    00027       delete p;
    00028       p = 0;
    00029     }
    00030   }
    00031
    00041   struct DataObjectPush {
    00043     DataObject* m_p;
    00045     DataObjectPush(DataObject* p):m_p(p){GaudiRoot::pushCurrentDataObject(&m_p);}
    00047     ~DataObjectPush() { GaudiRoot::popCurrentDataObject();  }
    00048   };
    00049 }
    00050
    00051 #endif // GAUDIROOTCNV_ROOTUTILS_H

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