All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AlgTool.cpp
Go to the documentation of this file.
1 // Include files
2 #include "GaudiKernel/AlgTool.h"
6 
8 #include "GaudiKernel/Service.h"
9 #include "GaudiKernel/Auditor.h"
10 #include "GaudiKernel/System.h"
14 #include "GaudiKernel/Guards.h"
15 
16 //------------------------------------------------------------------------------
18 ( const InterfaceID& riid ,
19  void** ppvi )
20 //------------------------------------------------------------------------------
21 {
22  if ( 0 == ppvi ) { return StatusCode::FAILURE ; } // RETURN
23  StatusCode sc = base_class::queryInterface(riid,ppvi);
24  if (sc.isSuccess()) {
25  return sc;
26  }
27  else {
28  for ( InterfaceList::iterator it = m_interfaceList.begin() ;
29  m_interfaceList.end() != it ; ++it )
30  {
31  if ( !it->first.versionMatch ( riid ) ) { continue ; }
32  // OK
33  *ppvi = it->second ;
34  addRef() ;
35  return SUCCESS ; // RETURN
36  }
37  *ppvi = 0 ;
38  return NO_INTERFACE ; // RETURN
39  }
40  // cannot reach this point
41 }
42 //------------------------------------------------------------------------------
43 void AlgTool::declInterface( const InterfaceID& iid, void* ii)
44 //------------------------------------------------------------------------------
45 {
46  m_interfaceList.push_back(std::make_pair(iid, ii));
47 }
48 
49 
50 //------------------------------------------------------------------------------
51 const std::string& AlgTool::name() const
52 //------------------------------------------------------------------------------
53 {
54  return m_name;
55 }
56 
57 //------------------------------------------------------------------------------
58 const std::string& AlgTool::type() const
59 //------------------------------------------------------------------------------
60 {
61  return m_type;
62 }
63 
64 //------------------------------------------------------------------------------
66 //------------------------------------------------------------------------------
67 {
68  return m_parent;
69 }
70 
71 //------------------------------------------------------------------------------
73 //------------------------------------------------------------------------------
74 {
75  return m_svcLocator;
76 }
77 
78 //------------------------------------------------------------------------------
80 //------------------------------------------------------------------------------
81 {
82  return m_messageSvc;
83 }
84 
85 //------------------------------------------------------------------------------
87 //------------------------------------------------------------------------------
88 {
89  if ( 0 == m_ptoolSvc ) {
90  StatusCode sc = service( "ToolSvc", m_ptoolSvc, true );
91  if( sc.isFailure() ) {
92  throw GaudiException("Service [ToolSvc] not found", name(), sc);
93  }
94  }
95  return m_ptoolSvc;
96 }
97 
98 //------------------------------------------------------------------------------
100 //------------------------------------------------------------------------------
101 {
102  return m_propertyMgr->setProperty(p);
103 }
104 
105 //------------------------------------------------------------------------------
106 StatusCode AlgTool::setProperty(const std::string& s)
107 //------------------------------------------------------------------------------
108 {
109  return m_propertyMgr->setProperty(s);
110 }
111 
112 //------------------------------------------------------------------------------
113 StatusCode AlgTool::setProperty(const std::string& n, const std::string& v)
114 //------------------------------------------------------------------------------
115 {
116  return m_propertyMgr->setProperty(n,v);
117 }
118 
119 //------------------------------------------------------------------------------
121 //------------------------------------------------------------------------------
122 {
123  return m_propertyMgr->getProperty(p);
124 }
125 
126 //------------------------------------------------------------------------------
127 const Property& AlgTool::getProperty(const std::string& n) const
128 {
129  return m_propertyMgr->getProperty(n);
130 }
131 
132 //------------------------------------------------------------------------------
133 StatusCode AlgTool::getProperty(const std::string& n, std::string& v ) const
134 //------------------------------------------------------------------------------
135 {
136  return m_propertyMgr->getProperty(n,v);
137 }
138 
139 //------------------------------------------------------------------------------
140 const std::vector<Property*>& AlgTool::getProperties() const
141 //------------------------------------------------------------------------------
142 {
143  return m_propertyMgr->getProperties();
144 }
145 
146 //------------------------------------------------------------------------------
148 //------------------------------------------------------------------------------
149 {
150  if( m_svcLocator == 0) {
151  return StatusCode::FAILURE;
152  }
153  SmartIF<IJobOptionsSvc> jos(m_svcLocator->service("JobOptionsSvc"));
154  if( !jos.isValid() ) return StatusCode::FAILURE;
155 
156  // set first generic Properties
157  StatusCode sc = jos->setMyProperties( getGaudiThreadGenericName(name()), this );
158  if( sc.isFailure() ) return StatusCode::FAILURE;
159 
160  // set specific Properties
161  if (isGaudiThreaded(name())) {
162  if(jos->setMyProperties( name(), this ).isFailure()) {
163  return StatusCode::FAILURE;
164  }
165  }
166 
167  // Change my own outputlevel
168  if ( 0 != m_messageSvc )
169  {
170  if ( MSG::NIL != m_outputLevel )
171  { m_messageSvc -> setOutputLevel ( name () , m_outputLevel ) ; }
173  }
174 
175  return StatusCode::SUCCESS;
176 }
177 
178 //------------------------------------------------------------------------------
179 AlgTool::AlgTool( const std::string& type,
180  const std::string& name,
181  const IInterface* parent)
182 //------------------------------------------------------------------------------
183  : m_outputLevel ( MSG::NIL )
184  , m_type ( type )
185  , m_name ( name )
186  , m_parent ( parent )
187  , m_svcLocator ( 0 )
188  , m_messageSvc ( 0 )
189  , m_ptoolSvc ( 0 )
190  , m_pMonitorSvc ( NULL )
191  , m_propertyMgr ( new PropertyMgr() )
192  , m_interfaceList ( )
193  , m_threadID ( )
194  , m_pAuditorSvc ( 0 )
195  , m_auditInit ( false )
196  , m_auditorInitialize(false)
197  , m_auditorStart(false)
198  , m_auditorStop(false)
199  , m_auditorFinalize(false)
200  , m_auditorReinitialize(false)
201  , m_auditorRestart(false)
202  , m_state ( Gaudi::StateMachine::CONFIGURED )
203  , m_targetState ( Gaudi::StateMachine::CONFIGURED )
204 {
205  addRef(); // Initial count set to 1
206 
207  declareProperty( "MonitorService", m_monitorSvcName = "MonitorSvc" );
208 
209  { // get the "OutputLevel" property from parent
210  const Property* _p = Gaudi::Utils::getProperty ( parent , "OutputLevel") ;
211  if ( 0 != _p ) { m_outputLevel.assign( *_p ) ; }
212  declareProperty ( "OutputLevel" , m_outputLevel ) ;
214  }
215 
216  IInterface* _p = const_cast<IInterface*> ( parent ) ;
217 
218  if ( Algorithm* _alg = dynamic_cast<Algorithm*> ( _p ) )
219  {
220  m_svcLocator = _alg -> serviceLocator () ;
221  m_messageSvc = _alg -> msgSvc () ;
222  m_threadID = getGaudiThreadIDfromName ( _alg -> name() ) ;
223  }
224  else if ( Service* _svc = dynamic_cast<Service*> ( _p ) )
225  {
226  m_svcLocator = _svc -> serviceLocator () ;
227  m_messageSvc = _svc -> msgSvc () ;
228  m_threadID = getGaudiThreadIDfromName ( _svc -> name() ) ;
229  }
230  else if ( AlgTool* _too = dynamic_cast<AlgTool*> ( _p ) )
231  {
232  m_svcLocator = _too -> m_svcLocator;
233  m_messageSvc = _too -> m_messageSvc;
235  }
236  else if ( Auditor* _aud = dynamic_cast<Auditor*> ( _p ) )
237  {
238  m_svcLocator = _aud -> serviceLocator() ;
239  m_messageSvc = _aud -> msgSvc() ;
240  m_threadID = getGaudiThreadIDfromName ( _aud -> name() ) ;
241  }
242  else
243  {
244  throw GaudiException
245  ( "Failure to create tool '"
246  + type + "/" + name + "': illegal parent type '"
247  + System::typeinfoName(typeid(*_p)) + "'", "AlgTool", 0 );
248  }
249 
250 
251  { // audit tools
252  SmartIF<IProperty> appMgr(m_svcLocator->service("ApplicationMgr"));
253  if ( !appMgr.isValid() ) {
254  throw GaudiException("Could not locate ApplicationMgr","AlgTool",0);
255  }
256  const Property* p = Gaudi::Utils::getProperty( appMgr , "AuditTools");
257  if ( 0 != p ) { m_auditInit.assign ( *p ) ; }
258  declareProperty ( "AuditTools", m_auditInit );
259  bool audit = m_auditInit.value();
260  // Declare common AlgTool properties with their defaults
261  declareProperty ( "AuditInitialize" , m_auditorInitialize = audit ) ;
262  declareProperty ( "AuditStart" , m_auditorStart = audit ) ;
263  declareProperty ( "AuditStop" , m_auditorStop = audit ) ;
264  declareProperty ( "AuditFinalize" , m_auditorFinalize = audit ) ;
265  }
266 
267  // check thread ID and try if tool name indicates thread ID
268  if ( m_threadID.empty() )
270 }
271 
272 //-----------------------------------------------------------------------------
274 //-----------------------------------------------------------------------------
275 
276  try {
278  Gaudi::Guards::AuditorGuard guard(this,
279  // check if we want to audit the initialize
283  if (sc.isSuccess())
285  return sc;
286  }
287  catch( const GaudiException& Exception ) {
288  MsgStream log ( msgSvc() , name() + ".sysInitialize()" );
289  log << MSG::FATAL << " Exception with tag=" << Exception.tag()
290  << " is caught " << endmsg;
291  log << MSG::ERROR << Exception << endmsg;
292  }
293  catch( const std::exception& Exception ) {
294  MsgStream log ( msgSvc() , name() + ".sysInitialize()" );
295  log << MSG::FATAL << " Standard std::exception is caught " << endmsg;
296  log << MSG::ERROR << Exception.what() << endmsg;
297  }
298  catch( ... ) {
299  MsgStream log ( msgSvc() , name() + ".sysInitialize()" );
300  log << MSG::FATAL << "UNKNOWN Exception is caught " << endmsg;
301  }
302  return StatusCode::FAILURE ;
303 
304 }
305 
306 //------------------------------------------------------------------------------
308 //------------------------------------------------------------------------------
309 {
310  // For the time being there is nothing to be done here.
311  // Setting the properties is done by the ToolSvc calling setProperties()
312  // explicitly.
313  return StatusCode::SUCCESS;
314 }
315 
316 //-----------------------------------------------------------------------------
318 //-----------------------------------------------------------------------------
319 
320  try {
322  Gaudi::Guards::AuditorGuard guard(this,
323  // check if we want to audit the initialize
324  (m_auditorStart) ? auditorSvc() : 0,
326  StatusCode sc = start();
327  if (sc.isSuccess())
329  return sc;
330  }
331  catch( const GaudiException& Exception ) {
332  MsgStream log ( msgSvc() , name() + ".sysStart()" );
333  log << MSG::FATAL << " Exception with tag=" << Exception.tag()
334  << " is caught " << endmsg;
335  log << MSG::ERROR << Exception << endmsg;
336  }
337  catch( const std::exception& Exception ) {
338  MsgStream log ( msgSvc() , name() + ".sysStart()" );
339  log << MSG::FATAL << " Standard std::exception is caught " << endmsg;
340  log << MSG::ERROR << Exception.what() << endmsg;
341  }
342  catch( ... ) {
343  MsgStream log ( msgSvc() , name() + ".sysStart()" );
344  log << MSG::FATAL << "UNKNOWN Exception is caught " << endmsg;
345  }
346  return StatusCode::FAILURE ;
347 
348 }
349 
350 //------------------------------------------------------------------------------
352 //------------------------------------------------------------------------------
353 {
354  // For the time being there is nothing to be done here.
355  return StatusCode::SUCCESS;
356 }
357 
358 //-----------------------------------------------------------------------------
360 //-----------------------------------------------------------------------------
361 
362  try {
364  Gaudi::Guards::AuditorGuard guard(this,
365  // check if we want to audit the initialize
366  (m_auditorStop) ? auditorSvc() : 0,
368  StatusCode sc = stop();
369  if (sc.isSuccess())
371  return sc;
372  }
373  catch( const GaudiException& Exception ) {
374  MsgStream log ( msgSvc() , name() + ".sysStop()" );
375  log << MSG::FATAL << " Exception with tag=" << Exception.tag()
376  << " is caught " << endmsg;
377  log << MSG::ERROR << Exception << endmsg;
378  }
379  catch( const std::exception& Exception ) {
380  MsgStream log ( msgSvc() , name() + ".sysStop()" );
381  log << MSG::FATAL << " Standard std::exception is caught " << endmsg;
382  log << MSG::ERROR << Exception.what() << endmsg;
383  }
384  catch( ... ) {
385  MsgStream log ( msgSvc() , name() + ".sysStop()" );
386  log << MSG::FATAL << "UNKNOWN Exception is caught " << endmsg;
387  }
388  return StatusCode::FAILURE ;
389 
390 }
391 
392 //------------------------------------------------------------------------------
394 //------------------------------------------------------------------------------
395 {
396  // For the time being there is nothing to be done here.
397  return StatusCode::SUCCESS;
398 }
399 
400 //-----------------------------------------------------------------------------
402 //-----------------------------------------------------------------------------
403 
404  try {
406  Gaudi::Guards::AuditorGuard guard(this,
407  // check if we want to audit the initialize
408  (m_auditorFinalize) ? auditorSvc() : 0,
410  StatusCode sc = finalize();
411  if (sc.isSuccess())
413  return sc;
414  }
415  catch( const GaudiException& Exception ) {
416  MsgStream log ( msgSvc() , name() + ".sysFinalize()" );
417  log << MSG::FATAL << " Exception with tag=" << Exception.tag()
418  << " is caught " << endmsg;
419  log << MSG::ERROR << Exception << endmsg;
420  }
421  catch( const std::exception& Exception ) {
422  MsgStream log ( msgSvc() , name() + ".sysFinalize()" );
423  log << MSG::FATAL << " Standard std::exception is caught " << endmsg;
424  log << MSG::ERROR << Exception.what() << endmsg;
425  }
426  catch( ... ) {
427  MsgStream log ( msgSvc() , name() + ".sysFinalize()" );
428  log << MSG::FATAL << "UNKNOWN Exception is caught " << endmsg;
429  }
430  return StatusCode::FAILURE;
431 
432 }
433 //------------------------------------------------------------------------------
435 //------------------------------------------------------------------------------
436 {
437  // For the time being there is nothing to be done here.
438  return StatusCode::SUCCESS;
439 }
440 
441 //-----------------------------------------------------------------------------
443 //-----------------------------------------------------------------------------
444 
445  // Check that the current status is the correct one.
447  MsgStream log ( msgSvc() , name() );
448  log << MSG::ERROR
449  << "sysReinitialize(): cannot reinitialize tool not initialized"
450  << endmsg;
451  return StatusCode::FAILURE;
452  }
453 
454  try {
455  Gaudi::Guards::AuditorGuard guard(this,
456  // check if we want to audit the initialize
460  return sc;
461  }
462  catch( const GaudiException& Exception ) {
463  MsgStream log ( msgSvc() , name() + ".sysReinitialize()" );
464  log << MSG::FATAL << " Exception with tag=" << Exception.tag()
465  << " is caught" << endmsg;
466  log << MSG::ERROR << Exception << endmsg;
467  }
468  catch( const std::exception& Exception ) {
469  MsgStream log ( msgSvc() , name() + ".sysReinitialize()" );
470  log << MSG::FATAL << " Standard std::exception is caught" << endmsg;
471  log << MSG::ERROR << Exception.what() << endmsg;
472  }
473  catch( ... ) {
474  MsgStream log ( msgSvc() , name() + ".sysReinitialize()" );
475  log << MSG::FATAL << "UNKNOWN Exception is caught" << endmsg;
476  }
477  return StatusCode::FAILURE ;
478 
479 }
480 
481 //------------------------------------------------------------------------------
483 //------------------------------------------------------------------------------
484 {
485  /* @TODO
486  * MCl 2008-10-23: the implementation of reinitialize as finalize+initialize
487  * is causing too many problems
488  *
489  // Default implementation is finalize+initialize
490  StatusCode sc = finalize();
491  if (sc.isFailure()) {
492  MsgStream log ( msgSvc() , name() );
493  log << MSG::ERROR << "reinitialize(): cannot be finalized" << endmsg;
494  return sc;
495  }
496  sc = initialize();
497  if (sc.isFailure()) {
498  MsgStream log ( msgSvc() , name() );
499  log << MSG::ERROR << "reinitialize(): cannot be initialized" << endmsg;
500  return sc;
501  }
502  */
503  return StatusCode::SUCCESS;
504 }
505 
506 //-----------------------------------------------------------------------------
508 //-----------------------------------------------------------------------------
509 
510  // Check that the current status is the correct one.
512  MsgStream log ( msgSvc() , name() );
513  log << MSG::ERROR
514  << "sysRestart(): cannot reinitialize tool not started"
515  << endmsg;
516  return StatusCode::FAILURE;
517  }
518 
519  try {
521  Gaudi::Guards::AuditorGuard guard(this,
522  // check if we want to audit the initialize
523  (m_auditorRestart) ? auditorSvc() : 0,
525  StatusCode sc = restart();
526  return sc;
527  }
528  catch( const GaudiException& Exception ) {
529  MsgStream log ( msgSvc() , name() + ".sysRestart()" );
530  log << MSG::FATAL << " Exception with tag=" << Exception.tag()
531  << " is caught" << endmsg;
532  log << MSG::ERROR << Exception << endmsg;
533  }
534  catch( const std::exception& Exception ) {
535  MsgStream log ( msgSvc() , name() + ".sysRestart()" );
536  log << MSG::FATAL << " Standard std::exception is caught" << endmsg;
537  log << MSG::ERROR << Exception.what() << endmsg;
538  }
539  catch( ... ) {
540  MsgStream log ( msgSvc() , name() + ".sysRestart()" );
541  log << MSG::FATAL << "UNKNOWN Exception is caught" << endmsg;
542  }
543  return StatusCode::FAILURE ;
544 
545 }
546 
547 //------------------------------------------------------------------------------
549 //------------------------------------------------------------------------------
550 {
551  // Default implementation is stop+start
552  StatusCode sc = stop();
553  if (sc.isFailure()) {
554  MsgStream log ( msgSvc() , name() );
555  log << MSG::ERROR << "restart(): cannot be stopped" << endmsg;
556  return sc;
557  }
558  sc = start();
559  if (sc.isFailure()) {
560  MsgStream log ( msgSvc() , name() );
561  log << MSG::ERROR << "restart(): cannot be started" << endmsg;
562  return sc;
563  }
564  return StatusCode::SUCCESS;
565 }
566 
567 //------------------------------------------------------------------------------
569 //------------------------------------------------------------------------------
570 {
571  delete m_propertyMgr;
572  if( m_ptoolSvc ) m_ptoolSvc->release();
575 }
576 
577 //------------------------------------------------------------------------------
580 AlgTool::service_i(const std::string& svcName,
581  bool createIf,
582  const InterfaceID& iid,
583  void** ppSvc) const {
584  const ServiceLocatorHelper helper(*serviceLocator(), *this);
585  return helper.getService(svcName, createIf, iid, ppSvc);
586 }
587 
588 //------------------------------------------------------------------------------
590 AlgTool::service_i(const std::string& svcType,
591  const std::string& svcName,
592  const InterfaceID& iid,
593  void** ppSvc) const {
594  const ServiceLocatorHelper helper(*serviceLocator(), *this);
595  return helper.createService(svcType, svcName, iid, ppSvc);
596 }
597 
598 SmartIF<IService> AlgTool::service(const std::string& name, const bool createIf, const bool quiet) const {
599  const ServiceLocatorHelper helper(*serviceLocator(), *this);
600  return helper.service(name, quiet, createIf);
601 }
602 
603 //-----------------------------------------------------------------------------
605 //---------------------------------------------------------------------------
606  if ( 0 == m_pAuditorSvc ) {
607  StatusCode sc = service( "AuditorSvc", m_pAuditorSvc, true );
608  if( sc.isFailure() ) {
609  throw GaudiException("Service [AuditorSvc] not found", name(), sc);
610  }
611  }
612  return m_pAuditorSvc;
613 }
614 
615 
616 //-----------------------------------------------------------------------------
618 //-----------------------------------------------------------------------------
619  // do nothing... yet ?
620 }
621 
void initOutputLevel(Property &prop)
callback for output level property
Definition: AlgTool.cpp:617
The interface implemented by the IToolSvc base class.
Definition: IToolSvc.h:17
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
an helper to share the implementation of service() among the various kernel base classes $Id: ...
StatusCode setProperty(const Property &p)
set the property form another property
PropertyMgr * m_propertyMgr
Property Manager.
Definition: AlgTool.h:331
Define general base for Gaudi exception.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:26
virtual StatusCode restart()
Initialization (from RUNNING to RUNNING, via INITIALIZED).
Definition: AlgTool.cpp:548
std::string m_type
AlgTool type (concrete class name)
Definition: AlgTool.h:323
virtual const std::string & type() const
Retrieve type (concrete class) of the sub-algtool.
Definition: AlgTool.cpp:58
virtual StatusCode setProperty(const Property &p)
Default implementations for IProperty interface.
Definition: AlgTool.cpp:99
virtual StatusCode sysReinitialize()
Initialize AlgTool.
Definition: AlgTool.cpp:442
virtual StatusCode finalize()
Finalize (from INITIALIZED to CONFIGURED).
Definition: AlgTool.cpp:434
virtual Gaudi::StateMachine::State FSMState() const
Get the current state.
Definition: AlgTool.h:65
StatusCode service_i(const std::string &algName, bool createIf, const InterfaceID &iid, void **ppSvc) const
implementation of service method
Definition: AlgTool.cpp:580
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:298
IMessageSvc * m_messageSvc
Message service.
Definition: AlgTool.h:327
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
virtual StatusCode reinitialize()
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
Definition: AlgTool.cpp:482
const IInterface * m_parent
AlgTool parent.
Definition: AlgTool.h:325
IToolSvc * toolSvc() const
The standard ToolSvc service, Return a pointer to the service if present.
Definition: AlgTool.cpp:86
virtual StatusCode stop()
Stop (from RUNNING to INITIALIZED).
Definition: AlgTool.cpp:393
ISvcLocator * m_svcLocator
Pointer to Service Locator service.
Definition: AlgTool.h:326
IntegerProperty m_outputLevel
AlgTool output level.
Definition: AlgTool.h:322
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:349
Property manager helper class.
Definition: PropertyMgr.h:38
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:85
GAUDI_API bool isGaudiThreaded(const std::string &name)
test if current Gaudi object is running /will run in a thread
Definition: ThreadGaudi.cpp:75
ISvcLocator * serviceLocator() const
Retrieve pointer to service locator.
Definition: AlgTool.cpp:72
virtual StatusCode sysStart()
Start AlgTool.
Definition: AlgTool.cpp:317
virtual StatusCode sysRestart()
Start AlgTool.
Definition: AlgTool.cpp:507
StatusCode setProperties()
Method for setting declared properties to the values specified in the jobOptions via the job option s...
Definition: AlgTool.cpp:147
Gaudi::InterfaceId< IInterface, 0, 0 > iid
Interface ID.
Definition: IInterface.h:164
std::string m_monitorSvcName
Name to use for Monitor Service.
Definition: AlgTool.h:330
const std::string m_name
AlgTool full name.
Definition: AlgTool.h:324
virtual void declareUpdateHandler(PropertyCallbackFunctor *pf)
set new callback for update
Definition: Property.cpp:141
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvUnknown)
Query for a given interface.
Definition: AlgTool.cpp:18
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:82
Interface ID class.
Definition: IInterface.h:55
AlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Constructor.
Definition: AlgTool.cpp:179
string type
Definition: gaudirun.py:126
IMessageSvc * msgSvc() const
Retrieve pointer to message service.
Definition: AlgTool.cpp:79
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: AlgTool.h:234
Definition of the basic interface.
Definition: IInterface.h:160
The IMessage is the interface implemented by the message service.
Definition: IMessageSvc.h:57
std::string m_threadID
Thread Id for Alg Tool.
Definition: AlgTool.h:333
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:179
StatusCode getProperty(Property *p) const
get the property
virtual const std::string & tag() const
name tag for the exception, or exception type
IToolSvc * m_ptoolSvc
Tool service.
Definition: AlgTool.h:328
virtual StatusCode getProperty(Property *p) const
Get the property by property.
Definition: AlgTool.cpp:120
const TYPE & value() const
explicit conversion
Definition: Property.h:355
bool m_auditorFinalize
flag for auditors in "finalize()"
Definition: AlgTool.h:351
virtual StatusCode sysFinalize()
Finalize AlgTool.
Definition: AlgTool.cpp:401
virtual bool assign(const Property &source)
get the value from another property
Definition: Property.h:283
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:61
const std::vector< Property * > & getProperties() const
get all properties
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:43
Gaudi::StateMachine::State m_state
state of the Tool
Definition: AlgTool.h:355
virtual unsigned long release()=0
Release Interface instance.
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
virtual ~AlgTool()
Definition: AlgTool.cpp:568
IAuditorSvc * m_pAuditorSvc
Auditor Service.
Definition: AlgTool.h:345
bool m_auditorReinitialize
flag for auditors in "reinitialize()"
Definition: AlgTool.h:352
IMonitorSvc * m_pMonitorSvc
Online Monitoring Service.
Definition: AlgTool.h:329
Base class from which all the concrete tool classes should be derived.
Definition: AlgTool.h:34
int outputLevel() const
get tool's output level
Definition: AlgTool.h:305
virtual const std::vector< Property * > & getProperties() const
Get list of properties.
Definition: AlgTool.cpp:140
string s
Definition: gaudirun.py:210
virtual StatusCode start()
Start (from INITIALIZED to RUNNING).
Definition: AlgTool.cpp:351
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
bool m_auditorRestart
flag for auditors in "restart()"
Definition: AlgTool.h:353
tuple appMgr
Definition: IOTest.py:83
virtual const IInterface * parent() const
Retrieve parent of the sub-algtool.
Definition: AlgTool.cpp:65
SmartIF< IService > service(const std::string &name, const bool quiet=false, const bool createIf=true) const
virtual StatusCode sysStop()
Stop AlgTool.
Definition: AlgTool.cpp:359
InterfaceList m_interfaceList
Interface list.
Definition: AlgTool.h:332
virtual StatusCode initialize()
Initialization (from CONFIGURED to INITIALIZED).
Definition: AlgTool.cpp:307
BooleanProperty m_auditInit
Definition: AlgTool.h:347
This is a number of static methods for bootstrapping the Gaudi framework.
Definition: Bootstrap.h:14
bool m_auditorStart
flag for auditors in "start()"
Definition: AlgTool.h:349
Gaudi::StateMachine::State m_targetState
state of the Tool
Definition: AlgTool.h:356
virtual StatusCode sysInitialize()
Initialize AlgTool.
Definition: AlgTool.cpp:273
void declInterface(const InterfaceID &, void *)
declare interface
Definition: AlgTool.cpp:43
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:218
The interface implemented by the IAuditorSvc base class.
Definition: IAuditorSvc.h:16
Base class for all services.
Definition: Service.h:33
bool m_auditorStop
flag for auditors in "stop()"
Definition: AlgTool.h:350
virtual const std::string & name() const
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:51
GAUDI_API std::string getGaudiThreadIDfromName(const std::string &name)
helper function to extract Gaudi Thread ID from thread copy name
Definition: ThreadGaudi.cpp:28
virtual void undeclareAll(const IInterface *owner)=0
Undeclare monitoring information.
StatusCode getService(const std::string &name, bool createIf, const InterfaceID &iid, void **ppSvc) const
bool m_auditorInitialize
flag for auditors in "initialize()"
Definition: AlgTool.h:348
IAuditorSvc * auditorSvc() const
Access the auditor service.
Definition: AlgTool.cpp:604
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
GAUDI_API std::string getGaudiThreadGenericName(const std::string &name)
helper function to extract Gaudi instance name from thread copy name
Definition: ThreadGaudi.cpp:52
StatusCode createService(const std::string &name, const InterfaceID &iid, void **ppSvc) const
Base class from which all concrete auditor classes should be derived.
Definition: Auditor.h:34