00001 #ifndef CCTBX_ELTBX_TINY_PSE_H
00002 #define CCTBX_ELTBX_TINY_PSE_H
00003
00004 #include <string>
00005
00006 namespace cctbx { namespace eltbx { namespace tiny_pse {
00007
00008 namespace detail
00009 {
00010 struct raw_record {
00011 int z;
00012 const char* symbol;
00013 const char* name;
00014 float weight;
00015 };
00016 }
00017
00019
00023 class table
00024 {
00025 public:
00027 table() : record_(0) {}
00028
00030
00036 explicit
00037 table(std::string const& label, bool exact=false);
00038
00040 explicit
00041 table(int atomic_number);
00042
00044
00048 bool
00049 is_valid() const { return record_->z != 0; }
00050
00052 int
00053 atomic_number() const { return record_->z; }
00054
00056 const char*
00057 symbol() const { return record_->symbol; }
00058
00060 const char*
00061 name() const { return record_->name; }
00062
00064 float
00065 weight() const { return record_->weight; }
00066
00067 private:
00068 const detail::raw_record* record_;
00069 friend class table_iterator;
00070 };
00071
00074 class table_iterator
00075 {
00076 public:
00078 table_iterator();
00079
00081
00083 table
00084 next();
00085
00086 private:
00087 table current_;
00088 };
00089
00090 }}}
00091
00092 #endif // CCTBX_ELTBX_TINY_PSE_H