| The Gaudi Framework v29r0 (ff2e7097)

- 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 <array>
7 #include <string>
8
18 class GAUDI_API IAuditor : virtual public INamedInterface
19 {
20 public:
22 DeclareInterfaceID( IAuditor, 3, 0 );
23
25 enum StandardEventType { Initialize, ReInitialize, Execute, BeginRun, EndRun, Finalize, Start, Stop, ReStart };
26
30 typedef std::string CustomEventType;
32 typedef const CustomEventType& CustomEventTypeRef;
33
35 virtual void before( StandardEventType, INamedInterface* ) = 0;
37 virtual void before( StandardEventType, const std::string& ) = 0;
38
40 virtual void before( CustomEventTypeRef, INamedInterface* ) = 0;
42 virtual void before( CustomEventTypeRef, const std::string& ) = 0;
43
45 virtual void after( StandardEventType, INamedInterface*,
46 const StatusCode& sc = StatusCode( StatusCode::SUCCESS, true ) ) = 0;
48 virtual void after( StandardEventType, const std::string&,
49 const StatusCode& sc = StatusCode( StatusCode::SUCCESS, true ) ) = 0;
50
52 virtual void after( CustomEventTypeRef, INamedInterface*,
53 const StatusCode& sc = StatusCode( StatusCode::SUCCESS, true ) ) = 0;
55 virtual void after( CustomEventTypeRef, const std::string&,
56 const StatusCode& sc = StatusCode( StatusCode::SUCCESS, true ) ) = 0;
57
59 virtual bool isEnabled() const = 0;
60
61 // ------- Obsolete interface ------
63 virtual void beforeInitialize( INamedInterface* ) = 0;
65 virtual void afterInitialize( INamedInterface* ) = 0;
66
68 virtual void beforeReinitialize( INamedInterface* ) = 0;
70 virtual void afterReinitialize( INamedInterface* ) = 0;
71
73 virtual void beforeExecute( INamedInterface* ) = 0;
75 virtual void afterExecute( INamedInterface*, const StatusCode& ) = 0;
76
78 virtual void beforeBeginRun( INamedInterface* ) = 0;
80 virtual void afterBeginRun( INamedInterface* ) = 0;
81
83 virtual void beforeEndRun( INamedInterface* ) = 0;
85 virtual void afterEndRun( INamedInterface* ) = 0;
86
88 virtual void beforeFinalize( INamedInterface* ) = 0;
90 virtual void afterFinalize( INamedInterface* ) = 0;
91
93 virtual StatusCode sysInitialize() = 0;
94
96 virtual StatusCode sysFinalize() = 0;
97 };
98
100 inline const char* toStr( IAuditor::StandardEventType e )
101 {
102 static const std::array<const char*, IAuditor::StandardEventType::ReStart + 1> s_tbl = {
103 {"Initialize", "ReInitialize", "Execute", "BeginRun", "EndRun", "Finalize", "Start", "Stop", "ReStart"}};
104 return e <= IAuditor::StandardEventType::ReStart ? s_tbl[e] : nullptr;
105 }
106
107 inline std::ostream& operator<<( std::ostream& s, IAuditor::StandardEventType e ) { return s << toStr( e ); }
108
109 #endif // GAUDIKERNEL_IAUDITOR_H
toStr
const char * toStr(IAuditor::StandardEventType e)
Simple mapping function from IAuditor::StandardEventType to string.
Definition: IAuditor.h:100
StatusCode::SUCCESS
Definition: StatusCode.h:31
IAuditor::StandardEventType
StandardEventType
Defines the standard (= used by the framework) auditable event types.
Definition: IAuditor.h:25
IAuditor::Stop
Definition: IAuditor.h:25
INamedInterface::DeclareInterfaceID
DeclareInterfaceID(INamedInterface, 1, 0)
InterfaceID.
IAuditor::CustomEventTypeRef
const CustomEventType & CustomEventTypeRef
Used in function calls for optimization purposes.
Definition: IAuditor.h:32
std::string
STL class.
operator<<
std::ostream & operator<<(std::ostream &s, IAuditor::StandardEventType e)
Definition: IAuditor.h:107
INamedInterface.h
IAuditor::CustomEventType
std::string CustomEventType
Type used to allow users to specify a custom event to be audit.
Definition: IAuditor.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
INamedInterface
IInterface compliant class extending IInterface with the name() method.
Definition: INamedInterface.h:15
gaudirun.s
string s
Definition: gaudirun.py:253
std::array
STL class.
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:110
IAuditor
The IAuditor is the interface implmented by the AlgAuditor base class.
Definition: IAuditor.h:18
std::ostream
STL class.