#include <GaudiKernel/AlgTool.h>
Inheritance diagram for AlgTool:
Public Types | |
SUCCESS = 1 | |
Normal successful completion. | |
NO_INTERFACE | |
Requested interface is not available. | |
VERSMISMATCH | |
Requested interface version is incompatible. | |
LAST_ERROR | |
Last error. | |
enum | Status { SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR } |
Return status. More... | |
Public Member Functions | |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvUnknown) |
Query for a given interface. | |
virtual unsigned long | addRef () |
Reference Interface instance. | |
virtual unsigned long | release () |
Release Interface instance. | |
virtual const std::string & | name () const |
Retrieve full identifying name of the concrete tool object. | |
virtual const std::string & | type () const |
Retrieve type (concrete class) of the sub-algtool. | |
virtual const IInterface * | parent () const |
Retrieve parent of the sub-algtool. | |
virtual StatusCode | configure () |
Configuration (from OFFLINE to CONFIGURED). | |
virtual StatusCode | initialize () |
Initialization (from CONFIGURED to INITIALIZED). | |
virtual StatusCode | start () |
Start (from INITIALIZED to RUNNING). | |
virtual StatusCode | stop () |
Stop (from RUNNING to INITIALIZED). | |
virtual StatusCode | finalize () |
Finalize (from INITIALIZED to CONFIGURED). | |
virtual StatusCode | terminate () |
Initialization (from CONFIGURED to OFFLINE). | |
virtual StatusCode | reinitialize () |
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED). | |
virtual StatusCode | restart () |
Initialization (from RUNNING to RUNNING, via INITIALIZED). | |
virtual Gaudi::StateMachine::State | FSMState () const |
Get the current state. | |
virtual Gaudi::StateMachine::State | targetFSMState () const |
When we are in the middle of a transition, get the state where the transition is leading us. | |
virtual StatusCode | sysInitialize () |
Initialize AlgTool. | |
virtual StatusCode | sysStart () |
Start AlgTool. | |
virtual StatusCode | sysStop () |
Stop AlgTool. | |
virtual StatusCode | sysFinalize () |
Finalize AlgTool. | |
virtual StatusCode | sysReinitialize () |
Initialize AlgTool. | |
virtual StatusCode | sysRestart () |
Start AlgTool. | |
virtual StatusCode | setProperty (const Property &p) |
Default implementations for IProperty interface. | |
virtual StatusCode | setProperty (const std::string &s) |
Set the property by string. | |
virtual StatusCode | setProperty (const std::string &n, const std::string &v) |
Set the property by std::string. | |
virtual StatusCode | getProperty (Property *p) const |
Get the property by property. | |
virtual const Property & | getProperty (const std::string &name) const |
Get the property by name. | |
virtual StatusCode | getProperty (const std::string &n, std::string &v) const |
Get the property by std::string. | |
virtual const std::vector< Property * > & | getProperties () const |
Get list of properties. | |
PropertyMgr * | getPropertyMgr () |
template<class TYPE> | |
StatusCode | setProperty (const std::string &name, const TYPE &value) |
set the property form the value | |
AlgTool (const std::string &type, const std::string &name, const IInterface *parent) | |
Standard Constructor. | |
ISvcLocator * | serviceLocator () const |
Retrieve pointer to service locator. | |
ISvcLocator * | svcLoc () const |
shortcut for the methos service locator | |
IMessageSvc * | msgSvc () const |
Retrieve pointer to message service. | |
IToolSvc * | toolSvc () const |
The standard ToolSvc service, Return a pointer to the service if present. | |
StatusCode | setProperties () |
Method for setting declared properties to the values specified in the jobOptions via the job option service. | |
template<class T> | |
StatusCode | service (const std::string &name, T *&svc, bool createIf=true) const |
Access a service by name, creating it if it doesn't already exist. | |
template<class T> | |
StatusCode | service (const std::string &type, const std::string &name, T *&svc) const |
Access a service by name, type creating it if it doesn't already exist. | |
void | declInterface (const InterfaceID &, void *) |
declare interface | |
template<class T> | |
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const |
Declare the named property. | |
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const |
Declare remote named properties. | |
IAuditorSvc * | auditorSvc () const |
Access the auditor service. | |
IMonitorSvc * | monitorSvc () const |
Access the monitor service. | |
template<class T> | |
void | declareInfo (const std::string &name, const T &var, const std::string &desc) const |
Declare monitoring information. | |
void | declareInfo (const std::string &name, const std::string &format, const void *var, int size, const std::string &desc) const |
Declare monitoring information (special case). | |
Static Public Member Functions | |
static const InterfaceID & | interfaceID () |
Retrieve interface ID. | |
static const InterfaceID & | interfaceID () |
Retrieve interface ID. | |
static const InterfaceID & | interfaceID () |
Retrieve interface ID. | |
Protected Member Functions | |
int | outputLevel () const |
get tool's output level | |
virtual unsigned long | refCount () const |
Current number of refCounts. | |
IntegerProperty & | outputLevelProperty () |
Accessor for the Message level property. | |
void | initOutputLevel (Property &prop) |
callback for output level property | |
virtual | ~AlgTool () |
Private Types | |
typedef std::list< std::pair< InterfaceID, void * > > | InterfaceList |
Private Member Functions | |
StatusCode | service_i (const std::string &algName, bool createIf, const InterfaceID &iid, void **ppSvc) const |
implementation of service method | |
StatusCode | service_i (const std::string &svcType, const std::string &svcName, const InterfaceID &iid, void **ppS) const |
Private Attributes | |
IntegerProperty | m_outputLevel |
AlgTool output level. | |
std::string | m_type |
AlgTool type (concrete class name). | |
const std::string | m_name |
AlgTool full name. | |
const IInterface * | m_parent |
AlgTool parent. | |
unsigned long | m_refCount |
Reference counter. | |
ISvcLocator * | m_svcLocator |
Pointer to Service Locator service. | |
IMessageSvc * | m_messageSvc |
Message service. | |
IToolSvc * | m_ptoolSvc |
Tool service. | |
IMonitorSvc * | m_pMonitorSvc |
Online Monitoring Service. | |
std::string | m_monitorSvcName |
Name to use for Monitor Service. | |
PropertyMgr * | m_propertyMgr |
Property Manager. | |
InterfaceList | m_interfaceList |
Interface list. | |
std::string | m_threadID |
Thread Id for Alg Tool. | |
IAuditorSvc * | m_pAuditorSvc |
Auditor Service. | |
BooleanProperty | m_auditInit |
bool | m_auditorInitialize |
flag for auditors in "initialize()" | |
bool | m_auditorStart |
flag for auditors in "start()" | |
bool | m_auditorStop |
flag for auditors in "stop()" | |
bool | m_auditorFinalize |
flag for auditors in "finalize()" | |
bool | m_auditorReinitialize |
flag for auditors in "reinitialize()" | |
bool | m_auditorRestart |
flag for auditors in "restart()" | |
Gaudi::StateMachine::State | m_state |
state of the Tool | |
Gaudi::StateMachine::State | m_targetState |
state of the Tool | |
Friends | |
class | ToolSvc |
Classes | |
class | declareInterface |
Specific methods for doing something usefull should be implemented in the concrete tools. Sub-types of this class could implement an additional interface for behaviour common to sets of concrete tools (for example vertexers).
Pere Mato
Definition at line 35 of file AlgTool.h.
typedef std::list<std::pair<InterfaceID,void*> > AlgTool::InterfaceList [private] |
enum IInterface::Status [inherited] |
Return status.
SUCCESS | Normal successful completion. |
NO_INTERFACE | Requested interface is not available. |
VERSMISMATCH | Requested interface version is incompatible. |
LAST_ERROR | Last error. |
Reimplemented in IConversionSvc, IConverter, and IDataProviderSvc.
Definition at line 113 of file IInterface.h.
00113 { 00115 SUCCESS = 1, 00117 NO_INTERFACE, 00119 VERSMISMATCH, 00121 LAST_ERROR 00122 };
AlgTool::AlgTool | ( | const std::string & | type, | |
const std::string & | name, | |||
const IInterface * | parent | |||
) |
Standard Constructor.
type | the concrete class of the sub-algtool | |
name | the full name of the concrete sub-algtool | |
parent | the parent of the concrete sub-algtool |
virtual AlgTool::~AlgTool | ( | ) | [protected, virtual] |
virtual StatusCode AlgTool::queryInterface | ( | const InterfaceID & | riid, | |
void ** | ppvUnknown | |||
) | [virtual] |
virtual unsigned long AlgTool::addRef | ( | ) | [virtual] |
virtual unsigned long AlgTool::release | ( | ) | [virtual] |
virtual const std::string& AlgTool::name | ( | ) | const [virtual] |
virtual const std::string& AlgTool::type | ( | ) | const [virtual] |
virtual const IInterface* AlgTool::parent | ( | ) | const [virtual] |
virtual StatusCode AlgTool::configure | ( | ) | [inline, virtual] |
Configuration (from OFFLINE to CONFIGURED).
Implements IAlgTool.
Definition at line 60 of file AlgTool.h.
00060 { return StatusCode::SUCCESS; }
virtual StatusCode AlgTool::initialize | ( | ) | [virtual] |
Initialization (from CONFIGURED to INITIALIZED).
Implements IAlgTool.
Reimplemented in DataStreamTool.
virtual StatusCode AlgTool::start | ( | ) | [virtual] |
virtual StatusCode AlgTool::stop | ( | ) | [virtual] |
virtual StatusCode AlgTool::finalize | ( | ) | [virtual] |
virtual StatusCode AlgTool::terminate | ( | ) | [inline, virtual] |
Initialization (from CONFIGURED to OFFLINE).
Implements IAlgTool.
Definition at line 65 of file AlgTool.h.
00065 { return StatusCode::SUCCESS; }
virtual StatusCode AlgTool::reinitialize | ( | ) | [virtual] |
virtual StatusCode AlgTool::restart | ( | ) | [virtual] |
virtual Gaudi::StateMachine::State AlgTool::FSMState | ( | ) | const [inline, virtual] |
virtual Gaudi::StateMachine::State AlgTool::targetFSMState | ( | ) | const [inline, virtual] |
When we are in the middle of a transition, get the state where the transition is leading us.
Otherwise it returns the same state as state().
Implements IStateful.
Definition at line 69 of file AlgTool.h.
00069 { return m_targetState; }
virtual StatusCode AlgTool::sysInitialize | ( | ) | [virtual] |
virtual StatusCode AlgTool::sysStart | ( | ) | [virtual] |
virtual StatusCode AlgTool::sysStop | ( | ) | [virtual] |
virtual StatusCode AlgTool::sysFinalize | ( | ) | [virtual] |
virtual StatusCode AlgTool::sysReinitialize | ( | ) | [virtual] |
virtual StatusCode AlgTool::sysRestart | ( | ) | [virtual] |
virtual StatusCode AlgTool::setProperty | ( | const Property & | p | ) | [virtual] |
virtual StatusCode AlgTool::setProperty | ( | const std::string & | s | ) | [virtual] |
virtual StatusCode AlgTool::setProperty | ( | const std::string & | n, | |
const std::string & | v | |||
) | [virtual] |
virtual StatusCode AlgTool::getProperty | ( | Property * | p | ) | const [virtual] |
virtual const Property& AlgTool::getProperty | ( | const std::string & | name | ) | const [virtual] |
virtual StatusCode AlgTool::getProperty | ( | const std::string & | n, | |
std::string & | v | |||
) | const [virtual] |
virtual const std::vector<Property*>& AlgTool::getProperties | ( | ) | const [virtual] |
PropertyMgr* AlgTool::getPropertyMgr | ( | ) | [inline] |
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 convinient in resetting of the default properties in the derived classes. E.g. without this method one needs to convert everything into strings to use IProperty::setProperty
setProperty ( "OutputLevel" , "1" ) ; setProperty ( "Enable" , "True" ) ; setProperty ( "ErrorMax" , "10" ) ;
For simple cases it is more or less ok, but for complicated properties it is just ugly..
name | name of the property | |
value | value of the property |
Definition at line 144 of file AlgTool.h.
00146 { return Gaudi::Utils::setProperty ( m_propertyMgr , name , value ) ; }
ISvcLocator* AlgTool::serviceLocator | ( | ) | const |
Retrieve pointer to service locator.
ISvcLocator* AlgTool::svcLoc | ( | ) | const [inline] |
shortcut for the methos service locator
Definition at line 162 of file AlgTool.h.
00162 { return serviceLocator() ; }
IMessageSvc* AlgTool::msgSvc | ( | ) | const |
Retrieve pointer to message service.
IToolSvc* AlgTool::toolSvc | ( | ) | const |
The standard ToolSvc service, Return a pointer to the service if present.
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::service | ( | const std::string & | name, | |
T *& | svc, | |||
bool | createIf = true | |||
) | const [inline] |
StatusCode AlgTool::service | ( | const std::string & | type, | |
const std::string & | name, | |||
T *& | svc | |||
) | const [inline] |
void AlgTool::declInterface | ( | const InterfaceID & | , | |
void * | ||||
) |
declare interface
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 fro property #1" ) ; // declare the property and attach the handler to it declareProperty( "Property2" , m_property2 , "Doc for property #2" ) -> declareUpdateHandler( &MyAlg::handler_2 ) ; }
name | the property name | |
property | the property itself, | |
doc | the documentation string |
Definition at line 234 of file AlgTool.h.
00237 { 00238 return m_propertyMgr -> declareProperty ( name , property , doc ) ; 00239 }
Property* AlgTool::declareRemoteProperty | ( | const std::string & | name, | |
IProperty * | rsvc, | |||
const std::string & | rname = "" | |||
) | const [inline] |
Declare remote named properties.
Definition at line 242 of file AlgTool.h.
00245 { 00246 return m_propertyMgr-> declareRemoteProperty ( name , rsvc , rname ) ; 00247 }
IAuditorSvc* AlgTool::auditorSvc | ( | ) | const |
Access the auditor service.
IMonitorSvc* AlgTool::monitorSvc | ( | ) | const [inline] |
Access the monitor service.
NULL | No monitor service is present | |
non-NULL | A monitor service is present and available to be used |
Definition at line 261 of file AlgTool.h.
00262 { 00263 // If not already located try to locate it without forcing a creation 00264 if ( !m_pMonitorSvc ){ 00265 service_i( m_monitorSvcName, false, 00266 IMonitorSvc::interfaceID(), pp_cast<void>(&m_pMonitorSvc) ); 00267 } 00268 return m_pMonitorSvc; 00269 }
void AlgTool::declareInfo | ( | const std::string & | name, | |
const T & | var, | |||
const std::string & | desc | |||
) | const [inline] |
Declare monitoring information.
name | Monitoring information name known to the external system | |
var | Monitoring Listener address (the item to monitor...) | |
desc | Textual description of the information being monitored |
Definition at line 277 of file AlgTool.h.
00280 { 00281 IMonitorSvc* mS = monitorSvc(); 00282 if ( mS ) mS->declareInfo(name, var, desc, this); 00283 }
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).
name | Monitoring information name known to the external system | |
format | Format information | |
var | Monitoring Listener address | |
size | Monitoring Listener address size | |
desc | Textual description of the information being monitored |
Definition at line 292 of file AlgTool.h.
00297 { 00298 IMonitorSvc* mS = monitorSvc(); 00299 if ( mS ) mS->declareInfo(name, format, var, size, desc, this); 00300 }
int AlgTool::outputLevel | ( | ) | const [inline, protected] |
get tool's output level
Definition at line 305 of file AlgTool.h.
00305 { return (int)m_outputLevel ; }
virtual unsigned long AlgTool::refCount | ( | ) | const [inline, protected, virtual] |
IntegerProperty& AlgTool::outputLevelProperty | ( | ) | [inline, protected] |
Accessor for the Message level property.
Definition at line 314 of file AlgTool.h.
00314 { return m_outputLevel; }
void AlgTool::initOutputLevel | ( | Property & | prop | ) | [protected] |
callback for output level property
StatusCode AlgTool::service_i | ( | const std::string & | algName, | |
bool | createIf, | |||
const InterfaceID & | iid, | |||
void ** | ppSvc | |||
) | const [private] |
implementation of service method
StatusCode AlgTool::service_i | ( | const std::string & | svcType, | |
const std::string & | svcName, | |||
const InterfaceID & | iid, | |||
void ** | ppS | |||
) | const [private] |
static const InterfaceID& IAlgTool::interfaceID | ( | ) | [inline, static, inherited] |
Retrieve interface ID.
Reimplemented from INamedInterface.
Reimplemented in IDataStreamTool, and IEventTimeDecoder.
Definition at line 30 of file IAlgTool.h.
00030 { return IID_IAlgTool; }
static const InterfaceID& IProperty::interfaceID | ( | ) | [inline, static, inherited] |
Retrieve interface ID.
Reimplemented from IInterface.
Definition at line 28 of file IProperty.h.
00028 { return IID_IProperty; }
static const InterfaceID& IStateful::interfaceID | ( | ) | [inline, static, inherited] |
Retrieve interface ID.
Reimplemented from IInterface.
Definition at line 23 of file IStateful.h.
00023 { return IID_IStateful; }
IntegerProperty AlgTool::m_outputLevel [private] |
std::string AlgTool::m_type [private] |
const std::string AlgTool::m_name [private] |
const IInterface* AlgTool::m_parent [private] |
unsigned long AlgTool::m_refCount [private] |
ISvcLocator* AlgTool::m_svcLocator [mutable, private] |
IMessageSvc* AlgTool::m_messageSvc [mutable, private] |
IToolSvc* AlgTool::m_ptoolSvc [mutable, private] |
IMonitorSvc* AlgTool::m_pMonitorSvc [mutable, private] |
std::string AlgTool::m_monitorSvcName [private] |
PropertyMgr* AlgTool::m_propertyMgr [private] |
InterfaceList AlgTool::m_interfaceList [private] |
std::string AlgTool::m_threadID [private] |
IAuditorSvc* AlgTool::m_pAuditorSvc [mutable, private] |
BooleanProperty AlgTool::m_auditInit [private] |
bool AlgTool::m_auditorInitialize [private] |
bool AlgTool::m_auditorStart [private] |
bool AlgTool::m_auditorStop [private] |
bool AlgTool::m_auditorFinalize [private] |
bool AlgTool::m_auditorReinitialize [private] |
bool AlgTool::m_auditorRestart [private] |
Gaudi::StateMachine::State AlgTool::m_state [private] |