MinimalEventLoopMgr.cpp
Go to the documentation of this file.
1 #define GAUDIKERNEL_MINIMALEVENTLOOPMGR_CPP
2 
3 #include "GaudiKernel/SmartIF.h"
4 #include "GaudiKernel/MsgStream.h"
5 #include "GaudiKernel/IAlgorithm.h"
6 #include "GaudiKernel/IAlgManager.h"
7 #include "GaudiKernel/TypeNameString.h"
8 #include "GaudiKernel/GaudiException.h"
9 #include "GaudiKernel/ThreadGaudi.h"
10 #include "GaudiKernel/Incident.h"
11 #include "GaudiKernel/IIncidentListener.h"
12 #include "GaudiKernel/IIncidentSvc.h"
13 #include "GaudiKernel/AppReturnCode.h"
14 
15 #include "GaudiKernel/MinimalEventLoopMgr.h"
16 
17 #include <algorithm>
18 
19 namespace {
20  class AbortEventListener: public implements1<IIncidentListener> {
21  public:
22  AbortEventListener(bool &flag, std::string &source):m_flag(flag),
23  m_source(source){
24  addRef(); // Initial count set to 1
25  }
26  virtual ~AbortEventListener() {}
28  virtual void handle(const Incident& i) {
29  if (i.type() == IncidentType::AbortEvent) {
30  m_flag = true;
31  m_source = i.source();
32  }
33  }
34 
35  private:
37  bool &m_flag;
39  std::string &m_source;
40  };
41 }
42 
43 #define ON_DEBUG if (UNLIKELY(outputLevel() <= MSG::DEBUG))
44 #define ON_VERBOSE if (UNLIKELY(outputLevel() <= MSG::VERBOSE))
45 
46 #define DEBMSG ON_DEBUG debug()
47 #define VERMSG ON_VERBOSE verbose()
48 
49 //--------------------------------------------------------------------------------------------
50 // Standard Constructor
51 //--------------------------------------------------------------------------------------------
52 MinimalEventLoopMgr::MinimalEventLoopMgr(const std::string& nam, ISvcLocator* svcLoc)
53  : base_class(nam, svcLoc), m_appMgrUI(svcLoc)
54 {
55  declareProperty("TopAlg", m_topAlgNames );
56  declareProperty("OutStream", m_outStreamNames );
57  declareProperty("OutStreamType", m_outStreamType = "OutputStream");
60  m_state = OFFLINE;
61  m_scheduledStop = false;
62  m_abortEvent = false;
63 }
64 
65 //--------------------------------------------------------------------------------------------
66 // Standard Destructor
67 //--------------------------------------------------------------------------------------------
69  m_state = OFFLINE;
70 }
71 
72 //--------------------------------------------------------------------------------------------
73 // implementation of IAppMgrUI::initialize
74 //--------------------------------------------------------------------------------------------
76 
77  if ( !m_appMgrUI.isValid() ) {
78  return StatusCode::FAILURE;
79  }
80 
82  if ( !sc.isSuccess() ) {
83  error() << "Failed to initialize Service Base class." << endmsg;
84  return StatusCode::FAILURE;
85  }
86 
88  if ( ! prpMgr.isValid() ) {
89  error() << "Error retrieving AppMgr interface IProperty." << endmsg;
90  return StatusCode::FAILURE;
91  }
92  else {
93  if ( m_topAlgNames.value().size() == 0 ) {
94  setProperty(prpMgr->getProperty("TopAlg")).ignore();
95  }
96  if ( m_outStreamNames.value().size() == 0 ) {
97  setProperty(prpMgr->getProperty("OutStream")).ignore();
98  }
99  }
100 
101  // Get the references to the services that are needed by the ApplicationMgr itself
102  m_incidentSvc = serviceLocator()->service("IncidentSvc");
103  if( !m_incidentSvc.isValid() ) {
104  fatal() << "Error retrieving IncidentSvc." << endmsg;
105  return StatusCode::FAILURE;
106  }
107 
108  m_abortEventListener = new AbortEventListener(m_abortEvent,m_abortEventSource);
110 
111  // The state is changed at this moment to allow decodeXXXX() to do something
113 
114  //--------------------------------------------------------------------------------------------
115  // Create output streams. Do not initialize them yet.
116  // The state is updated temporarily in order to enable the handler, which
117  // is also triggered by a change to the "OutputStream" Property.
118  //--------------------------------------------------------------------------------------------
119  sc = decodeOutStreams();
120  if ( !sc.isSuccess() ) {
121  error() << "Failed to initialize Output streams." << endmsg;
123  return sc;
124  }
125  //--------------------------------------------------------------------------------------------
126  // Create all needed Top Algorithms. Do not initialize them yet.
127  // The state is updated temporarily in order to enable the handler, which
128  // is also triggered by a change to the "TopAlg" Property.
129  //--------------------------------------------------------------------------------------------
130  sc = decodeTopAlgs();
131  if ( !sc.isSuccess() ) {
132  error() << "Failed to initialize Top Algorithms streams." << endmsg;
134  return sc;
135  }
136 
137  ListAlg::iterator ita;
138  // Initialize all the new TopAlgs. In fact Algorithms are protected against getting
139  // initialized twice.
140  for (ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) {
141  sc = (*ita)->sysInitialize();
142  if( !sc.isSuccess() ) {
143  error() << "Unable to initialize Algorithm: " << (*ita)->name() << endmsg;
144  return sc;
145  }
146  }
147  for (ita = m_outStreamList.begin(); ita != m_outStreamList.end(); ita++ ) {
148  sc = (*ita)->sysInitialize();
149  if( !sc.isSuccess() ) {
150  error() << "Unable to initialize Output Stream: " << (*ita)->name() << endmsg;
151  return sc;
152  }
153  }
154 
155  return StatusCode::SUCCESS;
156 }
157 //--------------------------------------------------------------------------------------------
158 // implementation of IAppMgrUI::start
159 //--------------------------------------------------------------------------------------------
161 
163  if ( ! sc.isSuccess() ) return sc;
164 
165  ListAlg::iterator ita;
166  // Start all the new TopAlgs. In fact Algorithms are protected against getting
167  // started twice.
168  for (ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) {
169  sc = (*ita)->sysStart();
170  if( !sc.isSuccess() ) {
171  error() << "Unable to start Algorithm: " << (*ita)->name() << endmsg;
172  return sc;
173  }
174  }
175  for (ita = m_outStreamList.begin(); ita != m_outStreamList.end(); ita++ ) {
176  sc = (*ita)->sysStart();
177  if( !sc.isSuccess() ) {
178  error() << "Unable to start Output Stream: " << (*ita)->name() << endmsg;
179  return sc;
180  }
181  }
182  return StatusCode::SUCCESS;
183 }
184 //--------------------------------------------------------------------------------------------
185 // implementation of IAppMgrUI::stop
186 //--------------------------------------------------------------------------------------------
188 
190 
191  ListAlg::iterator ita;
192  // Stop all the TopAlgs. In fact Algorithms are protected against getting
193  // stopped twice.
194  for (ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) {
195  sc = (*ita)->sysStop();
196  if( !sc.isSuccess() ) {
197  error() << "Unable to stop Algorithm: " << (*ita)->name() << endmsg;
198  return sc;
199  }
200  }
201  for (ita = m_outStreamList.begin(); ita != m_outStreamList.end(); ita++ ) {
202  sc = (*ita)->sysStop();
203  if( !sc.isSuccess() ) {
204  error() << "Unable to stop Output Stream: " << (*ita)->name() << endmsg;
205  return sc;
206  }
207  }
208 
209  return Service::stop();
210 }
211 
212 //--------------------------------------------------------------------------------------------
213 // implementation of IService::reinitialize
214 //--------------------------------------------------------------------------------------------
217  ListAlg::iterator ita;
218 
219  // Reinitialize all the TopAlgs.
220  for (ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) {
221  sc = (*ita)->sysReinitialize();
222  if( !sc.isSuccess() ) {
223  error() << "Unable to reinitialize Algorithm: " << (*ita)->name() << endmsg;
224  return sc;
225  }
226  }
227  for (ita = m_outStreamList.begin(); ita != m_outStreamList.end(); ita++ ) {
228  sc = (*ita)->sysReinitialize();
229  if( !sc.isSuccess() ) {
230  error() << "Unable to reinitialize Output Stream: " << (*ita)->name() << endmsg;
231  return sc;
232  }
233  }
234 
235  return sc;
236 }
237 //--------------------------------------------------------------------------------------------
238 // implementation of IService::restart
239 //--------------------------------------------------------------------------------------------
242  ListAlg::iterator ita;
243 
244  // Restart all the TopAlgs.
245  for (ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) {
246  sc = (*ita)->sysRestart();
247  if( !sc.isSuccess() ) {
248  error() << "Unable to restart Algorithm: " << (*ita)->name() << endmsg;
249  return sc;
250  }
251  }
252  for (ita = m_outStreamList.begin(); ita != m_outStreamList.end(); ita++ ) {
253  sc = (*ita)->sysRestart();
254  if( !sc.isSuccess() ) {
255  error() << "Unable to restart Output Stream: " << (*ita)->name() << endmsg;
256  return sc;
257  }
258  }
259 
260  return sc;
261 }
262 
263 //--------------------------------------------------------------------------------------------
264 // implementation of IService::finalize
265 //--------------------------------------------------------------------------------------------
269  // Call the finalize() method of all top algorithms
270  ListAlg::iterator ita;
271  for ( ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) {
272  sc = (*ita)->sysFinalize();
273  if( !sc.isSuccess() ) {
274  scRet = StatusCode::FAILURE;
275  warning() << "Finalization of algorithm " << (*ita)->name() << " failed" << endmsg;
276  }
277  }
278  // Call the finalize() method of all Output streams
279  for ( ita = m_outStreamList.begin(); ita != m_outStreamList.end(); ita++ ) {
280  sc = (*ita)->sysFinalize();
281  if( !sc.isSuccess() ) {
282  scRet = StatusCode::FAILURE;
283  warning() << "Finalization of algorithm " << (*ita)->name() << " failed" << endmsg;
284  }
285  }
286  // release all top algorithms
288  for ( ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) {
289  if (algMan->removeAlgorithm(*ita).isFailure()) {
290  scRet = StatusCode::FAILURE;
291  warning() << "Problems removing Algorithm " << (*ita)->name() << endmsg;
292  }
293  }
294  m_topAlgList.clear();
295 
296  // release all output streams
297  for ( ita = m_outStreamList.begin(); ita != m_outStreamList.end(); ita++ ) {
298  (*ita)->release();
299  }
300  m_outStreamList.clear();
301  if ( sc.isSuccess() ) m_state = FINALIZED;
302 
304  m_abortEventListener = 0; // release
305 
306  m_incidentSvc = 0; // release
307  m_appMgrUI = 0; // release
308 
309  sc = Service::finalize();
310 
311  if (sc.isFailure()) {
312  scRet = StatusCode::FAILURE;
313  error() << "Problems finalizing Service base class" << endmsg;
314  }
315 
316  return scRet;
317 }
318 
319 //--------------------------------------------------------------------------------------------
320 // implementation of IAppMgrUI::nextEvent
321 //--------------------------------------------------------------------------------------------
323  error() << "This method cannot be called on an object of type "
324  << System::typeinfoName(typeid(*this)) << endmsg;
325  return StatusCode::FAILURE;
326 }
327 
328 //--------------------------------------------------------------------------------------------
329 // IEventProcessing::executeRun
330 //--------------------------------------------------------------------------------------------
332  StatusCode sc;
333  ListAlg::iterator ita;
334  bool eventfailed = false;
335 
336  // Call the beginRun() method of all top algorithms
337  for (ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) {
338  sc = (*ita)->sysBeginRun();
339  if (!sc.isSuccess()) {
340  warning() << "beginRun() of algorithm " << (*ita)->name() << " failed" << endmsg;
341  eventfailed = true;
342  }
343  }
344 
345  // Call now the nextEvent(...)
346  sc = nextEvent(maxevt);
347  if (!sc.isSuccess()) {
348  eventfailed = true;
349  }
350 
351  // Call the endRun() method of all top algorithms
352  for (ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) {
353  sc = (*ita)->sysEndRun();
354  if (!sc.isSuccess()) {
355  warning() << "endRun() of algorithm " << (*ita)->name() << " failed" << endmsg;
356  eventfailed = true;
357  }
358  }
359 
360  if (eventfailed) {
361  return StatusCode::FAILURE;
362  }
363  else {
364  return StatusCode::SUCCESS;
365  }
366 }
367 
368 namespace {
371  class RetCodeGuard {
372  public:
373  inline RetCodeGuard(const SmartIF<IProperty> &appmgr, int retcode):
374  m_appmgr(appmgr), m_retcode(retcode) {}
375  inline void ignore() {
376  m_retcode = Gaudi::ReturnCode::Success;
377  }
378  inline ~RetCodeGuard() {
379  if (UNLIKELY(Gaudi::ReturnCode::Success != m_retcode)) {
380  Gaudi::setAppReturnCode(m_appmgr, m_retcode);
381  }
382  }
383  private:
384  SmartIF<IProperty> m_appmgr;
385  int m_retcode;
386  };
387 }
388 //--------------------------------------------------------------------------------------------
389 // Implementation of IEventProcessor::executeEvent(void* par)
390 //--------------------------------------------------------------------------------------------
392  bool eventfailed = false;
393 
394  // Call the resetExecuted() method of ALL "known" algorithms
395  // (before we were reseting only the topalgs)
397  if (LIKELY(algMan.isValid())) {
398  const auto& allAlgs = algMan->getAlgorithms();
399  std::for_each( std::begin(allAlgs), std::end(allAlgs),
400  [](IAlgorithm* alg) {
401  if (LIKELY(alg!=nullptr)) alg->resetExecuted();
402  } );
403  }
404 
405  // Get the IProperty interface of the ApplicationMgr to pass it to RetCodeGuard
406  const SmartIF<IProperty> appmgr(serviceLocator());
407  // Call the execute() method of all top algorithms
408  for (ListAlg::iterator ita = m_topAlgList.begin(); ita != m_topAlgList.end(); ita++ ) {
410  try {
411  if (UNLIKELY(m_abortEvent)) {
412  DEBMSG << "AbortEvent incident fired by "
414  m_abortEvent = false;
415  sc.ignore();
416  break;
417  }
418  RetCodeGuard rcg(appmgr, Gaudi::ReturnCode::UnhandledException);
419  sc = (*ita)->sysExecute();
420  rcg.ignore(); // disarm the guard
421  } catch ( const GaudiException& Exception ) {
422  fatal() << ".executeEvent(): Exception with tag=" << Exception.tag()
423  << " thrown by " << (*ita)->name() << endmsg;
424  error() << Exception << endmsg;
425  } catch ( const std::exception& Exception ) {
426  fatal() << ".executeEvent(): Standard std::exception thrown by "
427  << (*ita)->name() << endmsg;
428  error() << Exception.what() << endmsg;
429  } catch(...) {
430  fatal() << ".executeEvent(): UNKNOWN Exception thrown by "
431  << (*ita)->name() << endmsg;
432  }
433 
434  if (UNLIKELY(!sc.isSuccess())) {
435  warning() << "Execution of algorithm " << (*ita)->name() << " failed" << endmsg;
436  eventfailed = true;
437  }
438  }
439 
440  // ensure that the abortEvent flag is cleared before the next event
441  if (UNLIKELY(m_abortEvent)) {
442  DEBMSG << "AbortEvent incident fired by " << m_abortEventSource << endmsg;
443  m_abortEvent = false;
444  }
445 
446  // Call the execute() method of all output streams
447  for (ListAlg::iterator ito = m_outStreamList.begin(); ito != m_outStreamList.end(); ito++ ) {
448  (*ito)->resetExecuted();
449  StatusCode sc;
450  sc = (*ito)->sysExecute();
451  if (UNLIKELY(!sc.isSuccess())) {
452  warning() << "Execution of output stream " << (*ito)->name() << " failed" << endmsg;
453  eventfailed = true;
454  }
455  }
456 
457  // Check if there was an error processing current event
458  if (UNLIKELY(eventfailed)){
459  error() << "Error processing event loop." << endmsg;
460  return StatusCode(StatusCode::FAILURE,true);
461  }
462  return StatusCode(StatusCode::SUCCESS,true);
463 }
464 //--------------------------------------------------------------------------------------------
465 // Implementation of IEventProcessor::stopRun()
466 //--------------------------------------------------------------------------------------------
468  // Set the application return code
471  error() << "Could not set return code of the application ("
473  }
474  m_scheduledStop = true;
475  return StatusCode::SUCCESS;
476 }
477 
478 //--------------------------------------------------------------------------------------------
479 // Top algorithm List handler
480 //--------------------------------------------------------------------------------------------
482  if ( !(decodeTopAlgs( )).isSuccess() ) {
483  throw GaudiException("Failed to initialize Top Algorithms streams.",
484  "MinimalEventLoopMgr::topAlgHandler",
486  }
487 }
488 
489 //--------------------------------------------------------------------------------------------
490 // decodeTopAlgNameList & topAlgNameListHandler
491 //--------------------------------------------------------------------------------------------
494  if ( CONFIGURED == m_state || INITIALIZED == m_state ) {
496  if ( algMan.isValid()) {
497  // Reset the existing Top Algorithm List
498  m_topAlgList.clear( );
499  const std::vector<std::string>& algNames = m_topAlgNames.value( );
500  for (VectorName::const_iterator it = algNames.begin(); it != algNames.end(); it++) {
502  // Got the type and name. Now creating the algorithm, avoiding duplicate creation.
503  std::string item_name = item.name() + getGaudiThreadIDfromName(name());
504  const bool CREATE = false;
505  SmartIF<IAlgorithm> alg = algMan->algorithm(item_name, CREATE);
506  if (alg.isValid()) {
507  DEBMSG << "Top Algorithm " << item_name << " already exists" << endmsg;
508  }
509  else {
510  DEBMSG << "Creating Top Algorithm " << item.type() << " with name " << item_name << endmsg;
511  IAlgorithm *ialg = 0;
512  StatusCode sc1 = algMan->createAlgorithm(item.type(), item_name, ialg);
513  if( !sc1.isSuccess() ) {
514  error() << "Unable to create Top Algorithm " << item.type() << " with name " << item_name << endmsg;
515  return sc1;
516  }
517  alg = ialg; // manage reference counting
518  }
519  m_topAlgList.push_back(alg);
520  }
521  return sc;
522  }
523  sc = StatusCode::FAILURE;
524  }
525  return sc;
526 }
527 
528 //--------------------------------------------------------------------------------------------
529 // Output stream List handler
530 //--------------------------------------------------------------------------------------------
532  if ( !(decodeOutStreams( )).isSuccess() ) {
533  throw GaudiException("Failed to initialize output streams.",
534  "MinimalEventLoopMgr::outStreamHandler",
536  }
537 }
538 
539 //--------------------------------------------------------------------------------------------
540 // decodeOutStreamNameList & outStreamNameListHandler
541 //--------------------------------------------------------------------------------------------
544  if ( CONFIGURED == m_state || INITIALIZED == m_state ) {
546  if ( algMan.isValid() ) {
547  // Reset the existing Top Algorithm List
548  m_outStreamList.clear();
549  const std::vector<std::string>& algNames = m_outStreamNames.value( );
550  for (VectorName::const_iterator it = algNames.begin(); it != algNames.end(); it++) {
552  DEBMSG << "Creating " << m_outStreamType << (*it) << endmsg;
553  const bool CREATE = false;
554  SmartIF<IAlgorithm> os = algMan->algorithm( item, CREATE );
555  if (os.isValid()) {
556  DEBMSG << "Output Stream " << item.name() << " already exists" << endmsg;
557  }
558  else {
559  DEBMSG << "Creating Output Stream " << (*it) << endmsg;
560  IAlgorithm* ios = 0;
561  StatusCode sc1 = algMan->createAlgorithm( item.type(), item.name(), ios );
562  if( !sc1.isSuccess() ) {
563  error() << "Unable to create Output Stream " << (*it) << endmsg;
564  return sc1;
565  }
566  os = ios; // manage reference counting
567  }
568  m_outStreamList.push_back( os );
569  }
570  return sc;
571  }
572  sc = StatusCode::FAILURE;
573  }
574  return sc;
575 }
576 
577 
virtual ~MinimalEventLoopMgr()
Standard Destructor.
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
virtual SmartIF< IAlgorithm > & algorithm(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)=0
Returns a smart pointer to a service.
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
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 StatusCode getProperty(Property *p) const =0
Get the property by property.
virtual StatusCode stopRun()
implementation of IEventProcessor::stopRun( )
const std::string & type() const
Access to the incident type.
Definition: Incident.h:34
virtual StatusCode stop()
Stop (from RUNNING to INITIALIZED).
Definition: Service.cpp:150
bool m_scheduledStop
Scheduled stop of event processing.
virtual StatusCode setProperty(const Property &p)
Set the property by property.
Definition: Service.cpp:340
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
virtual StatusCode initialize()
implementation of IService::initialize
const std::string & source() const
Access to the source of the incident.
Definition: Incident.h:40
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:299
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
virtual StatusCode nextEvent(int maxevt)
implementation of IEventProcessor::nextEvent
virtual StatusCode start()
implementation of IService::start
void outStreamHandler(Property &p)
Output stream List handler.
virtual const std::vector< IAlgorithm * > & getAlgorithms() const =0
Return the list of Algorithms.
SmartIF< IAppMgrUI > m_appMgrUI
Reference to the IAppMgrUI interface of the application manager.
StatusCode decodeTopAlgs()
decodeTopAlgNameList & topAlgNameListHandler
virtual void resetExecuted()=0
Reset the Algorithm executed state for the current event.
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:85
const int UnhandledException
Definition: AppReturnCode.h:27
const std::string AbortEvent
Stop processing the current event and pass to te next one.
Definition: Incident.h:66
State m_state
State of the object.
virtual StatusCode createAlgorithm(const std::string &algtype, const std::string &algname, IAlgorithm *&alg, bool managed=false)=0
Create an instance of a algorithm type that has been declared beforehand and assigns to it a name...
virtual void declareUpdateHandler(PropertyCallbackFunctor *pf)
set new callback for update
Definition: Property.cpp:141
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:82
Base class used to implement the interfaces.
Definition: implements.h:133
std::string m_abortEventSource
Source of the AbortEvent incident.
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:9
virtual StatusCode executeEvent(void *par)
implementation of IEventProcessor::executeEvent(void* par)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual const std::string & tag() const
name tag for the exception, or exception type
void topAlgHandler(Property &p)
Top algorithm List handler.
StatusCode setAppReturnCode(SmartIF< IProperty > &appmgr, int value, bool force=false)
Set the application return code.
Definition: AppReturnCode.h:50
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:20
const TYPE & value() const
explicit conversion
Definition: Property.h:355
virtual StatusCode reinitialize()
implementation of IService::reinitialize
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:329
tuple end
Definition: IOTest.py:101
virtual StatusCode stop()
implementation of IService::stop
tuple retcode
Definition: gaudirun.py:477
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:43
virtual StatusCode executeRun(int maxevt)
implementation of IEventProcessor::executeRun( )
virtual StatusCode initialize()
Initialization (from CONFIGURED to INITIALIZED).
Definition: Service.cpp:72
ListAlg m_outStreamList
List of output streams.
virtual StatusCode restart()
implementation of IService::restart
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:51
virtual StatusCode finalize()
implementation of IService::finalize
const std::string & type() const
const int ScheduledStop
Definition: AppReturnCode.h:25
Base class for all Incidents (computing events).
Definition: Incident.h:16
virtual void addListener(IIncidentListener *lis, const std::string &type="", long priority=0, bool rethrow=false, bool singleShot=false)=0
Add listener.
SmartIF< IIncidentListener > m_abortEventListener
Instance of the incident listener waiting for AbortEvent.
tuple item
print s1,s2
Definition: ana.py:146
Templated class to add the standard messaging functionalities.
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
std::string m_outStreamType
Out Stream type.
#define UNLIKELY(x)
Definition: Kernel.h:127
virtual void removeListener(IIncidentListener *lis, const std::string &type="")=0
Remove listener.
const std::string & name() const
StringArrayProperty m_topAlgNames
List of top level algorithms names.
virtual StatusCode start()
Start (from INITIALIZED to RUNNING).
Definition: Service.cpp:156
virtual StatusCode removeAlgorithm(IAlgorithm *alg)=0
Remove an algorithm from the list of known algorithms.
#define LIKELY(x)
Definition: Kernel.h:126
#define DEBMSG
StatusCode decodeOutStreams()
decodeOutStreamNameList & outStreamNameListHandler
void ignore() const
Definition: StatusCode.h:107
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Service.h:212
list i
Definition: ana.py:128
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
StringArrayProperty m_outStreamNames
List of output stream names.
virtual StatusCode finalize()
Finalize (from INITIALIZED to CONFIGURED).
Definition: Service.cpp:197
MinimalEventLoopMgr(const std::string &nam, ISvcLocator *svcLoc)
Standard Constructor.
ListAlg m_topAlgList
List of top level algorithms.
bool m_abortEvent
Flag signalling that the event being processedhas to be aborted (skip all following top algs)...
SmartIF< ISvcLocator > & serviceLocator() const
Retrieve pointer to service locator.
Definition: Service.cpp:334