AlgTool.cpp
Go to the documentation of this file.
1 // Include files
2 #include "GaudiKernel/AlgTool.h"
3 #include "GaudiKernel/IMessageSvc.h"
4 #include "GaudiKernel/ISvcLocator.h"
5 #include "GaudiKernel/IJobOptionsSvc.h"
6 #include "GaudiKernel/IDataManagerSvc.h"
7 
8 #include "GaudiKernel/Algorithm.h"
9 #include "GaudiKernel/Service.h"
10 #include "GaudiKernel/Auditor.h"
11 #include "GaudiKernel/System.h"
12 #include "GaudiKernel/GaudiException.h"
13 #include "GaudiKernel/ServiceLocatorHelper.h"
14 #include "GaudiKernel/ThreadGaudi.h"
15 #include "GaudiKernel/Guards.h"
16 #include "GaudiKernel/ToolHandle.h"
17 
18 //------------------------------------------------------------------------------
19 namespace {
20 template <typename FUN>
21 StatusCode attempt( AlgTool& tool, const char* label, FUN&& fun ) {
22  try { return fun(); }
23  catch( const GaudiException& Exception ) {
24  MsgStream log ( tool.msgSvc(), tool.name() + "." + label );
25  log << MSG::FATAL << " Exception with tag=" << Exception.tag()
26  << " is caught" << endmsg;
27  log << MSG::ERROR << Exception << endmsg;
28  }
29  catch( const std::exception& Exception ) {
30  MsgStream log ( tool.msgSvc(), tool.name() + "." + label );
31  log << MSG::FATAL << " Standard std::exception is caught" << endmsg;
32  log << MSG::ERROR << Exception.what() << endmsg;
33  }
34  catch( ... ) {
35  MsgStream log ( tool.msgSvc(), tool.name() + "." + label );
36  log << MSG::FATAL << "UNKNOWN Exception is caught" << endmsg;
37  }
38  return StatusCode::FAILURE ;
39 }
40 }
41 
42 //------------------------------------------------------------------------------
44 ( const InterfaceID& riid,
45  void** ppvi )
46 //------------------------------------------------------------------------------
47 {
48  if ( !ppvi ) { return StatusCode::FAILURE ; } // RETURN
49  StatusCode sc = base_class::queryInterface(riid,ppvi);
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 }
63 //------------------------------------------------------------------------------
64 const std::string& AlgTool::name() const
65 //------------------------------------------------------------------------------
66 {
67  return m_name;
68 }
69 
70 //------------------------------------------------------------------------------
71 const std::string& AlgTool::type() const
72 //------------------------------------------------------------------------------
73 {
74  return m_type;
75 }
76 
77 //------------------------------------------------------------------------------
79 //------------------------------------------------------------------------------
80 {
81  return m_parent;
82 }
83 
84 //------------------------------------------------------------------------------
86 //------------------------------------------------------------------------------
87 {
88  return m_svcLocator;
89 }
90 
91 //------------------------------------------------------------------------------
93 //------------------------------------------------------------------------------
94 {
95  return m_messageSvc;
96 }
97 
98 // ============================================================================
99 // accessor to event service service
100 // ============================================================================
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 }
111 //------------------------------------------------------------------------------
113 //------------------------------------------------------------------------------
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 }
123 
124 //------------------------------------------------------------------------------
126 //------------------------------------------------------------------------------
127 {
128  return m_propertyMgr->setProperty(p);
129 }
130 
131 //------------------------------------------------------------------------------
132 StatusCode AlgTool::setProperty(const std::string& s)
133 //------------------------------------------------------------------------------
134 {
135  return m_propertyMgr->setProperty(s);
136 }
137 
138 //------------------------------------------------------------------------------
139 StatusCode AlgTool::setProperty(const std::string& n, const std::string& v)
140 //------------------------------------------------------------------------------
141 {
142  return m_propertyMgr->setProperty(n,v);
143 }
144 
145 //------------------------------------------------------------------------------
147 //------------------------------------------------------------------------------
148 {
149  return m_propertyMgr->getProperty(p);
150 }
151 
152 //------------------------------------------------------------------------------
153 const Property& AlgTool::getProperty(const std::string& n) const
154 {
155  return m_propertyMgr->getProperty(n);
156 }
157 
158 //------------------------------------------------------------------------------
159 StatusCode AlgTool::getProperty(const std::string& n, std::string& v ) const
160 //------------------------------------------------------------------------------
161 {
162  return m_propertyMgr->getProperty(n,v);
163 }
164 
165 //------------------------------------------------------------------------------
166 const std::vector<Property*>& AlgTool::getProperties() const
167 //------------------------------------------------------------------------------
168 {
169  return m_propertyMgr->getProperties();
170 }
171 
172 bool AlgTool::hasProperty(const std::string& name) const {
173  return m_propertyMgr->hasProperty(name);
174 }
175 
176 //------------------------------------------------------------------------------
178 //------------------------------------------------------------------------------
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 }
203 
204 //------------------------------------------------------------------------------
205 AlgTool::AlgTool( const std::string& type,
206  const std::string& name,
207  const IInterface* parent)
208 //------------------------------------------------------------------------------
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 }
280 
281 //-----------------------------------------------------------------------------
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 }
324 //------------------------------------------------------------------------------
326 //------------------------------------------------------------------------------
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 }
333 
334 //-----------------------------------------------------------------------------
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 }
348 
349 //------------------------------------------------------------------------------
351 //------------------------------------------------------------------------------
352 {
353  // For the time being there is nothing to be done here.
354  return StatusCode::SUCCESS;
355 }
356 
357 //-----------------------------------------------------------------------------
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 }
371 
372 //------------------------------------------------------------------------------
374 //------------------------------------------------------------------------------
375 {
376  // For the time being there is nothing to be done here.
377  return StatusCode::SUCCESS;
378 }
379 
380 //-----------------------------------------------------------------------------
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 }
394 //------------------------------------------------------------------------------
396 //------------------------------------------------------------------------------
397 {
398  // For the time being there is nothing to be done here.
399  return StatusCode::SUCCESS;
400 }
401 
402 //-----------------------------------------------------------------------------
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 }
424 
425 //------------------------------------------------------------------------------
427 //------------------------------------------------------------------------------
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 }
449 
450 //-----------------------------------------------------------------------------
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 }
472 
473 //------------------------------------------------------------------------------
475 //------------------------------------------------------------------------------
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 }
492 
493 //------------------------------------------------------------------------------
495 //------------------------------------------------------------------------------
496 {
497  if( m_pMonitorSvc ) { m_pMonitorSvc->undeclareAll(this); }
498 }
499 
500 
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 }
522 
523 const std::vector<IAlgTool *> & AlgTool::tools() const {
525  initToolHandles();
526 
527  return m_tools;
528 }
529 
530 std::vector<IAlgTool *> & AlgTool::tools() {
532  initToolHandles();
533 
534  return m_tools;
535 }
536 
537 //------------------------------------------------------------------------------
540 AlgTool::service_i(const std::string& svcName,
541  bool createIf,
542  const InterfaceID& iid,
543  void** ppSvc) const {
544  const ServiceLocatorHelper helper(*serviceLocator(), *this);
545  return helper.getService(svcName, createIf, iid, ppSvc);
546 }
547 
548 //------------------------------------------------------------------------------
550 AlgTool::service_i(const std::string& svcType,
551  const std::string& svcName,
552  const InterfaceID& iid,
553  void** ppSvc) const {
554  const ServiceLocatorHelper helper(*serviceLocator(), *this);
555  return helper.createService(svcType, svcName, iid, ppSvc);
556 }
557 
558 SmartIF<IService> AlgTool::service(const std::string& name, const bool createIf, const bool quiet) const {
559  const ServiceLocatorHelper helper(*serviceLocator(), *this);
560  return helper.service(name, quiet, createIf);
561 }
562 
563 //-----------------------------------------------------------------------------
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 }
574 
575 
576 //-----------------------------------------------------------------------------
578 //-----------------------------------------------------------------------------
579  // do nothing... yet ?
580 }
581 
void initOutputLevel(Property &prop)
callback for output level property
Definition: AlgTool.cpp:577
The interface implemented by the IToolSvc base class.
Definition: IToolSvc.h:18
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 ...
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:25
GAUDI_API std::string getGaudiThreadIDfromName(const std::string &name)
helper function to extract Gaudi Thread ID from thread copy name
Definition: ThreadGaudi.cpp:26
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::string m_type
AlgTool type (concrete class name)
Definition: AlgTool.h:575
SmartIF< IDataProviderSvc > m_evtSvc
Event data service.
Definition: AlgTool.h:580
SmartIF< IAuditorSvc > m_pAuditorSvc
Auditor Service.
Definition: AlgTool.h:606
StatusCode initialize() override
Definition: AlgTool.cpp:325
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
virtual Property & declareUpdateHandler(std::function< void(Property &)> fun)
set new callback for update
Definition: Property.cpp:72
StatusCode setProperty(const Property &p) override
set the property form another property
GAUDI_API bool isGaudiThreaded(const std::string &name)
test if current Gaudi object is running /will run in a thread
Definition: ThreadGaudi.cpp:73
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
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
std::vector< BaseToolHandle * > m_toolHandles
Definition: AlgTool.h:593
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
std::vector< IAlgTool * > m_tools
Definition: AlgTool.h:592
IToolSvc * toolSvc() const
The standard ToolSvc service, Return a pointer to the service if present.
Definition: AlgTool.cpp:112
DataObjectDescriptorCollection m_outputDataObjects
Definition: AlgTool.h:589
StatusCode sysReinitialize() override
Initialize AlgTool.
Definition: AlgTool.cpp:403
SmartIF< IMonitorSvc > m_pMonitorSvc
Online Monitoring Service.
Definition: AlgTool.h:582
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
Data provider interface definition.
~AlgTool() override
Definition: AlgTool.cpp:494
Property manager helper class.
Definition: PropertyMgr.h:35
StatusCode queryInterface(const InterfaceID &riid, void **ppvUnknown) override
Query for a given interface.
Definition: AlgTool.cpp:44
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
ISvcLocator * serviceLocator() const
Retrieve pointer to service locator.
Definition: AlgTool.cpp:85
StatusCode setProperties()
Method for setting declared properties to the values specified in the jobOptions via the job option s...
Definition: AlgTool.cpp:177
StatusCode sysStart() override
Start AlgTool.
Definition: AlgTool.cpp:335
Gaudi::StateMachine::State FSMState() const override
Definition: AlgTool.h:75
StatusCode sysStop() override
Stop AlgTool.
Definition: AlgTool.cpp:358
StatusCode getProperty(Property *p) const override
get the property
bool hasProperty(const std::string &name) const override
Definition: AlgTool.cpp:172
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 finalize() override
Definition: AlgTool.cpp:395
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
Interface ID class.
Definition: IInterface.h:30
AlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Constructor.
Definition: AlgTool.cpp:205
Main interface for the JobOptions service.
StatusCode setProperty(const Property &p) override
Default implementations for IProperty interface.
Definition: AlgTool.cpp:125
IMessageSvc * msgSvc() const
Retrieve pointer to message service.
Definition: AlgTool.cpp:92
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
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
const std::vector< Property * > & getProperties() const override
get all properties
SmartIF< PropertyMgr > m_propertyMgr
Property Manager.
Definition: AlgTool.h:584
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:586
const IInterface * m_parent
AlgTool parent.
Definition: AlgTool.h:577
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
virtual const std::string & tag() const
name tag for the exception, or exception type
StatusCode restart() override
Definition: AlgTool.cpp:474
virtual const std::string & type() const =0
The type of an AlgTool, meaning the concrete AlgTool class.
const std::vector< IAlgTool * > & tools() const
Definition: AlgTool.cpp:523
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
IDataProviderSvc * evtSvc() const
accessor to event service service
Definition: AlgTool.cpp:101
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
Gaudi::StateMachine::State m_state
state of the Tool
Definition: AlgTool.h:616
double fun(const std::vector< double > &x)
Definition: PFuncTest.cpp:26
bool m_auditorReinitialize
flag for auditors in "reinitialize()"
Definition: AlgTool.h:613
Base class from which all the concrete tool classes should be derived.
Definition: AlgTool.h:44
int outputLevel() const
get tool's output level
Definition: AlgTool.h:557
The interface implemented by the AlgTool base class.
Definition: IAlgTool.h:23
string s
Definition: gaudirun.py:245
bool hasProperty(const std::string &name) const override
Return true if we have a property with the given name.
tuple item
print s1,s2
Definition: ana.py:146
#define UNLIKELY(x)
Definition: Kernel.h:126
ISvcLocator * m_svcLocator
Pointer to Service Locator service.
Definition: AlgTool.h:578
bool m_auditorRestart
flag for auditors in "restart()"
Definition: AlgTool.h:614
tuple appMgr
Definition: IOTest.py:83
const std::vector< Property * > & getProperties() const override
Definition: AlgTool.cpp:166
const std::string & type() const override
Retrieve type (concrete class) of the sub-algtool.
Definition: AlgTool.cpp:71
SmartIF< IService > service(const std::string &name, const bool quiet=false, const bool createIf=true) const
StatusCode reinitialize() override
Definition: AlgTool.cpp:426
SmartIF< IToolSvc > m_ptoolSvc
Tool service.
Definition: AlgTool.h:581
StatusCode stop() override
Definition: AlgTool.cpp:373
BooleanProperty m_auditInit
Definition: AlgTool.h:608
StatusCode sysInitialize() override
Initialize AlgTool.
Definition: AlgTool.cpp:282
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
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:21
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:214
The interface implemented by the IAuditorSvc base class.
Definition: IAuditorSvc.h:15
Base class for all services.
Definition: Service.h:35
StatusCode getProperty(Property *p) const override
Definition: AlgTool.cpp:146
bool m_auditorStop
flag for auditors in "stop()"
Definition: AlgTool.h:611
virtual void undeclareAll(const IInterface *owner)=0
Undeclare monitoring information.
list i
Definition: ana.py:128
void initToolHandles() const
Definition: AlgTool.cpp:501
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:64
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:609
IAuditorSvc * auditorSvc() const
Access the auditor service.
Definition: AlgTool.cpp:564
DataObjectDescriptorCollection m_inputDataObjects
Definition: AlgTool.h:588
StatusCode sysFinalize() override
Finalize AlgTool.
Definition: AlgTool.cpp:381
string type
Definition: gaudirun.py:151
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
StatusCode sysRestart() override
Start AlgTool.
Definition: AlgTool.cpp:451
StatusCode start() override
Definition: AlgTool.cpp:350
const IInterface * parent() const override
Retrieve parent of the sub-algtool.
Definition: AlgTool.cpp:78