CommonAuditor.cpp
Go to the documentation of this file.
1 #include "CommonAuditor.h"
2 
4  declareProperty("EventTypes", m_types,
5  "List of event types to audit ([]=all, ['none']=none)");
6  declareProperty("CustomEventTypes", m_customTypes,
7  "OBSOLETE, use EventTypes instead")->declareUpdateHandler(&CommonAuditor::i_updateCustomTypes, this);
8 }
9 
11  warning() << "Property CustomEventTypes is deprecated, use EventTypes instead" << endmsg;
13 }
14 
15 void CommonAuditor::before(StandardEventType evt, INamedInterface* caller)
16 {
17  if (caller) before(toStr(evt), caller->name());
18 }
19 void CommonAuditor::before(StandardEventType evt, const std::string& caller)
20 {
21  before(toStr(evt), caller);
22 }
23 void CommonAuditor::before(CustomEventTypeRef evt, INamedInterface* caller)
24 {
25  if (caller) before(evt, caller->name());
26 }
27 void CommonAuditor::before(CustomEventTypeRef evt, const std::string& caller)
28 {
29  if (i_auditEventType(evt)) i_before(evt, caller);
30 }
31 
32 void CommonAuditor::after(StandardEventType evt, INamedInterface* caller, const StatusCode& sc)
33 {
34  if (caller) after(toStr(evt), caller->name(), sc);
35 }
36 void CommonAuditor::after(StandardEventType evt, const std::string& caller, const StatusCode& sc)
37 {
38  after(toStr(evt), caller, sc);
39 }
40 void CommonAuditor::after(CustomEventTypeRef evt, INamedInterface* caller, const StatusCode& sc)
41 {
42  if (caller) after(evt, caller->name(), sc);
43 }
44 void CommonAuditor::after(CustomEventTypeRef evt, const std::string& caller, const StatusCode& sc)
45 {
46  if (i_auditEventType(evt)) i_after(evt, caller, sc);
47 }
const char * toStr(IAuditor::StandardEventType e)
Simple mapping function from IAuditor::StandardEventType to string.
Definition: IAuditor.h:106
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
virtual Property & declareUpdateHandler(std::function< void(Property &)> fun)
set new callback for update
Definition: Property.cpp:72
virtual void before(StandardEventType evt, const std::string &caller)
bool setValue(const TYPE &value) override
implementation of PropertyWithValue::setValue
Definition: Property.h:406
virtual const std::string & name() const =0
Retrieve the name of the instance.
STL class.
bool i_auditEventType(const std::string &evt)
Check if we are requested to audit the passed event type.
Definition: CommonAuditor.h:42
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Auditor.h:232
void i_updateCustomTypes(Property &)
Update handler for the obsolete property CustomEventTypes.
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
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
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
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
Base class from which all concrete auditor classes should be derived.
Definition: Auditor.h:35