File indexing completed on 2025-01-18 09:57:38
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef GAUDI_IAUDITOR_H
0012 #define GAUDI_IAUDITOR_H
0013
0014
0015 #include "GaudiKernel/INamedInterface.h"
0016 #include <array>
0017 #include <string>
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 class GAUDI_API IAuditor : virtual public INamedInterface {
0029 public:
0030
0031 DeclareInterfaceID( IAuditor, 3, 0 );
0032
0033
0034 enum StandardEventType { Initialize, ReInitialize, Execute, Finalize, Start, Stop, ReStart };
0035
0036
0037
0038
0039 typedef std::string CustomEventType;
0040
0041 typedef const CustomEventType& CustomEventTypeRef;
0042
0043
0044 virtual void before( StandardEventType, INamedInterface* ) = 0;
0045
0046 virtual void before( StandardEventType, const std::string& ) = 0;
0047
0048
0049 virtual void before( CustomEventTypeRef, INamedInterface* ) = 0;
0050
0051 virtual void before( CustomEventTypeRef, const std::string& ) = 0;
0052
0053
0054 virtual void after( StandardEventType, INamedInterface*, const StatusCode& sc = StatusCode::SUCCESS ) = 0;
0055
0056 virtual void after( StandardEventType, const std::string&, const StatusCode& sc = StatusCode::SUCCESS ) = 0;
0057
0058
0059 virtual void after( CustomEventTypeRef, INamedInterface*, const StatusCode& sc = StatusCode::SUCCESS ) = 0;
0060
0061 virtual void after( CustomEventTypeRef, const std::string&, const StatusCode& sc = StatusCode::SUCCESS ) = 0;
0062
0063
0064 virtual bool isEnabled() const = 0;
0065
0066
0067
0068 virtual void beforeInitialize( INamedInterface* ) = 0;
0069
0070 virtual void afterInitialize( INamedInterface* ) = 0;
0071
0072
0073 virtual void beforeReinitialize( INamedInterface* ) = 0;
0074
0075 virtual void afterReinitialize( INamedInterface* ) = 0;
0076
0077
0078 virtual void beforeExecute( INamedInterface* ) = 0;
0079
0080 virtual void afterExecute( INamedInterface*, const StatusCode& ) = 0;
0081
0082
0083 virtual void beforeFinalize( INamedInterface* ) = 0;
0084
0085 virtual void afterFinalize( INamedInterface* ) = 0;
0086
0087
0088 virtual StatusCode sysInitialize() = 0;
0089
0090
0091 virtual StatusCode sysFinalize() = 0;
0092 };
0093
0094
0095 inline const char* toStr( IAuditor::StandardEventType e ) {
0096 static const std::array<const char*, IAuditor::StandardEventType::ReStart + 1> s_tbl = {
0097 { "Initialize", "ReInitialize", "Execute", "Finalize", "Start", "Stop", "ReStart" } };
0098 return e <= IAuditor::StandardEventType::ReStart ? s_tbl[e] : nullptr;
0099 }
0100
0101 inline std::ostream& operator<<( std::ostream& s, IAuditor::StandardEventType e ) { return s << toStr( e ); }
0102
0103 #endif