| # Gaudi Framework, version v22r4 |

Home |  | Generated: Fri Sep 2 2011

Public Member Functions | Protected Member Functions | Protected Attributes

# CommonAuditor Class Reference

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

`#include <CommonAuditor.h>`

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

List of all members.

## Public Member Functions
| CommonAuditor (const std::string &name, ISvcLocator *svcloc)
| Constructor.
virtual | ~CommonAuditor ()
| Destructor.
"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)
| The following methods are meant to be implemented by the child class...
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)
## Protected Member Functions
virtual void | i_before (CustomEventTypeRef evt, const std::string &caller)=0
| catch all "before" method, implemented in the derived class
virtual void | i_after (CustomEventTypeRef evt, const std::string &caller, const StatusCode &sc)=0
| catch all "after" method, implemented in the derived class
bool | i_auditEventType (const std::string &evt)
| Check if we are requested to audit the passed event type.
void | i_updateCustomTypes (Property &)
| Update handler for the obsolete property CustomEventTypes.
## Protected Attributes
StringArrayProperty | m_types
StringArrayProperty | m_customTypes

## 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.

                                                                          : Auditor(name, svcloc) {
      declareProperty("EventTypes", m_types,
                      "List of event types to audit ([]=all, ['none']=none)");
      declareProperty("CustomEventTypes", m_customTypes,
                      "OBSOLETE, use EventTypes instead")->declareUpdateHandler(&CommonAuditor::i_updateCustomTypes, this);
    }

CommonAuditor::~CommonAuditor | ( | ) | `[virtual]`

Destructor.

Definition at line 10 of file CommonAuditor.cpp.

    {}

## Member Function Documentation

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

Reimplemented from Auditor.

Definition at line 39 of file CommonAuditor.cpp.

    {
      after(toStr(evt), caller, sc);
    }

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

Reimplemented from Auditor.

Definition at line 43 of file CommonAuditor.cpp.

    {
      if (caller) after(evt, caller->name(), sc);
    }

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

Reimplemented from Auditor.

Definition at line 35 of file CommonAuditor.cpp.

    {
      if (caller) after(toStr(evt), caller->name(), sc);
    }

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

Reimplemented from Auditor.

Definition at line 47 of file CommonAuditor.cpp.

    {
      if (i_auditEventType(evt)) i_after(evt, caller, sc);
    }

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

Reimplemented from Auditor.

Definition at line 22 of file CommonAuditor.cpp.

    {
      before(toStr(evt), caller);
    }

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

Reimplemented from Auditor.

Definition at line 26 of file CommonAuditor.cpp.

    {
      if (caller) before(evt, caller->name());
    }

void CommonAuditor::before | ( | StandardEventType | evt,
|  | INamedInterface * | obj
| ) |  | `[virtual]`

The following methods are meant to be implemented by the child class...

Reimplemented from Auditor.

Definition at line 18 of file CommonAuditor.cpp.

    {
      if (caller) before(toStr(evt), caller->name());
    }

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

Reimplemented from Auditor.

Definition at line 30 of file CommonAuditor.cpp.

    {
      if (i_auditEventType(evt)) i_before(evt, caller);
    }

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.

                                                         {
        // Note: there is no way to extract from a Property type the type returned by
        // value().
        const std::vector<std::string> &v = m_types.value();
        // we need to return true is the list is empty or when the list does't
        // start by "none" and the list contain the event we got.
        return (v.size() == 0) || (
                 (v[0] != "none") &&
                 (find(v.begin(), v.end(), evt) != v.end())
               );
      }

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, MemoryAuditor, MemStatAuditor, and NameAuditor.

void CommonAuditor::i_updateCustomTypes | ( | Property & | ) | `[protected]`

Update handler for the obsolete property CustomEventTypes.

Definition at line 12 of file CommonAuditor.cpp.

                                                      {
      MsgStream log(msgSvc(), name());
      log << MSG::WARNING << "Property CustomEventTypes is deprecated, use EventTypes instead" << endmsg;
      m_types.setValue(m_customTypes.value());
    }

## 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:

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r4/GaudiAud/src/CommonAuditor.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r4/GaudiAud/src/CommonAuditor.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines