| The Gaudi Framework v27r1

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

- File List
- File Members

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 <string>
8 #include <map>
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 public:
19 GlobalDirectoryRestore() {
20 m_current = gDirectory;
21 }
22 virtual ~GlobalDirectoryRestore() {
23 gDirectory = m_current;
24 }
25 };
26
27 namespace RootHistCnv {
28
34 class RConverter : public Converter {
35 public:
37 StatusCode createRep(DataObject* pObj,
38 IOpaqueAddress*& refpAddr) override;
40 static long storageType() { return ROOT_StorageType; }
41 long repSvcType() const override { return i_repSvcType(); }
42
43 StatusCode error(const std::string& msg);
44 StatusCode regTFile(const std::string, const TFile*);
45 StatusCode findTFile(const std::string, TFile*&);
46
47 std::string diskDirectory(const std::string& loc);
48 std::string directory(const std::string& loc);
49 void setDirectory(const std::string& loc);
50 void setDiskDirectory(const std::string& loc);
51 StatusCode createDirectory(const std::string& loc);
52 StatusCode createDiskDirectory(const std::string& loc);
53 std::string getDirectory();
54
55 std::string convertId(const std::string& ) const ;
56
57 protected:
59 RConverter( const CLID& clid, ISvcLocator* svc )
60 : Converter(storageType(), clid, svc) { }
62 ~RConverter() override = default;
64 virtual StatusCode readObject( IOpaqueAddress* pAddr,
65 DataObject*& refpObj);
67 virtual TObject* createPersistent(DataObject* pObj);
69 StatusCode createAddress( DataObject* pObject,
70 TDirectory* pDir,
71 TObject* pTObject,
72 IOpaqueAddress*& refpAddr);
73
74 StatusCode createAddress(const std::string& rzdir,
75 const CLID& clid,
76 long id,
77 TObject* pTobj,
78 IOpaqueAddress*& refpAddress);
79
80 StatusCode createAddress(const std::string& rzdir,
81 const CLID& clid,
82 const std::string& title,
83 TObject* pTobj,
84 IOpaqueAddress*& refpAddress);
85
87 TDirectory* changeDirectory(DataObject* pObject);
88 };
89 } // namespace RootHistCnv
90
91 #endif // RootHistCnv_RConverter_H
RootHistCnv::RConverter::getDirectory
std::string getDirectory()
Definition: RConverter.cpp:153
RootHistCnv::RConverter
Root Converter.
Definition: RConverter.h:34
RootHistCnv::RConverter::RConverter
RConverter(const CLID &clid, ISvcLocator *svc)
Standard constructor.
Definition: RConverter.h:59
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:73
RootHistCnv::RConverter::setDirectory
void setDirectory(const std::string &loc)
Definition: RConverter.cpp:112
GaudiMP.FdsRegistry.msg
tuple msg
Definition: FdsRegistry.py:8
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:254
RootHistCnv::RConverter::~RConverter
~RConverter() override=default
Standard destructor.
RootHistCnv::RConverter::regTFile
StatusCode regTFile(const std::string, const TFile *)
Definition: RConverter.cpp:299
RootHistCnv::RConverter::findTFile
StatusCode findTFile(const std::string, TFile *&)
Definition: RConverter.cpp:316
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:226
RootHistCnv::RConverter::storageType
static long storageType()
Inquire storage type.
Definition: RConverter.h:40
std::string
STL class.
RootHistCnv::RConverter::createPersistent
virtual TObject * createPersistent(DataObject *pObj)
Create the persistent representation of an object.
Definition: RConverter.cpp:292
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
GlobalDirectoryRestore::GlobalDirectoryRestore
GlobalDirectoryRestore()
Definition: RConverter.h:19
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:22
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:105
Converter::i_repSvcType
virtual long i_repSvcType() const
Retrieve the class type of the data store the converter uses.
Definition: Converter.cpp:19
RootHistCnv::RConverter::error
StatusCode error(const std::string &msg)
Definition: RConverter.cpp:367
GlobalDirectoryRestore
Definition: RConverter.h:16
RootHistCnv::RConverter::repSvcType
long repSvcType() const override
Definition: RConverter.h:41
RootHistCnv::RConverter::convertId
std::string convertId(const std::string &) const
Definition: RConverter.cpp:351
RootHistCnv::RConverter::readObject
virtual StatusCode readObject(IOpaqueAddress *pAddr, DataObject *&refpObj)
Create the transient representation of an object.
Definition: RConverter.cpp:279
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:161
RootHistCnv::RConverter::setDiskDirectory
void setDiskDirectory(const std::string &loc)
Definition: RConverter.cpp:146