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 #include "GaudiKernel/IDetDataSvc.h"
7 #include "GaudiKernel/IIncidentListener.h"
8 #include "GaudiKernel/Time.h"
9 
10 // Forward declarations
11 class StatusCode;
12 class IAddressCreator;
13 
15 //--------------------------------------------------------------------------
22 
23 class DetDataSvc : public extends2<DataSvc, IDetDataSvc, IIncidentListener>
24 {
25 
26  // unhides DataSvc updateObject methods
28 
29 public:
30 
31  // Overloaded DataSvc methods
32 
34  StatusCode initialize() override;
35 
37  StatusCode reinitialize() override;
38 
40  StatusCode finalize() override;
41 
43  StatusCode clearStore() override;
44 
46  StatusCode updateObject( DataObject* toUpdate ) override;
47 
49  DetDataSvc(const std::string& name, ISvcLocator* svc);
50 
52  ~DetDataSvc() override = default;
53 
54 private:
57 
58 public:
59 
60  // Implementation of the IDetDataSvc interface
61 
64  bool validEventTime() const override;
65 
67  const Gaudi::Time& eventTime() const override;
68 
70  void setEventTime( const Gaudi::Time& time ) override;
71 
72 public:
73 
74  // Implementation of the IIncidentListener interface
75 
77  void handle( const Incident& ) override;
78 
79 private:
80 
83 
85  std::string m_detDbLocation = "empty";
86 
88  std::string m_detDbRootName = "dd";
89 
91  std::string m_persistencySvcName = "DetectorPersistencySvc";
92 
94  bool m_usePersistency = false;
95 
98 
101 
102 };
103 
104 #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(DataObject *toUpdate) override
Update object.
Definition: DetDataSvc.cpp:221
IAddressCreator interface definition.
~DetDataSvc() override=default
Standard Destructor.
std::string m_persistencySvcName
Name of the persistency service.
Definition: DetDataSvc.h:91
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:100
int m_detStorageType
Detector Data Persistency Storage type.
Definition: DetDataSvc.h:82
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:88
Gaudi::Time m_eventTime
Current event time.
Definition: DetDataSvc.h:97
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:85
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
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: DataSvc.cpp:889
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
const long XML_StorageType
Definition: ClassID.h:57
bool m_usePersistency
Flag to control if the persistency is required.
Definition: DetDataSvc.h:94