All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AlgTool Class Reference

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

#include <GaudiKernel/AlgTool.h>

Inheritance diagram for AlgTool:
Collaboration diagram for AlgTool:

Classes

class  declareInterface
 

Public Types

typedef
Gaudi::PluginService::Factory
< IAlgTool *, const
std::string &, const
std::string &, const
IInterface * > 
Factory
 
typedef
Gaudi::PluginService::Factory
< IAlgTool *, const
std::string &, const
std::string &, const
IInterface * > 
Factory
 
- Public Types inherited from implements3< IAlgTool, IProperty, IStateful >
typedef implements3 base_class
 Typedef to this class.
 
typedef implements3 base_class
 Typedef to this class.
 
typedef extend_interfaces3
< IAlgTool, IProperty,
IStateful
extend_interfaces_base
 Typedef to the base of this class.
 
typedef extend_interfaces3
< IAlgTool, IProperty,
IStateful
extend_interfaces_base
 Typedef to the base of this class.
 
typedef
extend_interfaces_base::ext_iids 
interfaces
 MPL set of all the implemented interfaces.
 
typedef
extend_interfaces_base::ext_iids 
interfaces
 MPL set of all the implemented interfaces.
 
- Public Types inherited from extend_interfaces3< I1, I2, I3 >
typedef mpl::fold< typename
I1::iid::iids::type, typename
mpl::fold< typename
I2::iid::iids::type, typename
I3::iid::iids::type,
mpl::insert< mpl::_1, mpl::_2 >
>::type, mpl::insert< mpl::_1,
mpl::_2 > >::type 
ext_iids
 MPL set of interfaces extended by this one.
 
typedef mpl::fold< typename
I1::iid::iids::type, typename
mpl::fold< typename
I2::iid::iids::type, typename
I3::iid::iids::type,
mpl::insert< mpl::_1, mpl::_2 >
>::type, mpl::insert< mpl::_1,
mpl::_2 > >::type 
ext_iids
 MPL set of interfaces extended by this one.
 

Public Member Functions

virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvUnknown)
 Query for a given interface.
 
virtual const std::string & name () const
 Retrieve full identifying name of the concrete tool object.
 
virtual const std::string & type () const
 Retrieve type (concrete class) of the sub-algtool.
 
virtual const IInterfaceparent () const
 Retrieve parent of the sub-algtool.
 
virtual StatusCode configure ()
 
virtual StatusCode initialize ()
 
virtual StatusCode start ()
 
virtual StatusCode stop ()
 
virtual StatusCode finalize ()
 
virtual StatusCode terminate ()
 
virtual StatusCode reinitialize ()
 
virtual StatusCode restart ()
 
virtual Gaudi::StateMachine::State FSMState () const
 
virtual Gaudi::StateMachine::State targetFSMState () const
 
virtual StatusCode sysInitialize ()
 Initialize AlgTool.
 
virtual StatusCode sysStart ()
 Start AlgTool.
 
virtual StatusCode sysStop ()
 Stop AlgTool.
 
virtual StatusCode sysFinalize ()
 Finalize AlgTool.
 
virtual StatusCode sysReinitialize ()
 Initialize AlgTool.
 
virtual StatusCode sysRestart ()
 Start AlgTool.
 
virtual StatusCode setProperty (const Property &p)
 Default implementations for IProperty interface.
 
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
 
PropertyMgrgetPropertyMgr ()
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value
 
 AlgTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Constructor.
 
ISvcLocatorserviceLocator () const
 Retrieve pointer to service locator.
 
ISvcLocatorsvcLoc () const
 shortcut for the method service locator
 
IMessageSvcmsgSvc () const
 Retrieve pointer to message service.
 
IToolSvctoolSvc () const
 The standard ToolSvc service, Return a pointer to the service if present.
 
StatusCode setProperties ()
 Method for setting declared properties to the values specified in the jobOptions via the job option service.
 
template<class T >
StatusCode service (const std::string &name, T *&svc, 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 &type, const std::string &name, T *&svc) const
 Access a service by name, type creating it if it doesn't already exist.
 
SmartIF< IServiceservice (const std::string &name, const bool createIf=true, const bool quiet=false) const
 Return a pointer to the service identified by name (or "type/name")
 
void declInterface (const InterfaceID &, void *)
 declare interface
 
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.
 
IAuditorSvcauditorSvc () const
 Access the auditor service.
 
IMonitorSvcmonitorSvc () const
 Access the monitor service.
 
template<class T >
void declareInfo (const std::string &name, const T &var, const std::string &desc) const
 Declare monitoring information.
 
void declareInfo (const std::string &name, const std::string &format, const void *var, int size, const std::string &desc) const
 Declare monitoring information (special case)
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvUnknown)
 Query for a given interface.
 
virtual const std::string & name () const
 Retrieve full identifying name of the concrete tool object.
 
virtual const std::string & type () const
 Retrieve type (concrete class) of the sub-algtool.
 
virtual const IInterfaceparent () const
 Retrieve parent of the sub-algtool.
 
virtual StatusCode configure ()
 
virtual StatusCode initialize ()
 
virtual StatusCode start ()
 
virtual StatusCode stop ()
 
virtual StatusCode finalize ()
 
virtual StatusCode terminate ()
 
virtual StatusCode reinitialize ()
 
virtual StatusCode restart ()
 
virtual Gaudi::StateMachine::State FSMState () const
 
virtual Gaudi::StateMachine::State targetFSMState () const
 
virtual StatusCode sysInitialize ()
 Initialize AlgTool.
 
virtual StatusCode sysStart ()
 Start AlgTool.
 
virtual StatusCode sysStop ()
 Stop AlgTool.
 
virtual StatusCode sysFinalize ()
 Finalize AlgTool.
 
virtual StatusCode sysReinitialize ()
 Initialize AlgTool.
 
virtual StatusCode sysRestart ()
 Start AlgTool.
 
virtual StatusCode setProperty (const Property &p)
 Default implementations for IProperty interface.
 
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
 
PropertyMgrgetPropertyMgr ()
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value
 
 AlgTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Constructor.
 
ISvcLocatorserviceLocator () const
 Retrieve pointer to service locator.
 
ISvcLocatorsvcLoc () const
 shortcut for the method service locator
 
IMessageSvcmsgSvc () const
 Retrieve pointer to message service.
 
IToolSvctoolSvc () const
 The standard ToolSvc service, Return a pointer to the service if present.
 
StatusCode setProperties ()
 Method for setting declared properties to the values specified in the jobOptions via the job option service.
 
template<class T >
StatusCode service (const std::string &name, T *&svc, 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 &type, const std::string &name, T *&svc) const
 Access a service by name, type creating it if it doesn't already exist.
 
SmartIF< IServiceservice (const std::string &name, const bool createIf=true, const bool quiet=false) const
 Return a pointer to the service identified by name (or "type/name")
 
void declInterface (const InterfaceID &, void *)
 declare interface
 
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.
 
IAuditorSvcauditorSvc () const
 Access the auditor service.
 
IMonitorSvcmonitorSvc () const
 Access the monitor service.
 
template<class T >
void declareInfo (const std::string &name, const T &var, const std::string &desc) const
 Declare monitoring information.
 
void declareInfo (const std::string &name, const std::string &format, const void *var, int size, const std::string &desc) const
 Declare monitoring information (special case)
 

Protected Member Functions

int outputLevel () const
 get tool's output level
 
IntegerPropertyoutputLevelProperty ()
 Accessor for the Message level property.
 
void initOutputLevel (Property &prop)
 callback for output level property
 
virtual ~AlgTool ()
 
int outputLevel () const
 get tool's output level
 
IntegerPropertyoutputLevelProperty ()
 Accessor for the Message level property.
 
void initOutputLevel (Property &prop)
 callback for output level property
 
virtual ~AlgTool ()
 

Private Types

typedef std::list< std::pair
< InterfaceID, void * > > 
InterfaceList
 
typedef std::list< std::pair
< InterfaceID, void * > > 
InterfaceList
 

Private Member Functions

StatusCode service_i (const std::string &algName, bool createIf, const InterfaceID &iid, void **ppSvc) const
 implementation of service method
 
StatusCode service_i (const std::string &svcType, const std::string &svcName, const InterfaceID &iid, void **ppS) const
 
StatusCode service_i (const std::string &algName, bool createIf, const InterfaceID &iid, void **ppSvc) const
 implementation of service method
 
StatusCode service_i (const std::string &svcType, const std::string &svcName, const InterfaceID &iid, void **ppS) const
 

Private Attributes

IntegerProperty m_outputLevel
 AlgTool output level.
 
std::string m_type
 AlgTool type (concrete class name)
 
const std::string m_name
 AlgTool full name.
 
const IInterfacem_parent
 AlgTool parent.
 
ISvcLocatorm_svcLocator
 Pointer to Service Locator service.
 
IMessageSvcm_messageSvc
 Message service.
 
IToolSvcm_ptoolSvc
 Tool service.
 
IMonitorSvcm_pMonitorSvc
 Online Monitoring Service.
 
std::string m_monitorSvcName
 Name to use for Monitor Service.
 
PropertyMgrm_propertyMgr
 Property Manager.
 
InterfaceList m_interfaceList
 Interface list.
 
std::string m_threadID
 Thread Id for Alg Tool.
 
IAuditorSvcm_pAuditorSvc
 Auditor Service.
 
BooleanProperty m_auditInit
 
bool m_auditorInitialize
 flag for auditors in "initialize()"
 
bool m_auditorStart
 flag for auditors in "start()"
 
bool m_auditorStop
 flag for auditors in "stop()"
 
bool m_auditorFinalize
 flag for auditors in "finalize()"
 
bool m_auditorReinitialize
 flag for auditors in "reinitialize()"
 
bool m_auditorRestart
 flag for auditors in "restart()"
 
Gaudi::StateMachine::State m_state
 state of the Tool
 
Gaudi::StateMachine::State m_targetState
 state of the Tool
 

Friends

class ToolSvc
 

Detailed Description

Base class from which all the concrete tool classes should be derived.

Specific methods for doing something useful should be implemented in the concrete tools. Sub-types of this class could implement an additional interface for behavior common to sets of concrete tools (for example vertexers).

Author
Gloria Corti
Pere Mato

Definition at line 34 of file AlgTool.h.

Member Typedef Documentation

typedef Gaudi::PluginService::Factory<IAlgTool*, const std::string&, const std::string&, const IInterface*> AlgTool::Factory

Definition at line 41 of file AlgTool.h.

typedef Gaudi::PluginService::Factory<IAlgTool*, const std::string&, const std::string&, const IInterface*> AlgTool::Factory

Definition at line 41 of file AlgTool.h.

typedef std::list<std::pair<InterfaceID,void*> > AlgTool::InterfaceList
private

Definition at line 321 of file AlgTool.h.

typedef std::list<std::pair<InterfaceID,void*> > AlgTool::InterfaceList
private

Definition at line 321 of file AlgTool.h.

Constructor & Destructor Documentation

AlgTool::AlgTool ( const std::string &  type,
const std::string &  name,
const IInterface parent 
)

Standard Constructor.

Parameters
typethe concrete class of the sub-algtool
namethe full name of the concrete sub-algtool
parentthe parent of the concrete sub-algtool

Definition at line 179 of file AlgTool.cpp.

, m_type ( type )
, m_name ( name )
, m_parent ( parent )
, m_svcLocator ( 0 )
, m_messageSvc ( 0 )
, m_ptoolSvc ( 0 )
, m_pMonitorSvc ( NULL )
, m_threadID ( )
, m_pAuditorSvc ( 0 )
, m_auditInit ( false )
, m_auditorStart(false)
, m_auditorStop(false)
{
addRef(); // Initial count set to 1
declareProperty( "MonitorService", m_monitorSvcName = "MonitorSvc" );
{ // get the "OutputLevel" property from parent
const Property* _p = Gaudi::Utils::getProperty ( parent , "OutputLevel") ;
if ( 0 != _p ) { m_outputLevel.assign( *_p ) ; }
declareProperty ( "OutputLevel" , m_outputLevel ) ;
}
IInterface* _p = const_cast<IInterface*> ( parent ) ;
if ( Algorithm* _alg = dynamic_cast<Algorithm*> ( _p ) )
{
m_messageSvc = _alg -> msgSvc () ;
}
else if ( Service* _svc = dynamic_cast<Service*> ( _p ) )
{
m_messageSvc = _svc -> msgSvc () ;
}
else if ( AlgTool* _too = dynamic_cast<AlgTool*> ( _p ) )
{
}
else if ( Auditor* _aud = dynamic_cast<Auditor*> ( _p ) )
{
m_messageSvc = _aud -> msgSvc() ;
}
else
{
( "Failure to create tool '"
+ type + "/" + name + "': illegal parent type '"
+ System::typeinfoName(typeid(*_p)) + "'", "AlgTool", 0 );
}
{ // audit tools
if ( !appMgr.isValid() ) {
throw GaudiException("Could not locate ApplicationMgr","AlgTool",0);
}
const Property* p = Gaudi::Utils::getProperty( appMgr , "AuditTools");
if ( 0 != p ) { m_auditInit.assign ( *p ) ; }
declareProperty ( "AuditTools", m_auditInit );
bool audit = m_auditInit.value();
// Declare common AlgTool properties with their defaults
declareProperty ( "AuditInitialize" , m_auditorInitialize = audit ) ;
declareProperty ( "AuditStart" , m_auditorStart = audit ) ;
declareProperty ( "AuditStop" , m_auditorStop = audit ) ;
declareProperty ( "AuditFinalize" , m_auditorFinalize = audit ) ;
}
// check thread ID and try if tool name indicates thread ID
if ( m_threadID.empty() )
}
AlgTool::~AlgTool ( )
protectedvirtual

Definition at line 568 of file AlgTool.cpp.

AlgTool::AlgTool ( const std::string &  type,
const std::string &  name,
const IInterface parent 
)

Standard Constructor.

Parameters
typethe concrete class of the sub-algtool
namethe full name of the concrete sub-algtool
parentthe parent of the concrete sub-algtool
virtual AlgTool::~AlgTool ( )
protectedvirtual

Member Function Documentation

IAuditorSvc * AlgTool::auditorSvc ( ) const

Access the auditor service.

Definition at line 604 of file AlgTool.cpp.

{
//---------------------------------------------------------------------------
if ( 0 == m_pAuditorSvc ) {
StatusCode sc = service( "AuditorSvc", m_pAuditorSvc, true );
if( sc.isFailure() ) {
throw GaudiException("Service [AuditorSvc] not found", name(), sc);
}
}
return m_pAuditorSvc;
}
IAuditorSvc* AlgTool::auditorSvc ( ) const

Access the auditor service.

virtual StatusCode AlgTool::configure ( )
inlinevirtual

Definition at line 57 of file AlgTool.h.

virtual StatusCode AlgTool::configure ( )
inlinevirtual

Definition at line 57 of file AlgTool.h.

template<class T >
void AlgTool::declareInfo ( const std::string &  name,
const T &  var,
const std::string &  desc 
) const
inline

Declare monitoring information.

Parameters
nameMonitoring information name known to the external system
varMonitoring Listener address (the item to monitor...)
descTextual description of the information being monitored

Definition at line 277 of file AlgTool.h.

{
if ( mS ) mS->declareInfo(name, var, desc, this);
}
template<class T >
void AlgTool::declareInfo ( const std::string &  name,
const T &  var,
const std::string &  desc 
) const
inline

Declare monitoring information.

Parameters
nameMonitoring information name known to the external system
varMonitoring Listener address (the item to monitor...)
descTextual description of the information being monitored

Definition at line 277 of file AlgTool.h.

{
if ( mS ) mS->declareInfo(name, var, desc, this);
}
void AlgTool::declareInfo ( const std::string &  name,
const std::string &  format,
const void *  var,
int  size,
const std::string &  desc 
) const
inline

Declare monitoring information (special case)

Parameters
nameMonitoring information name known to the external system
formatFormat information
varMonitoring Listener address
sizeMonitoring Listener address size
descTextual description of the information being monitored

Definition at line 292 of file AlgTool.h.

{
if ( mS ) mS->declareInfo(name, format, var, size, desc, this);
}
void AlgTool::declareInfo ( const std::string &  name,
const std::string &  format,
const void *  var,
int  size,
const std::string &  desc 
) const
inline

Declare monitoring information (special case)

Parameters
nameMonitoring information name known to the external system
formatFormat information
varMonitoring Listener address
sizeMonitoring Listener address size
descTextual description of the information being monitored

Definition at line 292 of file AlgTool.h.

{
if ( mS ) mS->declareInfo(name, format, var, size, desc, this);
}
template<class T >
Property* AlgTool::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
) const
inline

Declare the named property.

MyTool ( const std::string& type ,
const std::string& name ,
const IInterface* parent )
: AlgTool ( type , name , pSvc )
, 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( &MyTool::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 234 of file AlgTool.h.

{
return m_propertyMgr -> declareProperty ( name , property , doc ) ;
}
template<class T >
Property* AlgTool::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
) const
inline

Declare the named property.

MyTool ( const std::string& type ,
const std::string& name ,
const IInterface* parent )
: AlgTool ( type , name , pSvc )
, 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( &MyTool::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 234 of file AlgTool.h.

{
return m_propertyMgr -> declareProperty ( name , property , doc ) ;
}
Property* AlgTool::declareRemoteProperty ( const std::string &  name,
IProperty rsvc,
const std::string &  rname = "" 
) const
inline

Declare remote named properties.

Definition at line 242 of file AlgTool.h.

{
return m_propertyMgr-> declareRemoteProperty ( name , rsvc , rname ) ;
}
Property* AlgTool::declareRemoteProperty ( const std::string &  name,
IProperty rsvc,
const std::string &  rname = "" 
) const
inline

Declare remote named properties.

Definition at line 242 of file AlgTool.h.

{
return m_propertyMgr-> declareRemoteProperty ( name , rsvc , rname ) ;
}
void AlgTool::declInterface ( const InterfaceID iid,
void *  ii 
)

declare interface

Definition at line 43 of file AlgTool.cpp.

{
m_interfaceList.push_back(std::make_pair(iid, ii));
}
void AlgTool::declInterface ( const InterfaceID ,
void *   
)

declare interface

virtual Gaudi::StateMachine::State AlgTool::FSMState ( ) const
inlinevirtual

Definition at line 65 of file AlgTool.h.

{ return m_state; }
virtual Gaudi::StateMachine::State AlgTool::FSMState ( ) const
inlinevirtual

Definition at line 65 of file AlgTool.h.

{ return m_state; }
virtual const std::vector<Property*>& AlgTool::getProperties ( ) const
virtual
const std::vector< Property * > & AlgTool::getProperties ( ) const
virtual

Definition at line 140 of file AlgTool.cpp.

virtual StatusCode AlgTool::getProperty ( Property p) const
virtual
StatusCode AlgTool::getProperty ( Property p) const
virtual

Definition at line 120 of file AlgTool.cpp.

{
}
virtual const Property& AlgTool::getProperty ( const std::string &  name) const
virtual
const Property & AlgTool::getProperty ( const std::string &  name) const
virtual

Definition at line 127 of file AlgTool.cpp.

{
}
virtual StatusCode AlgTool::getProperty ( const std::string &  n,
std::string &  v 
) const
virtual
StatusCode AlgTool::getProperty ( const std::string &  n,
std::string &  v 
) const
virtual

Definition at line 133 of file AlgTool.cpp.

{
}
PropertyMgr* AlgTool::getPropertyMgr ( )
inline

Definition at line 95 of file AlgTool.h.

{ return m_propertyMgr; }
PropertyMgr* AlgTool::getPropertyMgr ( )
inline

Definition at line 95 of file AlgTool.h.

{ return m_propertyMgr; }
StatusCode AlgTool::initialize ( )
virtual

Reimplemented in GaudiHistos< GaudiTool >, GaudiHistos< GaudiTool >, GaudiCommon< AlgTool >, GaudiCommon< AlgTool >, GaudiTuples< GaudiHistoTool >, GaudiTuples< GaudiHistoTool >, GaudiTool, GaudiTool, GaudiHistoTool, GaudiHistoTool, GaudiTupleTool, GaudiTupleTool, SequencerTimerTool, FuncMinimum, PartitionSwitchTool, DataStreamTool, DataStreamTool, EqSolver, and DataSvcFileEntriesTool.

Definition at line 307 of file AlgTool.cpp.

{
// For the time being there is nothing to be done here.
// Setting the properties is done by the ToolSvc calling setProperties()
// explicitly.
}
void AlgTool::initOutputLevel ( Property prop)
protected

callback for output level property

Definition at line 617 of file AlgTool.cpp.

{
//-----------------------------------------------------------------------------
// do nothing... yet ?
}
void AlgTool::initOutputLevel ( Property prop)
protected

callback for output level property

IMonitorSvc* AlgTool::monitorSvc ( ) const
inline

Access the monitor service.

Attention
Note that this method will return a NULL pointer if no monitor service is configured to be present. You must take this possibility into account when using the pointer
Returns
Pointer to the Monitor service
Return values
NULLNo monitor service is present
non-NULLA monitor service is present and available to be used

Definition at line 261 of file AlgTool.h.

{
// If not already located try to locate it without forcing a creation
if ( !m_pMonitorSvc ){
}
return m_pMonitorSvc;
}
IMonitorSvc* AlgTool::monitorSvc ( ) const
inline

Access the monitor service.

Attention
Note that this method will return a NULL pointer if no monitor service is configured to be present. You must take this possibility into account when using the pointer
Returns
Pointer to the Monitor service
Return values
NULLNo monitor service is present
non-NULLA monitor service is present and available to be used

Definition at line 261 of file AlgTool.h.

{
// If not already located try to locate it without forcing a creation
if ( !m_pMonitorSvc ){
}
return m_pMonitorSvc;
}
IMessageSvc * AlgTool::msgSvc ( ) const

Retrieve pointer to message service.

Definition at line 79 of file AlgTool.cpp.

{
return m_messageSvc;
}
IMessageSvc* AlgTool::msgSvc ( ) const

Retrieve pointer to message service.

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

Retrieve full identifying name of the concrete tool object.

Definition at line 51 of file AlgTool.cpp.

{
return m_name;
}
virtual const std::string& AlgTool::name ( ) const
virtual

Retrieve full identifying name of the concrete tool object.

int AlgTool::outputLevel ( ) const
inlineprotected

get tool's output level

Definition at line 305 of file AlgTool.h.

{ return (int)m_outputLevel ; }
int AlgTool::outputLevel ( ) const
inlineprotected

get tool's output level

Definition at line 305 of file AlgTool.h.

{ return (int)m_outputLevel ; }
IntegerProperty& AlgTool::outputLevelProperty ( )
inlineprotected

Accessor for the Message level property.

Definition at line 308 of file AlgTool.h.

{ return m_outputLevel; }
IntegerProperty& AlgTool::outputLevelProperty ( )
inlineprotected

Accessor for the Message level property.

Definition at line 308 of file AlgTool.h.

{ return m_outputLevel; }
const IInterface * AlgTool::parent ( ) const
virtual

Retrieve parent of the sub-algtool.

Definition at line 65 of file AlgTool.cpp.

{
return m_parent;
}
virtual const IInterface* AlgTool::parent ( ) const
virtual

Retrieve parent of the sub-algtool.

StatusCode AlgTool::queryInterface ( const InterfaceID riid,
void **  ppvUnknown 
)
virtual

Query for a given interface.

Reimplemented in extends2< AlgTool, IDODAlgMapper, IDODNodeMapper >, extends2< AlgTool, IDODAlgMapper, IDODNodeMapper >, extends2< AlgTool, IDataStoreLeaves, IIncidentListener >, extends2< AlgTool, IDataStoreLeaves, IIncidentListener >, extends1< AlgTool, IDataStreamTool >, extends1< AlgTool, IDataStreamTool >, extends1< GaudiTool, IFuncMinimum >, extends1< GaudiTool, IFuncMinimum >, extends1< AlgTool, IGslErrorHandler >, extends1< AlgTool, IGslErrorHandler >, extends1< AlgTool, IFileAccess >, extends1< AlgTool, IFileAccess >, extends1< AlgTool, IPartitionControl >, extends1< AlgTool, IPartitionControl >, extends1< GaudiTool, IEqSolver >, and extends1< GaudiTool, IEqSolver >.

Definition at line 18 of file AlgTool.cpp.

{
if ( 0 == ppvi ) { return StatusCode::FAILURE ; } // RETURN
StatusCode sc = base_class::queryInterface(riid,ppvi);
if (sc.isSuccess()) {
return sc;
}
else {
for ( InterfaceList::iterator it = m_interfaceList.begin() ;
m_interfaceList.end() != it ; ++it )
{
if ( !it->first.versionMatch ( riid ) ) { continue ; }
// OK
*ppvi = it->second ;
addRef() ;
return SUCCESS ; // RETURN
}
*ppvi = 0 ;
return NO_INTERFACE ; // RETURN
}
// cannot reach this point
}
StatusCode AlgTool::reinitialize ( )
virtual

Definition at line 482 of file AlgTool.cpp.

{
/* @TODO
* MCl 2008-10-23: the implementation of reinitialize as finalize+initialize
* is causing too many problems
*
// Default implementation is finalize+initialize
StatusCode sc = finalize();
if (sc.isFailure()) {
MsgStream log ( msgSvc() , name() );
log << MSG::ERROR << "reinitialize(): cannot be finalized" << endmsg;
return sc;
}
sc = initialize();
if (sc.isFailure()) {
MsgStream log ( msgSvc() , name() );
log << MSG::ERROR << "reinitialize(): cannot be initialized" << endmsg;
return sc;
}
*/
}
virtual StatusCode AlgTool::reinitialize ( )
virtual
StatusCode AlgTool::restart ( )
virtual

Definition at line 548 of file AlgTool.cpp.

{
// Default implementation is stop+start
if (sc.isFailure()) {
MsgStream log ( msgSvc() , name() );
log << MSG::ERROR << "restart(): cannot be stopped" << endmsg;
return sc;
}
sc = start();
if (sc.isFailure()) {
MsgStream log ( msgSvc() , name() );
log << MSG::ERROR << "restart(): cannot be started" << endmsg;
return sc;
}
}
virtual StatusCode AlgTool::restart ( )
virtual
template<class T >
StatusCode AlgTool::service ( const std::string &  name,
T *&  svc,
bool  createIf = true 
) const
inline

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

Definition at line 179 of file AlgTool.h.

{
return service_i(name, createIf, T::interfaceID(), (void**)&svc);
}
template<class T >
StatusCode AlgTool::service ( const std::string &  name,
T *&  svc,
bool  createIf = true 
) const
inline

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

Definition at line 179 of file AlgTool.h.

{
return service_i(name, createIf, T::interfaceID(), (void**)&svc);
}
template<class T >
StatusCode AlgTool::service ( const std::string &  type,
const std::string &  name,
T *&  svc 
) const
inline

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

Definition at line 186 of file AlgTool.h.

{
return service_i(type, name, T::interfaceID(), (void**)&svc);
}
template<class T >
StatusCode AlgTool::service ( const std::string &  type,
const std::string &  name,
T *&  svc 
) const
inline

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

Definition at line 186 of file AlgTool.h.

{
return service_i(type, name, T::interfaceID(), (void**)&svc);
}
SmartIF<IService> AlgTool::service ( const std::string &  name,
const bool  createIf = true,
const bool  quiet = false 
) const

Return a pointer to the service identified by name (or "type/name")

SmartIF< IService > AlgTool::service ( const std::string &  name,
const bool  createIf = true,
const bool  quiet = false 
) const

Return a pointer to the service identified by name (or "type/name")

Definition at line 598 of file AlgTool.cpp.

{
const ServiceLocatorHelper helper(*serviceLocator(), *this);
return helper.service(name, quiet, createIf);
}
StatusCode AlgTool::service_i ( const std::string &  algName,
bool  createIf,
const InterfaceID iid,
void **  ppSvc 
) const
private

implementation of service method

StatusCode AlgTool::service_i ( const std::string &  algName,
bool  createIf,
const InterfaceID iid,
void **  ppSvc 
) const
private

implementation of service method

Definition at line 580 of file AlgTool.cpp.

{
const ServiceLocatorHelper helper(*serviceLocator(), *this);
return helper.getService(svcName, createIf, iid, ppSvc);
}
StatusCode AlgTool::service_i ( const std::string &  svcType,
const std::string &  svcName,
const InterfaceID iid,
void **  ppS 
) const
private
StatusCode AlgTool::service_i ( const std::string &  svcType,
const std::string &  svcName,
const InterfaceID iid,
void **  ppS 
) const
private

Definition at line 590 of file AlgTool.cpp.

{
const ServiceLocatorHelper helper(*serviceLocator(), *this);
return helper.createService(svcType, svcName, iid, ppSvc);
}
ISvcLocator* AlgTool::serviceLocator ( ) const

Retrieve pointer to service locator.

ISvcLocator * AlgTool::serviceLocator ( ) const

Retrieve pointer to service locator.

Definition at line 72 of file AlgTool.cpp.

{
return m_svcLocator;
}
StatusCode AlgTool::setProperties ( )

Method for setting declared properties to the values specified in the jobOptions via the job option service.

This method is called by the ToolSvc after creating the concrete tool, before passing it to the requesting parent and does not need to be called explicitly.

Definition at line 147 of file AlgTool.cpp.

{
if( m_svcLocator == 0) {
}
if( !jos.isValid() ) return StatusCode::FAILURE;
// set first generic Properties
StatusCode sc = jos->setMyProperties( getGaudiThreadGenericName(name()), this );
if( sc.isFailure() ) return StatusCode::FAILURE;
// set specific Properties
if(jos->setMyProperties( name(), this ).isFailure()) {
}
}
// Change my own outputlevel
if ( 0 != m_messageSvc )
{
{ m_messageSvc -> setOutputLevel ( name () , m_outputLevel ) ; }
}
}
StatusCode AlgTool::setProperties ( )

Method for setting declared properties to the values specified in the jobOptions via the job option service.

This method is called by the ToolSvc after creating the concrete tool, before passing it to the requesting parent and does not need to be called explicitly.

virtual StatusCode AlgTool::setProperty ( const Property p)
virtual

Default implementations for IProperty interface.

StatusCode AlgTool::setProperty ( const Property p)
virtual

Default implementations for IProperty interface.

Definition at line 99 of file AlgTool.cpp.

{
}
StatusCode AlgTool::setProperty ( const std::string &  s)
virtual

Definition at line 106 of file AlgTool.cpp.

{
}
virtual StatusCode AlgTool::setProperty ( const std::string &  s)
virtual
virtual StatusCode AlgTool::setProperty ( const std::string &  n,
const std::string &  v 
)
virtual
StatusCode AlgTool::setProperty ( const std::string &  n,
const std::string &  v 
)
virtual

Definition at line 113 of file AlgTool.cpp.

{
}
template<class TYPE >
StatusCode AlgTool::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 141 of file AlgTool.h.

template<class TYPE >
StatusCode AlgTool::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 141 of file AlgTool.h.

StatusCode AlgTool::start ( )
virtual

Definition at line 351 of file AlgTool.cpp.

{
// For the time being there is nothing to be done here.
}
virtual StatusCode AlgTool::start ( )
virtual
StatusCode AlgTool::stop ( )
virtual

Definition at line 393 of file AlgTool.cpp.

{
// For the time being there is nothing to be done here.
}
virtual StatusCode AlgTool::stop ( )
virtual
ISvcLocator* AlgTool::svcLoc ( ) const
inline

shortcut for the method service locator

Definition at line 159 of file AlgTool.h.

{ return serviceLocator() ; }
ISvcLocator* AlgTool::svcLoc ( ) const
inline

shortcut for the method service locator

Definition at line 159 of file AlgTool.h.

{ return serviceLocator() ; }
virtual StatusCode AlgTool::sysFinalize ( )
virtual

Finalize AlgTool.

StatusCode AlgTool::sysFinalize ( )
virtual

Finalize AlgTool.

Definition at line 401 of file AlgTool.cpp.

{
//-----------------------------------------------------------------------------
try {
Gaudi::Guards::AuditorGuard guard(this,
// check if we want to audit the initialize
if (sc.isSuccess())
return sc;
}
catch( const GaudiException& Exception ) {
MsgStream log ( msgSvc() , name() + ".sysFinalize()" );
log << MSG::FATAL << " Exception with tag=" << Exception.tag()
<< " is caught " << endmsg;
log << MSG::ERROR << Exception << endmsg;
}
catch( const std::exception& Exception ) {
MsgStream log ( msgSvc() , name() + ".sysFinalize()" );
log << MSG::FATAL << " Standard std::exception is caught " << endmsg;
log << MSG::ERROR << Exception.what() << endmsg;
}
catch( ... ) {
MsgStream log ( msgSvc() , name() + ".sysFinalize()" );
log << MSG::FATAL << "UNKNOWN Exception is caught " << endmsg;
}
}
StatusCode AlgTool::sysInitialize ( )
virtual

Initialize AlgTool.

Definition at line 273 of file AlgTool.cpp.

{
//-----------------------------------------------------------------------------
try {
Gaudi::Guards::AuditorGuard guard(this,
// check if we want to audit the initialize
if (sc.isSuccess())
return sc;
}
catch( const GaudiException& Exception ) {
MsgStream log ( msgSvc() , name() + ".sysInitialize()" );
log << MSG::FATAL << " Exception with tag=" << Exception.tag()
<< " is caught " << endmsg;
log << MSG::ERROR << Exception << endmsg;
}
catch( const std::exception& Exception ) {
MsgStream log ( msgSvc() , name() + ".sysInitialize()" );
log << MSG::FATAL << " Standard std::exception is caught " << endmsg;
log << MSG::ERROR << Exception.what() << endmsg;
}
catch( ... ) {
MsgStream log ( msgSvc() , name() + ".sysInitialize()" );
log << MSG::FATAL << "UNKNOWN Exception is caught " << endmsg;
}
}
virtual StatusCode AlgTool::sysInitialize ( )
virtual

Initialize AlgTool.

StatusCode AlgTool::sysReinitialize ( )
virtual

Initialize AlgTool.

Definition at line 442 of file AlgTool.cpp.

{
//-----------------------------------------------------------------------------
// Check that the current status is the correct one.
MsgStream log ( msgSvc() , name() );
<< "sysReinitialize(): cannot reinitialize tool not initialized"
<< endmsg;
}
try {
Gaudi::Guards::AuditorGuard guard(this,
// check if we want to audit the initialize
return sc;
}
catch( const GaudiException& Exception ) {
MsgStream log ( msgSvc() , name() + ".sysReinitialize()" );
log << MSG::FATAL << " Exception with tag=" << Exception.tag()
<< " is caught" << endmsg;
log << MSG::ERROR << Exception << endmsg;
}
catch( const std::exception& Exception ) {
MsgStream log ( msgSvc() , name() + ".sysReinitialize()" );
log << MSG::FATAL << " Standard std::exception is caught" << endmsg;
log << MSG::ERROR << Exception.what() << endmsg;
}
catch( ... ) {
MsgStream log ( msgSvc() , name() + ".sysReinitialize()" );
log << MSG::FATAL << "UNKNOWN Exception is caught" << endmsg;
}
}
virtual StatusCode AlgTool::sysReinitialize ( )
virtual

Initialize AlgTool.

StatusCode AlgTool::sysRestart ( )
virtual

Start AlgTool.

Definition at line 507 of file AlgTool.cpp.

{
//-----------------------------------------------------------------------------
// Check that the current status is the correct one.
MsgStream log ( msgSvc() , name() );
<< "sysRestart(): cannot reinitialize tool not started"
<< endmsg;
}
try {
Gaudi::Guards::AuditorGuard guard(this,
// check if we want to audit the initialize
return sc;
}
catch( const GaudiException& Exception ) {
MsgStream log ( msgSvc() , name() + ".sysRestart()" );
log << MSG::FATAL << " Exception with tag=" << Exception.tag()
<< " is caught" << endmsg;
log << MSG::ERROR << Exception << endmsg;
}
catch( const std::exception& Exception ) {
MsgStream log ( msgSvc() , name() + ".sysRestart()" );
log << MSG::FATAL << " Standard std::exception is caught" << endmsg;
log << MSG::ERROR << Exception.what() << endmsg;
}
catch( ... ) {
MsgStream log ( msgSvc() , name() + ".sysRestart()" );
log << MSG::FATAL << "UNKNOWN Exception is caught" << endmsg;
}
}
virtual StatusCode AlgTool::sysRestart ( )
virtual

Start AlgTool.

virtual StatusCode AlgTool::sysStart ( )
virtual

Start AlgTool.

StatusCode AlgTool::sysStart ( )
virtual

Start AlgTool.

Definition at line 317 of file AlgTool.cpp.

{
//-----------------------------------------------------------------------------
try {
Gaudi::Guards::AuditorGuard guard(this,
// check if we want to audit the initialize
if (sc.isSuccess())
return sc;
}
catch( const GaudiException& Exception ) {
MsgStream log ( msgSvc() , name() + ".sysStart()" );
log << MSG::FATAL << " Exception with tag=" << Exception.tag()
<< " is caught " << endmsg;
log << MSG::ERROR << Exception << endmsg;
}
catch( const std::exception& Exception ) {
MsgStream log ( msgSvc() , name() + ".sysStart()" );
log << MSG::FATAL << " Standard std::exception is caught " << endmsg;
log << MSG::ERROR << Exception.what() << endmsg;
}
catch( ... ) {
MsgStream log ( msgSvc() , name() + ".sysStart()" );
log << MSG::FATAL << "UNKNOWN Exception is caught " << endmsg;
}
}
virtual StatusCode AlgTool::sysStop ( )
virtual

Stop AlgTool.

StatusCode AlgTool::sysStop ( )
virtual

Stop AlgTool.

Definition at line 359 of file AlgTool.cpp.

{
//-----------------------------------------------------------------------------
try {
Gaudi::Guards::AuditorGuard guard(this,
// check if we want to audit the initialize
if (sc.isSuccess())
return sc;
}
catch( const GaudiException& Exception ) {
MsgStream log ( msgSvc() , name() + ".sysStop()" );
log << MSG::FATAL << " Exception with tag=" << Exception.tag()
<< " is caught " << endmsg;
log << MSG::ERROR << Exception << endmsg;
}
catch( const std::exception& Exception ) {
MsgStream log ( msgSvc() , name() + ".sysStop()" );
log << MSG::FATAL << " Standard std::exception is caught " << endmsg;
log << MSG::ERROR << Exception.what() << endmsg;
}
catch( ... ) {
MsgStream log ( msgSvc() , name() + ".sysStop()" );
log << MSG::FATAL << "UNKNOWN Exception is caught " << endmsg;
}
}
virtual Gaudi::StateMachine::State AlgTool::targetFSMState ( ) const
inlinevirtual

Definition at line 66 of file AlgTool.h.

{ return m_targetState; }
virtual Gaudi::StateMachine::State AlgTool::targetFSMState ( ) const
inlinevirtual

Definition at line 66 of file AlgTool.h.

{ return m_targetState; }
virtual StatusCode AlgTool::terminate ( )
inlinevirtual

Definition at line 62 of file AlgTool.h.

virtual StatusCode AlgTool::terminate ( )
inlinevirtual

Definition at line 62 of file AlgTool.h.

IToolSvc* AlgTool::toolSvc ( ) const

The standard ToolSvc service, Return a pointer to the service if present.

IToolSvc * AlgTool::toolSvc ( ) const

The standard ToolSvc service, Return a pointer to the service if present.

Definition at line 86 of file AlgTool.cpp.

{
if ( 0 == m_ptoolSvc ) {
StatusCode sc = service( "ToolSvc", m_ptoolSvc, true );
if( sc.isFailure() ) {
throw GaudiException("Service [ToolSvc] not found", name(), sc);
}
}
return m_ptoolSvc;
}
virtual const std::string& AlgTool::type ( ) const
virtual

Retrieve type (concrete class) of the sub-algtool.

const std::string & AlgTool::type ( ) const
virtual

Retrieve type (concrete class) of the sub-algtool.

Definition at line 58 of file AlgTool.cpp.

{
return m_type;
}

Friends And Related Function Documentation

ToolSvc
friend

Definition at line 35 of file AlgTool.h.

Member Data Documentation

BooleanProperty AlgTool::m_auditInit
private

Definition at line 347 of file AlgTool.h.

bool AlgTool::m_auditorFinalize
private

flag for auditors in "finalize()"

Definition at line 351 of file AlgTool.h.

bool AlgTool::m_auditorInitialize
private

flag for auditors in "initialize()"

Definition at line 348 of file AlgTool.h.

bool AlgTool::m_auditorReinitialize
private

flag for auditors in "reinitialize()"

Definition at line 352 of file AlgTool.h.

bool AlgTool::m_auditorRestart
private

flag for auditors in "restart()"

Definition at line 353 of file AlgTool.h.

bool AlgTool::m_auditorStart
private

flag for auditors in "start()"

Definition at line 349 of file AlgTool.h.

bool AlgTool::m_auditorStop
private

flag for auditors in "stop()"

Definition at line 350 of file AlgTool.h.

InterfaceList AlgTool::m_interfaceList
private

Interface list.

Definition at line 332 of file AlgTool.h.

IMessageSvc * AlgTool::m_messageSvc
mutableprivate

Message service.

Definition at line 327 of file AlgTool.h.

std::string AlgTool::m_monitorSvcName
private

Name to use for Monitor Service.

Definition at line 330 of file AlgTool.h.

const std::string AlgTool::m_name
private

AlgTool full name.

Definition at line 324 of file AlgTool.h.

IntegerProperty AlgTool::m_outputLevel
private

AlgTool output level.

Definition at line 322 of file AlgTool.h.

const IInterface * AlgTool::m_parent
private

AlgTool parent.

Definition at line 325 of file AlgTool.h.

IAuditorSvc * AlgTool::m_pAuditorSvc
mutableprivate

Auditor Service.

Definition at line 345 of file AlgTool.h.

IMonitorSvc * AlgTool::m_pMonitorSvc
mutableprivate

Online Monitoring Service.

Definition at line 329 of file AlgTool.h.

PropertyMgr * AlgTool::m_propertyMgr
private

Property Manager.

Definition at line 331 of file AlgTool.h.

IToolSvc * AlgTool::m_ptoolSvc
mutableprivate

Tool service.

Definition at line 328 of file AlgTool.h.

Gaudi::StateMachine::State AlgTool::m_state
private

state of the Tool

Definition at line 355 of file AlgTool.h.

ISvcLocator * AlgTool::m_svcLocator
mutableprivate

Pointer to Service Locator service.

Definition at line 326 of file AlgTool.h.

Gaudi::StateMachine::State AlgTool::m_targetState
private

state of the Tool

Definition at line 356 of file AlgTool.h.

std::string AlgTool::m_threadID
private

Thread Id for Alg Tool.

Definition at line 333 of file AlgTool.h.

std::string AlgTool::m_type
private

AlgTool type (concrete class name)

Definition at line 323 of file AlgTool.h.


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