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:

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 implements< Interfaces >
using base_class = implements< Interfaces...>
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces...>
 Typedef to the base of this class. More...
 
using iids = typename extend_interfaces_base::ext_iids
 
using base_class = implements< Interfaces...>
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces...>
 Typedef to the base of this class. More...
 
using iids = typename extend_interfaces_base::ext_iids
 
- Public Types inherited from extend_interfaces< Interfaces...>
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
 take union of the ext_iids of all Interfaces... More...
 
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
 take union of the ext_iids of all Interfaces... More...
 

Public Member Functions

StatusCode queryInterface (const InterfaceID &riid, void **ppvUnknown) override
 Query for a given interface. More...
 
const std::string & name () const override
 Retrieve full identifying name of the concrete tool object. More...
 
const std::string & type () const override
 Retrieve type (concrete class) of the sub-algtool. More...
 
const IInterfaceparent () const override
 Retrieve parent of the sub-algtool. More...
 
StatusCode configure () override
 
StatusCode initialize () override
 
StatusCode start () override
 
StatusCode stop () override
 
StatusCode finalize () override
 
StatusCode terminate () override
 
StatusCode reinitialize () override
 
StatusCode restart () override
 
Gaudi::StateMachine::State FSMState () const override
 
Gaudi::StateMachine::State targetFSMState () const override
 
StatusCode sysInitialize () override
 Initialize AlgTool. More...
 
StatusCode sysStart () override
 Start AlgTool. More...
 
StatusCode sysStop () override
 Stop AlgTool. More...
 
StatusCode sysFinalize () override
 Finalize AlgTool. More...
 
StatusCode sysReinitialize () override
 Initialize AlgTool. More...
 
StatusCode sysRestart () override
 Start AlgTool. More...
 
StatusCode setProperty (const Property &p) override
 Default implementations for IProperty interface. More...
 
StatusCode setProperty (const std::string &s) override
 
StatusCode setProperty (const std::string &n, const std::string &v) override
 
StatusCode getProperty (Property *p) const override
 
const PropertygetProperty (const std::string &name) const override
 
StatusCode getProperty (const std::string &n, std::string &v) const override
 
const std::vector< Property * > & getProperties () const override
 
bool hasProperty (const std::string &name) const override
 
PropertyMgrgetPropertyMgr ()
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
 AlgTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Constructor. More...
 
ISvcLocatorserviceLocator () const
 Retrieve pointer to service locator. More...
 
ISvcLocatorsvcLoc () const
 shortcut for the method service locator More...
 
IMessageSvcmsgSvc () const
 Retrieve pointer to message service. More...
 
IDataProviderSvcevtSvc () const
 accessor to event service service More...
 
IToolSvctoolSvc () const
 The standard ToolSvc service, Return a pointer to the service if present. More...
 
StatusCode setProperties ()
 Method for setting declared properties to the values specified in the jobOptions via the job option service. More...
 
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. More...
 
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. More...
 
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") More...
 
template<typename T >
SmartIF< T > service (const std::string &name, const bool createIf=true, const bool quiet=false) const
 
template<class T >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property. More...
 
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
 Declare remote named properties. More...
 
template<class T >
StatusCode declareInput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::string &address=DataObjectDescriptor::NULL_, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::READ)
 Declare input data object. More...
 
template<class T >
StatusCode declareInput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::vector< std::string > &addresses, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::READ)
 Declare input data object. More...
 
template<class T >
StatusCode declareOutput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::string &address=DataObjectDescriptor::NULL_, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::WRITE)
 Declare output data object. More...
 
const DataObjectDescriptorCollectioninputDataObjects () const override
 get inputs More...
 
const DataObjectDescriptorCollectionoutputDataObjects () const override
 get outputs More...
 
void registerTool (IAlgTool *tool) const
 
void deregisterTool (IAlgTool *tool) const
 
template<class T >
StatusCode declarePublicTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
 Declare used public tool. More...
 
template<class T >
StatusCode declarePrivateTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
 Declare used private tool. More...
 
const std::vector< IAlgTool * > & tools () const
 
IAuditorSvcauditorSvc () const
 Access the auditor service. More...
 
IMonitorSvcmonitorSvc () const
 Access the monitor service. More...
 
template<class T >
void declareInfo (const std::string &name, const T &var, const std::string &desc) const
 Declare monitoring information. More...
 
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) More...
 
StatusCode queryInterface (const InterfaceID &riid, void **ppvUnknown) override
 Query for a given interface. More...
 
const std::string & name () const override
 Retrieve full identifying name of the concrete tool object. More...
 
const std::string & type () const override
 Retrieve type (concrete class) of the sub-algtool. More...
 
const IInterfaceparent () const override
 Retrieve parent of the sub-algtool. More...
 
StatusCode configure () override
 
StatusCode initialize () override
 
StatusCode start () override
 
StatusCode stop () override
 
StatusCode finalize () override
 
StatusCode terminate () override
 
StatusCode reinitialize () override
 
StatusCode restart () override
 
Gaudi::StateMachine::State FSMState () const override
 
Gaudi::StateMachine::State targetFSMState () const override
 
StatusCode sysInitialize () override
 Initialize AlgTool. More...
 
StatusCode sysStart () override
 Start AlgTool. More...
 
StatusCode sysStop () override
 Stop AlgTool. More...
 
StatusCode sysFinalize () override
 Finalize AlgTool. More...
 
StatusCode sysReinitialize () override
 Initialize AlgTool. More...
 
StatusCode sysRestart () override
 Start AlgTool. More...
 
StatusCode setProperty (const Property &p) override
 Default implementations for IProperty interface. More...
 
StatusCode setProperty (const std::string &s) override
 
StatusCode setProperty (const std::string &n, const std::string &v) override
 
StatusCode getProperty (Property *p) const override
 
const PropertygetProperty (const std::string &name) const override
 
StatusCode getProperty (const std::string &n, std::string &v) const override
 
const std::vector< Property * > & getProperties () const override
 
bool hasProperty (const std::string &name) const override
 
PropertyMgrgetPropertyMgr ()
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
 AlgTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Constructor. More...
 
ISvcLocatorserviceLocator () const
 Retrieve pointer to service locator. More...
 
ISvcLocatorsvcLoc () const
 shortcut for the method service locator More...
 
IMessageSvcmsgSvc () const
 Retrieve pointer to message service. More...
 
IDataProviderSvcevtSvc () const
 accessor to event service service More...
 
IToolSvctoolSvc () const
 The standard ToolSvc service, Return a pointer to the service if present. More...
 
StatusCode setProperties ()
 Method for setting declared properties to the values specified in the jobOptions via the job option service. More...
 
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. More...
 
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. More...
 
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") More...
 
template<typename T >
SmartIF< T > service (const std::string &name, const bool createIf=true, const bool quiet=false) const
 
template<class T >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property. More...
 
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
 Declare remote named properties. More...
 
template<class T >
StatusCode declareInput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::string &address=DataObjectDescriptor::NULL_, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::READ)
 Declare input data object. More...
 
template<class T >
StatusCode declareInput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::vector< std::string > &addresses, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::READ)
 Declare input data object. More...
 
template<class T >
StatusCode declareOutput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::string &address=DataObjectDescriptor::NULL_, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::WRITE)
 Declare output data object. More...
 
const DataObjectDescriptorCollectioninputDataObjects () const override
 get inputs More...
 
const DataObjectDescriptorCollectionoutputDataObjects () const override
 get outputs More...
 
void registerTool (IAlgTool *tool) const
 
void deregisterTool (IAlgTool *tool) const
 
template<class T >
StatusCode declarePublicTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
 Declare used public tool. More...
 
template<class T >
StatusCode declarePrivateTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
 Declare used private tool. More...
 
const std::vector< IAlgTool * > & tools () const
 
IAuditorSvcauditorSvc () const
 Access the auditor service. More...
 
IMonitorSvcmonitorSvc () const
 Access the monitor service. More...
 
template<class T >
void declareInfo (const std::string &name, const T &var, const std::string &desc) const
 Declare monitoring information. More...
 
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) More...
 
- Public Member Functions inherited from implements< Interfaces >
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 implements ()=default
 Default constructor. More...
 
 implements (const implements &)
 Copy constructor (zero the reference count) More...
 
implementsoperator= (const implements &)
 Assignment operator (do not touch the reference count). More...
 
 ~implements () override=default
 Virtual destructor. More...
 
unsigned long addRef () override
 Reference Interface instance. More...
 
unsigned long release () override
 Release Interface instance. More...
 
unsigned long refCount () const override
 Current reference count. More...
 
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 implements ()=default
 Default constructor. More...
 
 implements (const implements &)
 Copy constructor (zero the reference count) More...
 
implementsoperator= (const implements &)
 Assignment operator (do not touch the reference count). More...
 
 ~implements () override=default
 Virtual destructor. More...
 
unsigned long addRef () override
 Reference Interface instance. More...
 
unsigned long release () override
 Release Interface instance. More...
 
unsigned long refCount () const override
 Current reference count. More...
 
- Public Member Functions inherited from extend_interfaces< Interfaces...>
 ~extend_interfaces () override=default
 Virtual destructor. More...
 
 ~extend_interfaces () override=default
 Virtual destructor. More...
 

Protected Member Functions

template<typename I >
void declareInterface (I *i)
 
DataObjectDescriptorCollectioninputDataObjects ()
 
DataObjectDescriptorCollectionoutputDataObjects ()
 
std::vector< IAlgTool * > & tools ()
 
int outputLevel () const
 get tool's output level More...
 
IntegerPropertyoutputLevelProperty ()
 Accessor for the Message level property. More...
 
void initOutputLevel (Property &prop)
 callback for output level property More...
 
 ~AlgTool () override
 
template<typename I >
void declareInterface (I *i)
 
DataObjectDescriptorCollectioninputDataObjects ()
 
DataObjectDescriptorCollectionoutputDataObjects ()
 
std::vector< IAlgTool * > & tools ()
 
int outputLevel () const
 get tool's output level More...
 
IntegerPropertyoutputLevelProperty ()
 Accessor for the Message level property. More...
 
void initOutputLevel (Property &prop)
 callback for output level property More...
 
 ~AlgTool () override
 

Private Types

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

Private Member Functions

void initToolHandles () const
 
StatusCode service_i (const std::string &algName, bool createIf, const InterfaceID &iid, void **ppSvc) const
 flag indicating whether ToolHandle tools have been added to m_tools More...
 
StatusCode service_i (const std::string &svcType, const std::string &svcName, const InterfaceID &iid, void **ppS) const
 
void initToolHandles () const
 
StatusCode service_i (const std::string &algName, bool createIf, const InterfaceID &iid, void **ppSvc) const
 flag indicating whether ToolHandle tools have been added to m_tools More...
 
StatusCode service_i (const std::string &svcType, const std::string &svcName, const InterfaceID &iid, void **ppS) const
 

Private Attributes

IntegerProperty m_outputLevel = MSG::NIL
 AlgTool output level. More...
 
std::string m_type
 AlgTool type (concrete class name) More...
 
const std::string m_name
 AlgTool full name. More...
 
const IInterfacem_parent = nullptr
 AlgTool parent. More...
 
ISvcLocatorm_svcLocator = nullptr
 Pointer to Service Locator service. More...
 
IMessageSvcm_messageSvc = nullptr
 Message service. More...
 
SmartIF< IDataProviderSvcm_evtSvc
 Event data service. More...
 
SmartIF< IToolSvcm_ptoolSvc
 Tool service. More...
 
SmartIF< IMonitorSvcm_pMonitorSvc
 Online Monitoring Service. More...
 
std::string m_monitorSvcName
 Name to use for Monitor Service. More...
 
SmartIF< PropertyMgrm_propertyMgr
 Property Manager. More...
 
InterfaceList m_interfaceList
 Interface list. More...
 
std::string m_threadID
 Thread Id for Alg Tool. More...
 
DataObjectDescriptorCollection m_inputDataObjects
 
DataObjectDescriptorCollection m_outputDataObjects
 
std::vector< IAlgTool * > m_tools
 
std::vector< BaseToolHandle * > m_toolHandles
 
bool m_toolHandlesInit = false
 
SmartIF< IAuditorSvcm_pAuditorSvc
 Auditor Service. More...
 
BooleanProperty m_auditInit = false
 
bool m_auditorInitialize = false
 flag for auditors in "initialize()" More...
 
bool m_auditorStart = false
 flag for auditors in "start()" More...
 
bool m_auditorStop = false
 flag for auditors in "stop()" More...
 
bool m_auditorFinalize = false
 flag for auditors in "finalize()" More...
 
bool m_auditorReinitialize = false
 flag for auditors in "reinitialize()" More...
 
bool m_auditorRestart = false
 flag for auditors in "restart()" More...
 
Gaudi::StateMachine::State m_state = Gaudi::StateMachine::CONFIGURED
 state of the Tool More...
 
Gaudi::StateMachine::State m_targetState = Gaudi::StateMachine::CONFIGURED
 state of the Tool More...
 

Friends

class ToolSvc
 

Additional Inherited Members

- Protected Attributes inherited from implements< Interfaces >
std::atomic_ulong m_refCount = {0}
 Reference counter. More...
 

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 44 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 51 of file AlgTool.h.

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

Definition at line 51 of file AlgTool.h.

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

Definition at line 573 of file AlgTool.h.

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

Definition at line 573 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 205 of file AlgTool.cpp.

209  : m_type ( type )
210  , m_name ( name )
211  , m_parent ( parent )
212  , m_propertyMgr ( new PropertyMgr() )
213 {
214  addRef(); // Initial count set to 1
215 
216  declareProperty( "MonitorService", m_monitorSvcName = "MonitorSvc" );
217 
218  { // get the "OutputLevel" property from parent
219  const Property* _p = Gaudi::Utils::getProperty ( parent , "OutputLevel") ;
220  if ( _p ) { m_outputLevel.assign( *_p ) ; }
221  declareProperty ( "OutputLevel" , m_outputLevel ) ;
223  }
224 
225  IInterface* _p = const_cast<IInterface*> ( parent ) ;
226 
227  if ( Algorithm* _alg = dynamic_cast<Algorithm*> ( _p ) )
228  {
229  m_svcLocator = _alg -> serviceLocator () ;
230  m_messageSvc = _alg -> msgSvc () ;
231  m_threadID = getGaudiThreadIDfromName ( _alg -> name() ) ;
232  }
233  else if ( Service* _svc = dynamic_cast<Service*> ( _p ) )
234  {
235  m_svcLocator = _svc -> serviceLocator () ;
236  m_messageSvc = _svc -> msgSvc () ;
237  m_threadID = getGaudiThreadIDfromName ( _svc -> name() ) ;
238  }
239  else if ( AlgTool* _too = dynamic_cast<AlgTool*> ( _p ) )
240  {
241  m_svcLocator = _too -> serviceLocator ();
242  m_messageSvc = _too -> msgSvc ();
244  }
245  else if ( Auditor* _aud = dynamic_cast<Auditor*> ( _p ) )
246  {
247  m_svcLocator = _aud -> serviceLocator() ;
248  m_messageSvc = _aud -> msgSvc() ;
249  m_threadID = getGaudiThreadIDfromName ( _aud -> name() ) ;
250  }
251  else
252  {
253  throw GaudiException
254  ( "Failure to create tool '"
255  + type + "/" + name + "': illegal parent type '"
256  + System::typeinfoName(typeid(*_p)) + "'", "AlgTool", 0 );
257  }
258 
259 
260  { // audit tools
261  auto appMgr = m_svcLocator->service<IProperty>("ApplicationMgr");
262  if ( !appMgr ) {
263  throw GaudiException("Could not locate ApplicationMgr","AlgTool",0);
264  }
265  const Property* p = Gaudi::Utils::getProperty( appMgr , "AuditTools");
266  if ( p ) { m_auditInit.assign ( *p ) ; }
267  declareProperty ( "AuditTools", m_auditInit );
268  bool audit = m_auditInit.value();
269  // Declare common AlgTool properties with their defaults
270  declareProperty ( "AuditInitialize" , m_auditorInitialize = audit ) ;
271  declareProperty ( "AuditStart" , m_auditorStart = audit ) ;
272  declareProperty ( "AuditStop" , m_auditorStop = audit ) ;
273  declareProperty ( "AuditFinalize" , m_auditorFinalize = audit ) ;
274  }
275 
276  // check thread ID and try if tool name indicates thread ID
277  if ( m_threadID.empty() )
279 }
void initOutputLevel(Property &prop)
callback for output level property
Definition: AlgTool.cpp:577
Define general base for Gaudi exception.
GAUDI_API std::string getGaudiThreadIDfromName(const std::string &name)
helper function to extract Gaudi Thread ID from thread copy name
Definition: ThreadGaudi.cpp:26
std::string m_type
AlgTool type (concrete class name)
Definition: AlgTool.h:575
virtual Property & declareUpdateHandler(std::function< void(Property &)> fun)
set new callback for update
Definition: Property.cpp:72
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:297
IMessageSvc * m_messageSvc
Message service.
Definition: AlgTool.h:579
IntegerProperty m_outputLevel
AlgTool output level.
Definition: AlgTool.h:574
Property manager helper class.
Definition: PropertyMgr.h:35
ISvcLocator * serviceLocator() const
Retrieve pointer to service locator.
Definition: AlgTool.cpp:85
std::string m_monitorSvcName
Name to use for Monitor Service.
Definition: AlgTool.h:583
const std::string m_name
AlgTool full name.
Definition: AlgTool.h:576
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
IMessageSvc * msgSvc() const
Retrieve pointer to message service.
Definition: AlgTool.cpp:92
unsigned long addRef() override
Reference Interface instance.
Definition: implements.h:44
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: AlgTool.h:249
Definition of the basic interface.
Definition: IInterface.h:234
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:584
std::string m_threadID
Thread Id for Alg Tool.
Definition: AlgTool.h:586
const IInterface * m_parent
AlgTool parent.
Definition: AlgTool.h:577
const TYPE & value() const
explicit conversion
Definition: Property.h:341
GAUDI_API Property * getProperty(const IProperty *p, const std::string &name)
simple function which gets the property with given name from the component
Definition: Property.cpp:278
bool m_auditorFinalize
flag for auditors in "finalize()"
Definition: AlgTool.h:612
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:77
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
bool assign(const Property &source) override
get the value from another property
Definition: Property.h:269
Base class from which all the concrete tool classes should be derived.
Definition: AlgTool.h:44
ISvcLocator * m_svcLocator
Pointer to Service Locator service.
Definition: AlgTool.h:578
tuple appMgr
Definition: IOTest.py:83
const std::string & type() const override
Retrieve type (concrete class) of the sub-algtool.
Definition: AlgTool.cpp:71
BooleanProperty m_auditInit
Definition: AlgTool.h:608
bool m_auditorStart
flag for auditors in "start()"
Definition: AlgTool.h:610
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:21
Base class for all services.
Definition: Service.h:35
bool m_auditorStop
flag for auditors in "stop()"
Definition: AlgTool.h:611
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
bool m_auditorInitialize
flag for auditors in "initialize()"
Definition: AlgTool.h:609
Base class from which all concrete auditor classes should be derived.
Definition: Auditor.h:34
const IInterface * parent() const override
Retrieve parent of the sub-algtool.
Definition: AlgTool.cpp:78
AlgTool::~AlgTool ( )
overrideprotected

Definition at line 494 of file AlgTool.cpp.

496 {
497  if( m_pMonitorSvc ) { m_pMonitorSvc->undeclareAll(this); }
498 }
SmartIF< IMonitorSvc > m_pMonitorSvc
Online Monitoring Service.
Definition: AlgTool.h:582
virtual void undeclareAll(const IInterface *owner)=0
Undeclare monitoring information.
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
AlgTool::~AlgTool ( )
overrideprotected

Member Function Documentation

IAuditorSvc * AlgTool::auditorSvc ( ) const

Access the auditor service.

Definition at line 564 of file AlgTool.cpp.

564  {
565 //---------------------------------------------------------------------------
566  if ( !m_pAuditorSvc ) {
567  m_pAuditorSvc = service( "AuditorSvc", true );
568  if( !m_pAuditorSvc ) {
569  throw GaudiException("Service [AuditorSvc] not found", name(), StatusCode::FAILURE);
570  }
571  }
572  return m_pAuditorSvc.get();
573 }
Define general base for Gaudi exception.
SmartIF< IAuditorSvc > m_pAuditorSvc
Auditor Service.
Definition: AlgTool.h:606
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
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.
Definition: AlgTool.h:195
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
IAuditorSvc* AlgTool::auditorSvc ( ) const

Access the auditor service.

StatusCode AlgTool::configure ( )
inlineoverride

Definition at line 67 of file AlgTool.h.

StatusCode AlgTool::configure ( )
inlineoverride

Definition at line 67 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 529 of file AlgTool.h.

532  {
533  IMonitorSvc* mS = monitorSvc();
534  if ( mS ) mS->declareInfo(name, var, desc, this);
535  }
IMonitorSvc * monitorSvc() const
Access the monitor service.
Definition: AlgTool.h:516
Definition of the IMonitorSvc interface, which publishes Gaudi variables to outside monitoring proces...
Definition: IMonitorSvc.h:21
virtual void declareInfo(const std::string &name, const bool &var, const std::string &desc, const IInterface *owner)=0
Declare monitoring information.
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
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 529 of file AlgTool.h.

532  {
533  IMonitorSvc* mS = monitorSvc();
534  if ( mS ) mS->declareInfo(name, var, desc, this);
535  }
IMonitorSvc * monitorSvc() const
Access the monitor service.
Definition: AlgTool.h:516
Definition of the IMonitorSvc interface, which publishes Gaudi variables to outside monitoring proces...
Definition: IMonitorSvc.h:21
virtual void declareInfo(const std::string &name, const bool &var, const std::string &desc, const IInterface *owner)=0
Declare monitoring information.
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
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 544 of file AlgTool.h.

549  {
550  IMonitorSvc* mS = monitorSvc();
551  if ( mS ) mS->declareInfo(name, format, var, size, desc, this);
552  }
IMonitorSvc * monitorSvc() const
Access the monitor service.
Definition: AlgTool.h:516
Definition of the IMonitorSvc interface, which publishes Gaudi variables to outside monitoring proces...
Definition: IMonitorSvc.h:21
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
virtual void declareInfo(const std::string &name, const bool &var, const std::string &desc, const IInterface *owner)=0
Declare monitoring information.
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
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 544 of file AlgTool.h.

549  {
550  IMonitorSvc* mS = monitorSvc();
551  if ( mS ) mS->declareInfo(name, format, var, size, desc, this);
552  }
IMonitorSvc * monitorSvc() const
Access the monitor service.
Definition: AlgTool.h:516
Definition of the IMonitorSvc interface, which publishes Gaudi variables to outside monitoring proces...
Definition: IMonitorSvc.h:21
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
virtual void declareInfo(const std::string &name, const bool &var, const std::string &desc, const IInterface *owner)=0
Declare monitoring information.
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
template<class T >
StatusCode AlgTool::declareInput ( const std::string &  propertyName,
DataObjectHandle< T > &  handle,
const std::string &  address = DataObjectDescriptor::NULL_,
bool  optional = false,
MinimalDataObjectHandle::AccessType  accessType = MinimalDataObjectHandle::READ 
)
inline

Declare input data object.

Parameters
propertyNameto identify input object in python config
handledata handle
addressrelative or absolute address in TES
optionaloptional input
accessTyperead, write or update

Definition at line 274 of file AlgTool.h.

277  {
278 
279  bool res = m_inputDataObjects.insert(propertyName, &handle);
280 
281  handle.descriptor()->setTag(propertyName);
282  handle.descriptor()->setAddress(address);
283  handle.descriptor()->setAccessType(accessType);
284  handle.descriptor()->setOptional(optional);
285 
286  handle.setOwner(this);
287 
288  MsgStream log(msgSvc(), name());
289 
290  if (LIKELY(res)) {
291  log << MSG::DEBUG << "Handle for " << propertyName << " ("
292  << address << ")" << " successfully created and stored."
293  << endmsg;
294  } else {
295  log << MSG::ERROR << "Handle for " << propertyName << " ("
296  << address << ")" << " could not be created." << endmsg;
297  }
298 
299  return res;
300 
301  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
DataObjectDescriptor * descriptor()
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
void setTag(const std::string &tag)
IMessageSvc * msgSvc() const
Retrieve pointer to message service.
Definition: AlgTool.cpp:92
void setAddress(const std::string &address)
void setOptional(bool optional)
bool insert(const std::string &tag, MinimalDataObjectHandle *descriptor)
void setAccessType(MinimalDataObjectHandle::AccessType accessType)
void setOwner(IAlgorithm *fatherAlg)
#define LIKELY(x)
Definition: Kernel.h:125
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
DataObjectDescriptorCollection m_inputDataObjects
Definition: AlgTool.h:588
template<class T >
StatusCode AlgTool::declareInput ( const std::string &  propertyName,
DataObjectHandle< T > &  handle,
const std::string &  address = DataObjectDescriptor::NULL_,
bool  optional = false,
MinimalDataObjectHandle::AccessType  accessType = MinimalDataObjectHandle::READ 
)
inline

Declare input data object.

Parameters
propertyNameto identify input object in python config
handledata handle
addressrelative or absolute address in TES
optionaloptional input
accessTyperead, write or update

Definition at line 274 of file AlgTool.h.

277  {
278 
279  bool res = m_inputDataObjects.insert(propertyName, &handle);
280 
281  handle.descriptor()->setTag(propertyName);
282  handle.descriptor()->setAddress(address);
283  handle.descriptor()->setAccessType(accessType);
284  handle.descriptor()->setOptional(optional);
285 
286  handle.setOwner(this);
287 
288  MsgStream log(msgSvc(), name());
289 
290  if (LIKELY(res)) {
291  log << MSG::DEBUG << "Handle for " << propertyName << " ("
292  << address << ")" << " successfully created and stored."
293  << endmsg;
294  } else {
295  log << MSG::ERROR << "Handle for " << propertyName << " ("
296  << address << ")" << " could not be created." << endmsg;
297  }
298 
299  return res;
300 
301  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
DataObjectDescriptor * descriptor()
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
void setTag(const std::string &tag)
IMessageSvc * msgSvc() const
Retrieve pointer to message service.
Definition: AlgTool.cpp:92
void setAddress(const std::string &address)
void setOptional(bool optional)
bool insert(const std::string &tag, MinimalDataObjectHandle *descriptor)
void setAccessType(MinimalDataObjectHandle::AccessType accessType)
void setOwner(IAlgorithm *fatherAlg)
#define LIKELY(x)
Definition: Kernel.h:125
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
DataObjectDescriptorCollection m_inputDataObjects
Definition: AlgTool.h:588
template<class T >
StatusCode AlgTool::declareInput ( const std::string &  propertyName,
DataObjectHandle< T > &  handle,
const std::vector< std::string > &  addresses,
bool  optional = false,
MinimalDataObjectHandle::AccessType  accessType = MinimalDataObjectHandle::READ 
)
inline

Declare input data object.

Parameters
propertyNameto identify input object in python config
handledata handle
addressesrelative or absolute addresses in TES, first is main address
optionaloptional input
accessTyperead, write or update

Definition at line 313 of file AlgTool.h.

316  {
317 
318  bool res = m_inputDataObjects.insert(propertyName, &handle);
319 
320  handle.descriptor()->setTag(propertyName);
321  handle.descriptor()->setAddresses(addresses);
322  handle.descriptor()->setAccessType(accessType);
323  handle.descriptor()->setOptional(optional);
324 
325  handle.setOwner(this);
326 
327  MsgStream log(msgSvc(), name());
328 
329  if (LIKELY(res)) {
330  log << MSG::DEBUG << "Handle for " << propertyName << " ("
331  << (addresses.empty() ? DataObjectDescriptor::NULL_ : addresses[0]) << ")" << " successfully created and stored."
332  << endmsg;
333  } else {
334  log << MSG::ERROR << "Handle for " << propertyName << " ("
335  << (addresses.empty() ? DataObjectDescriptor::NULL_ : addresses[0]) << ")" << " could not be created." << endmsg;
336  }
337 
338  return res;
339 
340  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
DataObjectDescriptor * descriptor()
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
void setTag(const std::string &tag)
IMessageSvc * msgSvc() const
Retrieve pointer to message service.
Definition: AlgTool.cpp:92
void setAddresses(const std::vector< std::string > &address)
void setOptional(bool optional)
bool insert(const std::string &tag, MinimalDataObjectHandle *descriptor)
void setAccessType(MinimalDataObjectHandle::AccessType accessType)
static const std::string NULL_
void setOwner(IAlgorithm *fatherAlg)
#define LIKELY(x)
Definition: Kernel.h:125
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
DataObjectDescriptorCollection m_inputDataObjects
Definition: AlgTool.h:588
template<class T >
StatusCode AlgTool::declareInput ( const std::string &  propertyName,
DataObjectHandle< T > &  handle,
const std::vector< std::string > &  addresses,
bool  optional = false,
MinimalDataObjectHandle::AccessType  accessType = MinimalDataObjectHandle::READ 
)
inline

Declare input data object.

Parameters
propertyNameto identify input object in python config
handledata handle
addressesrelative or absolute addresses in TES, first is main address
optionaloptional input
accessTyperead, write or update

Definition at line 313 of file AlgTool.h.

316  {
317 
318  bool res = m_inputDataObjects.insert(propertyName, &handle);
319 
320  handle.descriptor()->setTag(propertyName);
321  handle.descriptor()->setAddresses(addresses);
322  handle.descriptor()->setAccessType(accessType);
323  handle.descriptor()->setOptional(optional);
324 
325  handle.setOwner(this);
326 
327  MsgStream log(msgSvc(), name());
328 
329  if (LIKELY(res)) {
330  log << MSG::DEBUG << "Handle for " << propertyName << " ("
331  << (addresses.empty() ? DataObjectDescriptor::NULL_ : addresses[0]) << ")" << " successfully created and stored."
332  << endmsg;
333  } else {
334  log << MSG::ERROR << "Handle for " << propertyName << " ("
335  << (addresses.empty() ? DataObjectDescriptor::NULL_ : addresses[0]) << ")" << " could not be created." << endmsg;
336  }
337 
338  return res;
339 
340  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
DataObjectDescriptor * descriptor()
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
void setTag(const std::string &tag)
IMessageSvc * msgSvc() const
Retrieve pointer to message service.
Definition: AlgTool.cpp:92
void setAddresses(const std::vector< std::string > &address)
void setOptional(bool optional)
bool insert(const std::string &tag, MinimalDataObjectHandle *descriptor)
void setAccessType(MinimalDataObjectHandle::AccessType accessType)
static const std::string NULL_
void setOwner(IAlgorithm *fatherAlg)
#define LIKELY(x)
Definition: Kernel.h:125
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
DataObjectDescriptorCollection m_inputDataObjects
Definition: AlgTool.h:588
template<typename I >
void AlgTool::declareInterface ( I *  i)
inlineprotected

Definition at line 215 of file AlgTool.h.

215 { m_interfaceList.emplace_back( I::interfaceID(), i ); }
InterfaceList m_interfaceList
Interface list.
Definition: AlgTool.h:585
list i
Definition: ana.py:128
template<typename I >
void AlgTool::declareInterface ( I *  i)
inlineprotected

Definition at line 215 of file AlgTool.h.

215 { m_interfaceList.emplace_back( I::interfaceID(), i ); }
InterfaceList m_interfaceList
Interface list.
Definition: AlgTool.h:585
list i
Definition: ana.py:128
template<class T >
StatusCode AlgTool::declareOutput ( const std::string &  propertyName,
DataObjectHandle< T > &  handle,
const std::string &  address = DataObjectDescriptor::NULL_,
bool  optional = false,
MinimalDataObjectHandle::AccessType  accessType = MinimalDataObjectHandle::WRITE 
)
inline

Declare output data object.

Parameters
propertyNameto identify input object in python config
handledata handle
addressrelative or absolute address in TES
optionaloptional input
accessTypewrite or update

Definition at line 351 of file AlgTool.h.

354  {
355 
356  bool res = m_outputDataObjects.insert(propertyName, &handle);
357 
358  handle.descriptor()->setTag(propertyName);
359  handle.descriptor()->setAddress(address);
360  handle.descriptor()->setAccessType(accessType);
361  handle.descriptor()->setOptional(optional);
362 
363  handle.setOwner(this);
364 
365  MsgStream log(msgSvc(), name());
366 
367  if (LIKELY(res)) {
368  log << MSG::DEBUG << "Handle for " << propertyName << " ("
369  << address << ")" << " successfully created and stored."
370  << endmsg;
371  } else {
372  log << MSG::ERROR << "Handle for " << propertyName << " ("
373  << address << ")" << " could not be created." << endmsg;
374  }
375 
376  return res;
377 
378  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
DataObjectDescriptor * descriptor()
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
void setTag(const std::string &tag)
DataObjectDescriptorCollection m_outputDataObjects
Definition: AlgTool.h:589
IMessageSvc * msgSvc() const
Retrieve pointer to message service.
Definition: AlgTool.cpp:92
void setAddress(const std::string &address)
void setOptional(bool optional)
bool insert(const std::string &tag, MinimalDataObjectHandle *descriptor)
void setAccessType(MinimalDataObjectHandle::AccessType accessType)
void setOwner(IAlgorithm *fatherAlg)
#define LIKELY(x)
Definition: Kernel.h:125
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
template<class T >
StatusCode AlgTool::declareOutput ( const std::string &  propertyName,
DataObjectHandle< T > &  handle,
const std::string &  address = DataObjectDescriptor::NULL_,
bool  optional = false,
MinimalDataObjectHandle::AccessType  accessType = MinimalDataObjectHandle::WRITE 
)
inline

Declare output data object.

Parameters
propertyNameto identify input object in python config
handledata handle
addressrelative or absolute address in TES
optionaloptional input
accessTypewrite or update

Definition at line 351 of file AlgTool.h.

354  {
355 
356  bool res = m_outputDataObjects.insert(propertyName, &handle);
357 
358  handle.descriptor()->setTag(propertyName);
359  handle.descriptor()->setAddress(address);
360  handle.descriptor()->setAccessType(accessType);
361  handle.descriptor()->setOptional(optional);
362 
363  handle.setOwner(this);
364 
365  MsgStream log(msgSvc(), name());
366 
367  if (LIKELY(res)) {
368  log << MSG::DEBUG << "Handle for " << propertyName << " ("
369  << address << ")" << " successfully created and stored."
370  << endmsg;
371  } else {
372  log << MSG::ERROR << "Handle for " << propertyName << " ("
373  << address << ")" << " could not be created." << endmsg;
374  }
375 
376  return res;
377 
378  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
DataObjectDescriptor * descriptor()
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
void setTag(const std::string &tag)
DataObjectDescriptorCollection m_outputDataObjects
Definition: AlgTool.h:589
IMessageSvc * msgSvc() const
Retrieve pointer to message service.
Definition: AlgTool.cpp:92
void setAddress(const std::string &address)
void setOptional(bool optional)
bool insert(const std::string &tag, MinimalDataObjectHandle *descriptor)
void setAccessType(MinimalDataObjectHandle::AccessType accessType)
void setOwner(IAlgorithm *fatherAlg)
#define LIKELY(x)
Definition: Kernel.h:125
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
template<class T >
StatusCode AlgTool::declarePrivateTool ( ToolHandle< T > &  handle,
std::string  toolTypeAndName = "",
bool  createIf = true 
)
inline

Declare used private tool.

Parameters
handleToolHandle<T>
toolTypeAndName
parent,defaultpublic tool
createif necessary, default true

Definition at line 459 of file AlgTool.h.

460  {
461 
462  if (toolTypeAndName == "")
463  toolTypeAndName = System::typeinfoName(typeid(T));
464 
465  StatusCode sc = handle.initialize(toolTypeAndName, this, createIf);
466 
467  m_toolHandles.push_back(&handle);
468 
469  MsgStream log(msgSvc(), name());
470 
471  if (sc.isSuccess()) {
472  log << MSG::DEBUG << "Handle for private tool" << toolTypeAndName
473  << " successfully created and stored." << endmsg;
474  } else {
475 
476  log << MSG::ERROR << "Handle for private tool" << toolTypeAndName
477  << " could not be created." << endmsg;
478  }
479 
480  return sc;
481 
482  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
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:76
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:297
std::vector< BaseToolHandle * > m_toolHandles
Definition: AlgTool.h:593
IMessageSvc * msgSvc() const
Retrieve pointer to message service.
Definition: AlgTool.cpp:92
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode initialize(const std::string &toolTypeAndName, const IInterface *parent=nullptr, bool createIf=true)
Definition: ToolHandle.h:156
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
template<class T >
StatusCode AlgTool::declarePrivateTool ( ToolHandle< T > &  handle,
std::string  toolTypeAndName = "",
bool  createIf = true 
)
inline

Declare used private tool.

Parameters
handleToolHandle<T>
toolTypeAndName
parent,defaultpublic tool
createif necessary, default true

Definition at line 459 of file AlgTool.h.

460  {
461 
462  if (toolTypeAndName == "")
463  toolTypeAndName = System::typeinfoName(typeid(T));
464 
465  StatusCode sc = handle.initialize(toolTypeAndName, this, createIf);
466 
467  m_toolHandles.push_back(&handle);
468 
469  MsgStream log(msgSvc(), name());
470 
471  if (sc.isSuccess()) {
472  log << MSG::DEBUG << "Handle for private tool" << toolTypeAndName
473  << " successfully created and stored." << endmsg;
474  } else {
475 
476  log << MSG::ERROR << "Handle for private tool" << toolTypeAndName
477  << " could not be created." << endmsg;
478  }
479 
480  return sc;
481 
482  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
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:76
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:297
std::vector< BaseToolHandle * > m_toolHandles
Definition: AlgTool.h:593
IMessageSvc * msgSvc() const
Retrieve pointer to message service.
Definition: AlgTool.cpp:92
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode initialize(const std::string &toolTypeAndName, const IInterface *parent=nullptr, bool createIf=true)
Definition: ToolHandle.h:156
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
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 249 of file AlgTool.h.

252  {
253  return m_propertyMgr -> declareProperty ( name , property , doc ) ;
254  }
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: AlgTool.h:249
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:584
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
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 249 of file AlgTool.h.

252  {
253  return m_propertyMgr -> declareProperty ( name , property , doc ) ;
254  }
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: AlgTool.h:249
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:584
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
template<class T >
StatusCode AlgTool::declarePublicTool ( ToolHandle< T > &  handle,
std::string  toolTypeAndName = "",
bool  createIf = true 
)
inline

Declare used public tool.

Parameters
handleToolHandle<T>
toolTypeAndName
parent,defaultpublic tool
createif necessary, default true

Definition at line 426 of file AlgTool.h.

427  {
428 
429  if (toolTypeAndName == "")
430  toolTypeAndName = System::typeinfoName(typeid(T));
431 
432  StatusCode sc = handle.initialize(toolTypeAndName, 0, createIf);
433 
434  m_toolHandles.push_back(&handle);
435 
436  MsgStream log(msgSvc(), name());
437 
438  if (sc.isSuccess()) {
439  log << MSG::DEBUG << "Handle for public tool" << toolTypeAndName
440  << " successfully created and stored." << endmsg;
441  } else {
442 
443  log << MSG::ERROR << "Handle for public tool" << toolTypeAndName
444  << " could not be created." << endmsg;
445  }
446 
447  return sc;
448 
449  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
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:76
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:297
std::vector< BaseToolHandle * > m_toolHandles
Definition: AlgTool.h:593
IMessageSvc * msgSvc() const
Retrieve pointer to message service.
Definition: AlgTool.cpp:92
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode initialize(const std::string &toolTypeAndName, const IInterface *parent=nullptr, bool createIf=true)
Definition: ToolHandle.h:156
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
template<class T >
StatusCode AlgTool::declarePublicTool ( ToolHandle< T > &  handle,
std::string  toolTypeAndName = "",
bool  createIf = true 
)
inline

Declare used public tool.

Parameters
handleToolHandle<T>
toolTypeAndName
parent,defaultpublic tool
createif necessary, default true

Definition at line 426 of file AlgTool.h.

427  {
428 
429  if (toolTypeAndName == "")
430  toolTypeAndName = System::typeinfoName(typeid(T));
431 
432  StatusCode sc = handle.initialize(toolTypeAndName, 0, createIf);
433 
434  m_toolHandles.push_back(&handle);
435 
436  MsgStream log(msgSvc(), name());
437 
438  if (sc.isSuccess()) {
439  log << MSG::DEBUG << "Handle for public tool" << toolTypeAndName
440  << " successfully created and stored." << endmsg;
441  } else {
442 
443  log << MSG::ERROR << "Handle for public tool" << toolTypeAndName
444  << " could not be created." << endmsg;
445  }
446 
447  return sc;
448 
449  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
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:76
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:297
std::vector< BaseToolHandle * > m_toolHandles
Definition: AlgTool.h:593
IMessageSvc * msgSvc() const
Retrieve pointer to message service.
Definition: AlgTool.cpp:92
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode initialize(const std::string &toolTypeAndName, const IInterface *parent=nullptr, bool createIf=true)
Definition: ToolHandle.h:156
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
Property* AlgTool::declareRemoteProperty ( const std::string &  name,
IProperty rsvc,
const std::string &  rname = "" 
) const
inline

Declare remote named properties.

Definition at line 257 of file AlgTool.h.

260  {
261  return m_propertyMgr-> declareRemoteProperty ( name , rsvc , rname ) ;
262  }
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:584
Property * declareRemoteProperty(const std::string &name, IProperty *rsvc, const std::string &rname="") const
Declare remote named properties.
Definition: AlgTool.h:257
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
Property* AlgTool::declareRemoteProperty ( const std::string &  name,
IProperty rsvc,
const std::string &  rname = "" 
) const
inline

Declare remote named properties.

Definition at line 257 of file AlgTool.h.

260  {
261  return m_propertyMgr-> declareRemoteProperty ( name , rsvc , rname ) ;
262  }
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:584
Property * declareRemoteProperty(const std::string &name, IProperty *rsvc, const std::string &rname="") const
Declare remote named properties.
Definition: AlgTool.h:257
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
void AlgTool::deregisterTool ( IAlgTool tool) const
inline

Definition at line 403 of file AlgTool.h.

403  {
404  std::vector<IAlgTool *>::iterator it = std::find(m_tools.begin(),
405  m_tools.end(), tool);
406 
407  MsgStream log(msgSvc(), name());
408  if (it != m_tools.end()) {
409  log << MSG::DEBUG << "De-Registering tool " << tool->name()
410  << endmsg;
411  m_tools.erase(it);
412  } else {
413  log << MSG::DEBUG << "Could not de-register tool " << tool->name()
414  << endmsg;
415  }
416  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
std::vector< IAlgTool * > m_tools
Definition: AlgTool.h:592
IMessageSvc * msgSvc() const
Retrieve pointer to message service.
Definition: AlgTool.cpp:92
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
void AlgTool::deregisterTool ( IAlgTool tool) const
inline

Definition at line 403 of file AlgTool.h.

403  {
404  std::vector<IAlgTool *>::iterator it = std::find(m_tools.begin(),
405  m_tools.end(), tool);
406 
407  MsgStream log(msgSvc(), name());
408  if (it != m_tools.end()) {
409  log << MSG::DEBUG << "De-Registering tool " << tool->name()
410  << endmsg;
411  m_tools.erase(it);
412  } else {
413  log << MSG::DEBUG << "Could not de-register tool " << tool->name()
414  << endmsg;
415  }
416  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
std::vector< IAlgTool * > m_tools
Definition: AlgTool.h:592
IMessageSvc * msgSvc() const
Retrieve pointer to message service.
Definition: AlgTool.cpp:92
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
IDataProviderSvc * AlgTool::evtSvc ( ) const

accessor to event service service

Returns
pointer to detector service

Definition at line 101 of file AlgTool.cpp.

102 {
103  if ( !m_evtSvc ) {
104  m_evtSvc = service("EventDataSvc", true);
105  if ( !m_evtSvc ) {
106  throw GaudiException("Service [EventDataSvc] not found", name(), StatusCode::FAILURE);
107  }
108  }
109  return m_evtSvc.get();
110 }
Define general base for Gaudi exception.
SmartIF< IDataProviderSvc > m_evtSvc
Event data service.
Definition: AlgTool.h:580
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
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.
Definition: AlgTool.h:195
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
IDataProviderSvc* AlgTool::evtSvc ( ) const

accessor to event service service

Returns
pointer to detector service
StatusCode AlgTool::finalize ( )
override

Definition at line 395 of file AlgTool.cpp.

397 {
398  // For the time being there is nothing to be done here.
399  return StatusCode::SUCCESS;
400 }
StatusCode AlgTool::finalize ( )
override
Gaudi::StateMachine::State AlgTool::FSMState ( ) const
inlineoverride

Definition at line 75 of file AlgTool.h.

75 { return m_state; }
Gaudi::StateMachine::State m_state
state of the Tool
Definition: AlgTool.h:616
Gaudi::StateMachine::State AlgTool::FSMState ( ) const
inlineoverride

Definition at line 75 of file AlgTool.h.

75 { return m_state; }
Gaudi::StateMachine::State m_state
state of the Tool
Definition: AlgTool.h:616
const std::vector<Property*>& AlgTool::getProperties ( ) const
override
const std::vector< Property * > & AlgTool::getProperties ( ) const
override

Definition at line 166 of file AlgTool.cpp.

168 {
169  return m_propertyMgr->getProperties();
170 }
const std::vector< Property * > & getProperties() const override
get all properties
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:584
StatusCode AlgTool::getProperty ( Property p) const
override
StatusCode AlgTool::getProperty ( Property p) const
override

Definition at line 146 of file AlgTool.cpp.

148 {
149  return m_propertyMgr->getProperty(p);
150 }
StatusCode getProperty(Property *p) const override
get the property
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:584
const Property& AlgTool::getProperty ( const std::string &  name) const
override
const Property & AlgTool::getProperty ( const std::string &  name) const
override

Definition at line 153 of file AlgTool.cpp.

154 {
155  return m_propertyMgr->getProperty(n);
156 }
StatusCode getProperty(Property *p) const override
get the property
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:584
StatusCode AlgTool::getProperty ( const std::string &  n,
std::string &  v 
) const
override
StatusCode AlgTool::getProperty ( const std::string &  n,
std::string &  v 
) const
override

Definition at line 159 of file AlgTool.cpp.

161 {
162  return m_propertyMgr->getProperty(n,v);
163 }
StatusCode getProperty(Property *p) const override
get the property
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:584
PropertyMgr* AlgTool::getPropertyMgr ( )
inline

Definition at line 106 of file AlgTool.h.

106 { return m_propertyMgr.get(); }
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:584
PropertyMgr* AlgTool::getPropertyMgr ( )
inline

Definition at line 106 of file AlgTool.h.

106 { return m_propertyMgr.get(); }
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:584
bool AlgTool::hasProperty ( const std::string &  name) const
override
bool AlgTool::hasProperty ( const std::string &  name) const
override

Definition at line 172 of file AlgTool.cpp.

172  {
173  return m_propertyMgr->hasProperty(name);
174 }
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:584
bool hasProperty(const std::string &name) const override
Return true if we have a property with the given name.
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
StatusCode AlgTool::initialize ( )
override
StatusCode AlgTool::initialize ( )
override

Definition at line 325 of file AlgTool.cpp.

327 {
328  // For the time being there is nothing to be done here.
329  // Setting the properties is done by the ToolSvc calling setProperties()
330  // explicitly.
331  return StatusCode::SUCCESS;
332 }
void AlgTool::initOutputLevel ( Property prop)
protected

callback for output level property

void AlgTool::initOutputLevel ( Property prop)
protected

callback for output level property

Definition at line 577 of file AlgTool.cpp.

577  {
578 //-----------------------------------------------------------------------------
579  // do nothing... yet ?
580 }
void AlgTool::initToolHandles ( ) const
private

Definition at line 501 of file AlgTool.cpp.

501  {
502 
503  MsgStream log ( msgSvc() , name() ) ;
504 
505  for(auto th : m_toolHandles){
506  IAlgTool * tool = nullptr;
507 
508  //if(th->retrieve().isFailure())
509  //log << MSG::DEBUG << "Error in retrieving tool from ToolHandle" << endmsg;
510 
511  //get generic tool interface from ToolHandle
512  if(th->retrieve(tool).isSuccess() && tool != nullptr){
513  m_tools.push_back(tool);
514  log << MSG::DEBUG << "Adding ToolHandle tool " << tool->name() << " (" << tool->type() << ")" << endmsg;
515  } else {
516  log << MSG::DEBUG << "Trying to add nullptr tool" << endmsg;
517  }
518  }
519 
520  m_toolHandlesInit = true;
521 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
bool m_toolHandlesInit
Definition: AlgTool.h:594
std::vector< BaseToolHandle * > m_toolHandles
Definition: AlgTool.h:593
std::vector< IAlgTool * > m_tools
Definition: AlgTool.h:592
IMessageSvc * msgSvc() const
Retrieve pointer to message service.
Definition: AlgTool.cpp:92
virtual const std::string & type() const =0
The type of an AlgTool, meaning the concrete AlgTool class.
The interface implemented by the AlgTool base class.
Definition: IAlgTool.h:23
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
void AlgTool::initToolHandles ( ) const
private
const DataObjectDescriptorCollection& AlgTool::inputDataObjects ( ) const
inlineoverride

get inputs

Returns
DataObjectDescriptorCollection of inputs

Definition at line 384 of file AlgTool.h.

384  {
385  return m_inputDataObjects;
386  }
DataObjectDescriptorCollection m_inputDataObjects
Definition: AlgTool.h:588
const DataObjectDescriptorCollection& AlgTool::inputDataObjects ( ) const
inlineoverride

get inputs

Returns
DataObjectDescriptorCollection of inputs

Definition at line 384 of file AlgTool.h.

384  {
385  return m_inputDataObjects;
386  }
DataObjectDescriptorCollection m_inputDataObjects
Definition: AlgTool.h:588
DataObjectDescriptorCollection& AlgTool::inputDataObjects ( )
inlineprotected

Definition at line 488 of file AlgTool.h.

488  {
489  return m_inputDataObjects;
490  }
DataObjectDescriptorCollection m_inputDataObjects
Definition: AlgTool.h:588
DataObjectDescriptorCollection& AlgTool::inputDataObjects ( )
inlineprotected

Definition at line 488 of file AlgTool.h.

488  {
489  return m_inputDataObjects;
490  }
DataObjectDescriptorCollection m_inputDataObjects
Definition: AlgTool.h:588
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 516 of file AlgTool.h.

517  {
518  // If not already located try to locate it without forcing a creation
519  if ( !m_pMonitorSvc ) m_pMonitorSvc = service(m_monitorSvcName, false, true);
520  return m_pMonitorSvc.get();
521  }
SmartIF< IMonitorSvc > m_pMonitorSvc
Online Monitoring Service.
Definition: AlgTool.h:582
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
std::string m_monitorSvcName
Name to use for Monitor Service.
Definition: AlgTool.h:583
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.
Definition: AlgTool.h:195
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 516 of file AlgTool.h.

517  {
518  // If not already located try to locate it without forcing a creation
519  if ( !m_pMonitorSvc ) m_pMonitorSvc = service(m_monitorSvcName, false, true);
520  return m_pMonitorSvc.get();
521  }
SmartIF< IMonitorSvc > m_pMonitorSvc
Online Monitoring Service.
Definition: AlgTool.h:582
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
std::string m_monitorSvcName
Name to use for Monitor Service.
Definition: AlgTool.h:583
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.
Definition: AlgTool.h:195
IMessageSvc * AlgTool::msgSvc ( ) const

Retrieve pointer to message service.

Definition at line 92 of file AlgTool.cpp.

94 {
95  return m_messageSvc;
96 }
IMessageSvc * m_messageSvc
Message service.
Definition: AlgTool.h:579
IMessageSvc* AlgTool::msgSvc ( ) const

Retrieve pointer to message service.

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

Retrieve full identifying name of the concrete tool object.

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

Retrieve full identifying name of the concrete tool object.

Definition at line 64 of file AlgTool.cpp.

66 {
67  return m_name;
68 }
const std::string m_name
AlgTool full name.
Definition: AlgTool.h:576
const DataObjectDescriptorCollection& AlgTool::outputDataObjects ( ) const
inlineoverride

get outputs

Returns
DataObjectDescriptorCollection of outputs

Definition at line 392 of file AlgTool.h.

392  {
393  return m_outputDataObjects;
394  }
DataObjectDescriptorCollection m_outputDataObjects
Definition: AlgTool.h:589
const DataObjectDescriptorCollection& AlgTool::outputDataObjects ( ) const
inlineoverride

get outputs

Returns
DataObjectDescriptorCollection of outputs

Definition at line 392 of file AlgTool.h.

392  {
393  return m_outputDataObjects;
394  }
DataObjectDescriptorCollection m_outputDataObjects
Definition: AlgTool.h:589
DataObjectDescriptorCollection& AlgTool::outputDataObjects ( )
inlineprotected

Definition at line 491 of file AlgTool.h.

491  {
492  return m_outputDataObjects;
493  }
DataObjectDescriptorCollection m_outputDataObjects
Definition: AlgTool.h:589
DataObjectDescriptorCollection& AlgTool::outputDataObjects ( )
inlineprotected

Definition at line 491 of file AlgTool.h.

491  {
492  return m_outputDataObjects;
493  }
DataObjectDescriptorCollection m_outputDataObjects
Definition: AlgTool.h:589
int AlgTool::outputLevel ( ) const
inlineprotected

get tool's output level

Definition at line 557 of file AlgTool.h.

557 { return (int)m_outputLevel ; }
IntegerProperty m_outputLevel
AlgTool output level.
Definition: AlgTool.h:574
int AlgTool::outputLevel ( ) const
inlineprotected

get tool's output level

Definition at line 557 of file AlgTool.h.

557 { return (int)m_outputLevel ; }
IntegerProperty m_outputLevel
AlgTool output level.
Definition: AlgTool.h:574
IntegerProperty& AlgTool::outputLevelProperty ( )
inlineprotected

Accessor for the Message level property.

Definition at line 560 of file AlgTool.h.

560 { return m_outputLevel; }
IntegerProperty m_outputLevel
AlgTool output level.
Definition: AlgTool.h:574
IntegerProperty& AlgTool::outputLevelProperty ( )
inlineprotected

Accessor for the Message level property.

Definition at line 560 of file AlgTool.h.

560 { return m_outputLevel; }
IntegerProperty m_outputLevel
AlgTool output level.
Definition: AlgTool.h:574
const IInterface* AlgTool::parent ( ) const
override

Retrieve parent of the sub-algtool.

const IInterface * AlgTool::parent ( ) const
override

Retrieve parent of the sub-algtool.

Definition at line 78 of file AlgTool.cpp.

80 {
81  return m_parent;
82 }
const IInterface * m_parent
AlgTool parent.
Definition: AlgTool.h:577
StatusCode AlgTool::queryInterface ( const InterfaceID riid,
void **  ppvUnknown 
)
override

Query for a given interface.

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

Query for a given interface.

Definition at line 44 of file AlgTool.cpp.

47 {
48  if ( !ppvi ) { return StatusCode::FAILURE ; } // RETURN
50  if (sc.isSuccess()) return sc;
51  auto i = std::find_if( std::begin(m_interfaceList), std::end(m_interfaceList),
52  [&](const std::pair<InterfaceID,void*>& item) {
53  return item.first.versionMatch(riid);
54  } );
55  if ( i == std::end(m_interfaceList) ) {
56  *ppvi = nullptr ;
57  return NO_INTERFACE ; // RETURN
58  }
59  *ppvi = i->second ;
60  addRef() ;
61  return SUCCESS ; // RETURN
62 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
unsigned long addRef() override
Reference Interface instance.
Definition: implements.h:44
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
tuple item
print s1,s2
Definition: ana.py:146
InterfaceList m_interfaceList
Interface list.
Definition: AlgTool.h:585
StatusCode queryInterface(const InterfaceID &ti, void **pp) override
Implementation of IInterface::queryInterface.
Definition: implements.h:22
list i
Definition: ana.py:128
void AlgTool::registerTool ( IAlgTool tool) const
inline

Definition at line 396 of file AlgTool.h.

396  {
397  MsgStream log(msgSvc(), name());
398 
399  log << MSG::DEBUG << "Registering tool " << tool->name() << endmsg;
400  m_tools.push_back(tool);
401  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
std::vector< IAlgTool * > m_tools
Definition: AlgTool.h:592
IMessageSvc * msgSvc() const
Retrieve pointer to message service.
Definition: AlgTool.cpp:92
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
void AlgTool::registerTool ( IAlgTool tool) const
inline

Definition at line 396 of file AlgTool.h.

396  {
397  MsgStream log(msgSvc(), name());
398 
399  log << MSG::DEBUG << "Registering tool " << tool->name() << endmsg;
400  m_tools.push_back(tool);
401  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
std::vector< IAlgTool * > m_tools
Definition: AlgTool.h:592
IMessageSvc * msgSvc() const
Retrieve pointer to message service.
Definition: AlgTool.cpp:92
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
StatusCode AlgTool::reinitialize ( )
override
StatusCode AlgTool::reinitialize ( )
override

Definition at line 426 of file AlgTool.cpp.

428 {
429  /* @TODO
430  * MCl 2008-10-23: the implementation of reinitialize as finalize+initialize
431  * is causing too many problems
432  *
433  // Default implementation is finalize+initialize
434  StatusCode sc = finalize();
435  if (sc.isFailure()) {
436  MsgStream log ( msgSvc(), name() );
437  log << MSG::ERROR << "reinitialize(): cannot be finalized" << endmsg;
438  return sc;
439  }
440  sc = initialize();
441  if (sc.isFailure()) {
442  MsgStream log ( msgSvc(), name() );
443  log << MSG::ERROR << "reinitialize(): cannot be initialized" << endmsg;
444  return sc;
445  }
446  */
447  return StatusCode::SUCCESS;
448 }
StatusCode AlgTool::restart ( )
override
StatusCode AlgTool::restart ( )
override

Definition at line 474 of file AlgTool.cpp.

476 {
477  // Default implementation is stop+start
478  StatusCode sc = stop();
479  if (sc.isFailure()) {
480  MsgStream log ( msgSvc(), name() );
481  log << MSG::ERROR << "restart(): cannot be stopped" << endmsg;
482  return sc;
483  }
484  sc = start();
485  if (sc.isFailure()) {
486  MsgStream log ( msgSvc(), name() );
487  log << MSG::ERROR << "restart(): cannot be started" << endmsg;
488  return sc;
489  }
490  return StatusCode::SUCCESS;
491 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
IMessageSvc * msgSvc() const
Retrieve pointer to message service.
Definition: AlgTool.cpp:92
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode stop() override
Definition: AlgTool.cpp:373
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
StatusCode start() override
Definition: AlgTool.cpp:350
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 195 of file AlgTool.h.

195  {
196  return service_i(name, createIf, T::interfaceID(), (void**)&svc);
197  }
StatusCode service_i(const std::string &algName, bool createIf, const InterfaceID &iid, void **ppSvc) const
flag indicating whether ToolHandle tools have been added to m_tools
Definition: AlgTool.cpp:540
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
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 195 of file AlgTool.h.

195  {
196  return service_i(name, createIf, T::interfaceID(), (void**)&svc);
197  }
StatusCode service_i(const std::string &algName, bool createIf, const InterfaceID &iid, void **ppSvc) const
flag indicating whether ToolHandle tools have been added to m_tools
Definition: AlgTool.cpp:540
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
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 202 of file AlgTool.h.

202  {
203  return service_i(type, name, T::interfaceID(), (void**)&svc);
204  }
StatusCode service_i(const std::string &algName, bool createIf, const InterfaceID &iid, void **ppSvc) const
flag indicating whether ToolHandle tools have been added to m_tools
Definition: AlgTool.cpp:540
const std::string & type() const override
Retrieve type (concrete class) of the sub-algtool.
Definition: AlgTool.cpp:71
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
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 202 of file AlgTool.h.

202  {
203  return service_i(type, name, T::interfaceID(), (void**)&svc);
204  }
StatusCode service_i(const std::string &algName, bool createIf, const InterfaceID &iid, void **ppSvc) const
flag indicating whether ToolHandle tools have been added to m_tools
Definition: AlgTool.cpp:540
const std::string & type() const override
Retrieve type (concrete class) of the sub-algtool.
Definition: AlgTool.cpp:71
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
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 558 of file AlgTool.cpp.

558  {
559  const ServiceLocatorHelper helper(*serviceLocator(), *this);
560  return helper.service(name, quiet, createIf);
561 }
an helper to share the implementation of service() among the various kernel base classes ...
ISvcLocator * serviceLocator() const
Retrieve pointer to service locator.
Definition: AlgTool.cpp:85
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
template<typename T >
SmartIF<T> AlgTool::service ( const std::string &  name,
const bool  createIf = true,
const bool  quiet = false 
) const
inline

Definition at line 210 of file AlgTool.h.

211  { return SmartIF<T>( service(name,createIf,quiet) ); }
Small smart pointer class with automatic reference counting for IInterface.
Definition: IConverter.h:14
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.
Definition: AlgTool.h:195
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
template<typename T >
SmartIF<T> AlgTool::service ( const std::string &  name,
const bool  createIf = true,
const bool  quiet = false 
) const
inline

Definition at line 210 of file AlgTool.h.

211  { return SmartIF<T>( service(name,createIf,quiet) ); }
Small smart pointer class with automatic reference counting for IInterface.
Definition: IConverter.h:14
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.
Definition: AlgTool.h:195
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
StatusCode AlgTool::service_i ( const std::string &  algName,
bool  createIf,
const InterfaceID iid,
void **  ppSvc 
) const
private

flag indicating whether ToolHandle tools have been added to m_tools

implementation of service method

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

flag indicating whether ToolHandle tools have been added to m_tools

implementation of service method

Definition at line 540 of file AlgTool.cpp.

543  {
544  const ServiceLocatorHelper helper(*serviceLocator(), *this);
545  return helper.getService(svcName, createIf, iid, ppSvc);
546 }
an helper to share the implementation of service() among the various kernel base classes ...
ISvcLocator * serviceLocator() const
Retrieve pointer to service locator.
Definition: AlgTool.cpp:85
StatusCode AlgTool::service_i ( const std::string &  svcType,
const std::string &  svcName,
const InterfaceID iid,
void **  ppS 
) const
private

Definition at line 550 of file AlgTool.cpp.

553  {
554  const ServiceLocatorHelper helper(*serviceLocator(), *this);
555  return helper.createService(svcType, svcName, iid, ppSvc);
556 }
an helper to share the implementation of service() among the various kernel base classes ...
ISvcLocator * serviceLocator() const
Retrieve pointer to service locator.
Definition: AlgTool.cpp:85
StatusCode AlgTool::service_i ( const std::string &  svcType,
const std::string &  svcName,
const InterfaceID iid,
void **  ppS 
) const
private
ISvcLocator* AlgTool::serviceLocator ( ) const

Retrieve pointer to service locator.

ISvcLocator * AlgTool::serviceLocator ( ) const

Retrieve pointer to service locator.

Definition at line 85 of file AlgTool.cpp.

87 {
88  return m_svcLocator;
89 }
ISvcLocator * m_svcLocator
Pointer to Service Locator service.
Definition: AlgTool.h:578
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 177 of file AlgTool.cpp.

179 {
180  if( !m_svcLocator ) return StatusCode::FAILURE;
181  auto jos = m_svcLocator->service<IJobOptionsSvc>("JobOptionsSvc");
182  if( !jos ) return StatusCode::FAILURE;
183 
184  // set first generic Properties
185  StatusCode sc = jos->setMyProperties( getGaudiThreadGenericName(name()), this );
186  if( sc.isFailure() ) return StatusCode::FAILURE;
187 
188  // set specific Properties
189  if (isGaudiThreaded(name())) {
190  if(jos->setMyProperties( name(), this ).isFailure()) {
191  return StatusCode::FAILURE;
192  }
193  }
194 
195  // Change my own outputlevel
196  if ( m_messageSvc ) {
197  if ( MSG::NIL != m_outputLevel )
198  { m_messageSvc -> setOutputLevel ( name (), m_outputLevel ) ; }
200  }
201  return StatusCode::SUCCESS;
202 }
GAUDI_API bool isGaudiThreaded(const std::string &name)
test if current Gaudi object is running /will run in a thread
Definition: ThreadGaudi.cpp:73
IMessageSvc * m_messageSvc
Message service.
Definition: AlgTool.h:579
IntegerProperty m_outputLevel
AlgTool output level.
Definition: AlgTool.h:574
GAUDI_API std::string getGaudiThreadGenericName(const std::string &name)
helper function to extract Gaudi instance name from thread copy name
Definition: ThreadGaudi.cpp:50
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
Main interface for the JobOptions service.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
int outputLevel() const
get tool's output level
Definition: AlgTool.h:557
ISvcLocator * m_svcLocator
Pointer to Service Locator service.
Definition: AlgTool.h:578
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
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.

StatusCode AlgTool::setProperty ( const Property p)
override

Default implementations for IProperty interface.

Definition at line 125 of file AlgTool.cpp.

127 {
128  return m_propertyMgr->setProperty(p);
129 }
StatusCode setProperty(const Property &p) override
set the property form another property
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:584
StatusCode AlgTool::setProperty ( const Property p)
override

Default implementations for IProperty interface.

StatusCode AlgTool::setProperty ( const std::string &  s)
override

Definition at line 132 of file AlgTool.cpp.

134 {
135  return m_propertyMgr->setProperty(s);
136 }
StatusCode setProperty(const Property &p) override
set the property form another property
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:584
string s
Definition: gaudirun.py:245
StatusCode AlgTool::setProperty ( const std::string &  s)
override
StatusCode AlgTool::setProperty ( const std::string &  n,
const std::string &  v 
)
override
StatusCode AlgTool::setProperty ( const std::string &  n,
const std::string &  v 
)
override

Definition at line 139 of file AlgTool.cpp.

141 {
142  return m_propertyMgr->setProperty(n,v);
143 }
StatusCode setProperty(const Property &p) override
set the property form another property
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:584
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 152 of file AlgTool.h.

154  { return Gaudi::Utils::setProperty ( m_propertyMgr.get() , name , value ) ; }
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:1187
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:584
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
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 152 of file AlgTool.h.

154  { return Gaudi::Utils::setProperty ( m_propertyMgr.get() , name , value ) ; }
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:1187
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:584
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
StatusCode AlgTool::start ( )
override
StatusCode AlgTool::start ( )
override

Definition at line 350 of file AlgTool.cpp.

352 {
353  // For the time being there is nothing to be done here.
354  return StatusCode::SUCCESS;
355 }
StatusCode AlgTool::stop ( )
override
StatusCode AlgTool::stop ( )
override

Definition at line 373 of file AlgTool.cpp.

375 {
376  // For the time being there is nothing to be done here.
377  return StatusCode::SUCCESS;
378 }
ISvcLocator* AlgTool::svcLoc ( ) const
inline

shortcut for the method service locator

Definition at line 170 of file AlgTool.h.

170 { return serviceLocator() ; }
ISvcLocator * serviceLocator() const
Retrieve pointer to service locator.
Definition: AlgTool.cpp:85
ISvcLocator* AlgTool::svcLoc ( ) const
inline

shortcut for the method service locator

Definition at line 170 of file AlgTool.h.

170 { return serviceLocator() ; }
ISvcLocator * serviceLocator() const
Retrieve pointer to service locator.
Definition: AlgTool.cpp:85
StatusCode AlgTool::sysFinalize ( )
override

Finalize AlgTool.

StatusCode AlgTool::sysFinalize ( )
override

Finalize AlgTool.

Definition at line 381 of file AlgTool.cpp.

381  {
382 //-----------------------------------------------------------------------------
383  return attempt( *this, "sysFinalize", [&]() {
385  Gaudi::Guards::AuditorGuard guard(this,
386  // check if we want to audit the initialize
387  m_auditorFinalize ? auditorSvc() : nullptr,
389  StatusCode sc = finalize();
390  if (sc.isSuccess()) m_state = m_targetState;
391  return sc;
392  } );
393 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
State GAUDI_API ChangeState(const Transition transition, const State state)
Function to get the new state according to the required transition, checking if the transition is all...
Definition: StateMachine.cpp:8
StatusCode finalize() override
Definition: AlgTool.cpp:395
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
bool m_auditorFinalize
flag for auditors in "finalize()"
Definition: AlgTool.h:612
Gaudi::StateMachine::State m_state
state of the Tool
Definition: AlgTool.h:616
Gaudi::StateMachine::State m_targetState
state of the Tool
Definition: AlgTool.h:617
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:214
IAuditorSvc * auditorSvc() const
Access the auditor service.
Definition: AlgTool.cpp:564
StatusCode AlgTool::sysInitialize ( )
override

Initialize AlgTool.

StatusCode AlgTool::sysInitialize ( )
override

Initialize AlgTool.

Definition at line 282 of file AlgTool.cpp.

282  {
283 //-----------------------------------------------------------------------------
284  return attempt( *this, "sysInitialize", [&]() {
286  Gaudi::Guards::AuditorGuard guard(this,
287  // check if we want to audit the initialize
288  m_auditorInitialize ? auditorSvc() : nullptr,
291  if (sc.isSuccess()) m_state = m_targetState;
292 
293  // update DataHandles to point to full TES location
294  // init data handle
295  MsgStream log(msgSvc(), name());
296  for (auto tag : m_inputDataObjects) {
297  if (m_inputDataObjects[tag].isValid()) {
298  if (m_inputDataObjects[tag].initialize().isSuccess())
299  log << MSG::DEBUG << "Data Handle " << tag << " ("
300  << m_inputDataObjects[tag].dataProductName()
301  << ") initialized" << endmsg;
302  else
303  log << MSG::FATAL << "Data Handle " << tag << " ("
304  << m_inputDataObjects[tag].dataProductName()
305  << ") could NOT be initialized" << endmsg;
306  }
307  }
308  for (auto tag : m_outputDataObjects) {
309  if (m_outputDataObjects[tag].isValid()) {
310  if (m_outputDataObjects[tag].initialize().isSuccess())
311  log << MSG::DEBUG << "Data Handle " << tag << " ("
312  << m_outputDataObjects[tag].dataProductName()
313  << ") initialized" << endmsg;
314  else
315  log << MSG::FATAL << "Data Handle " << tag << " ("
316  << m_outputDataObjects[tag].dataProductName()
317  << ") could NOT be initialized" << endmsg;
318  }
319  }
320 
321  return sc;
322  } );
323 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode initialize() override
Definition: AlgTool.cpp:325
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
State GAUDI_API ChangeState(const Transition transition, const State state)
Function to get the new state according to the required transition, checking if the transition is all...
Definition: StateMachine.cpp:8
DataObjectDescriptorCollection m_outputDataObjects
Definition: AlgTool.h:589
IMessageSvc * msgSvc() const
Retrieve pointer to message service.
Definition: AlgTool.cpp:92
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Gaudi::StateMachine::State m_state
state of the Tool
Definition: AlgTool.h:616
Gaudi::StateMachine::State m_targetState
state of the Tool
Definition: AlgTool.h:617
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:214
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
bool m_auditorInitialize
flag for auditors in "initialize()"
Definition: AlgTool.h:609
IAuditorSvc * auditorSvc() const
Access the auditor service.
Definition: AlgTool.cpp:564
DataObjectDescriptorCollection m_inputDataObjects
Definition: AlgTool.h:588
StatusCode AlgTool::sysReinitialize ( )
override

Initialize AlgTool.

StatusCode AlgTool::sysReinitialize ( )
override

Initialize AlgTool.

Definition at line 403 of file AlgTool.cpp.

403  {
404 //-----------------------------------------------------------------------------
405 
406  // Check that the current status is the correct one.
408  MsgStream log ( msgSvc(), name() );
409  log << MSG::ERROR
410  << "sysReinitialize(): cannot reinitialize tool not initialized"
411  << endmsg;
412  return StatusCode::FAILURE;
413  }
414 
415  return attempt(*this, "SysReinitialize()", [&]() {
416  Gaudi::Guards::AuditorGuard guard(this,
417  // check if we want to audit the initialize
418  m_auditorReinitialize ? auditorSvc() : nullptr,
420  return reinitialize();
421  } );
422 
423 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
Gaudi::StateMachine::State FSMState() const override
Definition: AlgTool.h:75
IMessageSvc * msgSvc() const
Retrieve pointer to message service.
Definition: AlgTool.cpp:92
bool m_auditorReinitialize
flag for auditors in "reinitialize()"
Definition: AlgTool.h:613
StatusCode reinitialize() override
Definition: AlgTool.cpp:426
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:214
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
IAuditorSvc * auditorSvc() const
Access the auditor service.
Definition: AlgTool.cpp:564
StatusCode AlgTool::sysRestart ( )
override

Start AlgTool.

StatusCode AlgTool::sysRestart ( )
override

Start AlgTool.

Definition at line 451 of file AlgTool.cpp.

451  {
452 //-----------------------------------------------------------------------------
453 
454  // Check that the current status is the correct one.
456  MsgStream log ( msgSvc(), name() );
457  log << MSG::ERROR
458  << "sysRestart(): cannot reinitialize tool not started"
459  << endmsg;
460  return StatusCode::FAILURE;
461  }
462 
463  return attempt(*this, "sysRestart", [&]() {
465  Gaudi::Guards::AuditorGuard guard(this,
466  // check if we want to audit the initialize
467  m_auditorRestart ? auditorSvc() : nullptr,
469  return restart();
470  } );
471 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
State GAUDI_API ChangeState(const Transition transition, const State state)
Function to get the new state according to the required transition, checking if the transition is all...
Definition: StateMachine.cpp:8
Gaudi::StateMachine::State FSMState() const override
Definition: AlgTool.h:75
IMessageSvc * msgSvc() const
Retrieve pointer to message service.
Definition: AlgTool.cpp:92
StatusCode restart() override
Definition: AlgTool.cpp:474
Gaudi::StateMachine::State m_state
state of the Tool
Definition: AlgTool.h:616
bool m_auditorRestart
flag for auditors in "restart()"
Definition: AlgTool.h:614
Gaudi::StateMachine::State m_targetState
state of the Tool
Definition: AlgTool.h:617
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:214
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
IAuditorSvc * auditorSvc() const
Access the auditor service.
Definition: AlgTool.cpp:564
StatusCode AlgTool::sysStart ( )
override

Start AlgTool.

Definition at line 335 of file AlgTool.cpp.

335  {
336 //-----------------------------------------------------------------------------
337  return attempt( *this, "sysInitialize", [&]() {
339  Gaudi::Guards::AuditorGuard guard(this,
340  // check if we want to audit the initialize
341  m_auditorStart ? auditorSvc() : nullptr,
343  StatusCode sc = start();
344  if (sc.isSuccess()) m_state = m_targetState;
345  return sc;
346  } );
347 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
State GAUDI_API ChangeState(const Transition transition, const State state)
Function to get the new state according to the required transition, checking if the transition is all...
Definition: StateMachine.cpp:8
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Gaudi::StateMachine::State m_state
state of the Tool
Definition: AlgTool.h:616
bool m_auditorStart
flag for auditors in "start()"
Definition: AlgTool.h:610
Gaudi::StateMachine::State m_targetState
state of the Tool
Definition: AlgTool.h:617
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:214
IAuditorSvc * auditorSvc() const
Access the auditor service.
Definition: AlgTool.cpp:564
StatusCode start() override
Definition: AlgTool.cpp:350
StatusCode AlgTool::sysStart ( )
override

Start AlgTool.

StatusCode AlgTool::sysStop ( )
override

Stop AlgTool.

Definition at line 358 of file AlgTool.cpp.

358  {
359 //-----------------------------------------------------------------------------
360  return attempt( *this, "sysStop", [&]() {
362  Gaudi::Guards::AuditorGuard guard(this,
363  // check if we want to audit the initialize
364  m_auditorStop ? auditorSvc() : nullptr,
366  StatusCode sc = stop();
367  if (sc.isSuccess()) m_state = m_targetState;
368  return sc;
369  } );
370 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
State GAUDI_API ChangeState(const Transition transition, const State state)
Function to get the new state according to the required transition, checking if the transition is all...
Definition: StateMachine.cpp:8
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Gaudi::StateMachine::State m_state
state of the Tool
Definition: AlgTool.h:616
StatusCode stop() override
Definition: AlgTool.cpp:373
Gaudi::StateMachine::State m_targetState
state of the Tool
Definition: AlgTool.h:617
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:214
bool m_auditorStop
flag for auditors in "stop()"
Definition: AlgTool.h:611
IAuditorSvc * auditorSvc() const
Access the auditor service.
Definition: AlgTool.cpp:564
StatusCode AlgTool::sysStop ( )
override

Stop AlgTool.

Gaudi::StateMachine::State AlgTool::targetFSMState ( ) const
inlineoverride

Definition at line 76 of file AlgTool.h.

76 { return m_targetState; }
Gaudi::StateMachine::State m_targetState
state of the Tool
Definition: AlgTool.h:617
Gaudi::StateMachine::State AlgTool::targetFSMState ( ) const
inlineoverride

Definition at line 76 of file AlgTool.h.

76 { return m_targetState; }
Gaudi::StateMachine::State m_targetState
state of the Tool
Definition: AlgTool.h:617
StatusCode AlgTool::terminate ( )
inlineoverride

Definition at line 72 of file AlgTool.h.

StatusCode AlgTool::terminate ( )
inlineoverride

Definition at line 72 of file AlgTool.h.

const std::vector< IAlgTool * > & AlgTool::tools ( ) const

Definition at line 523 of file AlgTool.cpp.

523  {
525  initToolHandles();
526 
527  return m_tools;
528 }
bool m_toolHandlesInit
Definition: AlgTool.h:594
std::vector< IAlgTool * > m_tools
Definition: AlgTool.h:592
#define UNLIKELY(x)
Definition: Kernel.h:126
void initToolHandles() const
Definition: AlgTool.cpp:501
const std::vector<IAlgTool *>& AlgTool::tools ( ) const
std::vector<IAlgTool *>& AlgTool::tools ( )
protected
std::vector< IAlgTool * > & AlgTool::tools ( )
protected

Definition at line 530 of file AlgTool.cpp.

530  {
532  initToolHandles();
533 
534  return m_tools;
535 }
bool m_toolHandlesInit
Definition: AlgTool.h:594
std::vector< IAlgTool * > m_tools
Definition: AlgTool.h:592
#define UNLIKELY(x)
Definition: Kernel.h:126
void initToolHandles() const
Definition: AlgTool.cpp:501
IToolSvc * AlgTool::toolSvc ( ) const

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

Definition at line 112 of file AlgTool.cpp.

114 {
115  if ( !m_ptoolSvc ) {
116  m_ptoolSvc = service( "ToolSvc", true );
117  if( !m_ptoolSvc ) {
118  throw GaudiException("Service [ToolSvc] not found", name(), StatusCode::FAILURE);
119  }
120  }
121  return m_ptoolSvc.get();
122 }
Define general base for Gaudi exception.
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
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.
Definition: AlgTool.h:195
SmartIF< IToolSvc > m_ptoolSvc
Tool service.
Definition: AlgTool.h:581
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
IToolSvc* AlgTool::toolSvc ( ) const

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

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

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

Definition at line 71 of file AlgTool.cpp.

73 {
74  return m_type;
75 }
std::string m_type
AlgTool type (concrete class name)
Definition: AlgTool.h:575
const std::string& AlgTool::type ( ) const
override

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

Friends And Related Function Documentation

ToolSvc
friend

Definition at line 45 of file AlgTool.h.

Member Data Documentation

BooleanProperty AlgTool::m_auditInit = false
private

Definition at line 608 of file AlgTool.h.

bool AlgTool::m_auditorFinalize = false
private

flag for auditors in "finalize()"

Definition at line 612 of file AlgTool.h.

bool AlgTool::m_auditorInitialize = false
private

flag for auditors in "initialize()"

Definition at line 609 of file AlgTool.h.

bool AlgTool::m_auditorReinitialize = false
private

flag for auditors in "reinitialize()"

Definition at line 613 of file AlgTool.h.

bool AlgTool::m_auditorRestart = false
private

flag for auditors in "restart()"

Definition at line 614 of file AlgTool.h.

bool AlgTool::m_auditorStart = false
private

flag for auditors in "start()"

Definition at line 610 of file AlgTool.h.

bool AlgTool::m_auditorStop = false
private

flag for auditors in "stop()"

Definition at line 611 of file AlgTool.h.

SmartIF< IDataProviderSvc > AlgTool::m_evtSvc
mutableprivate

Event data service.

Definition at line 580 of file AlgTool.h.

DataObjectDescriptorCollection AlgTool::m_inputDataObjects
private

Definition at line 588 of file AlgTool.h.

InterfaceList AlgTool::m_interfaceList
private

Interface list.

Definition at line 585 of file AlgTool.h.

IMessageSvc * AlgTool::m_messageSvc = nullptr
mutableprivate

Message service.

Definition at line 579 of file AlgTool.h.

std::string AlgTool::m_monitorSvcName
private

Name to use for Monitor Service.

Definition at line 583 of file AlgTool.h.

const std::string AlgTool::m_name
private

AlgTool full name.

Definition at line 576 of file AlgTool.h.

DataObjectDescriptorCollection AlgTool::m_outputDataObjects
private

Definition at line 589 of file AlgTool.h.

IntegerProperty AlgTool::m_outputLevel = MSG::NIL
private

AlgTool output level.

Definition at line 574 of file AlgTool.h.

const IInterface * AlgTool::m_parent = nullptr
private

AlgTool parent.

Definition at line 577 of file AlgTool.h.

SmartIF< IAuditorSvc > AlgTool::m_pAuditorSvc
mutableprivate

Auditor Service.

Definition at line 606 of file AlgTool.h.

SmartIF< IMonitorSvc > AlgTool::m_pMonitorSvc
mutableprivate

Online Monitoring Service.

Definition at line 582 of file AlgTool.h.

SmartIF< PropertyMgr > AlgTool::m_propertyMgr
private

Property Manager.

Definition at line 584 of file AlgTool.h.

SmartIF< IToolSvc > AlgTool::m_ptoolSvc
mutableprivate

Tool service.

Definition at line 581 of file AlgTool.h.

state of the Tool

Definition at line 616 of file AlgTool.h.

ISvcLocator * AlgTool::m_svcLocator = nullptr
mutableprivate

Pointer to Service Locator service.

Definition at line 578 of file AlgTool.h.

state of the Tool

Definition at line 617 of file AlgTool.h.

std::string AlgTool::m_threadID
private

Thread Id for Alg Tool.

Definition at line 586 of file AlgTool.h.

std::vector< BaseToolHandle * > AlgTool::m_toolHandles
mutableprivate

Definition at line 593 of file AlgTool.h.

bool AlgTool::m_toolHandlesInit = false
mutableprivate

Definition at line 594 of file AlgTool.h.

std::vector< IAlgTool * > AlgTool::m_tools
mutableprivate

Definition at line 592 of file AlgTool.h.

std::string AlgTool::m_type
private

AlgTool type (concrete class name)

Definition at line 575 of file AlgTool.h.


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