The Gaudi Framework  v30r4 (9b837755)
MinimalEventLoopMgr.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_MINIMALEVENTLOOPMGR_H
2 #define GAUDIKERNEL_MINIMALEVENTLOOPMGR_H 1
3 
4 // Framework include files
13 #include "GaudiKernel/Service.h"
14 
15 // STL include files
16 #include <list>
17 #include <vector>
18 
28 class GAUDI_API MinimalEventLoopMgr : public extends<Service, IEventProcessor>
29 {
30 private:
31  class AbortEventListener : public implements<IIncidentListener>
32  {
33  public:
35  void handle( const Incident& i ) override
36  {
37  if ( i.type() == IncidentType::AbortEvent ) {
38  abortEvent = true;
39  abortEventSource = i.source();
40  }
41  }
42 
43  public:
46  bool abortEvent = false;
49  };
50 
51 public:
53 
54 protected:
55  // Properties
57  this, "TopAlg", {}, &MinimalEventLoopMgr::topAlgHandler, "list of top level algorithms names"};
59  this, "OutStream", {}, &MinimalEventLoopMgr::outStreamHandler, "list of output stream names"};
60  Gaudi::Property<std::string> m_outStreamType{this, "OutStreamType", "OutputStream",
61  "[[deprecated]] default type for OutputStream instances"};
62  Gaudi::Property<bool> m_printCFExp{this, "PrintControlFlowExpression", false,
63  "Print the control flow expression representing the content of TopAlg"};
64 
65  // enums
66  enum State { OFFLINE, CONFIGURED, FINALIZED, INITIALIZED };
73  ListAlg m_topAlgList;
75  ListAlg m_outStreamList;
77  State m_state = OFFLINE;
79  bool m_scheduledStop = false;
82 
83 public:
85  MinimalEventLoopMgr( const std::string& nam, ISvcLocator* svcLoc );
86 
87 #if defined( GAUDI_V20_COMPAT ) && !defined( G21_NO_DEPRECATED )
88 protected:
90  template <class T>
91  T* releaseInterface( T* iface )
92  {
93  if ( 0 != iface ) iface->release();
94  return 0;
95  }
96 
97 public:
98 #endif
99 
101  StatusCode initialize() override;
103  StatusCode start() override;
105  StatusCode stop() override;
107  StatusCode finalize() override;
109  StatusCode reinitialize() override;
111  StatusCode restart() override;
112 
114  StatusCode nextEvent( int maxevt ) override;
116  StatusCode executeEvent( void* par ) override;
118  StatusCode executeRun( int maxevt ) override;
120  StatusCode stopRun() override;
121 
123  void topAlgHandler( Gaudi::Details::PropertyBase& p );
125  StatusCode decodeTopAlgs();
127  void outStreamHandler( Gaudi::Details::PropertyBase& p );
129  StatusCode decodeOutStreams();
130 
131 private:
136 
139 
140  // number of events processed
141  size_t m_nevt{0};
142 };
143 #endif // GAUDIKERNEL_MINIMALEVENTLOOPMGR_H
void topAlgHandler(Gaudi::Details::PropertyBase &p)
Top algorithm List handler.
Base class used to implement the interfaces.
Definition: implements.h:9
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
const std::string & type() const
Access to the incident type.
Definition: Incident.h:41
Implementation of property with value of concrete type.
Definition: Property.h:383
SmartIF< IAlgExecStateSvc > m_aess
List of top level algorithms.
const std::string & source() const
Access to the source of the incident.
Definition: Incident.h:47
void outStreamHandler(Gaudi::Details::PropertyBase &p)
Output stream List handler.
std::string abortEventSource
Source of the AbortEvent incident.
PropertyMgr & operator=(const PropertyMgr &)=delete
STL class.
std::vector< SmartIF< IAlgorithm > > ListAlg
SmartIF< IHiveWhiteBoard > m_WB
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
start
Definition: IOTest.py:99
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:34
AbortEventListener m_abortEventListener
Instance of the incident listener waiting for AbortEvent.
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
STL class.
ListAlg m_outStreamList
List of output streams.
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
Base class for all Incidents (computing events).
Definition: Incident.h:17
This is the default processing manager of the application manager.
int maxevt
Definition: Bootstrap.cpp:276
return ep &&ep executeRun(maxevt).isSuccess()
#define GAUDI_API
Definition: Kernel.h:71
SmartIF< IAppMgrUI > m_appMgrUI
Reference to the IAppMgrUI interface of the application manager.
void handle(const Incident &i) override
Inform that a new incident has occurred.