| The Gaudi Framework v32r1 (f65d50dc)

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 public:
21 DeclareInterfaceID( IAuditor, 3, 0 );
22
24 enum StandardEventType { Initialize, ReInitialize, Execute, BeginRun, EndRun, Finalize, Start, Stop, ReStart };
25
29 typedef std::string CustomEventType;
31 typedef const CustomEventType& CustomEventTypeRef;
32
34 virtual void before( StandardEventType, INamedInterface* ) = 0;
36 virtual void before( StandardEventType, const std::string& ) = 0;
37
39 virtual void before( CustomEventTypeRef, INamedInterface* ) = 0;
41 virtual void before( CustomEventTypeRef, const std::string& ) = 0;
42
44 virtual void after( StandardEventType, INamedInterface*,
45 const StatusCode& sc = StatusCode( StatusCode::SUCCESS, true ) ) = 0;
47 virtual void after( StandardEventType, const std::string&,
48 const StatusCode& sc = StatusCode( StatusCode::SUCCESS, true ) ) = 0;
49
51 virtual void after( CustomEventTypeRef, INamedInterface*,
52 const StatusCode& sc = StatusCode( StatusCode::SUCCESS, true ) ) = 0;
54 virtual void after( CustomEventTypeRef, const std::string&,
55 const StatusCode& sc = StatusCode( StatusCode::SUCCESS, true ) ) = 0;
56
58 virtual bool isEnabled() const = 0;
59
60 // ------- Obsolete interface ------
62 virtual void beforeInitialize( INamedInterface* ) = 0;
64 virtual void afterInitialize( INamedInterface* ) = 0;
65
67 virtual void beforeReinitialize( INamedInterface* ) = 0;
69 virtual void afterReinitialize( INamedInterface* ) = 0;
70
72 virtual void beforeExecute( INamedInterface* ) = 0;
74 virtual void afterExecute( INamedInterface*, const StatusCode& ) = 0;
75
77 virtual void beforeBeginRun( INamedInterface* ) = 0;
79 virtual void afterBeginRun( INamedInterface* ) = 0;
80
82 virtual void beforeEndRun( INamedInterface* ) = 0;
84 virtual void afterEndRun( INamedInterface* ) = 0;
85
87 virtual void beforeFinalize( INamedInterface* ) = 0;
89 virtual void afterFinalize( INamedInterface* ) = 0;
90
92 virtual StatusCode sysInitialize() = 0;
93
95 virtual StatusCode sysFinalize() = 0;
96 };
97
99 inline const char* toStr( IAuditor::StandardEventType e ) {
100 static const std::array<const char*, IAuditor::StandardEventType::ReStart + 1> s_tbl = {
101 {"Initialize", "ReInitialize", "Execute", "BeginRun", "EndRun", "Finalize", "Start", "Stop", "ReStart"}};
102 return e <= IAuditor::StandardEventType::ReStart ? s_tbl[e] : nullptr;
103 }
104
105 inline std::ostream& operator<<( std::ostream& s, IAuditor::StandardEventType e ) { return s << toStr( e ); }
106
107 #endif // GAUDIKERNEL_IAUDITOR_H
toStr
const char * toStr(IAuditor::StandardEventType e)
Simple mapping function from IAuditor::StandardEventType to string.
Definition: IAuditor.h:99
IAuditor::StandardEventType
StandardEventType
Defines the standard (= used by the framework) auditable event types.
Definition: IAuditor.h:24
IAuditor::Stop
Definition: IAuditor.h:24
INamedInterface::DeclareInterfaceID
DeclareInterfaceID(INamedInterface, 1, 0)
InterfaceID.
IAuditor::CustomEventTypeRef
const CustomEventType & CustomEventTypeRef
Used in function calls for optimization purposes.
Definition: IAuditor.h:31
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
std::string
STL class.
operator<<
std::ostream & operator<<(std::ostream &s, IAuditor::StandardEventType e)
Definition: IAuditor.h:105
INamedInterface.h
IAuditor::CustomEventType
std::string CustomEventType
Type used to allow users to specify a custom event to be audit.
Definition: IAuditor.h:29
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
INamedInterface
IInterface compliant class extending IInterface with the name() method.
Definition: INamedInterface.h:15
gaudirun.s
string s
Definition: gaudirun.py:316
std::array
STL class.
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:71
IAuditor
The IAuditor is the interface implmented by the AlgAuditor base class.
Definition: IAuditor.h:18
std::ostream
STL class.