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_state ( Gaudi::StateMachine::CONFIGURED )
197  , m_targetState ( Gaudi::StateMachine::CONFIGURED )
198 {
199  addRef(); // Initial count set to 1
200 
201  declareProperty( "MonitorService", m_monitorSvcName = "MonitorSvc" );
202 
203  { // get the "OutputLevel" property from parent
204  const Property* _p = Gaudi::Utils::getProperty ( parent , "OutputLevel") ;
205  if ( 0 != _p ) { m_outputLevel.assign( *_p ) ; }
206  declareProperty ( "OutputLevel" , m_outputLevel ) ;
208  }
209 
210  IInterface* _p = const_cast<IInterface*> ( parent ) ;
211 
212  if ( Algorithm* _alg = dynamic_cast<Algorithm*> ( _p ) )
213  {
214  m_svcLocator = _alg -> serviceLocator () ;
215  m_messageSvc = _alg -> msgSvc () ;
216  m_threadID = getGaudiThreadIDfromName ( _alg -> name() ) ;
217  }
218  else if ( Service* _svc = dynamic_cast<Service*> ( _p ) )
219  {
220  m_svcLocator = _svc -> serviceLocator () ;
221  m_messageSvc = _svc -> msgSvc () ;
222  m_threadID = getGaudiThreadIDfromName ( _svc -> name() ) ;
223  }
224  else if ( AlgTool* _too = dynamic_cast<AlgTool*> ( _p ) )
225  {
226  m_svcLocator = _too -> m_svcLocator;
227  m_messageSvc = _too -> m_messageSvc;
229  }
230  else if ( Auditor* _aud = dynamic_cast<Auditor*> ( _p ) )
231  {
232  m_svcLocator = _aud -> serviceLocator() ;
233  m_messageSvc = _aud -> msgSvc() ;
234  m_threadID = getGaudiThreadIDfromName ( _aud -> name() ) ;
235  }
236  else
237  {
238  throw GaudiException
239  ( "Failure to create tool '"
240  + type + "/" + name + "': illegal parent type '"
241  + System::typeinfoName(typeid(*_p)) + "'", "AlgTool", 0 );
242  }
243 
244 
245  { // audit tools
246  SmartIF<IProperty> appMgr(m_svcLocator->service("ApplicationMgr"));
247  if ( !appMgr.isValid() ) {
248  throw GaudiException("Could not locate ApplicationMgr","AlgTool",0);
249  }
250  const Property* p = Gaudi::Utils::getProperty( appMgr , "AuditTools");
251  if ( 0 != p ) { m_auditInit.assign ( *p ) ; }
252  declareProperty ( "AuditTools", m_auditInit );
253  bool audit = m_auditInit.value();
254  // Declare common AlgTool properties with their defaults
255  declareProperty ( "AuditInitialize" , m_auditorInitialize = audit ) ;
256  declareProperty ( "AuditStart" , m_auditorStart = audit ) ;
257  declareProperty ( "AuditStop" , m_auditorStop = audit ) ;
258  declareProperty ( "AuditFinalize" , m_auditorFinalize = audit ) ;
259  }
260 
261  // check thread ID and try if tool name indicates thread ID
262  if ( m_threadID.empty() )
264 }
265 
266 //-----------------------------------------------------------------------------
268 //-----------------------------------------------------------------------------
269 
270  try {
272  Gaudi::Guards::AuditorGuard guard(this,
273  // check if we want to audit the initialize
277  if (sc.isSuccess())
279  return sc;
280  }
281  catch( const GaudiException& Exception ) {
282  MsgStream log ( msgSvc() , name() + ".sysInitialize()" );
283  log << MSG::FATAL << " Exception with tag=" << Exception.tag()
284  << " is caught " << endmsg;
285  log << MSG::ERROR << Exception << endmsg;
286  }
287  catch( const std::exception& Exception ) {
288  MsgStream log ( msgSvc() , name() + ".sysInitialize()" );
289  log << MSG::FATAL << " Standard std::exception is caught " << endmsg;
290  log << MSG::ERROR << Exception.what() << endmsg;
291  }
292  catch( ... ) {
293  MsgStream log ( msgSvc() , name() + ".sysInitialize()" );
294  log << MSG::FATAL << "UNKNOWN Exception is caught " << endmsg;
295  }
296  return StatusCode::FAILURE ;
297 
298 }
299 
300 //------------------------------------------------------------------------------
302 //------------------------------------------------------------------------------
303 {
304  // For the time being there is nothing to be done here.
305  // Setting the properties is done by the ToolSvc calling setProperties()
306  // explicitly.
307  return StatusCode::SUCCESS;
308 }
309 
310 //-----------------------------------------------------------------------------
312 //-----------------------------------------------------------------------------
313 
314  try {
316  Gaudi::Guards::AuditorGuard guard(this,
317  // check if we want to audit the initialize
318  (m_auditorStart) ? auditorSvc() : 0,
320  StatusCode sc = start();
321  if (sc.isSuccess())
323  return sc;
324  }
325  catch( const GaudiException& Exception ) {
326  MsgStream log ( msgSvc() , name() + ".sysStart()" );
327  log << MSG::FATAL << " Exception with tag=" << Exception.tag()
328  << " is caught " << endmsg;
329  log << MSG::ERROR << Exception << endmsg;
330  }
331  catch( const std::exception& Exception ) {
332  MsgStream log ( msgSvc() , name() + ".sysStart()" );
333  log << MSG::FATAL << " Standard std::exception is caught " << endmsg;
334  log << MSG::ERROR << Exception.what() << endmsg;
335  }
336  catch( ... ) {
337  MsgStream log ( msgSvc() , name() + ".sysStart()" );
338  log << MSG::FATAL << "UNKNOWN Exception is caught " << endmsg;
339  }
340  return StatusCode::FAILURE ;
341 
342 }
343 
344 //------------------------------------------------------------------------------
346 //------------------------------------------------------------------------------
347 {
348  // For the time being there is nothing to be done here.
349  return StatusCode::SUCCESS;
350 }
351 
352 //-----------------------------------------------------------------------------
354 //-----------------------------------------------------------------------------
355 
356  try {
358  Gaudi::Guards::AuditorGuard guard(this,
359  // check if we want to audit the initialize
360  (m_auditorStop) ? auditorSvc() : 0,
362  StatusCode sc = stop();
363  if (sc.isSuccess())
365  return sc;
366  }
367  catch( const GaudiException& Exception ) {
368  MsgStream log ( msgSvc() , name() + ".sysStop()" );
369  log << MSG::FATAL << " Exception with tag=" << Exception.tag()
370  << " is caught " << endmsg;
371  log << MSG::ERROR << Exception << endmsg;
372  }
373  catch( const std::exception& Exception ) {
374  MsgStream log ( msgSvc() , name() + ".sysStop()" );
375  log << MSG::FATAL << " Standard std::exception is caught " << endmsg;
376  log << MSG::ERROR << Exception.what() << endmsg;
377  }
378  catch( ... ) {
379  MsgStream log ( msgSvc() , name() + ".sysStop()" );
380  log << MSG::FATAL << "UNKNOWN Exception is caught " << endmsg;
381  }
382  return StatusCode::FAILURE ;
383 
384 }
385 
386 //------------------------------------------------------------------------------
388 //------------------------------------------------------------------------------
389 {
390  // For the time being there is nothing to be done here.
391  return StatusCode::SUCCESS;
392 }
393 
394 //-----------------------------------------------------------------------------
396 //-----------------------------------------------------------------------------
397 
398  try {
400  Gaudi::Guards::AuditorGuard guard(this,
401  // check if we want to audit the initialize
402  (m_auditorFinalize) ? auditorSvc() : 0,
404  StatusCode sc = finalize();
405  if (sc.isSuccess())
407  return sc;
408  }
409  catch( const GaudiException& Exception ) {
410  MsgStream log ( msgSvc() , name() + ".sysFinalize()" );
411  log << MSG::FATAL << " Exception with tag=" << Exception.tag()
412  << " is caught " << endmsg;
413  log << MSG::ERROR << Exception << endmsg;
414  }
415  catch( const std::exception& Exception ) {
416  MsgStream log ( msgSvc() , name() + ".sysFinalize()" );
417  log << MSG::FATAL << " Standard std::exception is caught " << endmsg;
418  log << MSG::ERROR << Exception.what() << endmsg;
419  }
420  catch( ... ) {
421  MsgStream log ( msgSvc() , name() + ".sysFinalize()" );
422  log << MSG::FATAL << "UNKNOWN Exception is caught " << endmsg;
423  }
424  return StatusCode::FAILURE;
425 
426 }
427 //------------------------------------------------------------------------------
429 //------------------------------------------------------------------------------
430 {
431  // For the time being there is nothing to be done here.
432  return StatusCode::SUCCESS;
433 }
434 
435 //-----------------------------------------------------------------------------
437 //-----------------------------------------------------------------------------
438 
439  // Check that the current status is the correct one.
441  MsgStream log ( msgSvc() , name() );
442  log << MSG::ERROR
443  << "sysReinitialize(): cannot reinitialize tool not initialized"
444  << endmsg;
445  return StatusCode::FAILURE;
446  }
447 
448  try {
449  Gaudi::Guards::AuditorGuard guard(this,
450  // check if we want to audit the initialize
454  return sc;
455  }
456  catch( const GaudiException& Exception ) {
457  MsgStream log ( msgSvc() , name() + ".sysReinitialize()" );
458  log << MSG::FATAL << " Exception with tag=" << Exception.tag()
459  << " is caught" << endmsg;
460  log << MSG::ERROR << Exception << endmsg;
461  }
462  catch( const std::exception& Exception ) {
463  MsgStream log ( msgSvc() , name() + ".sysReinitialize()" );
464  log << MSG::FATAL << " Standard std::exception is caught" << endmsg;
465  log << MSG::ERROR << Exception.what() << endmsg;
466  }
467  catch( ... ) {
468  MsgStream log ( msgSvc() , name() + ".sysReinitialize()" );
469  log << MSG::FATAL << "UNKNOWN Exception is caught" << endmsg;
470  }
471  return StatusCode::FAILURE ;
472 
473 }
474 
475 //------------------------------------------------------------------------------
477 //------------------------------------------------------------------------------
478 {
479  /* @TODO
480  * MCl 2008-10-23: the implementation of reinitialize as finalize+initialize
481  * is causing too many problems
482  *
483  // Default implementation is finalize+initialize
484  StatusCode sc = finalize();
485  if (sc.isFailure()) {
486  MsgStream log ( msgSvc() , name() );
487  log << MSG::ERROR << "reinitialize(): cannot be finalized" << endmsg;
488  return sc;
489  }
490  sc = initialize();
491  if (sc.isFailure()) {
492  MsgStream log ( msgSvc() , name() );
493  log << MSG::ERROR << "reinitialize(): cannot be initialized" << endmsg;
494  return sc;
495  }
496  */
497  return StatusCode::SUCCESS;
498 }
499 
500 //-----------------------------------------------------------------------------
502 //-----------------------------------------------------------------------------
503 
504  // Check that the current status is the correct one.
506  MsgStream log ( msgSvc() , name() );
507  log << MSG::ERROR
508  << "sysRestart(): cannot reinitialize tool not started"
509  << endmsg;
510  return StatusCode::FAILURE;
511  }
512 
513  try {
515  Gaudi::Guards::AuditorGuard guard(this,
516  // check if we want to audit the initialize
517  (m_auditorRestart) ? auditorSvc() : 0,
519  StatusCode sc = restart();
520  return sc;
521  }
522  catch( const GaudiException& Exception ) {
523  MsgStream log ( msgSvc() , name() + ".sysRestart()" );
524  log << MSG::FATAL << " Exception with tag=" << Exception.tag()
525  << " is caught" << endmsg;
526  log << MSG::ERROR << Exception << endmsg;
527  }
528  catch( const std::exception& Exception ) {
529  MsgStream log ( msgSvc() , name() + ".sysRestart()" );
530  log << MSG::FATAL << " Standard std::exception is caught" << endmsg;
531  log << MSG::ERROR << Exception.what() << endmsg;
532  }
533  catch( ... ) {
534  MsgStream log ( msgSvc() , name() + ".sysRestart()" );
535  log << MSG::FATAL << "UNKNOWN Exception is caught" << endmsg;
536  }
537  return StatusCode::FAILURE ;
538 
539 }
540 
541 //------------------------------------------------------------------------------
543 //------------------------------------------------------------------------------
544 {
545  // Default implementation is stop+start
546  StatusCode sc = stop();
547  if (sc.isFailure()) {
548  MsgStream log ( msgSvc() , name() );
549  log << MSG::ERROR << "restart(): cannot be stopped" << endmsg;
550  return sc;
551  }
552  sc = start();
553  if (sc.isFailure()) {
554  MsgStream log ( msgSvc() , name() );
555  log << MSG::ERROR << "restart(): cannot be started" << endmsg;
556  return sc;
557  }
558  return StatusCode::SUCCESS;
559 }
560 
561 //------------------------------------------------------------------------------
563 //------------------------------------------------------------------------------
564 {
565  delete m_propertyMgr;
566  if( m_ptoolSvc ) m_ptoolSvc->release();
569 }
570 
571 //------------------------------------------------------------------------------
574 AlgTool::service_i(const std::string& svcName,
575  bool createIf,
576  const InterfaceID& iid,
577  void** ppSvc) const {
578  const ServiceLocatorHelper helper(*serviceLocator(), *this);
579  return helper.getService(svcName, createIf, iid, ppSvc);
580 }
581 
582 //------------------------------------------------------------------------------
584 AlgTool::service_i(const std::string& svcType,
585  const std::string& svcName,
586  const InterfaceID& iid,
587  void** ppSvc) const {
588  const ServiceLocatorHelper helper(*serviceLocator(), *this);
589  return helper.createService(svcType, svcName, iid, ppSvc);
590 }
591 
592 SmartIF<IService> AlgTool::service(const std::string& name, const bool createIf, const bool quiet) const {
593  const ServiceLocatorHelper helper(*serviceLocator(), *this);
594  return helper.service(name, quiet, createIf);
595 }
596 
597 //-----------------------------------------------------------------------------
599 //---------------------------------------------------------------------------
600  if ( 0 == m_pAuditorSvc ) {
601  StatusCode sc = service( "AuditorSvc", m_pAuditorSvc, true );
602  if( sc.isFailure() ) {
603  throw GaudiException("Service [AuditorSvc] not found", name(), sc);
604  }
605  }
606  return m_pAuditorSvc;
607 }
608 
609 
610 //-----------------------------------------------------------------------------
612 //-----------------------------------------------------------------------------
613  // do nothing... yet ?
614 }
615 
void initOutputLevel(Property &prop)
callback for output level property
Definition: AlgTool.cpp:611
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:329
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:542
std::string m_type
AlgTool type (concrete class name)
Definition: AlgTool.h:321
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:436
virtual StatusCode finalize()
Finalize (from INITIALIZED to CONFIGURED).
Definition: AlgTool.cpp:428
virtual Gaudi::StateMachine::State FSMState() const
Get the current state.
Definition: AlgTool.h:63
StatusCode service_i(const std::string &algName, bool createIf, const InterfaceID &iid, void **ppSvc) const
implementation of service method
Definition: AlgTool.cpp:574
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:325
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:62
virtual StatusCode reinitialize()
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
Definition: AlgTool.cpp:476
const IInterface * m_parent
AlgTool parent.
Definition: AlgTool.h:323
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:387
ISvcLocator * m_svcLocator
Pointer to Service Locator service.
Definition: AlgTool.h:324
IntegerProperty m_outputLevel
AlgTool output level.
Definition: AlgTool.h:320
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:72
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:311
virtual StatusCode sysRestart()
Start AlgTool.
Definition: AlgTool.cpp:501
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:328
const std::string m_name
AlgTool full name.
Definition: AlgTool.h:322
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:232
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:331
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:177
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:326
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:349
virtual StatusCode sysFinalize()
Finalize AlgTool.
Definition: AlgTool.cpp:395
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:353
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:562
IAuditorSvc * m_pAuditorSvc
Auditor Service.
Definition: AlgTool.h:343
bool m_auditorReinitialize
flag for auditors in "reinitialize()"
Definition: AlgTool.h:350
IMonitorSvc * m_pMonitorSvc
Online Monitoring Service.
Definition: AlgTool.h:327
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:303
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:345
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
bool m_auditorRestart
flag for auditors in "restart()"
Definition: AlgTool.h:351
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:353
InterfaceList m_interfaceList
Interface list.
Definition: AlgTool.h:330
virtual StatusCode initialize()
Initialization (from CONFIGURED to INITIALIZED).
Definition: AlgTool.cpp:301
BooleanProperty m_auditInit
Definition: AlgTool.h:345
This is a number of static methods for bootstrapping the Gaudi framework.
Definition: Bootstrap.h:15
bool m_auditorStart
flag for auditors in "start()"
Definition: AlgTool.h:347
Gaudi::StateMachine::State m_targetState
state of the Tool
Definition: AlgTool.h:354
virtual StatusCode sysInitialize()
Initialize AlgTool.
Definition: AlgTool.cpp:267
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:348
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:346
IAuditorSvc * auditorSvc() const
Access the auditor service.
Definition: AlgTool.cpp:598
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:243
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