CommonAuditor.h
Go to the documentation of this file.
1 #include "GaudiKernel/Auditor.h"
2 
5 class CommonAuditor: public Auditor {
6 public:
10  CommonAuditor(const std::string& name, ISvcLocator *svcloc);
12  virtual ~CommonAuditor() = default;
13 
17 
18  virtual void before(StandardEventType evt, const std::string& caller);
19  virtual void before(StandardEventType evt, INamedInterface* caller);
20  virtual void before(CustomEventTypeRef evt, const std::string& caller);
21  virtual void before(CustomEventTypeRef evt, INamedInterface* caller);
23 
27 
28  virtual void after(StandardEventType evt, const std::string& caller, const StatusCode& sc);
29  virtual void after(StandardEventType evt, INamedInterface* caller, const StatusCode& sc);
30  virtual void after(CustomEventTypeRef evt, const std::string& caller, const StatusCode& sc);
31  virtual void after(CustomEventTypeRef evt, INamedInterface* caller, const StatusCode& sc);
33 
34 protected:
35 
37  virtual void i_before(CustomEventTypeRef evt, const std::string& caller) = 0;
39  virtual void i_after(CustomEventTypeRef evt, const std::string& caller, const StatusCode& sc) = 0;
40 
42  inline bool i_auditEventType(const std::string& evt) {
43  // Note: there is no way to extract from a Property type the type returned by
44  // value().
45  const std::vector<std::string> &v = m_types.value();
46  // we need to return true is the list is empty or when the list does't
47  // start by "none" and the list contain the event we got.
48  return v.empty() || (
49  (v[0] != "none") &&
50  (find(v.begin(), v.end(), evt) != v.end())
51  );
52  }
53 
55 
59 };
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
Base class with common functionalities shared by few auditor implementations.
Definition: CommonAuditor.h:5
virtual void before(StandardEventType evt, const std::string &caller)
bool i_auditEventType(const std::string &evt)
Check if we are requested to audit the passed event type.
Definition: CommonAuditor.h:42
void i_updateCustomTypes(Property &)
Update handler for the obsolete property CustomEventTypes.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StringArrayProperty m_customTypes
Definition: CommonAuditor.h:58
const TYPE & value() const
explicit conversion
Definition: Property.h:341
IInterface compliant class extending IInterface with the name() method.
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
const std::string & name() const override
Definition: Auditor.cpp:212
CommonAuditor(const std::string &name, ISvcLocator *svcloc)
Constructor.
virtual void after(StandardEventType evt, const std::string &caller, const StatusCode &sc)
virtual void i_before(CustomEventTypeRef evt, const std::string &caller)=0
catch all "before" method, implemented in the derived class
StringArrayProperty m_types
Definition: CommonAuditor.h:54
virtual void i_after(CustomEventTypeRef evt, const std::string &caller, const StatusCode &sc)=0
catch all "after" method, implemented in the derived class
virtual ~CommonAuditor()=default
Destructor.
Base class from which all concrete auditor classes should be derived.
Definition: Auditor.h:34