All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RootCnvSvc.h
Go to the documentation of this file.
1 // $Id: RootCnvSvc.h,v 1.7 2010-09-14 06:01:12 frankb Exp $
2 //====================================================================
3 // RootCnvSvc definition
4 //--------------------------------------------------------------------
5 //
6 // Author : M.Frank
7 //====================================================================
8 #ifndef GAUDIROOTCNV_GAUDIROOTCNVSVC_H
9 #define GAUDIROOTCNV_GAUDIROOTCNVSVC_H
10 // $Header: /afs/cern.ch/project/cvs/reps/lhcb/Online/RootCnv/src/RootCnvSvc.h,v 1.7 2010-09-14 06:01:12 frankb Exp $
11 
12 // Framework include files
14 #include "GaudiKernel/DataObject.h"
15 #include "GaudiKernel/ClassID.h"
16 
17 // C++ include files
18 #include <set>
19 
20 // Forward declarations
21 class IDataManagerSvc;
22 class IIncidentSvc;
23 class TClass;
24 
25 // ROOT include files
26 #include "TROOT.h"
27 #include "TClass.h"
28 #include "TTree.h"
29 #include "TBranch.h"
30 
31 //#include "RootCnv/RootPerfMonSvc.h"
32 
33 /*
34  * Gaudi namespace declaration
35  */
36 namespace Gaudi {
37 
38  // Forward declarations
39  class IIODataManager;
40  class IDataConnection;
41  class RootDataConnection;
42  class RootConnectionSetup;
43 
55  protected:
56 
64  TClass* m_classRefs;
66  TClass* m_classDO;
70  std::string m_currSection;
71 
75  std::string m_shareFiles;
77  std::string m_recordName;
79  std::string m_ioPerfStats;
81  std::string m_compression;
82 
91 
93  std::set<std::string> m_badFiles;
94 
97 
99  TClass* getClass(DataObject* pObject);
101  MsgStream& log() const { return *m_log; }
102 
103  public:
104 
106  RootCnvSvc(const std::string& name, ISvcLocator* svc);
107 
109  virtual ~RootCnvSvc();
110 
113  { return StatusCode::SUCCESS; }
114 
120  StatusCode error(const std::string& msg);
121 
128  StatusCode connectDatabase(const std::string& dataset, int mode, RootDataConnection** con);
129 
131  virtual StatusCode initialize();
132 
134  virtual StatusCode finalize();
135 
137  virtual IConverter* createConverter(long typ,
138  const CLID& wanted,
139  const ICnvFactory* fac);
140 
142  virtual void loadConverter(DataObject* pObj);
143 
150  virtual StatusCode connectOutput(const std::string& outputFile,
151  const std::string& openMode);
152 
158  virtual StatusCode connectOutput(const std::string& outputFile);
159 
170  virtual StatusCode commitOutput(const std::string& outputFile,
171  bool do_commit);
172 
178  virtual StatusCode disconnect(const std::string& dbName);
179 
191  virtual StatusCode createAddress( long svc_type,
192  const CLID& clid,
193  const std::string* par,
194  const unsigned long* ip,
195  IOpaqueAddress*& refpAddress);
196 
206  virtual StatusCode createAddress( long svc_type,
207  const CLID& clid,
208  const std::string& refAddress,
209  IOpaqueAddress*& refpAddress) {
210  return this->ConversionSvc::createAddress(svc_type,clid,refAddress,refpAddress);
211  }
212 
219  virtual StatusCode createNullRep(const std::string& path);
220 
227  virtual StatusCode createNullRef(const std::string& path);
228 
236  virtual StatusCode i__createRep(DataObject* pObj, IOpaqueAddress*& refpAddr);
237 
238 
246  virtual StatusCode i__fillRepRefs(IOpaqueAddress* pAddr,DataObject* pObj);
247 
255  virtual StatusCode i__createObj(IOpaqueAddress* pAddr, DataObject*& refpObj);
256 
264  virtual StatusCode i__fillObjRefs(IOpaqueAddress* pAddr, DataObject* pObj);
265  };
266 }
267 
268 #endif // GAUDIROOTCNV_GAUDIROOTCNVSVC_H
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & log() const
Helper: Use message streamer.
Definition: RootCnvSvc.h:101
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:26
The data converters are responsible to translate data from one representation into another...
Definition: IConverter.h:57
std::string m_currSection
Property: ROOT section name.
Definition: RootCnvSvc.h:70
Gaudi::IIODataManager * m_ioMgr
Reference to the I/O data manager.
Definition: RootCnvSvc.h:58
int m_basketSize
Property: Basket optimization parameter for ROOT TTree (total basket size)
Definition: RootCnvSvc.h:86
RootConnectionSetup * m_setup
Setup structure (ref-counted) and passed to data connections.
Definition: RootCnvSvc.h:68
IIncidentSvc * m_incidentSvc
Reference to incident service.
Definition: RootCnvSvc.h:60
Description:
Definition: RootCnvSvc.h:54
int m_splitLevel
Property: Split level optimization parameter for ROOT TTree.
Definition: RootCnvSvc.h:90
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
TClass * m_classDO
TClass pointer to DataObject class.
Definition: RootCnvSvc.h:66
unsigned int CLID
Class ID definition.
Definition: ClassID.h:9
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
bool m_incidentEnabled
Property: Flag to enable incidents on FILE_OPEN.
Definition: RootCnvSvc.h:73
std::set< std::string > m_badFiles
Set with bad files/tables.
Definition: RootCnvSvc.h:93
std::string m_shareFiles
Property: Share files ? If set to YES, files will not be closed on finalize.
Definition: RootCnvSvc.h:75
MsgStream * m_log
Message streamer.
Definition: RootCnvSvc.h:96
virtual StatusCode createAddress(long svc_type, const CLID &clid, const std::string &refAddress, IOpaqueAddress *&refpAddress)
IAddressCreator implementation: Creates an address in string form to object form. ...
Definition: RootCnvSvc.h:206
std::string m_compression
Property: Compression-algorithm:compression-level.
Definition: RootCnvSvc.h:81
std::string m_recordName
Property: Records name to fire incident for file records.
Definition: RootCnvSvc.h:77
virtual StatusCode createAddress(long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress)
Create a Generic address using explicit arguments to identify a single object.
Opaque address interface definition.
Base class for all conversion services.
Definition: ConversionSvc.h:47
This is a number of static methods for bootstrapping the Gaudi framework.
Definition: Bootstrap.h:14
std::string m_ioPerfStats
Property: Enable TTree IOperfStats if not empty; otherwise perf stat file name.
Definition: RootCnvSvc.h:79
#define GAUDI_API
Definition: Kernel.h:108
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
Concrete implementation of the IDataConnection interface to access ROOT files.
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:22
int m_bufferSize
Property: Buffer size optimization parameter for ROOT TTree.
Definition: RootCnvSvc.h:88
Gaudi::RootDataConnection * m_current
On writing: reference to active output stream.
Definition: RootCnvSvc.h:62
virtual StatusCode updateServiceState(IOpaqueAddress *)
Update state of the service.
Definition: RootCnvSvc.h:112
int m_autoFlush
Property: AutoFlush parameter for ROOT TTree (Number of events between auto flushes) ...
Definition: RootCnvSvc.h:84
TClass * m_classRefs
TClass pointer to reference class.
Definition: RootCnvSvc.h:64