| The Gaudi Framework v27r1

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

- File List
- File Members

IAuditor.h
Go to the documentation of this file.
1 #ifndef GAUDI_IAUDITOR_H
2 #define GAUDI_IAUDITOR_H
3
4 // Include files
5 #include "GaudiKernel/INamedInterface.h"
6 #include <string>
7 #include <array>
8
18 class GAUDI_API IAuditor: virtual public INamedInterface {
19 public:
21 DeclareInterfaceID(IAuditor,3,0);
22
24 enum StandardEventType {
25 Initialize,
26 ReInitialize,
27 Execute,
28 BeginRun,
29 EndRun,
30 Finalize,
31 Start,
32 Stop,
33 ReStart
34 };
35
39 typedef std::string CustomEventType;
41 typedef const CustomEventType& CustomEventTypeRef;
42
44 virtual void before(StandardEventType, INamedInterface*) = 0;
46 virtual void before(StandardEventType, const std::string&) = 0;
47
49 virtual void before(CustomEventTypeRef, INamedInterface*) = 0;
51 virtual void before(CustomEventTypeRef, const std::string&) = 0;
52
54 virtual void after(StandardEventType, INamedInterface*, const StatusCode& sc = StatusCode(StatusCode::SUCCESS,true)) = 0;
56 virtual void after(StandardEventType, const std::string&, const StatusCode& sc = StatusCode(StatusCode::SUCCESS,true)) = 0;
57
59 virtual void after(CustomEventTypeRef, INamedInterface*, const StatusCode& sc = StatusCode(StatusCode::SUCCESS,true)) = 0;
61 virtual void after(CustomEventTypeRef, const std::string&, const StatusCode& sc = StatusCode(StatusCode::SUCCESS,true)) = 0;
62
64 virtual bool isEnabled() const = 0;
65
66 // ------- Obsolete interface ------
68 virtual void beforeInitialize(INamedInterface* ) = 0;
70 virtual void afterInitialize(INamedInterface* ) = 0;
71
73 virtual void beforeReinitialize(INamedInterface* ) = 0;
75 virtual void afterReinitialize(INamedInterface* ) = 0;
76
78 virtual void beforeExecute(INamedInterface* ) = 0;
80 virtual void afterExecute(INamedInterface*, const StatusCode& ) = 0;
81
83 virtual void beforeBeginRun(INamedInterface* ) = 0;
85 virtual void afterBeginRun(INamedInterface* ) = 0;
86
88 virtual void beforeEndRun(INamedInterface* ) = 0;
90 virtual void afterEndRun(INamedInterface* ) = 0;
91
93 virtual void beforeFinalize(INamedInterface* ) = 0;
95 virtual void afterFinalize(INamedInterface* ) = 0;
96
98 virtual StatusCode sysInitialize( ) = 0;
99
101 virtual StatusCode sysFinalize( ) = 0;
102
103 };
104
106 inline const char* toStr(IAuditor::StandardEventType e) {
107 static const std::array<const char*,IAuditor::StandardEventType::ReStart+1> s_tbl =
108 {{ "Initialize", "ReInitialize", "Execute",
109 "BeginRun", "EndRun", "Finalize",
110 "Start", "Stop", "ReStart" }};
111 return e <= IAuditor::StandardEventType::ReStart ? s_tbl[e] : nullptr;
112 }
113
114 inline std::ostream & operator << (std::ostream & s, IAuditor::StandardEventType e) {
115 return s << toStr(e);
116 }
117
118
119 #endif // GAUDIKERNEL_IAUDITOR_H
120
IAuditor::Start
Definition: IAuditor.h:31
IAuditor::BeginRun
Definition: IAuditor.h:28
toStr
const char * toStr(IAuditor::StandardEventType e)
Simple mapping function from IAuditor::StandardEventType to string.
Definition: IAuditor.h:106
IAuditor::StandardEventType
StandardEventType
Defines the standard (= used by the framework) auditable event types.
Definition: IAuditor.h:24
IAuditor::Stop
Definition: IAuditor.h:32
IAuditor::ReInitialize
Definition: IAuditor.h:26
INamedInterface::DeclareInterfaceID
DeclareInterfaceID(INamedInterface, 1, 0)
InterfaceID.
IAuditor::CustomEventTypeRef
const CustomEventType & CustomEventTypeRef
Used in function calls for optimization purposes.
Definition: IAuditor.h:41
merge_files.sc
int sc
Definition: merge_files.py:167
std::string
STL class.
operator<<
std::ostream & operator<<(std::ostream &s, IAuditor::StandardEventType e)
Definition: IAuditor.h:114
INamedInterface.h
IAuditor::CustomEventType
std::string CustomEventType
Type used to allow users to specify a custom event to be audit.
Definition: IAuditor.h:39
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IAuditor::Finalize
Definition: IAuditor.h:30
IAuditor::Initialize
Definition: IAuditor.h:25
INamedInterface
IInterface compliant class extending IInterface with the name() method.
Definition: INamedInterface.h:15
IAuditor::Execute
Definition: IAuditor.h:27
gaudirun.s
string s
Definition: gaudirun.py:245
std::array
STL class.
IAuditor::EndRun
Definition: IAuditor.h:29
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:107
IAuditor
The IAuditor is the interface implmented by the AlgAuditor base class.
Definition: IAuditor.h:18
std::ostream
STL class.