All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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();
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.size() == 0) || (
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:26
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:218
StandardEventType
Defines the standard (= used by the framework) auditable event types.
Definition: IAuditor.h:24
Base class with common functionalities shared by few auditor implementations.
Definition: CommonAuditor.h:5
virtual void before(StandardEventType evt, const std::string &caller)
Audit the start of a standard "event" for callers that do not implement INamedInterface.
const CustomEventType & CustomEventTypeRef
Used in function calls for optimization purposes.
Definition: IAuditor.h:41
virtual ~CommonAuditor()
Destructor.
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:30
StringArrayProperty m_customTypes
Definition: CommonAuditor.h:58
const TYPE & value() const
explicit conversion
Definition: Property.h:355
IInterface compliant class extending IInterface with the name() method.
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:43
CommonAuditor(const std::string &name, ISvcLocator *svcloc)
Constructor.
virtual void after(StandardEventType evt, const std::string &caller, const StatusCode &sc)
Audit the end of a standard "event" for callers that do not implement INamedInterface.
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
Base class from which all concrete auditor classes should be derived.
Definition: Auditor.h:34