00001 // $Id: IAlgContextSvc.h,v 1.2 2007/05/24 13:48:50 hmd Exp $ 00002 // ============================================================================ 00003 // CVS tag $Name: GAUDI_v20r4-pre $, version $Revision: 1.2 $ 00004 // ============================================================================ 00005 #ifndef GAUDIKERNEL_IALGCONTEXTSVC_H 00006 #define GAUDIKERNEL_IALGCONTEXTSVC_H 00007 // ============================================================================ 00008 // Include files: 00009 // ============================================================================ 00010 // STD & STL 00011 // ============================================================================ 00012 #include <vector> 00013 // ============================================================================ 00014 // GaudiKernel 00015 // ============================================================================ 00016 #include "GaudiKernel/IInterface.h" 00017 // ============================================================================ 00018 // Forward declarations 00019 // ============================================================================ 00020 class IAlgorithm ; 00021 // ============================================================================ 00028 class IAlgContextSvc : virtual public IInterface 00029 { 00030 public: 00032 typedef std::vector<IAlgorithm*> Algorithms ; 00033 public: 00035 virtual StatusCode setCurrentAlg ( IAlgorithm* a ) = 0 ; 00037 virtual StatusCode unSetCurrentAlg ( IAlgorithm* a ) = 0 ; 00039 virtual IAlgorithm* currentAlg () const = 0 ; 00041 virtual const Algorithms& algorithms () const = 0 ; 00043 static const InterfaceID& interfaceID () ; 00044 protected: 00046 virtual ~IAlgContextSvc() ; 00047 } ; 00048 // ============================================================================ 00049 namespace Gaudi 00050 { 00051 namespace Utils 00052 { 00084 class AlgContext 00085 { 00086 public: 00094 AlgContext 00095 ( IAlgContextSvc* svc , 00096 IAlgorithm* alg ) ; 00104 AlgContext 00105 ( IAlgorithm* alg , 00106 IAlgContextSvc* svc ) ; 00112 ~AlgContext() ; 00113 private: 00114 // default constructor is disabled 00115 AlgContext() ; 00116 // copy constructor is disabled 00117 AlgContext ( const AlgContext& right ) ; 00118 // assignement operator is disabled 00119 AlgContext& operator=( const AlgContext& right ) ; 00120 private: 00121 IAlgContextSvc* m_svc ; 00122 IAlgorithm* m_alg ; 00123 }; 00124 } // end of namespace Gaudi::Utils 00125 } // end of namespace Gaudi 00126 // ============================================================================ 00127 // The END 00128 // ============================================================================ 00129 #endif // GAUDIKERNEL_IALGCONTEXTSVC_H 00130 // ============================================================================ 00131 00132