![]() |
HepPDT Reference DocumentationHepPDT |
00001 // ---------------------------------------------------------------------- 00002 // 00003 // DefTable.hh 00004 // Author: Lynn Garren 00005 // 00006 // ---------------------------------------------------------------------- 00007 #ifndef DEFTABLE_HH 00008 #define DEFTABLE_HH 00009 00010 #include <string> 00011 #include <map> 00012 00013 namespace HepPDT { 00014 00016 00023 class DefTable { 00024 typedef std::map<std::string,double> TempDefMap; 00025 00026 public: 00027 typedef TempDefMap::const_iterator const_iterator; 00028 typedef TempDefMap::iterator iterator; 00029 00030 DefTable( ); 00031 ~DefTable() { ; } 00032 00033 // --- mutator 00034 // 00036 void addDefinition( std::string const & def, double val ) { tempDefines[def] = val; } 00037 00038 // --- boolean 00039 // 00041 bool hasDefinition( std::string const & def ) const; 00042 00043 // --- accessors 00044 // 00046 int size() const { return tempDefines.size(); } 00048 double definition( std::string const & def ); 00050 void writeDefinitions() const; // intended for diagnostic use 00051 00053 iterator begin() { return tempDefines.begin(); } 00055 const_iterator begin() const { return tempDefines.begin(); } 00056 00058 iterator end() { return tempDefines.end(); } 00060 const_iterator end() const { return tempDefines.end(); } 00061 00062 private: 00063 TempDefMap tempDefines; // hold EvtGen "Define" info 00064 00065 // forbidden copy: 00066 DefTable & operator = ( DefTable const & ); 00067 DefTable( DefTable const & ); 00068 00069 }; // DefTable<> 00070 00071 } // namespace HepPDT 00072 00073 #endif // DEFTABLE_HH