Gaudi Framework, version v22r1

Home   Generated: Mon Feb 28 2011
Public Member Functions | Private Types | Private Member Functions | Private Attributes

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:
Inheritance graph
[legend]
Collaboration diagram for NameAuditor:
Collaboration graph
[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.

{ BEFORE, AFTER };

Constructor & Destructor Documentation

NameAuditor::NameAuditor ( const std::string name,
ISvcLocator pSvcLocator 
)

Definition at line 14 of file NameAuditor.cpp.

                                                                        :
  Auditor(name, pSvcLocator)
{

  declareProperty("CustomEventTypes", m_types,
                  "List of custom event types to audit ([]=all, ['none']=none");

}
NameAuditor::~NameAuditor (  ) [virtual]

Definition at line 23 of file NameAuditor.cpp.

                         {
}

Member Function Documentation

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

Reimplemented from Auditor.

Definition at line 35 of file NameAuditor.cpp.

{
  std::ostringstream oss;
  oss << evt;
  after(oss.str(), caller, sc);
}
virtual void NameAuditor::after ( CustomEventTypeRef  evt,
INamedInterface caller,
const StatusCode sc 
) [inline, virtual]

Reimplemented from Auditor.

Definition at line 45 of file NameAuditor.h.

                                                                                            {
    if (caller) after(evt, caller->name(), sc);
  }
virtual void NameAuditor::after ( StandardEventType  evt,
INamedInterface caller,
const StatusCode sc 
) [inline, virtual]

Reimplemented from Auditor.

Definition at line 39 of file NameAuditor.h.

                                                                                           {
    if (caller) after(evt, caller->name(), sc);
  }
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.

                                                                                         {
    i_doAudit(evt, caller, AFTER);
  }
void NameAuditor::before ( StandardEventType  evt,
const std::string caller 
) [virtual]

Reimplemented from Auditor.

Definition at line 27 of file NameAuditor.cpp.

{
  std::ostringstream oss;
  oss << evt;
  before(oss.str(), caller);
}
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.

                                                                      {
    if (caller) before(evt, caller->name());
  }
virtual void NameAuditor::before ( CustomEventTypeRef  evt,
INamedInterface caller 
) [inline, virtual]

Reimplemented from Auditor.

Definition at line 30 of file NameAuditor.h.

                                                                       {
    if (caller) before(evt, caller->name());
  }
virtual void NameAuditor::before ( CustomEventTypeRef  evt,
const std::string caller 
) [inline, virtual]

Reimplemented from Auditor.

Definition at line 27 of file NameAuditor.h.

                                                                       {
    i_doAudit(evt, caller, BEFORE);
  }
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.

{
  if (m_types.value().size() != 0) {
    if ( (m_types.value())[0] == "none") {
      return;
    }

    if ( find(m_types.value().begin(), m_types.value().end(), evt) ==
         m_types.value().end() ) {
      return;
    }
  }

  MsgStream log( msgSvc(), name() );
  if ( action==BEFORE ) {
    log << MSG::INFO << "About to Enter " << caller << " with auditor trigger "
        << evt << endmsg;
  }
  else {
    log << MSG::INFO << "Just Exited " << caller << " with auditor trigger "
        << evt << endmsg;
  }
}

Member Data Documentation

Filter for custom event types.

Definition at line 55 of file NameAuditor.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Mon Feb 28 2011 18:28:17 for Gaudi Framework, version v22r1 by Doxygen version 1.7.2 written by Dimitri van Heesch, © 1997-2004