#include <GaudiKernel/Auditor.h>
Inheritance diagram for Auditor:
Public Types | |
typedef std::string | CustomEventType |
Type used to allow users to specify a custom event to be audit. | |
typedef const CustomEventType & | CustomEventTypeRef |
Used in function calls for optimization purposes. | |
Initialize | |
ReInitialize | |
Execute | |
BeginRun | |
EndRun | |
Finalize | |
Start | |
Stop | |
ReStart | |
enum | StandardEventType { Initialize, ReInitialize, Execute, BeginRun, EndRun, Finalize, Start, Stop, ReStart } |
Defines the standard (= used by the framework) auditable event types. More... | |
SUCCESS = 1 | |
Normal successful completion. | |
NO_INTERFACE | |
Requested interface is not available. | |
VERSMISMATCH | |
Requested interface version is incompatible. | |
LAST_ERROR | |
Last error. | |
enum | Status { SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR } |
Return status. More... | |
Public Member Functions | |
Auditor (const std::string &name, ISvcLocator *svcloc) | |
Constructor. | |
virtual | ~Auditor () |
Destructor. | |
StatusCode | sysInitialize () |
Initialization method invoked by the framework. | |
StatusCode | sysFinalize () |
Finalization method invoked by the framework. | |
virtual void | before (StandardEventType, INamedInterface *) |
The following methods are meant to be implemented by the child class... | |
virtual void | before (StandardEventType, const std::string &) |
virtual void | before (CustomEventTypeRef, INamedInterface *) |
virtual void | before (CustomEventTypeRef, const std::string &) |
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 | 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. | |
virtual bool | isEnabled () const |
Tell if the auditor is enabled or not. | |
IMessageSvc * | msgSvc () const |
The standard message service. | |
int | outputLevel () const |
Retrieve the outputlevel of current auditor. | |
void | setOutputLevel (int level) |
Set the outputlevel for current auditor. | |
ISvcLocator * | serviceLocator () const |
The standard service locator. | |
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. | |
virtual StatusCode | setProperty (const Property &p) |
Set a value of a property of an auditor. | |
virtual StatusCode | setProperty (const std::string &s) |
Implementation of IProperty::setProperty. | |
virtual StatusCode | setProperty (const std::string &n, const std::string &v) |
Implementation of IProperty::setProperty. | |
virtual StatusCode | getProperty (Property *p) const |
Get the value of a property. | |
virtual const Property & | getProperty (const std::string &name) const |
Get the property by name. | |
virtual StatusCode | getProperty (const std::string &n, std::string &v) const |
Implementation of IProperty::getProperty. | |
const std::vector< Property * > & | getProperties () const |
Get all properties. | |
template<class TYPE> | |
StatusCode | setProperty (const std::string &name, const TYPE &value) |
set the property form the value | |
StatusCode | setProperties () |
Set the auditor's properties. | |
template<class T> | |
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const |
Declare the named property. | |
unsigned long | addRef () |
Methods for IInterface. | |
unsigned long | release () |
Release Interface instance. | |
StatusCode | queryInterface (const InterfaceID &riid, void **) |
Query interfaces of Interface. | |
virtual void | before (StandardEventType, INamedInterface *)=0 |
Audit the start of a standard "event". | |
virtual void | before (StandardEventType, const std::string &)=0 |
Audit the start of a standard "event" for callers that do not implement INamedInterface. | |
virtual void | before (CustomEventTypeRef, INamedInterface *)=0 |
Audit the start of a custom "event". | |
virtual void | before (CustomEventTypeRef, const std::string &)=0 |
Audit the start of a custom "event" for callers that do not implement INamedInterface. | |
virtual void | after (StandardEventType, INamedInterface *, const StatusCode &sc=StatusCode(StatusCode::SUCCESS, true))=0 |
Audit the end of a standard "event". | |
virtual void | after (StandardEventType, const std::string &, const StatusCode &sc=StatusCode(StatusCode::SUCCESS, true))=0 |
Audit the end of a standard "event" for callers that do not implement INamedInterface. | |
virtual void | after (CustomEventTypeRef, INamedInterface *, const StatusCode &sc=StatusCode(StatusCode::SUCCESS, true))=0 |
Audit the end of a custom "event". | |
virtual void | after (CustomEventTypeRef, const std::string &, const StatusCode &sc=StatusCode(StatusCode::SUCCESS, true))=0 |
Audit the end of a custom "event" for callers that do not implement INamedInterface. | |
Static Public Member Functions | |
static const InterfaceID & | interfaceID () |
Retrieve interface ID. | |
static const InterfaceID & | interfaceID () |
Retrieve interface ID. | |
Private Member Functions | |
Auditor (const Auditor &a) | |
Auditor & | operator= (const Auditor &rhs) |
Private Attributes | |
long | m_refCount |
Counter for references to Auditor. | |
std::string | m_name |
Auditor's name for identification. | |
IMessageSvc * | m_MS |
Message service. | |
ISvcLocator * | m_pSvcLocator |
Pointer to service locator service. | |
PropertyMgr * | m_PropertyMgr |
For management of properties. | |
int | m_outputLevel |
Auditor output level. | |
bool | m_isEnabled |
Auditor is enabled flag. | |
bool | m_isInitialized |
Auditor has been initialized flag. | |
bool | m_isFinalized |
Auditor has been finalized flag. |
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 initialise() and afterwards.
Definition at line 34 of file Auditor.h.
typedef std::string IAuditor::CustomEventType [inherited] |
Type used to allow users to specify a custom event to be audit.
Examples of custom events are callbacks (see patch #1725).
Definition at line 43 of file IAuditor.h.
typedef const CustomEventType& IAuditor::CustomEventTypeRef [inherited] |
enum IAuditor::StandardEventType [inherited] |
Defines the standard (= used by the framework) auditable event types.
Definition at line 28 of file IAuditor.h.
00028 { 00029 Initialize, 00030 ReInitialize, 00031 Execute, 00032 BeginRun, 00033 EndRun, 00034 Finalize, 00035 Start, 00036 Stop, 00037 ReStart 00038 };
enum IInterface::Status [inherited] |
Return status.
SUCCESS | Normal successful completion. |
NO_INTERFACE | Requested interface is not available. |
VERSMISMATCH | Requested interface version is incompatible. |
LAST_ERROR | Last error. |
Reimplemented in IConversionSvc, IConverter, and IDataProviderSvc.
Definition at line 113 of file IInterface.h.
00113 { 00115 SUCCESS = 1, 00117 NO_INTERFACE, 00119 VERSMISMATCH, 00121 LAST_ERROR 00122 };
Auditor::Auditor | ( | const std::string & | name, | |
ISvcLocator * | svcloc | |||
) |
Constructor.
name | The algorithm object's name | |
svcloc | A pointer to a service location service |
virtual Auditor::~Auditor | ( | ) | [virtual] |
Destructor.
Auditor::Auditor | ( | const Auditor & | a | ) | [private] |
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::sysFinalize | ( | ) | [virtual] |
Finalization method invoked by the framework.
This method is responsible for any bookkeeping of initialization required by the framework itself.
Implements IAuditor.
virtual void Auditor::before | ( | StandardEventType | , | |
INamedInterface * | ||||
) | [virtual] |
The following methods are meant to be implemented by the child class...
virtual void Auditor::before | ( | StandardEventType | , | |
const std::string & | ||||
) | [virtual] |
virtual void Auditor::before | ( | CustomEventTypeRef | , | |
INamedInterface * | ||||
) | [virtual] |
virtual void Auditor::before | ( | CustomEventTypeRef | , | |
const std::string & | ||||
) | [virtual] |
virtual void Auditor::after | ( | StandardEventType | , | |
INamedInterface * | , | |||
const StatusCode & | ||||
) | [virtual] |
virtual void Auditor::after | ( | StandardEventType | , | |
const std::string & | , | |||
const StatusCode & | ||||
) | [virtual] |
virtual void Auditor::after | ( | CustomEventTypeRef | , | |
INamedInterface * | , | |||
const StatusCode & | ||||
) | [virtual] |
virtual void Auditor::after | ( | CustomEventTypeRef | , | |
const std::string & | , | |||
const StatusCode & | ||||
) | [virtual] |
virtual void Auditor::beforeInitialize | ( | INamedInterface * | ) | [virtual] |
virtual void Auditor::afterInitialize | ( | INamedInterface * | ) | [virtual] |
virtual void Auditor::beforeReinitialize | ( | INamedInterface * | ) | [virtual] |
virtual void Auditor::afterReinitialize | ( | INamedInterface * | ) | [virtual] |
virtual void Auditor::beforeExecute | ( | INamedInterface * | ) | [virtual] |
virtual void Auditor::afterExecute | ( | INamedInterface * | , | |
const StatusCode & | ||||
) | [virtual] |
virtual void Auditor::beforeFinalize | ( | INamedInterface * | ) | [virtual] |
virtual void Auditor::afterFinalize | ( | INamedInterface * | ) | [virtual] |
virtual void Auditor::beforeBeginRun | ( | INamedInterface * | ) | [virtual] |
virtual void Auditor::afterBeginRun | ( | INamedInterface * | ) | [virtual] |
virtual void Auditor::beforeEndRun | ( | INamedInterface * | ) | [virtual] |
virtual void Auditor::afterEndRun | ( | INamedInterface * | ) | [virtual] |
virtual StatusCode Auditor::initialize | ( | ) | [virtual] |
virtual StatusCode Auditor::finalize | ( | ) | [virtual] |
virtual const std::string& Auditor::name | ( | ) | const [virtual] |
virtual bool Auditor::isEnabled | ( | ) | const [virtual] |
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.
int Auditor::outputLevel | ( | ) | const [inline] |
Retrieve the outputlevel of current auditor.
Definition at line 101 of file Auditor.h.
00101 { return m_outputLevel; }
void Auditor::setOutputLevel | ( | int | level | ) |
Set the outputlevel for current auditor.
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.
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 115 of file Auditor.h.
00115 { 00116 IService* theSvc; 00117 StatusCode sc = serviceLocator()->getService( name, theSvc, createIf ); 00118 if ( sc.isSuccess() ) { 00119 return theSvc->queryInterface(T::interfaceID(), (void**)&svc); 00120 } 00121 svc = 0; 00122 return sc; 00123 }
virtual StatusCode Auditor::setProperty | ( | const Property & | p | ) | [virtual] |
virtual StatusCode Auditor::setProperty | ( | const std::string & | s | ) | [virtual] |
virtual StatusCode Auditor::setProperty | ( | const std::string & | n, | |
const std::string & | v | |||
) | [virtual] |
virtual StatusCode Auditor::getProperty | ( | Property * | p | ) | const [virtual] |
virtual const Property& Auditor::getProperty | ( | const std::string & | name | ) | const [virtual] |
virtual StatusCode Auditor::getProperty | ( | const std::string & | n, | |
std::string & | v | |||
) | const [virtual] |
const std::vector<Property*>& Auditor::getProperties | ( | ) | const [virtual] |
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 convinient 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..
name | name of the property | |
value | value of the property |
Definition at line 189 of file Auditor.h.
00191 { return Gaudi::Utils::setProperty ( m_PropertyMgr , name , value ) ; }
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.
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 fro property #1" ) ; // declare the property and attach the handler to it declareProperty( "Property2" , m_property2 , "Doc for property #2" ) -> declareUpdateHandler( &MyAlg::handler_2 ) ; }
name | the property name | |
proeprty | the property itself, | |
doc | the documentation string |
Definition at line 229 of file Auditor.h.
00230 { 00231 return m_PropertyMgr->declareProperty(name, property, doc); 00232 }
unsigned long Auditor::addRef | ( | ) | [virtual] |
unsigned long Auditor::release | ( | ) | [virtual] |
StatusCode Auditor::queryInterface | ( | const InterfaceID & | riid, | |
void ** | ||||
) | [virtual] |
Query interfaces of Interface.
riid | ID of Interface to be retrieved | |
ppvInterface | Pointer to Location for interface pointer |
Implements IInterface.
static const InterfaceID& IAuditor::interfaceID | ( | ) | [inline, static, inherited] |
Retrieve interface ID.
Reimplemented from INamedInterface.
Reimplemented in IAuditorSvc.
Definition at line 25 of file IAuditor.h.
00025 { return IID_IAuditor; }
virtual void IAuditor::before | ( | StandardEventType | , | |
INamedInterface * | ||||
) | [pure virtual, inherited] |
Audit the start of a standard "event".
virtual void IAuditor::before | ( | StandardEventType | , | |
const std::string & | ||||
) | [pure virtual, inherited] |
Audit the start of a standard "event" for callers that do not implement INamedInterface.
virtual void IAuditor::before | ( | CustomEventTypeRef | , | |
INamedInterface * | ||||
) | [pure virtual, inherited] |
Audit the start of a custom "event".
virtual void IAuditor::before | ( | CustomEventTypeRef | , | |
const std::string & | ||||
) | [pure virtual, inherited] |
Audit the start of a custom "event" for callers that do not implement INamedInterface.
virtual void IAuditor::after | ( | StandardEventType | , | |
INamedInterface * | , | |||
const StatusCode & | sc = StatusCode(StatusCode::SUCCESS, true) | |||
) | [pure virtual, inherited] |
Audit the end of a standard "event".
virtual void IAuditor::after | ( | StandardEventType | , | |
const std::string & | , | |||
const StatusCode & | sc = StatusCode(StatusCode::SUCCESS, true) | |||
) | [pure virtual, inherited] |
Audit the end of a standard "event" for callers that do not implement INamedInterface.
virtual void IAuditor::after | ( | CustomEventTypeRef | , | |
INamedInterface * | , | |||
const StatusCode & | sc = StatusCode(StatusCode::SUCCESS, true) | |||
) | [pure virtual, inherited] |
Audit the end of a custom "event".
virtual void IAuditor::after | ( | CustomEventTypeRef | , | |
const std::string & | , | |||
const StatusCode & | sc = StatusCode(StatusCode::SUCCESS, true) | |||
) | [pure virtual, inherited] |
Audit the end of a custom "event" for callers that do not implement INamedInterface.
static const InterfaceID& IProperty::interfaceID | ( | ) | [inline, static, inherited] |
Retrieve interface ID.
Reimplemented from IInterface.
Definition at line 28 of file IProperty.h.
00028 { return IID_IProperty; }
long Auditor::m_refCount [private] |
std::string Auditor::m_name [private] |
IMessageSvc* Auditor::m_MS [private] |
ISvcLocator* Auditor::m_pSvcLocator [private] |
PropertyMgr* Auditor::m_PropertyMgr [private] |
int Auditor::m_outputLevel [private] |
bool Auditor::m_isEnabled [private] |
bool Auditor::m_isInitialized [private] |
bool Auditor::m_isFinalized [private] |