| The Gaudi Framework v32r1 (f65d50dc)

RConverter.h
Go to the documentation of this file.
1 #ifndef ROOTHISTCNV_RCONVERTER_H
2 #define ROOTHISTCNV_RCONVERTER_H 1
3
4 // Include files
5 #include "GaudiKernel/Converter.h"
6 #include "TDirectory.h"
7 #include <map>
8 #include <string>
9
10 // Forward declarations
11 class ISvcLocator;
12 class TObject;
13 class TTree;
14 class TFile;
15
16 class GlobalDirectoryRestore {
17 TDirectory* m_current;
18
19 public:
20 GlobalDirectoryRestore() { m_current = gDirectory; }
21 virtual ~GlobalDirectoryRestore() { gDirectory = m_current; }
22 };
23
24 namespace RootHistCnv {
25
31 class RConverter : public Converter {
32 public:
34 StatusCode createRep( DataObject* pObj, IOpaqueAddress*& refpAddr ) override;
36 static long storageType() { return ROOT_StorageType; }
37 long repSvcType() const override { return i_repSvcType(); }
38
39 StatusCode error( const std::string& msg );
40 StatusCode regTFile( const std::string, const TFile* );
41 StatusCode findTFile( const std::string, TFile*& );
42
43 std::string diskDirectory( const std::string& loc );
44 std::string directory( const std::string& loc );
45 void setDirectory( const std::string& loc );
46 void setDiskDirectory( const std::string& loc );
47 StatusCode createDirectory( const std::string& loc );
48 StatusCode createDiskDirectory( const std::string& loc );
49 std::string getDirectory();
50
51 std::string convertId( const std::string& ) const;
52
53 protected:
55 RConverter( const CLID& clid, ISvcLocator* svc ) : Converter( storageType(), clid, svc ) {}
57 virtual StatusCode readObject( IOpaqueAddress* pAddr, DataObject*& refpObj );
59 virtual TObject* createPersistent( DataObject* pObj );
61 StatusCode createAddress( DataObject* pObject, TDirectory* pDir, TObject* pTObject, IOpaqueAddress*& refpAddr );
62
63 StatusCode createAddress( const std::string& rzdir, const CLID& clid, long id, TObject* pTobj,
64 IOpaqueAddress*& refpAddress );
65
66 StatusCode createAddress( const std::string& rzdir, const CLID& clid, const std::string& title, TObject* pTobj,
67 IOpaqueAddress*& refpAddress );
68
70 TDirectory* changeDirectory( DataObject* pObject );
71 };
72 } // namespace RootHistCnv
73
74 #endif // RootHistCnv_RConverter_H
RootHistCnv::RConverter::getDirectory
std::string getDirectory()
Definition: RConverter.cpp:148
RootHistCnv::RConverter
Root Converter.
Definition: RConverter.h:31
RootHistCnv::RConverter::RConverter
RConverter(const CLID &clid, ISvcLocator *svc)
Standard constructor.
Definition: RConverter.h:55
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
RootHistCnv::RConverter::diskDirectory
std::string diskDirectory(const std::string &loc)
Definition: RConverter.cpp:69
RootHistCnv::RConverter::setDirectory
void setDirectory(const std::string &loc)
Definition: RConverter.cpp:108
Converter::i_repSvcType
virtual long i_repSvcType() const
Retrieve the class type of the data store the converter uses.
Definition: Converter.cpp:16
RootHistCnv::RConverter::createDiskDirectory
StatusCode createDiskDirectory(const std::string &loc)
RootHistCnv::RConverter::createRep
StatusCode createRep(DataObject *pObj, IOpaqueAddress *&refpAddr) override
Convert the transient object to the requested representation.
Definition: RConverter.cpp:228
RootHistCnv::RConverter::regTFile
StatusCode regTFile(const std::string, const TFile *)
Definition: RConverter.cpp:264
RootHistCnv::RConverter::findTFile
StatusCode findTFile(const std::string, TFile *&)
Definition: RConverter.cpp:279
RootHistCnv::RConverter::createDirectory
StatusCode createDirectory(const std::string &loc)
Definition: RConverter.cpp:24
RootHistCnv::RConverter::changeDirectory
TDirectory * changeDirectory(DataObject *pObject)
Switch to object directory (=Parent directory)
Definition: RConverter.cpp:200
RootHistCnv::RConverter::storageType
static long storageType()
Inquire storage type.
Definition: RConverter.h:36
std::string
STL class.
RootHistCnv::RConverter::createPersistent
virtual TObject * createPersistent(DataObject *pObj)
Create the persistent representation of an object.
Definition: RConverter.cpp:261
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
GlobalDirectoryRestore::GlobalDirectoryRestore
GlobalDirectoryRestore()
Definition: RConverter.h:20
RootHistCnv
Definition: DirectoryCnv.h:17
ROOT_StorageType
const long ROOT_StorageType
Definition: ClassID.h:52
GlobalDirectoryRestore::m_current
TDirectory * m_current
Definition: RConverter.h:17
GlobalDirectoryRestore::~GlobalDirectoryRestore
virtual ~GlobalDirectoryRestore()
Definition: RConverter.h:21
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
Converter
Converter base class.
Definition: Converter.h:24
RootHistCnv::RConverter::directory
std::string directory(const std::string &loc)
Definition: RConverter.cpp:101
RootHistCnv::RConverter::error
StatusCode error(const std::string &msg)
Definition: RConverter.cpp:329
GlobalDirectoryRestore
Definition: RConverter.h:16
RootHistCnv::RConverter::repSvcType
long repSvcType() const override
Definition: RConverter.h:37
GaudiMP.FdsRegistry.msg
msg
Definition: FdsRegistry.py:8
RootHistCnv::RConverter::convertId
std::string convertId(const std::string &) const
Definition: RConverter.cpp:312
RootHistCnv::RConverter::readObject
virtual StatusCode readObject(IOpaqueAddress *pAddr, DataObject *&refpObj)
Create the transient representation of an object.
Definition: RConverter.cpp:250
Converter.h
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
RootHistCnv::RConverter::createAddress
StatusCode createAddress(DataObject *pObject, TDirectory *pDir, TObject *pTObject, IOpaqueAddress *&refpAddr)
Create address of the transient object according to the requested representation.
Definition: RConverter.cpp:155
RootHistCnv::RConverter::setDiskDirectory
void setDiskDirectory(const std::string &loc)
Definition: RConverter.cpp:141