| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

CommonAuditor.h
Go to the documentation of this file.
1 #ifndef GAUDIAUD_COMMONAUDITOR_H
2 #define GAUDIAUD_COMMONAUDITOR_H
3
4 #include "GaudiKernel/Auditor.h"
5
8 class CommonAuditor : public Auditor
9 {
10 public:
14 CommonAuditor( const std::string& name, ISvcLocator* svcloc );
16 ~CommonAuditor() override = default;
17
21
22 void before( StandardEventType evt, const std::string& caller ) override;
23 void before( StandardEventType evt, INamedInterface* caller ) override;
24 void before( CustomEventTypeRef evt, const std::string& caller ) override;
25 void before( CustomEventTypeRef evt, INamedInterface* caller ) override;
27
31
32 void after( StandardEventType evt, const std::string& caller, const StatusCode& sc ) override;
33 void after( StandardEventType evt, INamedInterface* caller, const StatusCode& sc ) override;
34 void after( CustomEventTypeRef evt, const std::string& caller, const StatusCode& sc ) override;
35 void after( CustomEventTypeRef evt, INamedInterface* caller, const StatusCode& sc ) override;
37
38 protected:
40 virtual void i_before( CustomEventTypeRef evt, const std::string& caller ) = 0;
42 virtual void i_after( CustomEventTypeRef evt, const std::string& caller, const StatusCode& sc ) = 0;
43
45 inline bool i_auditEventType( const std::string& evt )
46 {
47 // Note: there is no way to extract from a Property type the type returned by
48 // value().
49 const std::vector<std::string>& v = m_types.value();
50 // we need to return true is the list is empty or when the list does't
51 // start by "none" and the list contain the event we got.
52 return v.empty() || ( ( v[0] != "none" ) && ( find( v.begin(), v.end(), evt ) != v.end() ) );
53 }
54
55 Gaudi::Property<std::vector<std::string>> m_types{
56 this, "EventTypes", {}, "list of event types to audit ([]=all, ['none']=none)"};
57 Gaudi::Property<std::vector<std::string>> m_customTypes{
58 this, "CustomEventTypes", {}, "[[deprecated]] use EventTypes instead"};
59 };
60
61 #endif // GAUDIAUD_COMMONAUDITOR_H
std::vector::empty
T empty(T...args)
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:319
CommonAuditor
Base class with common functionalities shared by few auditor implementations.
Definition: CommonAuditor.h:8
CommonAuditor::m_types
Gaudi::Property< std::vector< std::string > > m_types
Definition: CommonAuditor.h:55
CommonAuditor::before
void before(StandardEventType evt, const std::string &caller) override
Definition: CommonAuditor.cpp:16
std::vector::end
T end(T...args)
std::string
STL class.
CommonAuditor::i_auditEventType
bool i_auditEventType(const std::string &evt)
Check if we are requested to audit the passed event type.
Definition: CommonAuditor.h:45
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
std::vector< std::string >
std::vector::begin
T begin(T...args)
CommonAuditor::m_customTypes
Gaudi::Property< std::vector< std::string > > m_customTypes
Definition: CommonAuditor.h:57
CommonAuditor::~CommonAuditor
~CommonAuditor() override=default
Destructor.
CommonAuditor::CommonAuditor
CommonAuditor(const std::string &name, ISvcLocator *svcloc)
Constructor.
Definition: CommonAuditor.cpp:3
CommonAuditor::i_before
virtual void i_before(CustomEventTypeRef evt, const std::string &caller)=0
catch all "before" method, implemented in the derived class
CommonAuditor::after
void after(StandardEventType evt, const std::string &caller, const StatusCode &sc) override
Definition: CommonAuditor.cpp:30
Auditor.h
CommonAuditor::i_after
virtual void i_after(CustomEventTypeRef evt, const std::string &caller, const StatusCode &sc)=0
catch all "after" method, implemented in the derived class
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:202
IOTest.evt
evt
Definition: IOTest.py:96
Auditor
Base class from which all concrete auditor classes should be derived.
Definition: Auditor.h:35