| The Gaudi Framework v27r1

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

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CommonAuditor Class Referenceabstract

Base class with common functionalities shared by few auditor implementations. More...

`#include <src/CommonAuditor.h>`

Inheritance diagram for CommonAuditor:
[legend]
Collaboration diagram for CommonAuditor:
[legend]

## Public Member Functions
| CommonAuditor (const std::string &name, ISvcLocator *svcloc)
| Constructor. More...
virtual | ~CommonAuditor ()=default
| Destructor. More...
"before" Auditor hooks
The default behavior is to fall back on the version accepting 2 strings, which must be implemented in the derived class.
virtual void | before (StandardEventType evt, const std::string &caller)
virtual void | before (StandardEventType evt, INamedInterface *caller)
virtual void | before (CustomEventTypeRef evt, const std::string &caller)
virtual void | before (CustomEventTypeRef evt, INamedInterface *caller)
"after" Auditor hooks
The default behavior is to fall back on the version accepting 2 strings, which must be implemented in the derived class.
virtual void | after (StandardEventType evt, const std::string &caller, const StatusCode &sc)
virtual void | after (StandardEventType evt, INamedInterface *caller, const StatusCode &sc)
virtual void | after (CustomEventTypeRef evt, const std::string &caller, const StatusCode &sc)
virtual void | after (CustomEventTypeRef evt, INamedInterface *caller, const StatusCode &sc)
Public Member Functions inherited from Auditor
| Auditor (const std::string &name, ISvcLocator *svcloc)
| Constructor. More...
| ~Auditor () override=default
| Destructor. More...
StatusCode | sysInitialize () override
| Initialization method invoked by the framework. More...
StatusCode | sysFinalize () override
| Finalization method invoked by the framework. More...
void | before (StandardEventType, INamedInterface *) override
| The following methods are meant to be implemented by the child class... More...
void | before (StandardEventType, const std::string &) override
void | before (CustomEventTypeRef, INamedInterface *) override
void | before (CustomEventTypeRef, const std::string &) override
void | after (StandardEventType, INamedInterface *, const StatusCode &) override
void | after (StandardEventType, const std::string &, const StatusCode &) override
void | after (CustomEventTypeRef, INamedInterface *, const StatusCode &) override
void | after (CustomEventTypeRef, const std::string &, const StatusCode &) override
void | beforeInitialize (INamedInterface *) override
void | afterInitialize (INamedInterface *) override
void | beforeReinitialize (INamedInterface *) override
void | afterReinitialize (INamedInterface *) override
void | beforeExecute (INamedInterface *) override
void | afterExecute (INamedInterface *, const StatusCode &) override
void | beforeFinalize (INamedInterface *) override
void | afterFinalize (INamedInterface *) override
void | beforeBeginRun (INamedInterface *) override
void | afterBeginRun (INamedInterface *) override
void | beforeEndRun (INamedInterface *) override
void | afterEndRun (INamedInterface *) override
virtual StatusCode | initialize ()
virtual StatusCode | finalize ()
const std::string & | name () const override
bool | isEnabled () const override
SmartIF< ISvcLocator > & | serviceLocator () const
| The standard service locator. More...
template<class T >
StatusCode | service (const std::string &name, T *&svc, bool createIf=false) const
| Access a service by name, creating it if it doesn't already exist. More...
template<class T = IService>
SmartIF< T > | service (const std::string &name, bool createIf=false) const
StatusCode | setProperty (const Property &p) override
| Set a value of a property of an auditor. More...
StatusCode | setProperty (const std::string &s) override
| Implementation of IProperty::setProperty. More...
StatusCode | setProperty (const std::string &n, const std::string &v) override
| Implementation of IProperty::setProperty. More...
StatusCode | getProperty (Property *p) const override
| Get the value of a property. More...
const Property & | getProperty (const std::string &name) const override
| Get the property by name. More...
StatusCode | getProperty (const std::string &n, std::string &v) const override
| Implementation of IProperty::getProperty. More...
const std::vector< Property * > & | getProperties () const override
| Get all properties. More...
bool | hasProperty (const std::string &name) const override
| Implementation of IProperty::hasProperty. More...
template<class TYPE >
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
StatusCode | setProperties ()
| Set the auditor's properties. More...
template<class T >
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const
| Declare the named property. More...
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...
MSG::Level | msgLevel () const
| get the output level from the embedded MsgStream More...
MSG::Level | outputLevel () const __attribute__((deprecated))
| Backward compatibility function for getting the output level. More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...

## Protected Member Functions
virtual void | i_before (CustomEventTypeRef evt, const std::string &caller)=0
| catch all "before" method, implemented in the derived class More...
virtual void | i_after (CustomEventTypeRef evt, const std::string &caller, const StatusCode &sc)=0
| catch all "after" method, implemented in the derived class More...
bool | i_auditEventType (const std::string &evt)
| Check if we are requested to audit the passed event type. More...
void | i_updateCustomTypes (Property &)
| Update handler for the obsolete property CustomEventTypes. More...
Protected Member Functions inherited from CommonMessaging< implements< IAuditor, IProperty > >
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...

## Protected Attributes
StringArrayProperty | m_types
StringArrayProperty | m_customTypes

## Additional Inherited Members
Public Types inherited from Auditor
typedef Gaudi::PluginService::Factory< IAuditor *, const std::string &, ISvcLocator * > | Factory
Public Types inherited from CommonMessaging< implements< IAuditor, IProperty > >
using | base_class = CommonMessaging

## Detailed Description

Base class with common functionalities shared by few auditor implementations.

Author
  Marco Clemencic

Definition at line 5 of file CommonAuditor.h.

## Constructor & Destructor Documentation

CommonAuditor::CommonAuditor | ( | const std::string & | name,
|  | ISvcLocator * | svcloc
| ) |  |

Constructor.

Parameters

  name | The algorithm object's name
  svcloc | A pointer to a service location service

Definition at line 3 of file CommonAuditor.cpp.

3 : Auditor(name, svcloc) {
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 }
Property::declareUpdateHandler
virtual Property & declareUpdateHandler(std::function< void(Property &)> fun)
set new callback for update
Definition: Property.cpp:72
Auditor::declareProperty
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Auditor.h:232
CommonAuditor::i_updateCustomTypes
void i_updateCustomTypes(Property &)
Update handler for the obsolete property CustomEventTypes.
Definition: CommonAuditor.cpp:10
Auditor::Auditor
Auditor(const std::string &name, ISvcLocator *svcloc)
Constructor.
Definition: Auditor.cpp:12
CommonAuditor::m_customTypes
StringArrayProperty m_customTypes
Definition: CommonAuditor.h:58
CommonAuditor::m_types
StringArrayProperty m_types
Definition: CommonAuditor.h:54

virtual CommonAuditor::~CommonAuditor | ( |  | ) |
| virtual default

Destructor.

## Member Function Documentation

void CommonAuditor::after | ( | StandardEventType | evt,
|  | const std::string & | caller,
|  | const StatusCode & | sc
| ) |  |
| virtual

Definition at line 36 of file CommonAuditor.cpp.

37 {
38 after(toStr(evt), caller, sc);
39 }
toStr
const char * toStr(IAuditor::StandardEventType e)
Simple mapping function from IAuditor::StandardEventType to string.
Definition: IAuditor.h:106
read_lhcb_event_file.evt
tuple evt
Definition: read_lhcb_event_file.py:14
CommonAuditor::after
virtual void after(StandardEventType evt, const std::string &caller, const StatusCode &sc)
Definition: CommonAuditor.cpp:36

void CommonAuditor::after | ( | StandardEventType | evt,
|  | INamedInterface * | caller,
|  | const StatusCode & | sc
| ) |  |
| virtual

Definition at line 32 of file CommonAuditor.cpp.

33 {
34 if (caller) after(toStr(evt), caller->name(), sc);
35 }
toStr
const char * toStr(IAuditor::StandardEventType e)
Simple mapping function from IAuditor::StandardEventType to string.
Definition: IAuditor.h:106
merge_files.sc
int sc
Definition: merge_files.py:167
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
read_lhcb_event_file.evt
tuple evt
Definition: read_lhcb_event_file.py:14
CommonAuditor::after
virtual void after(StandardEventType evt, const std::string &caller, const StatusCode &sc)
Definition: CommonAuditor.cpp:36

void CommonAuditor::after | ( | CustomEventTypeRef | evt,
|  | const std::string & | caller,
|  | const StatusCode & | sc
| ) |  |
| virtual

Definition at line 44 of file CommonAuditor.cpp.

45 {
46 if (i_auditEventType(evt)) i_after(evt, caller, sc);
47 }
CommonAuditor::i_auditEventType
bool i_auditEventType(const std::string &evt)
Check if we are requested to audit the passed event type.
Definition: CommonAuditor.h:42
read_lhcb_event_file.evt
tuple evt
Definition: read_lhcb_event_file.py:14
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

void CommonAuditor::after | ( | CustomEventTypeRef | evt,
|  | INamedInterface * | caller,
|  | const StatusCode & | sc
| ) |  |
| virtual

Definition at line 40 of file CommonAuditor.cpp.

41 {
42 if (caller) after(evt, caller->name(), sc);
43 }
merge_files.sc
int sc
Definition: merge_files.py:167
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
read_lhcb_event_file.evt
tuple evt
Definition: read_lhcb_event_file.py:14
CommonAuditor::after
virtual void after(StandardEventType evt, const std::string &caller, const StatusCode &sc)
Definition: CommonAuditor.cpp:36

void CommonAuditor::before | ( | StandardEventType | evt,
|  | const std::string & | caller
| ) |  |
| virtual

Definition at line 19 of file CommonAuditor.cpp.

20 {
21 before(toStr(evt), caller);
22 }
toStr
const char * toStr(IAuditor::StandardEventType e)
Simple mapping function from IAuditor::StandardEventType to string.
Definition: IAuditor.h:106
CommonAuditor::before
virtual void before(StandardEventType evt, const std::string &caller)
Definition: CommonAuditor.cpp:19
read_lhcb_event_file.evt
tuple evt
Definition: read_lhcb_event_file.py:14

void CommonAuditor::before | ( | StandardEventType | evt,
|  | INamedInterface * | caller
| ) |  |
| virtual

Definition at line 15 of file CommonAuditor.cpp.

16 {
17 if (caller) before(toStr(evt), caller->name());
18 }
toStr
const char * toStr(IAuditor::StandardEventType e)
Simple mapping function from IAuditor::StandardEventType to string.
Definition: IAuditor.h:106
CommonAuditor::before
virtual void before(StandardEventType evt, const std::string &caller)
Definition: CommonAuditor.cpp:19
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
read_lhcb_event_file.evt
tuple evt
Definition: read_lhcb_event_file.py:14

void CommonAuditor::before | ( | CustomEventTypeRef | evt,
|  | const std::string & | caller
| ) |  |
| virtual

Definition at line 27 of file CommonAuditor.cpp.

28 {
29 if (i_auditEventType(evt)) i_before(evt, caller);
30 }
CommonAuditor::i_auditEventType
bool i_auditEventType(const std::string &evt)
Check if we are requested to audit the passed event type.
Definition: CommonAuditor.h:42
read_lhcb_event_file.evt
tuple evt
Definition: read_lhcb_event_file.py:14
CommonAuditor::i_before
virtual void i_before(CustomEventTypeRef evt, const std::string &caller)=0
catch all "before" method, implemented in the derived class

void CommonAuditor::before | ( | CustomEventTypeRef | evt,
|  | INamedInterface * | caller
| ) |  |
| virtual

Definition at line 23 of file CommonAuditor.cpp.

24 {
25 if (caller) before(evt, caller->name());
26 }
CommonAuditor::before
virtual void before(StandardEventType evt, const std::string &caller)
Definition: CommonAuditor.cpp:19
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
read_lhcb_event_file.evt
tuple evt
Definition: read_lhcb_event_file.py:14

virtual void CommonAuditor::i_after | ( | CustomEventTypeRef | evt,
|  | const std::string & | caller,
|  | const StatusCode & | sc
| ) |  |
| protected pure virtual

catch all "after" method, implemented in the derived class

Implemented in ChronoAuditor, MemoryAuditor, and NameAuditor.

bool CommonAuditor::i_auditEventType | ( | const std::string & | evt | ) |
| inline protected

Check if we are requested to audit the passed event type.

Definition at line 42 of file CommonAuditor.h.

42 {
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 }
std::vector::empty
T empty(T...args)
std::vector::end
T end(T...args)
read_lhcb_event_file.evt
tuple evt
Definition: read_lhcb_event_file.py:14
PropertyWithValue::value
const TYPE & value() const
explicit conversion
Definition: Property.h:341
std::find
T find(T...args)
std::vector< std::string >
std::vector::begin
T begin(T...args)
CommonAuditor::m_types
StringArrayProperty m_types
Definition: CommonAuditor.h:54

virtual void CommonAuditor::i_before | ( | CustomEventTypeRef | evt,
|  | const std::string & | caller
| ) |  |
| protected pure virtual

catch all "before" method, implemented in the derived class

Implemented in ChronoAuditor, MemStatAuditor, MemoryAuditor, and NameAuditor.

void CommonAuditor::i_updateCustomTypes | ( | Property & |  | ) |
| protected

Update handler for the obsolete property CustomEventTypes.

Definition at line 10 of file CommonAuditor.cpp.

10 {
11 warning() << "Property CustomEventTypes is deprecated, use EventTypes instead" << endmsg;
12 m_types.setValue(m_customTypes.value());
13 }
PropertyWithVerifier::setValue
bool setValue(const TYPE &value) override
implementation of PropertyWithValue::setValue
Definition: Property.h:406
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:121
CommonAuditor::m_customTypes
StringArrayProperty m_customTypes
Definition: CommonAuditor.h:58
PropertyWithValue::value
const TYPE & value() const
explicit conversion
Definition: Property.h:341
CommonAuditor::m_types
StringArrayProperty m_types
Definition: CommonAuditor.h:54
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

## Member Data Documentation

StringArrayProperty CommonAuditor::m_customTypes
| protected

Definition at line 58 of file CommonAuditor.h.

StringArrayProperty CommonAuditor::m_types
| protected

Definition at line 54 of file CommonAuditor.h.

The documentation for this class was generated from the following files:

- GaudiAud/src/CommonAuditor.h
- GaudiAud/src/CommonAuditor.cpp