Loading [MathJax]/jax/output/HTML-CSS/config.js
The Gaudi Framework  v38r0 (2143aa4c)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
IAuditor.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef GAUDI_IAUDITOR_H
12 #define GAUDI_IAUDITOR_H
13 
14 // Include files
16 #include <array>
17 #include <string>
18 
28 class GAUDI_API IAuditor : virtual public INamedInterface {
29 public:
32 
34  enum StandardEventType { Initialize, ReInitialize, Execute, Finalize, Start, Stop, ReStart };
35 
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 
56  virtual void after( StandardEventType, const std::string&, const StatusCode& sc = StatusCode::SUCCESS ) = 0;
57 
61  virtual void after( CustomEventTypeRef, const std::string&, const StatusCode& sc = StatusCode::SUCCESS ) = 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 beforeFinalize( INamedInterface* ) = 0;
85  virtual void afterFinalize( INamedInterface* ) = 0;
86 
88  virtual StatusCode sysInitialize() = 0;
89 
91  virtual StatusCode sysFinalize() = 0;
92 };
93 
95 inline const char* toStr( IAuditor::StandardEventType e ) {
97  { "Initialize", "ReInitialize", "Execute", "Finalize", "Start", "Stop", "ReStart" } };
98  return e <= IAuditor::StandardEventType::ReStart ? s_tbl[e] : nullptr;
99 }
100 
102 
103 #endif // GAUDIKERNEL_IAUDITOR_H
IAuditor::sysFinalize
virtual StatusCode sysFinalize()=0
Used by AuditorSvc.
std::string
STL class.
IAuditor::after
virtual void after(CustomEventTypeRef, const std::string &, const StatusCode &sc=StatusCode::SUCCESS)=0
Audit the end of a custom "event" for callers that do not implement INamedInterface.
IAuditor::beforeExecute
virtual void beforeExecute(INamedInterface *)=0
gaudirun.s
string s
Definition: gaudirun.py:346
IAuditor::afterExecute
virtual void afterExecute(INamedInterface *, const StatusCode &)=0
IAuditor::sysInitialize
virtual StatusCode sysInitialize()=0
Used by AuditorSvc.
IAuditor::before
virtual void before(CustomEventTypeRef, const std::string &)=0
Audit the start of a custom "event" for callers that do not implement INamedInterface.
IAuditor::before
virtual void before(CustomEventTypeRef, INamedInterface *)=0
Audit the start of a custom "event".
IAuditor::before
virtual void before(StandardEventType, INamedInterface *)=0
Audit the start of a standard "event".
IAuditor::beforeFinalize
virtual void beforeFinalize(INamedInterface *)=0
operator<<
std::ostream & operator<<(std::ostream &s, IAuditor::StandardEventType e)
Definition: IAuditor.h:101
INamedInterface.h
StatusCode
Definition: StatusCode.h:65
IAuditor::Stop
@ Stop
Definition: IAuditor.h:34
IAuditor::afterFinalize
virtual void afterFinalize(INamedInterface *)=0
IAuditor::after
virtual void after(StandardEventType, INamedInterface *, const StatusCode &sc=StatusCode::SUCCESS)=0
Audit the end of a standard "event".
std::ostream
STL class.
IAuditor::CustomEventTypeRef
const CustomEventType & CustomEventTypeRef
Used in function calls for optimization purposes.
Definition: IAuditor.h:41
IAuditor::beforeInitialize
virtual void beforeInitialize(INamedInterface *)=0
IAuditor::before
virtual void before(StandardEventType, const std::string &)=0
Audit the start of a standard "event" for callers that do not implement INamedInterface.
std::array
STL class.
IAuditor::afterReinitialize
virtual void afterReinitialize(INamedInterface *)=0
IAuditor::beforeReinitialize
virtual void beforeReinitialize(INamedInterface *)=0
IAuditor::DeclareInterfaceID
DeclareInterfaceID(IAuditor, 3, 0)
InterfaceID.
IAuditor::afterInitialize
virtual void afterInitialize(INamedInterface *)=0
INamedInterface
Definition: INamedInterface.h:25
IAuditor::CustomEventType
std::string CustomEventType
Type used to allow users to specify a custom event to be audit.
Definition: IAuditor.h:39
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
IAuditor::isEnabled
virtual bool isEnabled() const =0
Tell if the auditor is enabled or not.
IAuditor::StandardEventType
StandardEventType
Defines the standard (= used by the framework) auditable event types.
Definition: IAuditor.h:34
toStr
const char * toStr(IAuditor::StandardEventType e)
Simple mapping function from IAuditor::StandardEventType to string.
Definition: IAuditor.h:95
IAuditor::after
virtual void after(StandardEventType, const std::string &, const StatusCode &sc=StatusCode::SUCCESS)=0
Audit the end of a standard "event" for callers that do not implement INamedInterface.
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:81
IAuditor
Definition: IAuditor.h:28
IAuditor::after
virtual void after(CustomEventTypeRef, INamedInterface *, const StatusCode &sc=StatusCode::SUCCESS)=0
Audit the end of a custom "event".