The Gaudi Framework  v29r0 (ff2e7097)
CommonAuditor.cpp
Go to the documentation of this file.
1 #include "CommonAuditor.h"
2 
3 CommonAuditor::CommonAuditor( const std::string& name, ISvcLocator* svcloc ) : Auditor( name, svcloc )
4 {
5  auto deprecated_property = [this]( Gaudi::Details::PropertyBase& p ) {
6  warning() << p.name() << " " << p.documentation() << endmsg;
8  };
9  m_customTypes.declareUpdateHandler( deprecated_property );
10 }
11 
12 void CommonAuditor::before( StandardEventType evt, INamedInterface* caller )
13 {
14  if ( caller ) before( toStr( evt ), caller->name() );
15 }
16 void CommonAuditor::before( StandardEventType evt, const std::string& caller ) { before( toStr( evt ), caller ); }
17 void CommonAuditor::before( CustomEventTypeRef evt, INamedInterface* caller )
18 {
19  if ( caller ) before( evt, caller->name() );
20 }
21 void CommonAuditor::before( CustomEventTypeRef evt, const std::string& caller )
22 {
23  if ( i_auditEventType( evt ) ) i_before( evt, caller );
24 }
25 
26 void CommonAuditor::after( StandardEventType evt, INamedInterface* caller, const StatusCode& sc )
27 {
28  if ( caller ) after( toStr( evt ), caller->name(), sc );
29 }
30 void CommonAuditor::after( StandardEventType evt, const std::string& caller, const StatusCode& sc )
31 {
32  after( toStr( evt ), caller, sc );
33 }
34 void CommonAuditor::after( CustomEventTypeRef evt, INamedInterface* caller, const StatusCode& sc )
35 {
36  if ( caller ) after( evt, caller->name(), sc );
37 }
38 void CommonAuditor::after( CustomEventTypeRef evt, const std::string& caller, const StatusCode& sc )
39 {
40  if ( i_auditEventType( evt ) ) i_after( evt, caller, sc );
41 }
const char * toStr(IAuditor::StandardEventType e)
Simple mapping function from IAuditor::StandardEventType to string.
Definition: IAuditor.h:100
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
Gaudi::Property< std::vector< std::string > > m_types
Definition: CommonAuditor.h:55
void before(StandardEventType evt, const std::string &caller) override
STL class.
bool i_auditEventType(const std::string &evt)
Check if we are requested to audit the passed event type.
Definition: CommonAuditor.h:45
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
IInterface compliant class extending IInterface with the name() method.
Gaudi::Property< std::vector< std::string > > m_customTypes
Definition: CommonAuditor.h:57
CommonAuditor(const std::string &name, ISvcLocator *svcloc)
Constructor.
virtual void i_before(CustomEventTypeRef evt, const std::string &caller)=0
catch all "before" method, implemented in the derived class
void after(StandardEventType evt, const std::string &caller, const StatusCode &sc) override
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:209
virtual const std::string & name() const =0
Retrieve the name of the instance.
evt
Definition: IOTest.py:96
Base class from which all concrete auditor classes should be derived.
Definition: Auditor.h:35