| The Gaudi Framework v28r2-patches (bc4ad17a)

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

- File List
- File Members

HistorySvc.h
Go to the documentation of this file.
1 #ifndef GAUDISVC_FASTHISTORYSVC_H
2 #define GAUDISVC_FASTHISTORYSVC_H
3
4 #include "GaudiKernel/IHistorySvc.h"
5
6 #include "GaudiKernel/AlgTool.h"
7 #include "GaudiKernel/Algorithm.h"
8 #include "GaudiKernel/IIncidentListener.h"
9 #include "GaudiKernel/IVersHistoryObj.h"
10 #include "GaudiKernel/Service.h"
11 #include "GaudiKernel/StatusCode.h"
12
13 #include "GaudiKernel/ClassID.h"
14 #include "GaudiKernel/MsgStream.h"
15 #include <fstream>
16 #include <map>
17 #include <set>
18 #include <string>
19 #include <vector>
20
21 class StoreGateSvc;
22 class IAlgContextSvc;
23 class IIncidentSvc;
24 class HistoryObj;
25 class DataHistory;
26 class AlgorithmHistory;
27 class ServiceHistory;
28 struct DHH;
29
36 class HistorySvc : public extends<Service, IHistorySvc, IIncidentListener>
37 {
38 public:
39 StatusCode initialize() override;
40 StatusCode reinitialize() override;
41 StatusCode finalize() override;
42 StatusCode stop() override;
43
44 virtual StatusCode captureState();
45
46 StatusCode registerJob() override;
47 StatusCode listProperties() const override;
48 JobHistory* getJobHistory() const override;
49
50 StatusCode registerSvc( const IService& ) override;
51 StatusCode listProperties( const IService& ) const override;
52 ServiceHistory* getServiceHistory( const IService& ) const override;
53 void getServiceHistory( std::set<ServiceHistory*>& ) const override;
54
55 StatusCode registerAlg( const Algorithm& ) override;
56 StatusCode listProperties( const Algorithm& ) const override;
57 AlgorithmHistory* getAlgHistory( const Algorithm& ) const override;
58 void getAlgHistory( std::set<AlgorithmHistory*>& ) const override;
59
60 StatusCode registerAlgTool( const IAlgTool& ) override;
61 StatusCode listProperties( const IAlgTool& ) const override;
62 AlgToolHistory* getAlgToolHistory( const IAlgTool& ) const override;
63 void getAlgToolHistory( std::set<AlgToolHistory*>& ) const override;
64
65 DataHistory* createDataHistoryObj( const CLID& id, const std::string& key, const std::string& store ) override;
66 virtual StatusCode registerDataHistory( const CLID& id, const std::string& key, const std::string& store );
67 DataHistory* getDataHistory( const CLID& id, const std::string& key, const std::string& store ) const override;
68 virtual int getDataHistory( const CLID& id, const std::string& key, const std::string& storeName,
69 std::list<DataHistory*>& dhlist ) const;
70
71 using extends::extends;
72
73 void handle( const Incident& inc ) override;
74
75 // Destructor.
76 ~HistorySvc() override = default;
77
78 private:
79 // typedef std::map<const CLID, std::map<const std::string, DataHistory*> >
80 // DataHistMap;
81
82 typedef IVersHistoryObj::PropertyList PropertyList;
83
84 typedef std::multimap<DHH, DataHistory*> DataHistMap;
85 typedef DataHistMap::iterator DHMitr;
86 typedef DataHistMap::const_iterator DHMCitr;
87
88 Gaudi::Property<bool> m_dump{this, "Dump", false};
89 Gaudi::Property<bool> m_activate{this, "Activate", true};
90 Gaudi::Property<std::string> m_outputFile{this, "OutputFile"};
91
92 void clearState();
93
94 bool m_isInitialized = false;
95
96 IAlgContextSvc* p_algCtxSvc = nullptr;
97
98 std::map<const Algorithm*, AlgorithmHistory*> m_algmap;
99
100 std::set<const IAlgTool*> m_ialgtools;
101 std::map<const AlgTool*, AlgToolHistory*> m_algtoolmap;
102 std::map<const IService*, ServiceHistory*> m_svcmap;
103
104 std::multimap<DHH, DataHistory*> m_datMap;
105
106 std::unique_ptr<JobHistory> m_jobHistory;
107
108 void dumpProperties( std::ofstream& ) const;
109 void dumpProperties( const IService&, std::ofstream& ) const;
110 void dumpProperties( const Algorithm&, std::ofstream& ) const;
111 void dumpProperties( const IAlgTool&, std::ofstream& ) const;
112
113 void dumpState( std::ofstream& ) const;
114 void dumpState( const INamedInterface*, std::ofstream& ) const;
115
116 std::string dumpProp( const Gaudi::Details::PropertyBase*, const bool isXML = false, int indent = 0 ) const;
117
118 IAlgorithm* getCurrentIAlg() const;
119
120 IIncidentSvc* m_incidentSvc = nullptr;
121 SmartIF<IToolSvc> m_toolSvc;
122
123 bool m_outputFileTypeXML = false;
124 };
125
126 #endif
HistorySvc::reinitialize
StatusCode reinitialize() override
Definition: HistorySvc.cpp:80
HistorySvc::getAlgToolHistory
AlgToolHistory * getAlgToolHistory(const IAlgTool &) const override
Definition: HistorySvc.cpp:683
Algorithm.h
SmartIF< IToolSvc >
ClassID.h
HistorySvc::~HistorySvc
~HistorySvc() override=default
HistorySvc::m_toolSvc
SmartIF< IToolSvc > m_toolSvc
Definition: HistorySvc.h:121
HistorySvc::registerSvc
StatusCode registerSvc(const IService &) override
Definition: HistorySvc.cpp:535
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:314
HistorySvc::registerAlgTool
StatusCode registerAlgTool(const IAlgTool &) override
Definition: HistorySvc.cpp:612
MsgStream.h
HistorySvc::dumpProp
std::string dumpProp(const Gaudi::Details::PropertyBase *, const bool isXML=false, int indent=0) const
Definition: HistorySvc.cpp:713
HistorySvc::registerAlg
StatusCode registerAlg(const Algorithm &) override
Definition: HistorySvc.cpp:293
DHH
Definition: HistorySvc.cpp:62
AlgorithmHistory
AlgorithmHistory class definition.
Definition: AlgorithmHistory.h:26
HistorySvc::initialize
StatusCode initialize() override
Definition: HistorySvc.cpp:119
AlgTool.h
HistorySvc::listProperties
StatusCode listProperties() const override
Definition: HistorySvc.cpp:370
HistorySvc::registerDataHistory
virtual StatusCode registerDataHistory(const CLID &id, const std::string &key, const std::string &store)
Definition: HistorySvc.cpp:471
HistorySvc::getAlgHistory
AlgorithmHistory * getAlgHistory(const Algorithm &) const override
Definition: HistorySvc.cpp:352
HistorySvc::stop
StatusCode stop() override
Definition: HistorySvc.cpp:247
HistorySvc
HistorySvc class definition.
Definition: HistorySvc.h:36
HistoryObj
Base class for History Objects.
Definition: HistoryObj.h:21
HistorySvc::m_datMap
std::multimap< DHH, DataHistory * > m_datMap
Definition: HistorySvc.h:104
HistorySvc::m_algtoolmap
std::map< const AlgTool *, AlgToolHistory * > m_algtoolmap
Definition: HistorySvc.h:101
JobHistory
JobHistory class definition.
Definition: JobHistory.h:22
std::map< const Algorithm *, AlgorithmHistory * >
IVersHistoryObj.h
HistorySvc::getCurrentIAlg
IAlgorithm * getCurrentIAlg() const
Definition: HistorySvc.cpp:433
HistorySvc::handle
void handle(const Incident &inc) override
Definition: HistorySvc.cpp:701
HistorySvc::DataHistMap
std::multimap< DHH, DataHistory * > DataHistMap
Definition: HistorySvc.h:84
std::string
STL class.
Service.h
std::ofstream
STL class.
HistorySvc::m_dump
Gaudi::Property< bool > m_dump
Definition: HistorySvc.h:88
HistorySvc::m_isInitialized
bool m_isInitialized
Definition: HistorySvc.h:94
HistorySvc::getJobHistory
JobHistory * getJobHistory() const override
Definition: HistorySvc.cpp:430
IService
General service interface definition.
Definition: IService.h:18
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
HistorySvc::m_outputFileTypeXML
bool m_outputFileTypeXML
Definition: HistorySvc.h:123
DataHistory
DataHistory class definition.
Definition: DataHistory.h:23
HistorySvc::p_algCtxSvc
IAlgContextSvc * p_algCtxSvc
Definition: HistorySvc.h:96
IHistorySvc.h
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
HistorySvc::DHMCitr
DataHistMap::const_iterator DHMCitr
Definition: HistorySvc.h:86
std::list
STL class.
IAlgorithm
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:27
HistorySvc::finalize
StatusCode finalize() override
Definition: HistorySvc.cpp:273
std::multimap< DHH, DataHistory * >
AlgToolHistory
AlgToolHistory class definition.
Definition: AlgToolHistory.h:21
HistorySvc::dumpState
void dumpState(std::ofstream &) const
Definition: HistorySvc.cpp:731
HistorySvc::m_incidentSvc
IIncidentSvc * m_incidentSvc
Definition: HistorySvc.h:120
Algorithm
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:78
INamedInterface
IInterface compliant class extending IInterface with the name() method.
Definition: INamedInterface.h:15
std::set
STL class.
std::vector< Gaudi::Details::PropertyBase * >
std::unique_ptr< JobHistory >
HistorySvc::dumpProperties
void dumpProperties(std::ofstream &) const
Definition: HistorySvc.cpp:411
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
HistorySvc::createDataHistoryObj
DataHistory * createDataHistoryObj(const CLID &id, const std::string &key, const std::string &store) override
Definition: HistorySvc.cpp:443
Incident
Base class for all Incidents (computing events).
Definition: Incident.h:17
HistorySvc::registerJob
StatusCode registerJob() override
Definition: HistorySvc.cpp:367
IAlgTool
The interface implemented by the AlgTool base class.
Definition: IAlgTool.h:23
ServiceHistory
ServiceHistory class definition.
Definition: ServiceHistory.h:21
HistorySvc::m_algmap
std::map< const Algorithm *, AlgorithmHistory * > m_algmap
Definition: HistorySvc.h:98
HistorySvc::PropertyList
IVersHistoryObj::PropertyList PropertyList
Definition: HistorySvc.h:82
IAlgContextSvc
An abstract interface for Algorithm Context Service.
Definition: IAlgContextSvc.h:23
IIncidentListener.h
StatusCode.h
HistorySvc::m_outputFile
Gaudi::Property< std::string > m_outputFile
Definition: HistorySvc.h:90
HistorySvc::m_ialgtools
std::set< const IAlgTool * > m_ialgtools
Definition: HistorySvc.h:100
HistorySvc::DHMitr
DataHistMap::iterator DHMitr
Definition: HistorySvc.h:85
HistorySvc::clearState
void clearState()
Definition: HistorySvc.cpp:107
HistorySvc::captureState
virtual StatusCode captureState()
Definition: HistorySvc.cpp:169
HistorySvc::getServiceHistory
ServiceHistory * getServiceHistory(const IService &) const override
Definition: HistorySvc.cpp:566
HistorySvc::m_svcmap
std::map< const IService *, ServiceHistory * > m_svcmap
Definition: HistorySvc.h:102
HistorySvc::getDataHistory
DataHistory * getDataHistory(const CLID &id, const std::string &key, const std::string &store) const override
Definition: HistorySvc.cpp:505
IIncidentSvc
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:23
HistorySvc::m_activate
Gaudi::Property< bool > m_activate
Definition: HistorySvc.h:89
HistorySvc::m_jobHistory
std::unique_ptr< JobHistory > m_jobHistory
Definition: HistorySvc.h:106