The Gaudi Framework  v32r2 (46d42edc)
MinimalEventLoopMgr.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_MINIMALEVENTLOOPMGR_H
2 #define GAUDIKERNEL_MINIMALEVENTLOOPMGR_H 1
3 
12 #include <GaudiKernel/Service.h>
13 #include <vector>
14 
24 class GAUDI_API MinimalEventLoopMgr : public extends<Service, IEventProcessor> {
25 private:
26  class AbortEventListener : public implements<IIncidentListener> {
27  public:
29  void handle( const Incident& i ) override {
30  if ( i.type() == IncidentType::AbortEvent ) {
31  abortEvent = true;
32  abortEventSource = i.source();
33  }
34  }
35 
36  public:
39  bool abortEvent = false;
42  };
43 
44 public:
46 
47 protected:
48  // Properties
50  this, "TopAlg", {}, &MinimalEventLoopMgr::topAlgHandler, "list of top level algorithms names"};
52  this, "OutStream", {}, &MinimalEventLoopMgr::outStreamHandler, "list of output stream names"};
53  Gaudi::Property<std::string> m_outStreamType{this, "OutStreamType", "OutputStream",
54  "[[deprecated]] default type for OutputStream instances"};
55  Gaudi::Property<bool> m_printCFExp{this, "PrintControlFlowExpression", false,
56  "Print the control flow expression representing the content of TopAlg"};
57 
58  // enums
59  enum State { OFFLINE, CONFIGURED, FINALIZED, INITIALIZED };
70  State m_state = OFFLINE;
72  bool m_scheduledStop = false;
75 
76 public:
78  MinimalEventLoopMgr( const std::string& nam, ISvcLocator* svcLoc );
80  MinimalEventLoopMgr( const MinimalEventLoopMgr& ) = delete;
82  MinimalEventLoopMgr& operator=( const MinimalEventLoopMgr& ) = delete;
83 
84 #if defined( GAUDI_V20_COMPAT ) && !defined( G21_NO_DEPRECATED )
85 protected:
87  template <class T>
88  T* releaseInterface( T* iface ) {
89  if ( 0 != iface ) iface->release();
90  return 0;
91  }
92 
93 public:
94 #endif
95 
97  StatusCode initialize() override;
99  StatusCode start() override;
101  StatusCode stop() override;
103  StatusCode finalize() override;
105  StatusCode reinitialize() override;
107  StatusCode restart() override;
109  EventContext createEventContext() override;
111  StatusCode nextEvent( int maxevt ) override;
113  StatusCode executeEvent( EventContext&& ctx ) override;
115  StatusCode executeRun( int maxevt ) override;
117  StatusCode stopRun() override;
118 
120  void topAlgHandler( Gaudi::Details::PropertyBase& p );
122  StatusCode decodeTopAlgs();
124  void outStreamHandler( Gaudi::Details::PropertyBase& p );
126  StatusCode decodeOutStreams();
127 
128 protected:
131 
132  // number of events processed
133  size_t m_nevt{0};
134 };
135 #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
executeEvent
Helpers for re-entrant interfaces.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
Implementation of property with value of concrete type.
Definition: Property.h:352
const std::string & type() const
Access to the incident type.
Definition: Incident.h:38
SmartIF< IAlgExecStateSvc > m_aess
List of top level algorithms.
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
def start
Definition: IOTest.py:98
const std::string & source() const
Access to the source of the incident.
Definition: Incident.h:44
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
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.
int maxevt
Definition: Bootstrap.cpp:260
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.