00001 // $Header: /local/reps/Gaudi/GaudiKernel/GaudiKernel/MinimalEventLoopMgr.h,v 1.4 2008/07/15 12:48:18 marcocle Exp $ 00002 #ifndef GAUDIKERNEL_MINIMALEVENTLOOPMGR_H 00003 #define GAUDIKERNEL_MINIMALEVENTLOOPMGR_H 1 00004 00005 // Framework include files 00006 #include "GaudiKernel/Service.h" 00007 #include "GaudiKernel/IAppMgrUI.h" 00008 #include "GaudiKernel/IEventProcessor.h" 00009 00010 // STL include files 00011 #include <list> 00012 #include <vector> 00013 00014 // Forward declarations 00015 class IAlgorithm; 00016 class IIncidentSvc; 00017 class IIncidentListener; 00018 00028 class MinimalEventLoopMgr : public Service, 00029 virtual public IEventProcessor 00030 { 00031 public: 00033 typedef std::list<IAlgorithm*> ListAlg; 00034 typedef std::list<std::string> ListName; 00035 typedef std::vector<std::string> VectorName; 00036 00037 protected: 00038 // enums 00039 enum State { OFFLINE, CONFIGURED, FINALIZED, INITIALIZED }; 00041 IAppMgrUI* m_appMgrUI; 00043 IIncidentSvc* m_incidentSvc; 00045 ListAlg m_topAlgList; 00047 ListAlg m_outStreamList; 00049 std::string m_outStreamType; 00051 StringArrayProperty m_topAlgNames; 00053 StringArrayProperty m_outStreamNames; 00055 State m_state; 00057 bool m_scheduledStop; 00059 IIncidentListener* m_abortEventListener; 00062 bool m_abortEvent; 00064 std::string m_abortEventSource; 00065 00066 public: 00068 MinimalEventLoopMgr(const std::string& nam, ISvcLocator* svcLoc); 00070 virtual ~MinimalEventLoopMgr(); 00071 00072 protected: 00073 00075 template<class T> T* releaseInterface(T* iface) { 00076 if ( 0 != iface ) iface->release(); 00077 return 0; 00078 } 00079 00080 public: 00082 virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface); 00084 virtual StatusCode initialize(); 00086 virtual StatusCode start(); 00088 virtual StatusCode stop(); 00090 virtual StatusCode finalize(); 00092 virtual StatusCode reinitialize(); 00094 virtual StatusCode restart(); 00095 00097 virtual StatusCode nextEvent(int maxevt); 00099 virtual StatusCode executeEvent(void* par ); 00101 virtual StatusCode executeRun(int maxevt); 00103 virtual StatusCode stopRun(); 00104 00106 void topAlgHandler( Property& p); 00108 StatusCode decodeTopAlgs(); 00110 void outStreamHandler( Property& p); 00112 StatusCode decodeOutStreams(); 00113 00114 }; 00115 #endif // GAUDIKERNEL_MINIMALEVENTLOOPMGR_H