Gaudi Framework, version v24r2

Home   Generated: Wed Dec 4 2013
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
AuditorSvc Class Reference

#include <AuditorSvc.h>

Inheritance diagram for AuditorSvc:
Inheritance graph
[legend]
Collaboration diagram for AuditorSvc:
Collaboration graph
[legend]

Public Types

typedef std::list< IAuditor * > ListAudits
 
typedef std::vector< std::stringVectorName
 
- Public Types inherited from extends1< Service, IAuditorSvc >
typedef extends1 base_class
 Typedef to this class.
 
typedef extend_interfaces1
< IAuditorSvc
extend_interfaces_base
 Typedef to the base of this class.
 
typedef
extend_interfaces_base::ext_iids 
interfaces
 MPL set of all the implemented interfaces.
 
- Public Types inherited from extend_interfaces1< IAuditorSvc >
typedef
IAuditorSvc::iid::iids::type 
ext_iids
 MPL set of interfaces extended by this one.
 

Public Member Functions

virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
virtual void before (StandardEventType, INamedInterface *)
 The following methods are meant to be implemented by the child class...
 
virtual void before (StandardEventType, const std::string &)
 Audit the start of a standard "event" for callers that do not implement INamedInterface.
 
virtual void before (CustomEventTypeRef, INamedInterface *)
 Audit the start of a custom "event".
 
virtual void before (CustomEventTypeRef, const std::string &)
 Audit the start of a custom "event" for callers that do not implement INamedInterface.
 
virtual void after (StandardEventType, INamedInterface *, const StatusCode &)
 Audit the end of a standard "event".
 
virtual void after (StandardEventType, const std::string &, const StatusCode &)
 Audit the end of a standard "event" for callers that do not implement INamedInterface.
 
virtual void after (CustomEventTypeRef, INamedInterface *, const StatusCode &)
 Audit the end of a custom "event".
 
virtual void after (CustomEventTypeRef, const std::string &, const StatusCode &)
 Audit the end of a custom "event" for callers that do not implement INamedInterface.
 
virtual void beforeInitialize (INamedInterface *ini)
 
virtual void afterInitialize (INamedInterface *ini)
 
virtual void beforeReinitialize (INamedInterface *ini)
 
virtual void afterReinitialize (INamedInterface *ini)
 
virtual void beforeExecute (INamedInterface *ini)
 
virtual void afterExecute (INamedInterface *ini, const StatusCode &)
 
virtual void beforeBeginRun (INamedInterface *ini)
 
virtual void afterBeginRun (INamedInterface *ini)
 
virtual void beforeEndRun (INamedInterface *ini)
 
virtual void afterEndRun (INamedInterface *ini)
 
virtual void beforeFinalize (INamedInterface *ini)
 
virtual void afterFinalize (INamedInterface *ini)
 
virtual bool isEnabled () const
 Tell if the auditor is enabled or not.
 
virtual StatusCode sysInitialize ()
 Initialize Service.
 
virtual StatusCode sysFinalize ()
 Finalize Service.
 
virtual IAuditorgetAuditor (const std::string &name)
 management functionality: retrieve an Auditor
 
 AuditorSvc (const std::string &name, ISvcLocator *svc)
 
virtual ~AuditorSvc ()
 
- Public Member Functions inherited from extends1< Service, IAuditorSvc >
 extends1 (A1 a1, A2 a2, A3 a3)
 Templated constructor with 3 arguments.
 
 extends1 (A1 a1, A2 a2)
 Templated constructor with 2 arguments.
 
 extends1 (A1 a1)
 Templated constructor with 1 argument.
 
 extends1 ()
 Default constructor.
 
virtual void * i_cast (const InterfaceID &tid) const
 Implementation of IInterface::i_cast.
 
virtual StatusCode queryInterface (const InterfaceID &ti, void **pp)
 Implementation of IInterface::queryInterface.
 
virtual std::vector< std::stringgetInterfaceNames () const
 Implementation of IInterface::getInterfaceNames.
 
virtual ~extends1 ()
 Virtual destructor.
 
- Public Member Functions inherited from Service
virtual unsigned long release ()
 Release Interface instance.
 
virtual const std::stringname () const
 Retrieve name of the service.
 
virtual StatusCode configure ()
 
virtual StatusCode start ()
 
virtual StatusCode stop ()
 
virtual StatusCode terminate ()
 
virtual Gaudi::StateMachine::State FSMState () const
 
virtual Gaudi::StateMachine::State targetFSMState () const
 
virtual StatusCode reinitialize ()
 
virtual StatusCode restart ()
 
virtual StatusCode sysStart ()
 Initialize Service.
 
virtual StatusCode sysStop ()
 Initialize Service.
 
virtual StatusCode sysReinitialize ()
 Re-initialize the Service.
 
virtual StatusCode sysRestart ()
 Re-initialize the Service.
 
virtual StatusCode setProperty (const Property &p)
 
virtual StatusCode setProperty (const std::string &s)
 
virtual StatusCode setProperty (const std::string &n, const std::string &v)
 
virtual StatusCode getProperty (Property *p) const
 
virtual const PropertygetProperty (const std::string &name) const
 
virtual StatusCode getProperty (const std::string &n, std::string &v) const
 
virtual const std::vector
< Property * > & 
getProperties () const
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value
 
 Service (const std::string &name, ISvcLocator *svcloc)
 Standard Constructor.
 
SmartIF< ISvcLocator > & serviceLocator () const
 Retrieve pointer to service locator.
 
StatusCode setProperties ()
 Method for setting declared properties to the values specified for the job.
 
template<class T >
StatusCode service (const std::string &name, const T *&psvc, bool createIf=true) const
 Access a service by name, creating it if it doesn't already exist.
 
template<class T >
StatusCode service (const std::string &name, T *&psvc, bool createIf=true) const
 
template<class T >
StatusCode service (const std::string &svcType, const std::string &svcName, T *&psvc) const
 Access a service by name and type, creating it if it doesn't already exist.
 
template<class T >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property.
 
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
 Declare remote named properties.
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked.
 
- Public Member Functions inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
 CommonMessaging (const A1 &a1, const A2 &a2, const A3 &a3)
 Templated constructor with 3 arguments.
 
 CommonMessaging (const A1 &a1, const A2 &a2)
 Templated constructor with 2 arguments.
 
 CommonMessaging (const A1 &a1)
 Templated constructor with 1 argument.
 
 CommonMessaging ()
 Default constructor.
 
virtual ~CommonMessaging ()
 Virtual destructor.
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service.
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream.
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts.
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS)
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL)
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR)
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR)
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING)
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO)
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG)
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE)
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO)
 
MSG::Level msgLevel () const
 get the output level from the embedded MsgStream
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream
 
- Public Member Functions inherited from extend_interfaces1< IAuditorSvc >
virtual ~extend_interfaces1 ()
 Virtual destructor.
 
- Public Member Functions inherited from IAuditorSvc
 DeclareInterfaceIDMultiBase (IAuditorSvc, 3, 0)
 InterfaceID.
 
- Public Member Functions inherited from extend_interfaces2< IService, IAuditor >
virtual ~extend_interfaces2 ()
 Virtual destructor.
 
- Public Member Functions inherited from IService
 DeclareInterfaceID (IService, 3, 0)
 InterfaceID.
 
virtual StatusCode sysStart ()=0
 Start Service.
 
virtual StatusCode sysStop ()=0
 Stop Service.
 
virtual StatusCode sysReinitialize ()=0
 Re-initialize the Service.
 
virtual StatusCode sysRestart ()=0
 Re-start the Service.
 
virtual StatusCode configure ()=0
 Configuration (from OFFLINE to CONFIGURED).
 
virtual StatusCode start ()=0
 Start (from INITIALIZED to RUNNING).
 
virtual StatusCode stop ()=0
 Stop (from RUNNING to INITIALIZED).
 
virtual StatusCode terminate ()=0
 Initialization (from CONFIGURED to OFFLINE).
 
virtual StatusCode reinitialize ()=0
 Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
 
virtual StatusCode restart ()=0
 Initialization (from RUNNING to RUNNING, via INITIALIZED).
 
virtual Gaudi::StateMachine::State FSMState () const =0
 Get the current state.
 
virtual Gaudi::StateMachine::State targetFSMState () const =0
 When we are in the middle of a transition, get the state where the transition is leading us.
 
virtual ~IService ()
 virtual destructor
 
- Public Member Functions inherited from INamedInterface
 DeclareInterfaceID (INamedInterface, 1, 0)
 InterfaceID.
 
virtual const std::stringname () const =0
 Retrieve the name of the instance.
 
virtual ~INamedInterface ()
 Virtual destructor (always needed for abstract classes).
 
- Public Member Functions inherited from IInterface
virtual unsigned long addRef ()=0
 Increment the reference count of Interface instance.
 
virtual unsigned long release ()=0
 Release Interface instance.
 
virtual unsigned long refCount () const =0
 Current reference count.
 
virtual ~IInterface ()
 Virtual destructor.
 
- Public Member Functions inherited from IAuditor
 DeclareInterfaceID (IAuditor, 3, 0)
 InterfaceID.
 

Private Member Functions

IAuditornewAuditor_ (MsgStream &, const std::string &)
 
IAuditorfindAuditor_ (const std::string &)
 
StatusCode syncAuditors_ ()
 

Private Attributes

VectorName m_audNameList
 
ListAudits m_pAudList
 
bool m_isEnabled
 

Additional Inherited Members

- Static Public Member Functions inherited from IInterface
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface.
 
- Protected Member Functions inherited from Service
virtual ~Service ()
 Standard Destructor.
 
int outputLevel () const
 get the Service's output level
 
- Protected Member Functions inherited from IService
virtual void setServiceManager (ISvcManager *)=0
 
- Protected Attributes inherited from Service
IntegerProperty m_outputLevel
 Service output level.
 
Gaudi::StateMachine::State m_state
 Service state.
 
Gaudi::StateMachine::State m_targetState
 Service state.
 

Detailed Description

Definition at line 19 of file AuditorSvc.h.

Member Typedef Documentation

Definition at line 24 of file AuditorSvc.h.

Definition at line 25 of file AuditorSvc.h.

Constructor & Destructor Documentation

AuditorSvc::AuditorSvc ( const std::string name,
ISvcLocator svc 
)

Definition at line 99 of file AuditorSvc.cpp.

: base_class(name, svc) {
declareProperty("Enable", m_isEnabled = true);
}
AuditorSvc::~AuditorSvc ( )
virtual

Definition at line 107 of file AuditorSvc.cpp.

{
}

Member Function Documentation

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

Audit the end of a standard "event".

Implements IAuditor.

Definition at line 177 of file AuditorSvc.cpp.

{
if (!isEnabled()) return;
for (ListAudits::iterator it = m_pAudList.begin() ; it != m_pAudList.end(); it++) {
if((*it)->isEnabled()) {
(*it)->after(evt,obj,sc);
}
}
}
void AuditorSvc::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.

Definition at line 186 of file AuditorSvc.cpp.

{
if (!isEnabled()) return;
for (ListAudits::iterator it = m_pAudList.begin() ; it != m_pAudList.end(); it++) {
if((*it)->isEnabled()) {
(*it)->after(evt,name,sc);
}
}
}
void AuditorSvc::after ( CustomEventTypeRef  ,
INamedInterface ,
const StatusCode sc 
)
virtual

Audit the end of a custom "event".

Implements IAuditor.

Definition at line 195 of file AuditorSvc.cpp.

{
if (!isEnabled()) return;
for (ListAudits::iterator it = m_pAudList.begin() ; it != m_pAudList.end(); it++) {
if((*it)->isEnabled()) {
(*it)->after(evt,obj,sc);
}
}
}
void AuditorSvc::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.

Definition at line 204 of file AuditorSvc.cpp.

{
if (!isEnabled()) return;
for (ListAudits::iterator it = m_pAudList.begin() ; it != m_pAudList.end(); it++) {
if((*it)->isEnabled()) {
(*it)->after(evt,name,sc);
}
}
}
virtual void AuditorSvc::afterBeginRun ( INamedInterface )
virtual
Deprecated:
use after

Implements IAuditor.

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

Implements IAuditor.

void AuditorSvc::afterExecute ( INamedInterface ,
const StatusCode  
)
virtual
Deprecated:
use after

Implements IAuditor.

Definition at line 227 of file AuditorSvc.cpp.

{
throw GaudiException("The method afterExecute is obsolete do not call it.",
"AuditorSvc::afterExecute" , StatusCode::FAILURE);
}
virtual void AuditorSvc::afterFinalize ( INamedInterface )
virtual
Deprecated:
use after

Implements IAuditor.

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

Implements IAuditor.

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

Implements IAuditor.

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

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

Implements IAuditor.

Definition at line 140 of file AuditorSvc.cpp.

{
if (!isEnabled()) return;
for (ListAudits::iterator it = m_pAudList.begin() ; it != m_pAudList.end(); it++) {
if((*it)->isEnabled()) {
(*it)->before(evt,obj);
}
}
}
void AuditorSvc::before ( StandardEventType  ,
const std::string  
)
virtual

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

Implements IAuditor.

Definition at line 149 of file AuditorSvc.cpp.

{
if (!isEnabled()) return;
for (ListAudits::iterator it = m_pAudList.begin() ; it != m_pAudList.end(); it++) {
if((*it)->isEnabled()) {
(*it)->before(evt,name);
}
}
}
void AuditorSvc::before ( CustomEventTypeRef  ,
INamedInterface  
)
virtual

Audit the start of a custom "event".

Implements IAuditor.

Definition at line 158 of file AuditorSvc.cpp.

{
if (!isEnabled()) return;
for (ListAudits::iterator it = m_pAudList.begin() ; it != m_pAudList.end(); it++) {
if((*it)->isEnabled()) {
(*it)->before(evt,obj);
}
}
}
void AuditorSvc::before ( CustomEventTypeRef  ,
const std::string  
)
virtual

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

Implements IAuditor.

Definition at line 167 of file AuditorSvc.cpp.

{
if (!isEnabled()) return;
for (ListAudits::iterator it = m_pAudList.begin() ; it != m_pAudList.end(); it++) {
if((*it)->isEnabled()) {
(*it)->before(evt,name);
}
}
}
virtual void AuditorSvc::beforeBeginRun ( INamedInterface )
virtual
Deprecated:
use before

Implements IAuditor.

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

Implements IAuditor.

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

Implements IAuditor.

virtual void AuditorSvc::beforeFinalize ( INamedInterface )
virtual
Deprecated:
use before

Implements IAuditor.

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

Implements IAuditor.

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

Implements IAuditor.

StatusCode AuditorSvc::finalize ( )
virtual

Reimplemented from Service.

Definition at line 125 of file AuditorSvc.cpp.

{
for (ListAudits::iterator it = m_pAudList.begin() ; it != m_pAudList.end(); it++) {
if((*it)->isEnabled()) {
(*it)->sysFinalize().ignore();
}
(*it)->release();
}
// Finalize this specific service
}
IAuditor * AuditorSvc::findAuditor_ ( const std::string name)
private

Definition at line 49 of file AuditorSvc.cpp.

{
// find an auditor by name, return 0 on error
IAuditor* aud = 0;
const std::string item_name = Gaudi::Utils::TypeNameString(name).name();
for ( ListAudits::iterator it = m_pAudList.begin() ; it != m_pAudList.end(); ++it ) {
if ( (*it)->name() == item_name ) {
(*it)->addRef();
aud = *it;
break;
}
}
return aud;
}
IAuditor * AuditorSvc::getAuditor ( const std::string name)
virtual

management functionality: retrieve an Auditor

Implements IAuditorSvc.

Definition at line 254 of file AuditorSvc.cpp.

{
// by interactively setting properties, auditors might be out of sync
if ( !syncAuditors_().isSuccess() ) {
// as we didn't manage to sync auditors, the safest bet is to assume the
// worse...
// So don't let clients play with an AuditorSvc in an inconsistent state
return 0;
}
// search available auditors, returns 0 on error
return findAuditor_( name );
}
StatusCode AuditorSvc::initialize ( )
virtual

Reimplemented from Service.

Definition at line 113 of file AuditorSvc.cpp.

{
if ( sc.isFailure() )
return sc;
// create auditor objects for all named auditors
sc = syncAuditors_();
return sc;
}
bool AuditorSvc::isEnabled ( ) const
virtual

Tell if the auditor is enabled or not.

Implements IAuditor.

Definition at line 242 of file AuditorSvc.cpp.

{
return m_isEnabled;
}
IAuditor * AuditorSvc::newAuditor_ ( MsgStream log,
const std::string name 
)
private

Definition at line 25 of file AuditorSvc.cpp.

{
// locate the auditor factory, instantiate a new auditor, initialize it
IAuditor* aud = 0;
Gaudi::Utils::TypeNameString item(name) ;
aud = PluginService::Create<IAuditor*>( item.type(), item.name(), serviceLocator().get() );
if ( aud ) {
aud->addRef();
sc = aud->sysInitialize();
if ( sc.isFailure() ) {
log << MSG::WARNING << "Failed to initialize Auditor " << name << endmsg;
aud->release();
aud = 0;
}
}
}
else {
log << MSG::WARNING << "Unable to retrieve factory for Auditor " << name << endmsg;
}
return aud;
}
StatusCode AuditorSvc::syncAuditors_ ( )
private

Definition at line 64 of file AuditorSvc.cpp.

{
// if ( sc.isFailure() ) {
// log << MSG::ERROR << "Unable to locate ObjectManager Service" << endmsg;
// return sc;
// }
// create all declared Auditors that do not yet exist
for ( VectorName::iterator it = m_audNameList.begin(); it != m_audNameList.end(); it++ ) {
// this is clumsy, but the PropertyMgr won't tell us when my property changes right
// under my nose, so I'll have to figure this out the hard way
if ( !findAuditor_( *it ) ) { // if auditor does not yet exist
IAuditor* aud = newAuditor_( log, *it );
if ( aud != 0 ) {
}
else {
log << MSG::ERROR << "Error constructing Auditor " << *it << endmsg;
}
}
}
return sc;
}
StatusCode AuditorSvc::sysFinalize ( )
virtual

Finalize Service.

Reimplemented from Service.

Definition at line 249 of file AuditorSvc.cpp.

{
}
StatusCode AuditorSvc::sysInitialize ( )
virtual

Initialize Service.

Reimplemented from Service.

Definition at line 246 of file AuditorSvc.cpp.

{
}

Member Data Documentation

VectorName AuditorSvc::m_audNameList
private

Definition at line 104 of file AuditorSvc.h.

bool AuditorSvc::m_isEnabled
private

Definition at line 110 of file AuditorSvc.h.

ListAudits AuditorSvc::m_pAudList
private

Definition at line 107 of file AuditorSvc.h.


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

Generated at Wed Dec 4 2013 14:33:14 for Gaudi Framework, version v24r2 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004