The Gaudi Framework  v30r3 (a5ef0a68)
IAuditor.h
Go to the documentation of this file.
1 #ifndef GAUDI_IAUDITOR_H
2 #define GAUDI_IAUDITOR_H
3 
4 // Include files
6 #include <array>
7 #include <string>
8 
18 class GAUDI_API IAuditor : virtual public INamedInterface
19 {
20 public:
23 
25  enum StandardEventType { Initialize, ReInitialize, Execute, BeginRun, EndRun, Finalize, Start, Stop, ReStart };
26 
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 {
103  {"Initialize", "ReInitialize", "Execute", "BeginRun", "EndRun", "Finalize", "Start", "Stop", "ReStart"}};
104  return e <= IAuditor::StandardEventType::ReStart ? s_tbl[e] : nullptr;
105 }
106 
108 
109 #endif // GAUDIKERNEL_IAUDITOR_H
const char * toStr(IAuditor::StandardEventType e)
Simple mapping function from IAuditor::StandardEventType to string.
Definition: IAuditor.h:100
StandardEventType
Defines the standard (= used by the framework) auditable event types.
Definition: IAuditor.h:25
DeclareInterfaceID(INamedInterface, 1, 0)
InterfaceID.
const CustomEventType & CustomEventTypeRef
Used in function calls for optimization purposes.
Definition: IAuditor.h:32
STL class.
std::ostream & operator<<(std::ostream &s, IAuditor::StandardEventType e)
Definition: IAuditor.h:107
std::string CustomEventType
Type used to allow users to specify a custom event to be audit.
Definition: IAuditor.h:30
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
IInterface compliant class extending IInterface with the name() method.
string s
Definition: gaudirun.py:253
STL class.
#define GAUDI_API
Definition: Kernel.h:104
The IAuditor is the interface implmented by the AlgAuditor base class.
Definition: IAuditor.h:18
STL class.