00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef GAUDISVC_MINIMALEVENTLOOPMGR_H
00013 #define GAUDISVC_MINIMALEVENTLOOPMGR_H 1
00014
00015
00016 #include "GaudiKernel/Service.h"
00017 #include "GaudiKernel/IAppMgrUI.h"
00018 #include "GaudiKernel/IEventProcessor.h"
00019
00020
00021 #include <list>
00022 #include <vector>
00023
00024
00025 class IAlgorithm;
00026
00044 class MinimalEventLoopMgr : public Service,
00045 virtual public IAppMgrUI,
00046 virtual public IEventProcessor
00047 {
00048 public:
00050 friend class SvcFactory<MinimalEventLoopMgr>;
00051 typedef std::list<IAlgorithm*> ListAlg;
00052 typedef std::list<std::string> ListName;
00053 typedef std::vector<std::string> VectorName;
00054
00055 protected:
00056
00057 enum State { OFFLINE, CONFIGURED, FINALIZED, INITIALIZED };
00059 IAppMgrUI* m_appMgrUI;
00061 ListAlg m_topAlgList;
00063 ListAlg m_outStreamList;
00065 StringArrayProperty m_topAlgNames;
00067 StringArrayProperty m_outStreamNames;
00069 State m_state;
00070
00071 protected:
00073 MinimalEventLoopMgr(const std::string& nam, ISvcLocator* svcLoc);
00075 virtual ~MinimalEventLoopMgr();
00076
00078 template<class T> T* releaseInterface(T* iface) {
00079 if ( 0 != iface ) iface->release();
00080 return 0;
00081 }
00082
00083 public:
00085 virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface);
00087 virtual StatusCode run();
00089 virtual StatusCode configure();
00091 virtual StatusCode terminate();
00093 virtual StatusCode initialize();
00095 virtual StatusCode finalize();
00097 virtual StatusCode nextEvent(int maxevt);
00099 virtual const std::string& state() const;
00101 virtual const std::string& name() const {
00102 return Service::name();
00103 }
00104
00106 virtual StatusCode executeEvent(void* par );
00107
00109 void topAlgHandler( Property& p);
00111 StatusCode decodeTopAlgs();
00113 void outStreamHandler( Property& p);
00115 StatusCode decodeOutStreams();
00116
00117 };
00118 #endif // GAUDISVC_MINIMALEVENTLOOPMGR_H