| # Gaudi Framework, version v21r11 |

Home |  | Generated: 30 Sep 2010

# NameAuditor Class Reference

Prints the name of each algorithm before entering the algorithm and after leaving it. More...

`#include <NameAuditor.h>`

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

List of all members.

## Public Member Functions
| NameAuditor (const std::string &name, ISvcLocator *pSvcLocator)
virtual | ~NameAuditor ()
"before" Auditor hooks
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
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 &)
virtual void | after (CustomEventTypeRef evt, INamedInterface *caller, const StatusCode &sc)
## Private Types
enum | Action { BEFORE, AFTER }
## Private Member Functions
void | i_doAudit (const std::string &evt, const std::string &caller, Action action)
| Implementation of the auditor.
## Private Attributes
StringArrayProperty | m_types
| Filter for custom event types.

## Detailed Description

Prints the name of each algorithm before entering the algorithm and after leaving it.

Author:
  M. Shapiro, LBNL

Definition at line 12 of file NameAuditor.h.

## Member Enumeration Documentation

enum NameAuditor::Action`[private]`

Enumerator:

  BEFORE |
  AFTER |

Definition at line 14 of file NameAuditor.h.

    00014 { BEFORE, AFTER };

## Constructor & Destructor Documentation

NameAuditor::NameAuditor | ( | const std::string & | name,
|  | ISvcLocator * | pSvcLocator |
| ) |  |  |

Definition at line 14 of file NameAuditor.cpp.

    00014                                                                         :
    00015   Auditor(name, pSvcLocator)
    00016 {
    00017
    00018   declareProperty("CustomEventTypes", m_types,
    00019                   "List of custom event types to audit ([]=all, ['none']=none");
    00020
    00021 }

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

Definition at line 23 of file NameAuditor.cpp.

    00023                          {
    00024 }

## Member Function Documentation

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

Reimplemented from Auditor.

Definition at line 27 of file NameAuditor.cpp.

    00028 {
    00029   std::ostringstream oss;
    00030   oss << evt;
    00031   before(oss.str(), caller);
    00032 }

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

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

Reimplemented from Auditor.

Definition at line 24 of file NameAuditor.h.

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

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

Reimplemented from Auditor.

Definition at line 27 of file NameAuditor.h.

    00027                                                                        {
    00028     i_doAudit(evt, caller, BEFORE);
    00029   }

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

Reimplemented from Auditor.

Definition at line 30 of file NameAuditor.h.

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

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

Reimplemented from Auditor.

Definition at line 35 of file NameAuditor.cpp.

    00036 {
    00037   std::ostringstream oss;
    00038   oss << evt;
    00039   after(oss.str(), caller, sc);
    00040 }

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

Reimplemented from Auditor.

Definition at line 39 of file NameAuditor.h.

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

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

Reimplemented from Auditor.

Definition at line 42 of file NameAuditor.h.

    00042                                                                                          {
    00043     i_doAudit(evt, caller, AFTER);
    00044   }

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

Reimplemented from Auditor.

Definition at line 45 of file NameAuditor.h.

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

void NameAuditor::i_doAudit | ( | const std::string & | evt,
|  | const std::string & | caller,
|  | Action | action |
| ) |  |  | `[private]`

Implementation of the auditor.

Definition at line 43 of file NameAuditor.cpp.

    00044 {
    00045   if (m_types.value().size() != 0) {
    00046     if ( (m_types.value())[0] == "none") {
    00047       return;
    00048     }
    00049
    00050     if ( find(m_types.value().begin(), m_types.value().end(), evt) ==
    00051          m_types.value().end() ) {
    00052       return;
    00053     }
    00054   }
    00055
    00056   MsgStream log( msgSvc(), name() );
    00057   if ( action==BEFORE ) {
    00058     log << MSG::INFO << "About to Enter " << caller << " with auditor trigger "
    00059         << evt << endmsg;
    00060   }
    00061   else {
    00062     log << MSG::INFO << "Just Exited " << caller << " with auditor trigger "
    00063         << evt << endmsg;
    00064   }
    00065 }

## Member Data Documentation

StringArrayProperty NameAuditor::m_types`[private]`

Filter for custom event types.

Definition at line 55 of file NameAuditor.h.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v21r11/GaudiAud/src/NameAuditor.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v21r11/GaudiAud/src/NameAuditor.cpp