![]() |
|
|
Generated: 8 Jan 2009 |
00001 // $Id: AlgContextSvc.h,v 1.4 2007/05/24 13:49:47 hmd Exp $ 00002 // ============================================================================ 00003 // CVS tag $Name: $, version $Revision: 1.4 $ 00004 // ============================================================================ 00005 // $Log: AlgContextSvc.h,v $ 00006 // Revision 1.4 2007/05/24 13:49:47 hmd 00007 // ( Vanya Belyaev) patch #1171. The enhancement of existing Algorithm Context Service 00008 // is the primary goal of the proposed patch. The existing 00009 // AlgContextSvc is not safe with respect to e.g. Data-On-Demand 00010 // service or to operations with subalgorithms. The patched service 00011 // essentially implements the queue of executing algorithms, thus the 00012 // problems are eliminiated. In addition the enriched interface 00013 // provides the access to the whole queue of executing algorithms. 00014 // 00015 // ============================================================================ 00016 #ifndef GAUDISVC_ALGCONTEXTSVC_H 00017 #define GAUDISVC_ALGCONTEXTSVC_H 1 00018 // ============================================================================ 00019 // Include files 00020 // ============================================================================ 00021 // GaudiKernel 00022 // ============================================================================ 00023 #include "GaudiKernel/StatusCode.h" 00024 #include "GaudiKernel/IAlgContextSvc.h" 00025 #include "GaudiKernel/IAlgorithm.h" 00026 #include "GaudiKernel/IIncidentListener.h" 00027 #include "GaudiKernel/Service.h" 00028 // ============================================================================ 00029 // Forward declarations 00030 // ============================================================================ 00031 template <class TYPE> class SvcFactory; 00032 class IIncidentSvc ; 00033 // ============================================================================ 00041 class AlgContextSvc 00042 : public Service 00043 , virtual public IAlgContextSvc 00044 , virtual public IIncidentListener 00045 { 00046 public: 00048 friend class SvcFactory<AlgContextSvc>; 00049 public: 00051 virtual StatusCode setCurrentAlg ( IAlgorithm* a ) ; 00053 virtual StatusCode unSetCurrentAlg ( IAlgorithm* a ) ; 00055 virtual IAlgorithm* currentAlg () const ; 00057 virtual const IAlgContextSvc::Algorithms& algorithms () const 00058 { return m_algorithms ; } 00059 public: 00061 virtual StatusCode queryInterface 00062 ( const InterfaceID& riid , 00063 void** ppvi ) ; 00064 public: 00066 virtual void handle ( const Incident& ) ; 00067 public: 00069 virtual StatusCode initialize () ; 00071 virtual StatusCode finalize () ; 00072 public: 00074 AlgContextSvc 00075 ( const std::string& name , 00076 ISvcLocator* svc ) ; 00078 virtual ~AlgContextSvc(); 00079 private: 00080 // default constructor is disabled 00081 AlgContextSvc () ; 00082 // copy constructor is disabled 00083 AlgContextSvc ( const AlgContextSvc& ); 00084 // assignement operator is disabled 00085 AlgContextSvc& operator=( const AlgContextSvc& ); 00086 private: 00087 // the stack of currect algorithms 00088 IAlgContextSvc::Algorithms m_algorithms ; 00089 // pointer to Incident Service 00090 IIncidentSvc* m_inc ; 00091 // flag to perform more checking 00092 bool m_check ; 00093 } ; 00094 00095 // ============================================================================ 00096 // The END 00097 // ============================================================================ 00098 #endif // GAUDISVC_ALGCONTEXTSVC_H 00099 // ============================================================================ 00100