| The Gaudi Framework v32r1 (f65d50dc)

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