| The Gaudi Framework v27r1

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

- File List
- File Members

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/Service.h"
6 #include "GaudiKernel/IAuditorSvc.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,
19 IAuditorSvc> {
20 public:
21
22
23 // Inherited Service overrides:
24 //
25 // Initialize the service.
26 StatusCode initialize() override;
27
28 // Finalize the service.
29 StatusCode finalize() override;
30
31 // IAuditorSvc interfaces overwrite
32 //
34
35 void before(StandardEventType, INamedInterface*) override;
36 void before(StandardEventType, const std::string&) override;
37
38 void before(CustomEventTypeRef, INamedInterface*) override;
39 void before(CustomEventTypeRef, const std::string&) override;
40
41 void after(StandardEventType, INamedInterface*, const StatusCode&) override;
42 void after(StandardEventType, const std::string&, const StatusCode&) override;
43
44 void after(CustomEventTypeRef, INamedInterface*, const StatusCode&) override;
45 void after(CustomEventTypeRef, const std::string&, const StatusCode&) override;
46
47 // inform Auditors that the initialize() is about to be called
48 void beforeInitialize(INamedInterface* ini) override;
49 // inform Auditors that the initialize() has been called
50 void afterInitialize(INamedInterface* ini) override;
51
52 // inform Auditors that the reinitialize() is about to be called
53 void beforeReinitialize(INamedInterface* ini) override;
54 // inform Auditors that the reinitialize() has been called
55 void afterReinitialize(INamedInterface* ini) override;
56
57 // inform Auditors that the execute() is about to be called
58 void beforeExecute(INamedInterface* ini) override;
59 // inform Auditors that the execute() has been called
60 void afterExecute(INamedInterface* ini, const StatusCode& ) override;
61
62 // inform Auditors that the beginRun() is about to be called
63 void beforeBeginRun(INamedInterface* ini) override;
64 // inform Auditors that the beginRun() has been called
65 void afterBeginRun(INamedInterface* ini) override;
66
67 // inform Auditors that the endRun() is about to be called
68 void beforeEndRun(INamedInterface* ini) override;
69 // inform Auditors that the endRun() has been called
70 void afterEndRun(INamedInterface* ini) override;
71
72 // inform Auditors that the finalize() is about to be called
73 void beforeFinalize(INamedInterface* ini) override;
74 // inform Auditors that the finalize() has been called
75 void afterFinalize(INamedInterface* ini) override;
76
77 bool isEnabled() const override;
78
79 StatusCode sysInitialize() override;
80 StatusCode sysFinalize() override;
81
82 // management functionality: retrieve an Auditor
83 IAuditor* getAuditor( const std::string& name ) override;
84
85 // Standard Constructor.
86 // Input: name String with service name
87 // Input: svc Pointer to service locator interface
88 AuditorSvc( const std::string& name, ISvcLocator* svc );
89
90 // Destructor.
91 ~AuditorSvc() override = default;
92
93 private:
94 // management helper
95 SmartIF<IAuditor> newAuditor_( MsgStream&, const std::string& );
96 SmartIF<IAuditor> findAuditor_( const std::string& );
97 StatusCode syncAuditors_();
98
99 // List of auditor names
100 std::vector<std::string> m_audNameList;
101
102 // Manager list of Auditors
103 std::vector<SmartIF<IAuditor>> m_pAudList;
104
105 // To disable alltogether the auditors
106 bool m_isEnabled = true;
107 };
108
109 #endif
AuditorSvc::beforeBeginRun
void beforeBeginRun(INamedInterface *ini) override
AuditorSvc::initialize
StatusCode initialize() override
Definition: AuditorSvc.cpp:90
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
SmartIF< IAuditor >
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
IAuditorSvc.h
AuditorSvc::after
void after(StandardEventType, INamedInterface *, const StatusCode &) override
Definition: AuditorSvc.cpp:143
AuditorSvc::afterReinitialize
void afterReinitialize(INamedInterface *ini) override
AuditorSvc::sysFinalize
StatusCode sysFinalize() override
Definition: AuditorSvc.cpp:207
AuditorSvc::afterExecute
void afterExecute(INamedInterface *ini, const StatusCode &) override
Definition: AuditorSvc.cpp:185
AuditorSvc::AuditorSvc
AuditorSvc(const std::string &name, ISvcLocator *svc)
Definition: AuditorSvc.cpp:81
AuditorSvc::beforeEndRun
void beforeEndRun(INamedInterface *ini) override
AuditorSvc
Definition: AuditorSvc.h:18
AuditorSvc::m_pAudList
std::vector< SmartIF< IAuditor > > m_pAudList
Definition: AuditorSvc.h:103
AuditorSvc::before
void before(StandardEventType, INamedInterface *) override
The following methods are meant to be implemented by the child class...
Definition: AuditorSvc.cpp:114
AuditorSvc::isEnabled
bool isEnabled() const override
Definition: AuditorSvc.cpp:200
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:319
AuditorSvc::sysInitialize
StatusCode sysInitialize() override
Definition: AuditorSvc.cpp:204
AuditorSvc::beforeReinitialize
void beforeReinitialize(INamedInterface *ini) override
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
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< std::string >
AuditorSvc::finalize
StatusCode finalize() override
Definition: AuditorSvc.cpp:102
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
AuditorSvc::~AuditorSvc
~AuditorSvc() override=default
AuditorSvc::getAuditor
IAuditor * getAuditor(const std::string &name) override
Definition: AuditorSvc.cpp:212
AuditorSvc::newAuditor_
SmartIF< IAuditor > newAuditor_(MsgStream &, const std::string &)
Definition: AuditorSvc.cpp:22
AuditorSvc::m_audNameList
std::vector< std::string > m_audNameList
Definition: AuditorSvc.h:100
AuditorSvc::m_isEnabled
bool m_isEnabled
Definition: AuditorSvc.h:106
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