00001 //*****************************************************************************// 00002 // // 00003 // Copyright (c) 2001 // 00004 // INRIA // 00005 // 54600 VILLERS LES NANCY // 00006 // France // 00007 // // 00008 //*****************************************************************************// 00009 // // 00010 // *** NOTICE OF PROPRIETARY INFORMATION *** // 00011 // // 00012 // The information contained in this file is considered proprietary and the // 00013 // exclusive property of INRIA. This information may not be disclosed, // 00014 // duplicated or used, in whole or in part, for any purpose whatsoever // 00015 // without express written authorization from INRIA // 00016 // // 00017 //*****************************************************************************// 00018 00019 00020 #ifndef QC_TABLE_H_ 00021 #define QC_TABLE_H_ 00022 00023 #include <string> 00024 #include <map> 00025 #include <assert.h> 00026 00027 00028 using namespace std; 00029 00030 00036 class QCTable 00037 { 00038 00040 public: 00041 00045 QCTable (void); 00046 00047 00051 ~QCTable (void) {}; 00052 00053 00057 inline int 00058 operator [] (const string& str) const; 00059 00060 00064 inline string& 00065 operator [] (int str) const; 00066 00067 00069 protected: 00070 00071 00073 private: 00074 00075 00076 00079 public: 00083 static const int _H_ ; 00084 static const int _Be_; 00085 static const int _B_ ; 00086 static const int _C_ ; 00087 static const int _N_ ; 00088 static const int _O_ ; 00089 static const int _F_ ; 00090 static const int _Mg_; 00091 static const int _Al_; 00092 static const int _Si_; 00093 static const int _P_ ; 00094 static const int _S_ ; 00095 static const int _Cl_; 00096 static const int _Zn_; 00097 static const int _Ga_; 00098 static const int _Ge_; 00099 static const int _As_; 00100 static const int _Se_; 00101 static const int _Br_; 00102 static const int _Cd_; 00103 static const int _In_; 00104 static const int _Sn_; 00105 static const int _Sb_; 00106 static const int _Te_; 00107 static const int _I_ ; 00108 static const int _Hg_; 00109 static const int _Tl_; 00110 static const int _Pb_; 00111 static const int _Bi_; 00112 00113 static const int _UNKNOWN_; 00114 00118 static const string HYDROGEN; 00119 static const string BERILIUM; 00120 static const string BORON; 00121 static const string CARBON; 00122 static const string NITROGEN; 00123 static const string OXYGEN; 00124 static const string FLUORINE; 00125 static const string MAGNESIUM; 00126 static const string ALUMINIUM; 00127 static const string SILICON; 00128 static const string PHOSPHORUS; 00129 static const string SULFUR; 00130 static const string CHLORINE; 00131 static const string ZINC; 00132 static const string GALLIUM; 00133 static const string GERMANIUM; 00134 static const string ARSENIC; 00135 static const string SELENIUM; 00136 static const string BROMINE; 00137 static const string CADMIUM; 00138 static const string INDIUM; 00139 static const string TIN; 00140 static const string ANTIMONY; 00141 static const string TELLURIUM; 00142 static const string IODINE; 00143 static const string MERCURY; 00144 static const string THALLIUM; 00145 static const string LEAD; 00146 static const string BISMUTH; 00147 00148 static const string UNKNOWN; 00149 00150 00151 protected: 00152 private: 00156 map <string, int> type; 00157 00161 map <int, string> name; 00162 00163 }; 00164 00168 int 00169 QCTable::operator [] (const string& key) const { 00170 int ret = -1; 00171 map<string, int>::const_iterator iter; 00172 iter = type.find(key); 00173 if (iter != type.end()) 00174 ret = iter->second; 00175 return ret; 00176 } 00177 00178 00182 string& 00183 QCTable::operator [] (int key) const { 00184 string *ret = new string (""); 00185 map<int, string>::const_iterator iter; 00186 iter = name.find(key); 00187 if (iter != name.end()) 00188 *ret = iter->second; 00189 return *ret; 00190 } 00191 00195 extern const QCTable table; 00196 00197 00198 00199 #endif // QC_TABLE_H_