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
10 #include "GaudiKernel/Time.h"
11 
12 // Forward declarations
13 class StatusCode;
14 class IAddressCreator;
15 
17 //--------------------------------------------------------------------------
27 
28 class DetDataSvc : public extends<TsDataSvc,
29  IDetDataSvc,
30  IIncidentListener>
31 {
32 
33  // unhides DataSvc updateObject methods
35 
36 public:
37 
38  // Overloaded DataSvc methods
39 
41  StatusCode initialize() override;
42 
44  StatusCode reinitialize() override;
45 
47  StatusCode finalize() override;
48 
50  StatusCode clearStore() override;
51 
53  StatusCode updateObject( DataObject* toUpdate ) override;
54 
56  DetDataSvc(const std::string& name, ISvcLocator* svc);
57 
59  ~DetDataSvc() override = default;
60 
61 private:
64 
65 public:
66 
67  // Implementation of the IDetDataSvc interface
68 
71  bool validEventTime() const override;
72 
74  const Gaudi::Time& eventTime() const override;
75 
77  void setEventTime( const Gaudi::Time& time ) override;
78 
79 public:
80 
81  // Implementation of the IIncidentListener interface
82 
84  void handle( const Incident& ) override;
85 
86 private:
87 
90 
93 
96 
98  std::string m_persistencySvcName = "DetectorPersistencySvc";
99 
101  bool m_usePersistency = false;
102 
105 
108 
109 };
110 
111 #endif // DETECTORDATASVC_DETDATASVC_H
bool validEventTime() const override
Check if the event time has been set.
Definition: DetDataSvc.cpp:199
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:204
void handle(const Incident &) override
Inform that a new incident has occured.
Definition: DetDataSvc.cpp:209
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:219
IAddressCreator interface definition.
~DetDataSvc() override=default
Standard Destructor.
std::string m_persistencySvcName
Name of the persistency service.
Definition: DetDataSvc.h:98
STL class.
StatusCode setupDetectorDescription()
Deal with Detector Description initialization.
Definition: DetDataSvc.cpp:55
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
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:107
int m_detStorageType
Detector Data Persistency Storage type.
Definition: DetDataSvc.h:89
DetDataSvc(const std::string &name, ISvcLocator *svc)
Standard Constructor.
Definition: DetDataSvc.cpp:181
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
const long XML_StorageType
Definition: ClassID.h:57
std::string m_detDbRootName
Name of the root node of the detector.
Definition: DetDataSvc.h:95
Gaudi::Time m_eventTime
Current event time.
Definition: DetDataSvc.h:104
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:92
Base class for all Incidents (computing events).
Definition: Incident.h:17
void setEventTime(const Gaudi::Time &time) override
Set the new event time.
Definition: DetDataSvc.cpp:193
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:101