The Gaudi Framework  v32r0 (3325bb39)
MinimalEventLoopMgr.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_MINIMALEVENTLOOPMGR_H
2 #define GAUDIKERNEL_MINIMALEVENTLOOPMGR_H 1
3 
13 #include <GaudiKernel/Service.h>
14 #include <vector>
15 
25 class GAUDI_API MinimalEventLoopMgr : public extends<Service, IEventProcessor> {
26 private:
27  class AbortEventListener : public implements<IIncidentListener> {
28  public:
30  void handle( const Incident& i ) override {
31  if ( i.type() == IncidentType::AbortEvent ) {
32  abortEvent = true;
33  abortEventSource = i.source();
34  }
35  }
36 
37  public:
40  bool abortEvent = false;
43  };
44 
45 public:
47 
48 protected:
49  // Properties
51  this, "TopAlg", {}, &MinimalEventLoopMgr::topAlgHandler, "list of top level algorithms names"};
53  this, "OutStream", {}, &MinimalEventLoopMgr::outStreamHandler, "list of output stream names"};
54  Gaudi::Property<std::string> m_outStreamType{this, "OutStreamType", "OutputStream",
55  "[[deprecated]] default type for OutputStream instances"};
56  Gaudi::Property<bool> m_printCFExp{this, "PrintControlFlowExpression", false,
57  "Print the control flow expression representing the content of TopAlg"};
58 
59  // enums
60  enum State { OFFLINE, CONFIGURED, FINALIZED, INITIALIZED };
67  ListAlg m_topAlgList;
69  ListAlg m_outStreamList;
71  State m_state = OFFLINE;
73  bool m_scheduledStop = false;
76 
77 public:
79  MinimalEventLoopMgr( const std::string& nam, ISvcLocator* svcLoc );
81  MinimalEventLoopMgr( const MinimalEventLoopMgr& ) = delete;
84 
85 #if defined( GAUDI_V20_COMPAT ) && !defined( G21_NO_DEPRECATED )
86 protected:
88  template <class T>
89  T* releaseInterface( T* iface ) {
90  if ( 0 != iface ) iface->release();
91  return 0;
92  }
93 
94 public:
95 #endif
96 
98  StatusCode initialize() override;
100  StatusCode start() override;
102  StatusCode stop() override;
104  StatusCode finalize() override;
106  StatusCode reinitialize() override;
108  StatusCode restart() override;
110  EventContext createEventContext() override;
112  StatusCode nextEvent( int maxevt ) override;
114  StatusCode executeEvent( EventContext&& ctx ) override;
116  StatusCode executeRun( int maxevt ) override;
118  StatusCode stopRun() override;
119 
121  void topAlgHandler( Gaudi::Details::PropertyBase& p );
123  StatusCode decodeTopAlgs();
125  void outStreamHandler( Gaudi::Details::PropertyBase& p );
127  StatusCode decodeOutStreams();
128 
129 protected:
132 
133  // number of events processed
134  size_t m_nevt{0};
135 };
136 #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:38
Implementation of property with value of concrete type.
Definition: Property.h:352
SmartIF< IAlgExecStateSvc > m_aess
List of top level algorithms.
const std::string & source() const
Access to the source of the incident.
Definition: Incident.h:44
void outStreamHandler(Gaudi::Details::PropertyBase &p)
Output stream List handler.
std::string abortEventSource
Source of the AbortEvent incident.
This class represents an entry point to all the event specific data.
Definition: EventContext.h:24
PropertyMgr & operator=(const PropertyMgr &)=delete
STL class.
std::vector< SmartIF< IAlgorithm > > ListAlg
SmartIF< IHiveWhiteBoard > m_WB
< Event data service (whiteboard)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
start
Definition: IOTest.py:97
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
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.
#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.