#include <NameAuditor.h>
Inheritance diagram for NameAuditor:
Public Types | |
typedef std::string | CustomEventType |
typedef const CustomEventType & | CustomEventTypeRef |
Initialize | |
ReInitialize | |
Execute | |
BeginRun | |
EndRun | |
Finalize | |
Start | |
Stop | |
ReStart | |
SUCCESS | |
NO_INTERFACE | |
VERSMISMATCH | |
LAST_ERROR | |
enum | StandardEventType |
enum | Status |
Public Member Functions | |
NameAuditor (const std::string &name, ISvcLocator *pSvcLocator) | |
virtual | ~NameAuditor () |
StatusCode | sysInitialize () |
StatusCode | sysFinalize () |
virtual void | before (StandardEventType, INamedInterface *) |
virtual void | before (StandardEventType, const std::string &) |
virtual void | before (CustomEventTypeRef, INamedInterface *) |
virtual void | before (CustomEventTypeRef, const std::string &) |
virtual void | before (StandardEventType, INamedInterface *)=0 |
virtual void | before (StandardEventType, const std::string &)=0 |
virtual void | after (StandardEventType, INamedInterface *, const StatusCode &) |
virtual void | after (StandardEventType, const std::string &, const StatusCode &) |
virtual void | after (CustomEventTypeRef, INamedInterface *, const StatusCode &) |
virtual void | after (CustomEventTypeRef, const std::string &, const StatusCode &) |
virtual void | after (StandardEventType, INamedInterface *, const StatusCode &sc=StatusCode(StatusCode::SUCCESS, true))=0 |
virtual void | after (StandardEventType, const std::string &, const StatusCode &sc=StatusCode(StatusCode::SUCCESS, true))=0 |
virtual void | beforeInitialize (INamedInterface *) |
virtual void | afterInitialize (INamedInterface *) |
virtual void | beforeReinitialize (INamedInterface *) |
virtual void | afterReinitialize (INamedInterface *) |
virtual void | beforeExecute (INamedInterface *) |
virtual void | afterExecute (INamedInterface *, const StatusCode &) |
virtual void | beforeFinalize (INamedInterface *) |
virtual void | afterFinalize (INamedInterface *) |
virtual void | beforeBeginRun (INamedInterface *) |
virtual void | afterBeginRun (INamedInterface *) |
virtual void | beforeEndRun (INamedInterface *) |
virtual void | afterEndRun (INamedInterface *) |
virtual StatusCode | initialize () |
virtual StatusCode | finalize () |
virtual const std::string & | name () const |
virtual bool | isEnabled () const |
IMessageSvc * | msgSvc () const |
int | outputLevel () const |
void | setOutputLevel (int level) |
ISvcLocator * | serviceLocator () const |
StatusCode | service (const std::string &name, T *&svc, bool createIf=false) const |
virtual StatusCode | setProperty (const Property &p) |
virtual StatusCode | setProperty (const std::string &s) |
virtual StatusCode | setProperty (const std::string &n, const std::string &v) |
StatusCode | setProperty (const std::string &name, const TYPE &value) |
virtual StatusCode | getProperty (Property *p) const |
virtual const Property & | getProperty (const std::string &name) const |
virtual StatusCode | getProperty (const std::string &n, std::string &v) const |
const std::vector< Property * > & | getProperties () const |
StatusCode | setProperties () |
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const |
unsigned long | addRef () |
unsigned long | release () |
StatusCode | queryInterface (const InterfaceID &riid, void **) |
"before" Auditor hooks | |
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 | |
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) |
Static Public Member Functions | |
static const InterfaceID & | interfaceID () |
static const InterfaceID & | interfaceID () |
Public Attributes | |
Initialize | |
ReInitialize | |
Execute | |
BeginRun | |
EndRun | |
Finalize | |
Start | |
Stop | |
ReStart | |
SUCCESS | |
NO_INTERFACE | |
VERSMISMATCH | |
LAST_ERROR | |
Private Types | |
BEFORE | |
AFTER | |
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. |
Definition at line 14 of file NameAuditor.h.
enum NameAuditor::Action [private] |
NameAuditor::NameAuditor | ( | const std::string & | name, | |
ISvcLocator * | pSvcLocator | |||
) |
Definition at line 15 of file NameAuditor.cpp.
00015 : 00016 Auditor(name, pSvcLocator) 00017 { 00018 00019 declareProperty("CustomEventTypes", m_types, 00020 "List of custom event types to audit ([]=all, ['none']=none"); 00021 00022 }
NameAuditor::~NameAuditor | ( | ) | [virtual] |
void NameAuditor::before | ( | StandardEventType | evt, | |
const std::string & | caller | |||
) | [virtual] |
Definition at line 28 of file NameAuditor.cpp.
00029 { 00030 std::ostringstream oss; 00031 oss << evt; 00032 before(oss.str(), caller); 00033 }
virtual void NameAuditor::before | ( | StandardEventType | evt, | |
INamedInterface * | caller | |||
) | [inline, virtual] |
Definition at line 26 of file NameAuditor.h.
00026 { 00027 if (caller) before(evt, caller->name()); 00028 }
virtual void NameAuditor::before | ( | CustomEventTypeRef | evt, | |
const std::string & | caller | |||
) | [inline, virtual] |
virtual void NameAuditor::before | ( | CustomEventTypeRef | evt, | |
INamedInterface * | caller | |||
) | [inline, virtual] |
Definition at line 32 of file NameAuditor.h.
00032 { 00033 if (caller) before(evt, caller->name()); 00034 }
void NameAuditor::after | ( | StandardEventType | evt, | |
const std::string & | caller, | |||
const StatusCode & | sc | |||
) | [virtual] |
virtual void NameAuditor::after | ( | StandardEventType | evt, | |
INamedInterface * | caller, | |||
const StatusCode & | sc | |||
) | [inline, virtual] |
virtual void NameAuditor::after | ( | CustomEventTypeRef | evt, | |
const std::string & | caller, | |||
const StatusCode & | ||||
) | [inline, virtual] |
virtual void NameAuditor::after | ( | CustomEventTypeRef | evt, | |
INamedInterface * | caller, | |||
const StatusCode & | sc | |||
) | [inline, virtual] |
void NameAuditor::i_doAudit | ( | const std::string & | evt, | |
const std::string & | caller, | |||
Action | action | |||
) | [private] |
Implementation of the auditor.
Definition at line 44 of file NameAuditor.cpp.
00045 { 00046 if (m_types.value().size() != 0) { 00047 if ( (m_types.value())[0] == "none") { 00048 return; 00049 } 00050 00051 if ( find(m_types.value().begin(), m_types.value().end(), evt) == 00052 m_types.value().end() ) { 00053 return; 00054 } 00055 } 00056 00057 MsgStream log( msgSvc(), name() ); 00058 if ( action==BEFORE ) { 00059 log << MSG::INFO << "About to Enter " << caller << " with auditor trigger " 00060 << evt << endreq; 00061 } 00062 else { 00063 log << MSG::INFO << "Just Exited " << caller << " with auditor trigger " 00064 << evt << endreq; 00065 } 00066 }
StringArrayProperty NameAuditor::m_types [private] |