00001 // $Header: /nfs/slac/g/glast/ground/cvs/GaudiKernel/GaudiKernel/AlgTool.h,v 1.1.1.1 2001/04/18 18:14:18 tlindner Exp $ 00002 #ifndef GAUDIKERNEL_ALGTOOL_H 00003 #define GAUDIKERNEL_ALGTOOL_H 00004 00005 // Include files 00006 #include "GaudiKernel/IAlgTool.h" 00007 #include "GaudiKernel/IProperty.h" 00008 #include "GaudiKernel/IService.h" 00009 #include "GaudiKernel/PropertyMgr.h" 00010 00011 #include <vector> 00012 00013 // Forward declarations 00014 class ISvcLocator; 00015 class IMessageSvc; 00016 00029 class AlgTool : public virtual IAlgTool, 00030 public virtual IProperty { 00031 public: 00032 00038 virtual StatusCode queryInterface(const IID& riid, void** ppvUnknown); 00039 00041 virtual unsigned long addRef(); 00042 00044 virtual unsigned long release(); 00045 00046 00048 virtual const std::string& name() const; 00049 00051 virtual const std::string& type() const; 00052 00054 virtual const IInterface* parent() const; 00055 00056 00058 virtual StatusCode setProperty(const Property& p); 00059 virtual StatusCode setProperty( std::istream& s ); 00060 virtual StatusCode setProperty( const std::string& n, const std::string& v); 00061 virtual StatusCode getProperty(Property* p) const; 00062 virtual const Property& getProperty( const std::string& name) const; 00063 virtual StatusCode getProperty( const std::string& n, std::string& v ) const; 00064 virtual const std::vector<Property*>& getProperties( ) const; 00065 00071 AlgTool( const std::string& type, 00072 const std::string& name, 00073 const IInterface* parent); 00074 00076 ISvcLocator* serviceLocator(); 00077 00079 IMessageSvc* msgSvc(); 00080 IMessageSvc* msgSvc() const; 00081 00087 StatusCode setProperties(); 00088 00090 template <class T> 00091 StatusCode declareProperty( const std::string& name, T& property ) const { 00092 m_propertyMgr->declareProperty(name, property); 00093 return StatusCode::SUCCESS; 00094 } 00095 00096 protected: 00097 00098 // Standard destructor. 00099 virtual ~AlgTool(); 00100 00101 private: 00102 00103 int m_outputLevel; 00104 std::string m_type; 00105 const std::string m_name; 00106 const IInterface* m_parent; 00107 unsigned long m_refCount; 00108 ISvcLocator* m_svcLocator; 00109 IMessageSvc* m_messageSvc; 00110 PropertyMgr* m_propertyMgr; 00111 }; 00112 00113 #endif // GAUDIKERNEL_ALGTOOL_H
1.2.3 written by Dimitri van Heesch,
© 1997-2000