| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RootUtils.h
Go to the documentation of this file.
1 #ifndef GAUDIROOTCNV_ROOTUTILS_H
2 #define GAUDIROOTCNV_ROOTUTILS_H
3
4 // Framework include files
5 //#include "GaudiKernel/DataObject.h"
6
7 // Forward declarations
8 class DataObject;
9
10 // Functions imported from GaudiKernel
11 namespace GaudiRoot {
12 void popCurrentDataObject();
13 void pushCurrentDataObject(DataObject** pobjAddr);
14 }
15
16 namespace {
18 template<class T> inline void releasePtr(T*& p) {
19 if ( 0 != p ) {
20 p->release();
21 p = 0;
22 }
23 }
25 template<class T> inline void deletePtr(T*& p) {
26 if ( 0 != p ) {
27 delete p;
28 p = 0;
29 }
30 }
31
41 struct DataObjectPush {
43 DataObject* m_p;
45 DataObjectPush(DataObject* p):m_p(p){GaudiRoot::pushCurrentDataObject(&m_p);}
47 ~DataObjectPush() { GaudiRoot::popCurrentDataObject(); }
48 };
49 }
50
51 #endif // GAUDIROOTCNV_ROOTUTILS_H