Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 private:
30  class AbortEventListener : public implements<IIncidentListener> {
31  public:
33  void handle( const Incident& i ) override {
34  if ( i.type() == IncidentType::AbortEvent ) {
35  abortEvent = true;
36  abortEventSource = i.source();
37  }
38  }
39 
40  public:
43  bool abortEvent = false;
46  };
47 
48 public:
50 
51 protected:
52  // Properties
54  this, "TopAlg", {}, &MinimalEventLoopMgr::topAlgHandler, "list of top level algorithms names"};
56  this, "OutStream", {}, &MinimalEventLoopMgr::outStreamHandler, "list of output stream names"};
57  Gaudi::Property<std::string> m_outStreamType{this, "OutStreamType", "OutputStream",
58  "[[deprecated]] default type for OutputStream instances"};
59  Gaudi::Property<bool> m_printCFExp{this, "PrintControlFlowExpression", false,
60  "Print the control flow expression representing the content of TopAlg"};
61 
62  // enums
63  enum State { OFFLINE, CONFIGURED, FINALIZED, INITIALIZED };
70  ListAlg m_topAlgList;
72  ListAlg m_outStreamList;
74  State m_state = OFFLINE;
76  bool m_scheduledStop = false;
79 
80 public:
82  MinimalEventLoopMgr( const std::string& nam, ISvcLocator* svcLoc );
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;
108 
110  StatusCode nextEvent( int maxevt ) override;
112  StatusCode executeEvent( void* par ) override;
114  StatusCode executeRun( int maxevt ) override;
116  StatusCode stopRun() override;
117 
119  void topAlgHandler( Gaudi::Details::PropertyBase& p );
121  StatusCode decodeTopAlgs();
123  void outStreamHandler( Gaudi::Details::PropertyBase& p );
125  StatusCode decodeOutStreams();
126 
127 private:
132 
135 
136  // number of events processed
137  size_t m_nevt{0};
138 };
139 #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.
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: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.
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.