DetDataSvc.h
Go to the documentation of this file.
1 #ifndef DETECTORDATASVC_DETDATASVC_H
2 #define DETECTORDATASVC_DETDATASVC_H
3 
4 // Base classes
5 //#include "GaudiKernel/DataSvc.h"
6 // D. Piparo: Change to the new thread safe version
7 #include "GaudiKernel/TsDataSvc.h"
8 #include "GaudiKernel/IDetDataSvc.h"
9 #include "GaudiKernel/IIncidentListener.h"
10 #include "GaudiKernel/Time.h"
11 
12 // Forward declarations
13 class StatusCode;
14 class IAddressCreator;
15 
17 //--------------------------------------------------------------------------
27 
28 class DetDataSvc : public extends2<TsDataSvc, IDetDataSvc, IIncidentListener>
29 {
30 
31  // unhides DataSvc updateObject methods
33 
34 public:
35 
36  // Overloaded DataSvc methods
37 
39  StatusCode initialize() override;
40 
42  StatusCode reinitialize() override;
43 
45  StatusCode finalize() override;
46 
48  StatusCode clearStore() override;
49 
51  StatusCode updateObject( DataObject* toUpdate ) override;
52 
54  DetDataSvc(const std::string& name, ISvcLocator* svc);
55 
57  ~DetDataSvc() override = default;
58 
59 private:
62 
63 public:
64 
65  // Implementation of the IDetDataSvc interface
66 
69  bool validEventTime() const override;
70 
72  const Gaudi::Time& eventTime() const override;
73 
75  void setEventTime( const Gaudi::Time& time ) override;
76 
77 public:
78 
79  // Implementation of the IIncidentListener interface
80 
82  void handle( const Incident& ) override;
83 
84 private:
85 
88 
90  std::string m_detDbLocation = "empty";
91 
93  std::string m_detDbRootName = "dd";
94 
96  std::string m_persistencySvcName = "DetectorPersistencySvc";
97 
99  bool m_usePersistency = false;
100 
103 
106 
107 };
108 
109 #endif // DETECTORDATASVC_DETDATASVC_H
bool validEventTime() const override
Check if the event time has been set.
Definition: DetDataSvc.cpp:201
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
const Gaudi::Time & eventTime() const override
Get the event time.
Definition: DetDataSvc.cpp:206
void handle(const Incident &) override
Inform that a new incident has occured.
Definition: DetDataSvc.cpp:211
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: TsDataSvc.cpp:1017
StatusCode updateObject(DataObject *toUpdate) override
Update object.
Definition: DetDataSvc.cpp:221
IAddressCreator interface definition.
~DetDataSvc() override=default
Standard Destructor.
const long XML_StorageType
Definition: ClassID.h:57
std::string m_persistencySvcName
Name of the persistency service.
Definition: DetDataSvc.h:96
StatusCode setupDetectorDescription()
Deal with Detector Description initialization.
Definition: DetDataSvc.cpp:55
StatusCode clearStore() override
Remove all data objects in the data store.
Definition: DetDataSvc.cpp:150
Based on seal::Time.
Definition: Time.h:213
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
SmartIF< IAddressCreator > m_addrCreator
Address Creator to be used.
Definition: DetDataSvc.h:105
int m_detStorageType
Detector Data Persistency Storage type.
Definition: DetDataSvc.h:87
DetDataSvc(const std::string &name, ISvcLocator *svc)
Standard Constructor.
Definition: DetDataSvc.cpp:183
StatusCode reinitialize() override
Initialize the service.
Definition: DetDataSvc.cpp:113
StatusCode finalize() override
Finalize the service.
Definition: DetDataSvc.cpp:131
StatusCode initialize() override
Initialize the service.
Definition: DetDataSvc.cpp:27
std::string m_detDbRootName
Name of the root node of the detector.
Definition: DetDataSvc.h:93
Gaudi::Time m_eventTime
Current event time.
Definition: DetDataSvc.h:102
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
std::string m_detDbLocation
Location of detector Db (filename,URL)
Definition: DetDataSvc.h:90
Base class for all Incidents (computing events).
Definition: Incident.h:16
void setEventTime(const Gaudi::Time &time) override
Set the new event time.
Definition: DetDataSvc.cpp:195
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
bool m_usePersistency
Flag to control if the persistency is required.
Definition: DetDataSvc.h:99