Auditor Class Reference

Base class from which all concrete auditor classes should be derived. More...

#include <GaudiKernel/Auditor.h>

Inheritance diagram for Auditor:
Collaboration diagram for Auditor:

Public Types

typedef Gaudi::PluginService::Factory< IAuditor *, const std::string &, ISvcLocator * > Factory
 
typedef Gaudi::PluginService::Factory< IAuditor *, const std::string &, ISvcLocator * > Factory
 
- Public Types inherited from implements2< IAuditor, IProperty >
typedef implements2 base_class
 Typedef to this class. More...
 
typedef implements2 base_class
 Typedef to this class. More...
 
typedef extend_interfaces2< IAuditor, IPropertyextend_interfaces_base
 Typedef to the base of this class. More...
 
typedef extend_interfaces2< IAuditor, IPropertyextend_interfaces_base
 Typedef to the base of this class. More...
 
typedef extend_interfaces_base::ext_iids interfaces
 MPL set of all the implemented interfaces. More...
 
typedef extend_interfaces_base::ext_iids interfaces
 MPL set of all the implemented interfaces. More...
 
- Public Types inherited from extend_interfaces2< IAuditor, IProperty >
typedef mpl::fold< typename IAuditor::iid::iids::type, typename IProperty::iid::iids::type, mpl::insert< mpl::_1, mpl::_2 > >::type ext_iids
 MPL set of interfaces extended by this one. More...
 
typedef mpl::fold< typename IAuditor::iid::iids::type, typename IProperty::iid::iids::type, mpl::insert< mpl::_1, mpl::_2 > >::type ext_iids
 MPL set of interfaces extended by this one. More...
 
- Public Types inherited from IAuditor
enum  StandardEventType {
  Initialize, ReInitialize, Execute, BeginRun,
  EndRun, Finalize, Start, Stop,
  ReStart, Initialize, ReInitialize, Execute,
  BeginRun, EndRun, Finalize, Start,
  Stop, ReStart
}
 Defines the standard (= used by the framework) auditable event types. More...
 
enum  StandardEventType {
  Initialize, ReInitialize, Execute, BeginRun,
  EndRun, Finalize, Start, Stop,
  ReStart, Initialize, ReInitialize, Execute,
  BeginRun, EndRun, Finalize, Start,
  Stop, ReStart
}
 Defines the standard (= used by the framework) auditable event types. More...
 
typedef std::string CustomEventType
 Type used to allow users to specify a custom event to be audit. More...
 
typedef const CustomEventTypeCustomEventTypeRef
 Used in function calls for optimization purposes. More...
 
typedef std::string CustomEventType
 Type used to allow users to specify a custom event to be audit. More...
 
typedef const CustomEventTypeCustomEventTypeRef
 Used in function calls for optimization purposes. More...
 
- Public Types inherited from IInterface
enum  Status {
  SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR,
  SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR
}
 Return status. More...
 
enum  Status {
  SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR,
  SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR
}
 Return status. More...
 
typedef Gaudi::InterfaceId< IInterface, 0, 0 > iid
 Interface ID. More...
 
typedef mpl::set1< iidext_iids
 Extra interfaces. More...
 
typedef Gaudi::InterfaceId< IInterface, 0, 0 > iid
 Interface ID. More...
 
typedef mpl::set1< iidext_iids
 Extra interfaces. More...
 

Public Member Functions

 Auditor (const std::string &name, ISvcLocator *svcloc)
 Constructor. More...
 
virtual ~Auditor ()
 Destructor. More...
 
StatusCode sysInitialize ()
 Initialization method invoked by the framework. More...
 
StatusCode sysFinalize ()
 Finalization method invoked by the framework. More...
 
virtual void before (StandardEventType, INamedInterface *)
 The following methods are meant to be implemented by the child class... More...
 
virtual void before (StandardEventType, const std::string &)
 Audit the start of a standard "event" for callers that do not implement INamedInterface. More...
 
virtual void before (CustomEventTypeRef, INamedInterface *)
 Audit the start of a custom "event". More...
 
virtual void before (CustomEventTypeRef, const std::string &)
 Audit the start of a custom "event" for callers that do not implement INamedInterface. More...
 
virtual void after (StandardEventType, INamedInterface *, const StatusCode &)
 Audit the end of a standard "event". More...
 
virtual void after (StandardEventType, const std::string &, const StatusCode &)
 Audit the end of a standard "event" for callers that do not implement INamedInterface. More...
 
virtual void after (CustomEventTypeRef, INamedInterface *, const StatusCode &)
 Audit the end of a custom "event". More...
 
virtual void after (CustomEventTypeRef, const std::string &, const StatusCode &)
 Audit the end of a custom "event" for callers that do not implement INamedInterface. More...
 
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
 Retrieve the name of the instance. More...
 
virtual bool isEnabled () const
 Tell if the auditor is enabled or not. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
int outputLevel () const
 Retrieve the output level of current auditor. More...
 
void setOutputLevel (int level)
 Set the output level for current auditor. More...
 
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...
 
virtual StatusCode setProperty (const Property &p)
 Set a value of a property of an auditor. More...
 
virtual StatusCode setProperty (const std::string &s)
 Implementation of IProperty::setProperty. More...
 
virtual StatusCode setProperty (const std::string &n, const std::string &v)
 Implementation of IProperty::setProperty. More...
 
virtual StatusCode getProperty (Property *p) const
 Get the value of a property. More...
 
virtual const PropertygetProperty (const std::string &name) const
 Get the property by name. More...
 
virtual StatusCode getProperty (const std::string &n, std::string &v) const
 Implementation of IProperty::getProperty. More...
 
const std::vector< Property * > & getProperties () const
 Get all properties. More...
 
virtual bool hasProperty (const std::string &name) const
 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 >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property. More...
 
 Auditor (const std::string &name, ISvcLocator *svcloc)
 Constructor. More...
 
virtual ~Auditor ()
 Destructor. More...
 
StatusCode sysInitialize ()
 Initialization method invoked by the framework. More...
 
StatusCode sysFinalize ()
 Finalization method invoked by the framework. More...
 
virtual void before (StandardEventType, INamedInterface *)
 The following methods are meant to be implemented by the child class... More...
 
virtual void before (StandardEventType, const std::string &)
 Audit the start of a standard "event" for callers that do not implement INamedInterface. More...
 
virtual void before (CustomEventTypeRef, INamedInterface *)
 Audit the start of a custom "event". More...
 
virtual void before (CustomEventTypeRef, const std::string &)
 Audit the start of a custom "event" for callers that do not implement INamedInterface. More...
 
virtual void after (StandardEventType, INamedInterface *, const StatusCode &)
 Audit the end of a standard "event". More...
 
virtual void after (StandardEventType, const std::string &, const StatusCode &)
 Audit the end of a standard "event" for callers that do not implement INamedInterface. More...
 
virtual void after (CustomEventTypeRef, INamedInterface *, const StatusCode &)
 Audit the end of a custom "event". More...
 
virtual void after (CustomEventTypeRef, const std::string &, const StatusCode &)
 Audit the end of a custom "event" for callers that do not implement INamedInterface. More...
 
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
 Retrieve the name of the instance. More...
 
virtual bool isEnabled () const
 Tell if the auditor is enabled or not. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
int outputLevel () const
 Retrieve the output level of current auditor. More...
 
void setOutputLevel (int level)
 Set the output level for current auditor. More...
 
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...
 
virtual StatusCode setProperty (const Property &p)
 Set a value of a property of an auditor. More...
 
virtual StatusCode setProperty (const std::string &s)
 Implementation of IProperty::setProperty. More...
 
virtual StatusCode setProperty (const std::string &n, const std::string &v)
 Implementation of IProperty::setProperty. More...
 
virtual StatusCode getProperty (Property *p) const
 Get the value of a property. More...
 
virtual const PropertygetProperty (const std::string &name) const
 Get the property by name. More...
 
virtual StatusCode getProperty (const std::string &n, std::string &v) const
 Implementation of IProperty::getProperty. More...
 
const std::vector< Property * > & getProperties () const
 Get all properties. More...
 
virtual bool hasProperty (const std::string &name) const
 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 >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property. More...
 
- Public Member Functions inherited from extend_interfaces2< IAuditor, IProperty >
virtual ~extend_interfaces2 ()
 Virtual destructor. More...
 
virtual ~extend_interfaces2 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IAuditor
 DeclareInterfaceID (IAuditor, 3, 0)
 InterfaceID. More...
 
 DeclareInterfaceID (IAuditor, 3, 0)
 InterfaceID. More...
 
- Public Member Functions inherited from INamedInterface
 DeclareInterfaceID (INamedInterface, 1, 0)
 InterfaceID. More...
 
virtual ~INamedInterface ()
 Virtual destructor (always needed for abstract classes). More...
 
 DeclareInterfaceID (INamedInterface, 1, 0)
 InterfaceID. More...
 
virtual ~INamedInterface ()
 Virtual destructor (always needed for abstract classes). More...
 
- Public Member Functions inherited from IInterface
virtual void * i_cast (const InterfaceID &) const =0
 main cast function More...
 
virtual std::vector< std::string > getInterfaceNames () const =0
 Returns a vector of strings containing the names of all the implemented interfaces. More...
 
virtual unsigned long addRef ()=0
 Increment the reference count of Interface instance. More...
 
virtual unsigned long release ()=0
 Release Interface instance. More...
 
virtual unsigned long refCount () const =0
 Current reference count. More...
 
virtual StatusCode queryInterface (const InterfaceID &ti, void **pp)=0
 Set the void** to the pointer to the requested interface of the instance. More...
 
virtual ~IInterface ()
 Virtual destructor. More...
 
virtual void * i_cast (const InterfaceID &) const =0
 main cast function More...
 
virtual std::vector< std::string > getInterfaceNames () const =0
 Returns a vector of strings containing the names of all the implemented interfaces. More...
 
virtual unsigned long addRef ()=0
 Increment the reference count of Interface instance. More...
 
virtual unsigned long release ()=0
 Release Interface instance. More...
 
virtual unsigned long refCount () const =0
 Current reference count. More...
 
virtual StatusCode queryInterface (const InterfaceID &ti, void **pp)=0
 Set the void** to the pointer to the requested interface of the instance. More...
 
virtual ~IInterface ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IProperty
 DeclareInterfaceID (IProperty, 2, 1)
 InterfaceID. More...
 
 DeclareInterfaceID (IProperty, 2, 1)
 InterfaceID. More...
 

Private Member Functions

 Auditor (const Auditor &a)
 
Auditoroperator= (const Auditor &rhs)
 
 Auditor (const Auditor &a)
 
Auditoroperator= (const Auditor &rhs)
 

Private Attributes

std::string m_name
 Auditor's name for identification. More...
 
SmartIF< IMessageSvcm_MS
 Message service. More...
 
SmartIF< ISvcLocatorm_pSvcLocator
 Pointer to service locator service. More...
 
PropertyMgrm_PropertyMgr
 For management of properties. More...
 
int m_outputLevel
 Auditor output level. More...
 
bool m_isEnabled
 Auditor is enabled flag. More...
 
bool m_isInitialized
 Auditor has been initialized flag. More...
 
bool m_isFinalized
 Auditor has been finalized flag. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from IInterface
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface. More...
 
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface. More...
 

Detailed Description

Base class from which all concrete auditor classes should be derived.

The only base class functionality which may be used in the constructor of a concrete auditor is the declaration of member variables as properties. All other functionality, i.e. the use of services, may be used only in initialize() and afterwards.

Author
David Quarrie
Date
2000
Author
Marco Clemencic
Date
2008-03

Definition at line 34 of file Auditor.h.

Member Typedef Documentation

Definition at line 39 of file Auditor.h.

Definition at line 39 of file Auditor.h.

Constructor & Destructor Documentation

Auditor::Auditor ( const std::string &  name,
ISvcLocator svcloc 
)

Constructor.

Parameters
nameThe algorithm object's name
svclocA pointer to a service location service

Definition at line 12 of file Auditor.cpp.

13 : m_name(name),
14  m_pSvcLocator(pSvcLocator),
15  m_isEnabled(true),
16  m_isInitialized(false),
17  m_isFinalized(false)
18 {
19  m_PropertyMgr = new PropertyMgr();
20 
21  // Declare common Auditor properties with their defaults
22  declareProperty( "OutputLevel", m_outputLevel = MSG::NIL);
23  declareProperty( "Enable", m_isEnabled = true);
24 }
bool m_isEnabled
Auditor is enabled flag.
Definition: Auditor.h:250
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:216
Property manager helper class.
Definition: PropertyMgr.h:34
std::string m_name
Auditor's name for identification.
Definition: Auditor.h:244
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Auditor.h:237
bool m_isInitialized
Auditor has been initialized flag.
Definition: Auditor.h:251
PropertyMgr * m_PropertyMgr
For management of properties.
Definition: Auditor.h:248
int m_outputLevel
Auditor output level.
Definition: Auditor.h:249
SmartIF< ISvcLocator > m_pSvcLocator
Pointer to service locator service.
Definition: Auditor.h:247
bool m_isFinalized
Auditor has been finalized flag.
Definition: Auditor.h:252
Auditor::~Auditor ( )
virtual

Destructor.

Definition at line 27 of file Auditor.cpp.

27  {
28  delete m_PropertyMgr;
29 }
PropertyMgr * m_PropertyMgr
For management of properties.
Definition: Auditor.h:248
Auditor::Auditor ( const Auditor a)
private
Auditor::Auditor ( const std::string &  name,
ISvcLocator svcloc 
)

Constructor.

Parameters
nameThe algorithm object's name
svclocA pointer to a service location service
virtual Auditor::~Auditor ( )
virtual

Destructor.

Auditor::Auditor ( const Auditor a)
private

Member Function Documentation

void Auditor::after ( StandardEventType  ,
INamedInterface ,
const StatusCode sc 
)
virtual

Audit the end of a standard "event".

Implements IAuditor.

Reimplemented in Google::AuditorBase, PerfMonAuditor, IntelProfilerAuditor, TimingAuditor, and CommonAuditor.

Definition at line 120 of file Auditor.cpp.

120  {
121  switch (evt) {
122  case Initialize: afterInitialize(obj); break;
123  case ReInitialize: afterReinitialize(obj); break;
124  case Execute: afterExecute(obj, sc); break;
125  case BeginRun: afterBeginRun(obj); break;
126  case EndRun: afterEndRun(obj); break;
127  case Finalize: afterFinalize(obj); break;
128  case Start: break;
129  case Stop: break;
130  case ReStart: break;
131  default: break ;// do nothing
132  }
133 }
virtual void afterBeginRun(INamedInterface *)
Definition: Auditor.cpp:153
virtual void afterFinalize(INamedInterface *)
Definition: Auditor.cpp:161
virtual void afterExecute(INamedInterface *, const StatusCode &)
Definition: Auditor.cpp:149
virtual void afterReinitialize(INamedInterface *)
Definition: Auditor.cpp:145
virtual void afterInitialize(INamedInterface *)
Definition: Auditor.cpp:141
virtual void afterEndRun(INamedInterface *)
Definition: Auditor.cpp:157
virtual void Auditor::after ( StandardEventType  ,
INamedInterface ,
const StatusCode sc 
)
virtual

Audit the end of a standard "event".

Implements IAuditor.

Reimplemented in Google::AuditorBase, PerfMonAuditor, IntelProfilerAuditor, TimingAuditor, and CommonAuditor.

void Auditor::after ( StandardEventType  ,
const std::string &  ,
const StatusCode sc 
)
virtual

Audit the end of a standard "event" for callers that do not implement INamedInterface.

Implements IAuditor.

Reimplemented in Google::AuditorBase, and CommonAuditor.

Definition at line 134 of file Auditor.cpp.

134 {}
virtual void Auditor::after ( StandardEventType  ,
const std::string &  ,
const StatusCode sc 
)
virtual

Audit the end of a standard "event" for callers that do not implement INamedInterface.

Implements IAuditor.

Reimplemented in Google::AuditorBase, and CommonAuditor.

void Auditor::after ( CustomEventTypeRef  ,
INamedInterface ,
const StatusCode sc 
)
virtual

Audit the end of a custom "event".

Implements IAuditor.

Reimplemented in Google::AuditorBase, and CommonAuditor.

Definition at line 136 of file Auditor.cpp.

136 {}
virtual void Auditor::after ( CustomEventTypeRef  ,
INamedInterface ,
const StatusCode sc 
)
virtual

Audit the end of a custom "event".

Implements IAuditor.

Reimplemented in Google::AuditorBase, and CommonAuditor.

void Auditor::after ( CustomEventTypeRef  ,
const std::string &  ,
const StatusCode sc 
)
virtual

Audit the end of a custom "event" for callers that do not implement INamedInterface.

Implements IAuditor.

Reimplemented in Google::AuditorBase, TimingAuditor, and CommonAuditor.

Definition at line 137 of file Auditor.cpp.

137 {}
virtual void Auditor::after ( CustomEventTypeRef  ,
const std::string &  ,
const StatusCode sc 
)
virtual

Audit the end of a custom "event" for callers that do not implement INamedInterface.

Implements IAuditor.

Reimplemented in Google::AuditorBase, TimingAuditor, and CommonAuditor.

void Auditor::afterBeginRun ( INamedInterface )
virtual
Deprecated:
use after

Implements IAuditor.

Reimplemented in Google::AuditorBase.

Definition at line 153 of file Auditor.cpp.

153 {}
virtual void Auditor::afterBeginRun ( INamedInterface )
virtual
Deprecated:
use after

Implements IAuditor.

Reimplemented in Google::AuditorBase.

virtual void Auditor::afterEndRun ( INamedInterface )
virtual
Deprecated:
use after

Implements IAuditor.

Reimplemented in Google::AuditorBase.

void Auditor::afterEndRun ( INamedInterface )
virtual
Deprecated:
use after

Implements IAuditor.

Reimplemented in Google::AuditorBase.

Definition at line 157 of file Auditor.cpp.

157 {}
void Auditor::afterExecute ( INamedInterface ,
const StatusCode  
)
virtual
Deprecated:
use after

Implements IAuditor.

Reimplemented in Google::AuditorBase, AlgContextAuditor, and AlgErrorAuditor.

Definition at line 149 of file Auditor.cpp.

149 {}
virtual void Auditor::afterExecute ( INamedInterface ,
const StatusCode  
)
virtual
Deprecated:
use after

Implements IAuditor.

Reimplemented in Google::AuditorBase, AlgContextAuditor, and AlgErrorAuditor.

void Auditor::afterFinalize ( INamedInterface )
virtual
Deprecated:
use after

Implements IAuditor.

Reimplemented in Google::AuditorBase, and AlgContextAuditor.

Definition at line 161 of file Auditor.cpp.

161 {}
virtual void Auditor::afterFinalize ( INamedInterface )
virtual
Deprecated:
use after

Implements IAuditor.

Reimplemented in Google::AuditorBase, and AlgContextAuditor.

void Auditor::afterInitialize ( INamedInterface )
virtual
Deprecated:
use after

Implements IAuditor.

Reimplemented in Google::AuditorBase, and AlgContextAuditor.

Definition at line 141 of file Auditor.cpp.

141 {}
virtual void Auditor::afterInitialize ( INamedInterface )
virtual
Deprecated:
use after

Implements IAuditor.

Reimplemented in Google::AuditorBase, and AlgContextAuditor.

void Auditor::afterReinitialize ( INamedInterface )
virtual
Deprecated:
use after

Implements IAuditor.

Reimplemented in Google::AuditorBase.

Definition at line 145 of file Auditor.cpp.

145 {}
virtual void Auditor::afterReinitialize ( INamedInterface )
virtual
Deprecated:
use after

Implements IAuditor.

Reimplemented in Google::AuditorBase.

virtual void Auditor::before ( StandardEventType  ,
INamedInterface  
)
virtual

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

Implements IAuditor.

Reimplemented in PerfMonAuditor, Google::AuditorBase, IntelProfilerAuditor, TimingAuditor, and CommonAuditor.

void Auditor::before ( StandardEventType  evt,
INamedInterface obj 
)
virtual

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

Implements IAuditor.

Reimplemented in PerfMonAuditor, Google::AuditorBase, IntelProfilerAuditor, TimingAuditor, and CommonAuditor.

Definition at line 100 of file Auditor.cpp.

100  {
101  switch (evt) {
102  case Initialize: beforeInitialize(obj); break;
103  case ReInitialize: beforeReinitialize(obj); break;
104  case Execute: beforeExecute(obj); break;
105  case BeginRun: beforeBeginRun(obj); break;
106  case EndRun: beforeEndRun(obj); break;
107  case Finalize: beforeFinalize(obj); break;
108  case Start: break;
109  case Stop: break;
110  case ReStart: break;
111  default: break ;// do nothing
112  }
113 }
virtual void beforeBeginRun(INamedInterface *)
Definition: Auditor.cpp:151
virtual void beforeExecute(INamedInterface *)
Definition: Auditor.cpp:147
virtual void beforeReinitialize(INamedInterface *)
Definition: Auditor.cpp:143
virtual void beforeFinalize(INamedInterface *)
Definition: Auditor.cpp:159
virtual void beforeEndRun(INamedInterface *)
Definition: Auditor.cpp:155
virtual void beforeInitialize(INamedInterface *)
Definition: Auditor.cpp:139
void Auditor::before ( StandardEventType  ,
const std::string &   
)
virtual

Audit the start of a standard "event" for callers that do not implement INamedInterface.

Implements IAuditor.

Reimplemented in Google::AuditorBase, and CommonAuditor.

Definition at line 114 of file Auditor.cpp.

114 {}
virtual void Auditor::before ( StandardEventType  ,
const std::string &   
)
virtual

Audit the start of a standard "event" for callers that do not implement INamedInterface.

Implements IAuditor.

Reimplemented in Google::AuditorBase, and CommonAuditor.

void Auditor::before ( CustomEventTypeRef  ,
INamedInterface  
)
virtual

Audit the start of a custom "event".

Implements IAuditor.

Reimplemented in Google::AuditorBase, and CommonAuditor.

Definition at line 116 of file Auditor.cpp.

116 {}
virtual void Auditor::before ( CustomEventTypeRef  ,
INamedInterface  
)
virtual

Audit the start of a custom "event".

Implements IAuditor.

Reimplemented in Google::AuditorBase, and CommonAuditor.

virtual void Auditor::before ( CustomEventTypeRef  ,
const std::string &   
)
virtual

Audit the start of a custom "event" for callers that do not implement INamedInterface.

Implements IAuditor.

Reimplemented in Google::AuditorBase, TimingAuditor, and CommonAuditor.

void Auditor::before ( CustomEventTypeRef  ,
const std::string &   
)
virtual

Audit the start of a custom "event" for callers that do not implement INamedInterface.

Implements IAuditor.

Reimplemented in Google::AuditorBase, TimingAuditor, and CommonAuditor.

Definition at line 117 of file Auditor.cpp.

117 {}
void Auditor::beforeBeginRun ( INamedInterface )
virtual
Deprecated:
use before

Implements IAuditor.

Reimplemented in Google::AuditorBase.

Definition at line 151 of file Auditor.cpp.

151 {}
virtual void Auditor::beforeBeginRun ( INamedInterface )
virtual
Deprecated:
use before

Implements IAuditor.

Reimplemented in Google::AuditorBase.

virtual void Auditor::beforeEndRun ( INamedInterface )
virtual
Deprecated:
use before

Implements IAuditor.

Reimplemented in Google::AuditorBase.

void Auditor::beforeEndRun ( INamedInterface )
virtual
Deprecated:
use before

Implements IAuditor.

Reimplemented in Google::AuditorBase.

Definition at line 155 of file Auditor.cpp.

155 {}
virtual void Auditor::beforeExecute ( INamedInterface )
virtual
Deprecated:
use before

Implements IAuditor.

Reimplemented in Google::AuditorBase, AlgContextAuditor, and AlgErrorAuditor.

void Auditor::beforeExecute ( INamedInterface )
virtual
Deprecated:
use before

Implements IAuditor.

Reimplemented in Google::AuditorBase, AlgContextAuditor, and AlgErrorAuditor.

Definition at line 147 of file Auditor.cpp.

147 {}
void Auditor::beforeFinalize ( INamedInterface )
virtual
Deprecated:
use before

Implements IAuditor.

Reimplemented in Google::AuditorBase, and AlgContextAuditor.

Definition at line 159 of file Auditor.cpp.

159 {}
virtual void Auditor::beforeFinalize ( INamedInterface )
virtual
Deprecated:
use before

Implements IAuditor.

Reimplemented in Google::AuditorBase, and AlgContextAuditor.

void Auditor::beforeInitialize ( INamedInterface )
virtual
Deprecated:
use before

Implements IAuditor.

Reimplemented in Google::AuditorBase, and AlgContextAuditor.

Definition at line 139 of file Auditor.cpp.

139 {}
virtual void Auditor::beforeInitialize ( INamedInterface )
virtual
Deprecated:
use before

Implements IAuditor.

Reimplemented in Google::AuditorBase, and AlgContextAuditor.

void Auditor::beforeReinitialize ( INamedInterface )
virtual
Deprecated:
use before

Implements IAuditor.

Reimplemented in Google::AuditorBase.

Definition at line 143 of file Auditor.cpp.

143 {}
virtual void Auditor::beforeReinitialize ( INamedInterface )
virtual
Deprecated:
use before

Implements IAuditor.

Reimplemented in Google::AuditorBase.

template<class T >
Property* Auditor::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
) const
inline

Declare the named property.

MyAuditor( ... )
: Auditor ( ... )
, m_property1 ( ... )
, m_property2 ( ... )
{
// declare the property
declareProperty( "Property1" , m_property1 , "Doc for property #1" ) ;
// declare the property and attach the handler to it
declareProperty( "Property2" , m_property2 , "Doc for property #2" )
-> declareUpdateHandler( &MyAuditor::handler_2 ) ;
}
See also
PropertyMgr
PropertyMgr::declareProperty
Parameters
namethe property name
propertythe property itself,
docthe documentation string
Returns
the actual property objects

Definition at line 237 of file Auditor.h.

238  {
239  return m_PropertyMgr->declareProperty(name, property, doc);
240  }
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:216
Property * declareProperty(const std::string &name, TYPE &value, const std::string &doc="none")
Declare a property (templated)
Definition: PropertyMgr.h:182
PropertyMgr * m_PropertyMgr
For management of properties.
Definition: Auditor.h:248
template<class T >
Property* Auditor::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
) const
inline

Declare the named property.

MyAuditor( ... )
: Auditor ( ... )
, m_property1 ( ... )
, m_property2 ( ... )
{
// declare the property
declareProperty( "Property1" , m_property1 , "Doc for property #1" ) ;
// declare the property and attach the handler to it
declareProperty( "Property2" , m_property2 , "Doc for property #2" )
-> declareUpdateHandler( &MyAuditor::handler_2 ) ;
}
See also
PropertyMgr
PropertyMgr::declareProperty
Parameters
namethe property name
propertythe property itself,
docthe documentation string
Returns
the actual property objects

Definition at line 237 of file Auditor.h.

238  {
239  return m_PropertyMgr->declareProperty(name, property, doc);
240  }
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:216
Property * declareProperty(const std::string &name, TYPE &value, const std::string &doc="none")
Declare a property (templated)
Definition: PropertyMgr.h:182
PropertyMgr * m_PropertyMgr
For management of properties.
Definition: Auditor.h:248
virtual StatusCode Auditor::finalize ( )
virtual
StatusCode Auditor::finalize ( )
virtual

Reimplemented in PerfMonAuditor, Google::AuditorBase, TimingAuditor, AlgContextAuditor, and AlgErrorAuditor.

Definition at line 211 of file Auditor.cpp.

211  {
212  m_MS = 0; // release message service
213  return StatusCode::SUCCESS;
214 }
SmartIF< IMessageSvc > m_MS
Message service.
Definition: Auditor.h:246
const std::vector< Property * > & Auditor::getProperties ( ) const
virtual

Get all properties.

Implements IProperty.

Definition at line 272 of file Auditor.cpp.

272  {
273  return m_PropertyMgr->getProperties();
274 }
PropertyMgr * m_PropertyMgr
For management of properties.
Definition: Auditor.h:248
const std::vector< Property * > & getProperties() const
get all properties
const std::vector<Property*>& Auditor::getProperties ( ) const
virtual

Get all properties.

Implements IProperty.

StatusCode Auditor::getProperty ( Property p) const
virtual

Get the value of a property.

Implements IProperty.

Definition at line 263 of file Auditor.cpp.

263  {
264  return m_PropertyMgr->getProperty(p);
265 }
StatusCode getProperty(Property *p) const
get the property
PropertyMgr * m_PropertyMgr
For management of properties.
Definition: Auditor.h:248
virtual StatusCode Auditor::getProperty ( Property p) const
virtual

Get the value of a property.

Implements IProperty.

virtual const Property& Auditor::getProperty ( const std::string &  name) const
virtual

Get the property by name.

Implements IProperty.

const Property & Auditor::getProperty ( const std::string &  name) const
virtual

Get the property by name.

Implements IProperty.

Definition at line 266 of file Auditor.cpp.

266  {
267  return m_PropertyMgr->getProperty(name);
268 }
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:216
StatusCode getProperty(Property *p) const
get the property
PropertyMgr * m_PropertyMgr
For management of properties.
Definition: Auditor.h:248
StatusCode Auditor::getProperty ( const std::string &  n,
std::string &  v 
) const
virtual

Implementation of IProperty::getProperty.

Implements IProperty.

Definition at line 269 of file Auditor.cpp.

269  {
270  return m_PropertyMgr->getProperty(n,v);
271 }
StatusCode getProperty(Property *p) const
get the property
PropertyMgr * m_PropertyMgr
For management of properties.
Definition: Auditor.h:248
virtual StatusCode Auditor::getProperty ( const std::string &  n,
std::string &  v 
) const
virtual

Implementation of IProperty::getProperty.

Implements IProperty.

virtual bool Auditor::hasProperty ( const std::string &  name) const
virtual

Implementation of IProperty::hasProperty.

Implements IProperty.

bool Auditor::hasProperty ( const std::string &  name) const
virtual

Implementation of IProperty::hasProperty.

Implements IProperty.

Definition at line 275 of file Auditor.cpp.

275  {
276  return m_PropertyMgr->hasProperty(name);
277 }
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:216
bool hasProperty(const std::string &name) const
Return true if we have a property with the given name.
PropertyMgr * m_PropertyMgr
For management of properties.
Definition: Auditor.h:248
virtual bool Auditor::isEnabled ( ) const
virtual

Tell if the auditor is enabled or not.

Implements IAuditor.

bool Auditor::isEnabled ( ) const
virtual

Tell if the auditor is enabled or not.

Implements IAuditor.

Definition at line 220 of file Auditor.cpp.

220  {
221  return m_isEnabled;
222 }
bool m_isEnabled
Auditor is enabled flag.
Definition: Auditor.h:250
SmartIF< IMessageSvc > & Auditor::msgSvc ( ) const

The standard message service.

Returns a pointer to the standard message service. May not be invoked before sysInitialize() has been invoked.

Definition at line 224 of file Auditor.cpp.

224  {
225  return m_MS;
226 }
SmartIF< IMessageSvc > m_MS
Message service.
Definition: Auditor.h:246
SmartIF<IMessageSvc>& Auditor::msgSvc ( ) const

The standard message service.

Returns a pointer to the standard message service. May not be invoked before sysInitialize() has been invoked.

const std::string & Auditor::name ( ) const
virtual

Retrieve the name of the instance.

Implements INamedInterface.

Definition at line 216 of file Auditor.cpp.

216  {
217  return m_name;
218 }
std::string m_name
Auditor's name for identification.
Definition: Auditor.h:244
virtual const std::string& Auditor::name ( ) const
virtual

Retrieve the name of the instance.

Implements INamedInterface.

Auditor& Auditor::operator= ( const Auditor rhs)
private
Auditor& Auditor::operator= ( const Auditor rhs)
private
int Auditor::outputLevel ( ) const
inline

Retrieve the output level of current auditor.

Definition at line 105 of file Auditor.h.

105 { return m_outputLevel; }
int m_outputLevel
Auditor output level.
Definition: Auditor.h:249
int Auditor::outputLevel ( ) const
inline

Retrieve the output level of current auditor.

Definition at line 105 of file Auditor.h.

105 { return m_outputLevel; }
int m_outputLevel
Auditor output level.
Definition: Auditor.h:249
template<class T >
StatusCode Auditor::service ( const std::string &  name,
T *&  svc,
bool  createIf = false 
) const
inline

Access a service by name, creating it if it doesn't already exist.

Definition at line 119 of file Auditor.h.

119  {
120  SmartIF<T> ptr(serviceLocator()->service(name, createIf));
121  if (ptr.isValid()) {
122  svc = ptr.get();
123  svc->addRef();
124  return StatusCode::SUCCESS;
125  }
126  // else
127  svc = 0;
128  return StatusCode::FAILURE;
129  }
Small smart pointer class with automatic reference counting for IInterface.
Definition: IConverter.h:14
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.
Definition: Auditor.h:119
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:216
SmartIF< ISvcLocator > & serviceLocator() const
The standard service locator.
Definition: Auditor.cpp:234
template<class T >
StatusCode Auditor::service ( const std::string &  name,
T *&  svc,
bool  createIf = false 
) const
inline

Access a service by name, creating it if it doesn't already exist.

Definition at line 119 of file Auditor.h.

119  {
120  SmartIF<T> ptr(serviceLocator()->service(name, createIf));
121  if (ptr.isValid()) {
122  svc = ptr.get();
123  svc->addRef();
124  return StatusCode::SUCCESS;
125  }
126  // else
127  svc = 0;
128  return StatusCode::FAILURE;
129  }
Small smart pointer class with automatic reference counting for IInterface.
Definition: IConverter.h:14
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.
Definition: Auditor.h:119
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:216
SmartIF< ISvcLocator > & serviceLocator() const
The standard service locator.
Definition: Auditor.cpp:234
SmartIF<ISvcLocator>& Auditor::serviceLocator ( ) const

The standard service locator.

Returns a pointer to the service locator service. This service may be used by an auditor to request any services it requires in addition to those provided by default.

SmartIF< ISvcLocator > & Auditor::serviceLocator ( ) const

The standard service locator.

Returns a pointer to the service locator service. This service may be used by an auditor to request any services it requires in addition to those provided by default.

Definition at line 234 of file Auditor.cpp.

234  {
235  return m_pSvcLocator;
236 }
SmartIF< ISvcLocator > m_pSvcLocator
Pointer to service locator service.
Definition: Auditor.h:247
void Auditor::setOutputLevel ( int  level)

Set the output level for current auditor.

void Auditor::setOutputLevel ( int  level)

Set the output level for current auditor.

Definition at line 228 of file Auditor.cpp.

228  {
229  if( m_MS != 0) {
230  m_MS->setOutputLevel( name(), level );
231  }
232 }
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:216
SmartIF< IMessageSvc > m_MS
Message service.
Definition: Auditor.h:246
virtual void setOutputLevel(int new_level)=0
Set new global output level threshold.
StatusCode Auditor::setProperties ( )

Set the auditor's properties.

This method requests the job options service to set the values of any declared properties. The method is invoked from within sysInitialize() by the framework and does not need to be explicitly called by a concrete auditor.

Definition at line 239 of file Auditor.cpp.

239  {
240  if( m_pSvcLocator != 0 ) {
241  IJobOptionsSvc* jos;
242  StatusCode sc = service("JobOptionsSvc", jos);
243  if( sc.isSuccess() ) {
244  jos->setMyProperties( name(), this ).ignore();
245  jos->release();
246  return StatusCode::SUCCESS;
247  }
248  }
249  return StatusCode::FAILURE;
250 }
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.
Definition: Auditor.h:119
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:216
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
Main interface for the JobOptions service.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual StatusCode setMyProperties(const std::string &client, IProperty *me)=0
Override default properties of the calling client.
virtual unsigned long release()=0
Release Interface instance.
void ignore() const
Definition: StatusCode.h:107
SmartIF< ISvcLocator > m_pSvcLocator
Pointer to service locator service.
Definition: Auditor.h:247
StatusCode Auditor::setProperties ( )

Set the auditor's properties.

This method requests the job options service to set the values of any declared properties. The method is invoked from within sysInitialize() by the framework and does not need to be explicitly called by a concrete auditor.

StatusCode Auditor::setProperty ( const Property p)
virtual

Set a value of a property of an auditor.

Implements IProperty.

Definition at line 254 of file Auditor.cpp.

254  {
255  return m_PropertyMgr->setProperty(p);
256 }
StatusCode setProperty(const Property &p)
set the property form another property
PropertyMgr * m_PropertyMgr
For management of properties.
Definition: Auditor.h:248
virtual StatusCode Auditor::setProperty ( const Property p)
virtual

Set a value of a property of an auditor.

Implements IProperty.

virtual StatusCode Auditor::setProperty ( const std::string &  s)
virtual

Implementation of IProperty::setProperty.

Implements IProperty.

StatusCode Auditor::setProperty ( const std::string &  s)
virtual

Implementation of IProperty::setProperty.

Implements IProperty.

Definition at line 257 of file Auditor.cpp.

257  {
258  return m_PropertyMgr->setProperty(s);
259 }
StatusCode setProperty(const Property &p)
set the property form another property
PropertyMgr * m_PropertyMgr
For management of properties.
Definition: Auditor.h:248
string s
Definition: gaudirun.py:244
StatusCode Auditor::setProperty ( const std::string &  n,
const std::string &  v 
)
virtual

Implementation of IProperty::setProperty.

Implements IProperty.

Definition at line 260 of file Auditor.cpp.

260  {
261  return m_PropertyMgr->setProperty(n,v);
262 }
StatusCode setProperty(const Property &p)
set the property form another property
PropertyMgr * m_PropertyMgr
For management of properties.
Definition: Auditor.h:248
virtual StatusCode Auditor::setProperty ( const std::string &  n,
const std::string &  v 
)
virtual

Implementation of IProperty::setProperty.

Implements IProperty.

template<class TYPE >
StatusCode Auditor::setProperty ( const std::string &  name,
const TYPE &  value 
)
inline

set the property form the value

std::vector<double> data = ... ;
setProperty( "Data" , data ) ;
std::map<std::string,double> cuts = ... ;
setProperty( "Cuts" , cuts ) ;
std::map<std::string,std::string> dict = ... ;
setProperty( "Dictionary" , dict ) ;

Note: the interface IProperty allows setting of the properties either directly from other properties or from strings only

This is very convenient in resetting of the default properties in the derived classes. E.g. without this method one needs to convert everything into strings to use IProperty::setProperty

setProperty ( "OutputLevel" , "1" ) ;
setProperty ( "Enable" , "True" ) ;
setProperty ( "ErrorMax" , "10" ) ;

For simple cases it is more or less ok, but for complicated properties it is just ugly..

Parameters
namename of the property
valuevalue of the property
See also
Gaudi::Utils::setProperty
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-05-13

Definition at line 197 of file Auditor.h.

StatusCode setProperty(IProperty *component, const std::string &name, const TYPE &value, const std::string &doc)
simple function to set the property of the given object from the value
Definition: Property.h:1212
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:216
PropertyMgr * m_PropertyMgr
For management of properties.
Definition: Auditor.h:248
template<class TYPE >
StatusCode Auditor::setProperty ( const std::string &  name,
const TYPE &  value 
)
inline

set the property form the value

std::vector<double> data = ... ;
setProperty( "Data" , data ) ;
std::map<std::string,double> cuts = ... ;
setProperty( "Cuts" , cuts ) ;
std::map<std::string,std::string> dict = ... ;
setProperty( "Dictionary" , dict ) ;

Note: the interface IProperty allows setting of the properties either directly from other properties or from strings only

This is very convenient in resetting of the default properties in the derived classes. E.g. without this method one needs to convert everything into strings to use IProperty::setProperty

setProperty ( "OutputLevel" , "1" ) ;
setProperty ( "Enable" , "True" ) ;
setProperty ( "ErrorMax" , "10" ) ;

For simple cases it is more or less ok, but for complicated properties it is just ugly..

Parameters
namename of the property
valuevalue of the property
See also
Gaudi::Utils::setProperty
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-05-13

Definition at line 197 of file Auditor.h.

StatusCode setProperty(IProperty *component, const std::string &name, const TYPE &value, const std::string &doc)
simple function to set the property of the given object from the value
Definition: Property.h:1212
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:216
PropertyMgr * m_PropertyMgr
For management of properties.
Definition: Auditor.h:248
StatusCode Auditor::sysFinalize ( )
virtual

Finalization method invoked by the framework.

This method is responsible for any bookkeeping of initialization required by the framework itself.

Implements IAuditor.

StatusCode Auditor::sysFinalize ( )
virtual

Finalization method invoked by the framework.

This method is responsible for any bookkeeping of initialization required by the framework itself.

RETURN !!!

catch GaudiExeption

(1) perform the printout of message

(2) print the exception itself (NB! - GaudiException is a linked list of all "previous exceptions")

catch std::exception

(1) perform the printout of message

(2) print the exception itself

catch unknown exception

(1) perform the printout

Implements IAuditor.

Definition at line 163 of file Auditor.cpp.

163  {
165  try{
166  //
167  // Invoke the finalize() method of the derived class if
168  // it has been initialized.
169  if ( m_isInitialized && ! m_isFinalized ) {
170  m_isFinalized = true;
171  sc = finalize();
172  if( !sc.isSuccess() ) return StatusCode::FAILURE;
173  }
174  return sc;
175  //
176  }
177  catch( const GaudiException& Exception )
178  {
180  MsgStream log ( msgSvc() , name() + ".sysFinalize()" );
181  log << MSG::FATAL
182  << " Exception with tag=" << Exception.tag() << " is catched " << endmsg;
185  MsgStream logEx ( msgSvc() , Exception.tag() );
186  logEx << MSG::ERROR
187  << Exception << endmsg;
188  }
189  catch( const std::exception& Exception )
190  {
192  MsgStream log ( msgSvc() , name() + ".sysFinalize()" );
193  log << MSG::FATAL
194  << " Standard std::exception is caught " << endmsg;
196  MsgStream logEx ( msgSvc() , name() + "*std::exception*" );
197  logEx << MSG::ERROR
198  << Exception.what() << endmsg;
199  }
200  catch( ... )
201  {
203  MsgStream log ( msgSvc() , name() + ".sysFinalize()" );
204  log << MSG::FATAL
205  << " UNKNOWN Exception is caught " << endmsg;
206  }
208  return StatusCode::FAILURE ;
209 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
virtual StatusCode finalize()
Definition: Auditor.cpp:211
Define general base for Gaudi exception.
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:216
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Auditor.cpp:224
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
bool m_isInitialized
Auditor has been initialized flag.
Definition: Auditor.h:251
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual const std::string & tag() const
name tag for the exception, or exception type
bool m_isFinalized
Auditor has been finalized flag.
Definition: Auditor.h:252
StatusCode Auditor::sysInitialize ( )
virtual

Initialization method invoked by the framework.

This method is responsible for any bookkeeping of initialization required by the framework itself.

Implements IAuditor.

StatusCode Auditor::sysInitialize ( )
virtual

Initialization method invoked by the framework.

This method is responsible for any bookkeeping of initialization required by the framework itself.

RETURN !!!

catch Gaudi Exception

(1) perform the printout of message

(2) print the exception itself (NB! - GaudiException is a linked list of all "previous exceptions")

catch std::exception

(1) perform the printout of message

(2) print the exception itself (NB! - GaudiException is a linked list of all "previous exceptions")

(1) perform the printout

Implements IAuditor.

Definition at line 32 of file Auditor.cpp.

32  {
33  StatusCode sc;
34 
35  // Bypass the initialization if the auditor is disabled or
36  // has already been initialized.
37  if ( isEnabled( ) && ! m_isInitialized ) {
38 
39  // Setup the default service ... this should be upgraded so as to be configurable.
40  if( m_pSvcLocator == 0 )
41  return StatusCode::FAILURE;
42 
43  // Set up message service
44  m_MS = serviceLocator(); // get default message service
45  if( !m_MS.isValid() ) return StatusCode::FAILURE;
46 
47  // Set the Auditor's properties
48  sc = setProperties();
49  if( !sc.isSuccess() ) return StatusCode::FAILURE;
50 
51  // Check current outputLevel to eventually inform the MessagsSvc
52  if( m_outputLevel != MSG::NIL ) {
54  }
55 
56  {
57  try{
58  // Invoke the initialize() method of the derived class
59  sc = initialize();
60  if( !sc.isSuccess() ) return StatusCode::FAILURE;
61  m_isInitialized = true;
62 
63  return sc;
64  }
65  catch ( const GaudiException& Exception )
66  {
68  MsgStream log ( msgSvc() , name() + ".sysInitialize()" );
69  log << MSG::FATAL << " Exception with tag=" << Exception.tag() << " is catched " << endmsg;
71  MsgStream logEx ( msgSvc() , Exception.tag() );
72  logEx << MSG::ERROR << Exception << endmsg;
73  }
74  catch( const std::exception& Exception )
75  {
77  MsgStream log ( msgSvc() , name() + ".sysInitialize()" );
78  log << MSG::FATAL << " Standard std::exception is catched " << endmsg;
80  MsgStream logEx ( msgSvc() , name() + "*std::exception*" );
81  logEx << MSG::ERROR << Exception.what() << endmsg;
82  }
83  catch(...)
84  {
86  MsgStream log ( msgSvc() , name() + ".sysInitialize()" );
87  log << MSG::FATAL << " UNKNOWN Exception is catched " << endmsg;
88  }
89  }
90  }
92  return StatusCode::FAILURE;
93 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
void setOutputLevel(int level)
Set the output level for current auditor.
Definition: Auditor.cpp:228
Define general base for Gaudi exception.
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:216
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Auditor.cpp:224
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
StatusCode setProperties()
Set the auditor's properties.
Definition: Auditor.cpp:239
SmartIF< IMessageSvc > m_MS
Message service.
Definition: Auditor.h:246
bool m_isInitialized
Auditor has been initialized flag.
Definition: Auditor.h:251
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual const std::string & tag() const
name tag for the exception, or exception type
SmartIF< ISvcLocator > & serviceLocator() const
The standard service locator.
Definition: Auditor.cpp:234
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:51
virtual StatusCode initialize()
Definition: Auditor.cpp:95
virtual bool isEnabled() const
Tell if the auditor is enabled or not.
Definition: Auditor.cpp:220
int m_outputLevel
Auditor output level.
Definition: Auditor.h:249
SmartIF< ISvcLocator > m_pSvcLocator
Pointer to service locator service.
Definition: Auditor.h:247

Member Data Documentation

bool Auditor::m_isEnabled
private

Auditor is enabled flag.

Definition at line 250 of file Auditor.h.

bool Auditor::m_isFinalized
private

Auditor has been finalized flag.

Definition at line 252 of file Auditor.h.

bool Auditor::m_isInitialized
private

Auditor has been initialized flag.

Definition at line 251 of file Auditor.h.

SmartIF< IMessageSvc > Auditor::m_MS
mutableprivate

Message service.

Definition at line 246 of file Auditor.h.

std::string Auditor::m_name
private

Auditor's name for identification.

Definition at line 244 of file Auditor.h.

int Auditor::m_outputLevel
private

Auditor output level.

Definition at line 249 of file Auditor.h.

PropertyMgr * Auditor::m_PropertyMgr
private

For management of properties.

Definition at line 248 of file Auditor.h.

SmartIF< ISvcLocator > Auditor::m_pSvcLocator
mutableprivate

Pointer to service locator service.

Definition at line 247 of file Auditor.h.


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