00001
00002
00003 #ifndef ASGTOOLS_ASGTOOL_H
00004 #define ASGTOOLS_ASGTOOL_H
00005
00006
00007 #include "AsgTools/AsgToolsConf.h"
00008 #include "AsgTools/IAsgTool.h"
00009 #include "AsgTools/MsgLevel.h"
00010
00011
00012 #ifdef ASGTOOL_STANDALONE
00013 # include "AsgTools/AsgMessaging.h"
00014 # include "AsgTools/SgTEvent.h"
00015
00016 class Property;
00017 class PropertyMgr;
00018 #elif defined(ASGTOOL_ATHENA)
00019 # include "AthenaBaseComps/AthAlgTool.h"
00020 #else
00021 # error "What environment are we in?!?"
00022 #endif // Environment selection
00023
00024
00025 namespace asg {
00026
00027
00028 #ifdef ASGTOOL_ATHENA
00029 typedef ::AthAlgTool AsgToolBase;
00030 #elif defined(ASGTOOL_STANDALONE)
00031 typedef AsgMessaging AsgToolBase;
00032 #else
00033 # error "What environment are we in?!?"
00034 #endif // Environment selection
00035
00046 class AsgTool : public virtual IAsgTool,
00047 public AsgToolBase {
00048
00049 public:
00051 AsgTool( const std::string& name );
00053 ~AsgTool();
00054
00055
00056
00057
00058 #ifdef ASGTOOL_STANDALONE
00059
00061 SgTEvent* evtStore() const;
00062
00065
00067 template< class T >
00068 Property* declareProperty( const std::string& name, T& loc,
00069 const std::string& doc = "" );
00070
00072 StatusCode setProperty( const std::string& name,
00073 const char* value );
00075 template< class T >
00076 StatusCode setProperty( const std::string& name, const T& val );
00077
00079 PropertyMgr* getPropertyMgr();
00081 const PropertyMgr* getPropertyMgr() const;
00082
00084
00087
00089 virtual const std::string& name() const;
00091 virtual void setName( const std::string& name );
00092
00094
00095 #endif // ASGTOOL_STANDALONE
00096
00097 #ifdef ASGTOOL_ATHENA
00098 public:
00100 using ::AthAlgTool::getProperty;
00101
00102 #endif // ASGTOOL_ATHENA
00103
00106
00108 template< class T >
00109 const T* getProperty( const std::string& name ) const;
00110
00112 const std::string& msg_level_name() const __attribute__ ((deprecated));
00113
00115
00121 virtual StatusCode initialize() { return StatusCode::SUCCESS; }
00122
00124 virtual void print() const;
00125
00126 private:
00127 #ifdef ASGTOOL_STANDALONE
00128 std::string m_name;
00129 PropertyMgr* m_ppropmgr;
00130 mutable SgTEvent m_event;
00131 #endif // ASGTOOL_STANDALONE
00132
00133 };
00134
00135 }
00136
00137
00138 #include "AsgTools/AsgTool.icc"
00139
00140
00141 #include "AsgTools/SetProperty.h"
00142
00143 #endif // ASGTOOLS_ASGTOOL_H