The Gaudi Framework  v30r3 (a5ef0a68)
AuditorSvc.h
Go to the documentation of this file.
1 #ifndef AuditorSvc_AuditorSvc_H
2 #define AuditorSvc_AuditorSvc_H
3 
4 // Include Files
6 #include "GaudiKernel/Service.h"
7 #include <list>
8 #include <vector>
9 
10 //------------------------------------------------------------------
11 //
12 // ClassName: AuditorSvc
13 //
14 // Description: This service manages Auditors.
15 // Auditors can be inserted in the system to audit the Algorithms is
16 // in their functions.
17 //------------------------------------------------------------------
18 class AuditorSvc : public extends<Service, IAuditorSvc>
19 {
20 public:
21  // Inherited Service overrides:
22  //
23  // Initialize the service.
24  StatusCode initialize() override;
25 
26  // Finalize the service.
27  StatusCode finalize() override;
28 
29  // IAuditorSvc interfaces overwrite
30  //
32 
33  void before( StandardEventType, INamedInterface* ) override;
34  void before( StandardEventType, const std::string& ) override;
35 
36  void before( CustomEventTypeRef, INamedInterface* ) override;
37  void before( CustomEventTypeRef, const std::string& ) override;
38 
39  void after( StandardEventType, INamedInterface*, const StatusCode& ) override;
40  void after( StandardEventType, const std::string&, const StatusCode& ) override;
41 
42  void after( CustomEventTypeRef, INamedInterface*, const StatusCode& ) override;
43  void after( CustomEventTypeRef, const std::string&, const StatusCode& ) override;
44 
45  // inform Auditors that the initialize() is about to be called
46  void beforeInitialize( INamedInterface* ini ) override;
47  // inform Auditors that the initialize() has been called
48  void afterInitialize( INamedInterface* ini ) override;
49 
50  // inform Auditors that the reinitialize() is about to be called
51  void beforeReinitialize( INamedInterface* ini ) override;
52  // inform Auditors that the reinitialize() has been called
53  void afterReinitialize( INamedInterface* ini ) override;
54 
55  // inform Auditors that the execute() is about to be called
56  void beforeExecute( INamedInterface* ini ) override;
57  // inform Auditors that the execute() has been called
58  void afterExecute( INamedInterface* ini, const StatusCode& ) override;
59 
60  // inform Auditors that the beginRun() is about to be called
61  void beforeBeginRun( INamedInterface* ini ) override;
62  // inform Auditors that the beginRun() has been called
63  void afterBeginRun( INamedInterface* ini ) override;
64 
65  // inform Auditors that the endRun() is about to be called
66  void beforeEndRun( INamedInterface* ini ) override;
67  // inform Auditors that the endRun() has been called
68  void afterEndRun( INamedInterface* ini ) override;
69 
70  // inform Auditors that the finalize() is about to be called
71  void beforeFinalize( INamedInterface* ini ) override;
72  // inform Auditors that the finalize() has been called
73  void afterFinalize( INamedInterface* ini ) override;
74 
75  bool isEnabled() const override;
76 
77  StatusCode sysInitialize() override;
78  StatusCode sysFinalize() override;
79 
80  // management functionality: retrieve an Auditor
81  IAuditor* getAuditor( const std::string& name ) override;
82 
83  using extends::extends;
84 
85 private:
86  // management helper
90 
91  Gaudi::Property<std::vector<std::string>> m_audNameList{this, "Auditors", {}, "list of auditors names"};
92  Gaudi::Property<bool> m_isEnabled{this, "Enable", true, "enable/disable alltogether the auditors"};
93 
94  // Manager list of Auditors
96 };
97 
98 #endif
void beforeBeginRun(INamedInterface *ini) override
StatusCode initialize() override
Definition: AuditorSvc.cpp:83
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:288
Implementation of property with value of concrete type.
Definition: Property.h:381
Gaudi::Property< bool > m_isEnabled
Definition: AuditorSvc.h:92
void after(StandardEventType, INamedInterface *, const StatusCode &) override
Definition: AuditorSvc.cpp:141
void afterReinitialize(INamedInterface *ini) override
StatusCode sysFinalize() override
Definition: AuditorSvc.cpp:206
void afterExecute(INamedInterface *ini, const StatusCode &) override
Definition: AuditorSvc.cpp:188
void beforeEndRun(INamedInterface *ini) override
std::vector< SmartIF< IAuditor > > m_pAudList
Definition: AuditorSvc.h:95
void before(StandardEventType, INamedInterface *) override
The following methods are meant to be implemented by the child class...
Definition: AuditorSvc.cpp:108
STL class.
void beforeExecute(INamedInterface *ini) override
StatusCode sysInitialize() override
Definition: AuditorSvc.cpp:205
void beforeReinitialize(INamedInterface *ini) override
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
void beforeInitialize(INamedInterface *ini) override
void afterInitialize(INamedInterface *ini) override
void afterEndRun(INamedInterface *ini) override
void afterBeginRun(INamedInterface *ini) override
SmartIF< IAuditor > findAuditor_(const std::string &)
Definition: AuditorSvc.cpp:42
IInterface compliant class extending IInterface with the name() method.
void beforeFinalize(INamedInterface *ini) override
STL class.
StatusCode finalize() override
Definition: AuditorSvc.cpp:95
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
IAuditor * getAuditor(const std::string &name) override
Definition: AuditorSvc.cpp:208
SmartIF< IAuditor > newAuditor_(MsgStream &, const std::string &)
Definition: AuditorSvc.cpp:22
void afterFinalize(INamedInterface *ini) override
StatusCode syncAuditors_()
Definition: AuditorSvc.cpp:51
The IAuditor is the interface implmented by the AlgAuditor base class.
Definition: IAuditor.h:18
Gaudi::Property< std::vector< std::string > > m_audNameList
Definition: AuditorSvc.h:91
bool isEnabled() const override
Definition: AuditorSvc.cpp:203