00001 #ifndef CCTBX_ELTBX_NEUTRON_H
00002 #define CCTBX_ELTBX_NEUTRON_H
00003
00004 #include <string>
00005 #include <complex>
00006
00007 namespace cctbx { namespace eltbx { namespace neutron {
00008
00009 namespace detail
00010 {
00011 struct raw_record_neutron_news_1992
00012 {
00013 const char* label;
00014 float bound_coh_scatt_length_real;
00015 float bound_coh_scatt_length_imag;
00016 float abs_cross_sect;
00017 };
00018 }
00019
00021
00026 class neutron_news_1992_table
00027 {
00028 public:
00030 neutron_news_1992_table() : record_(0) {}
00031
00033
00039 explicit
00040 neutron_news_1992_table(std::string const& label, bool exact=false);
00041
00043
00047 bool
00048 is_valid() const { return record_->label != 0; }
00049
00051 const char*
00052 label() const
00053 {
00054 return record_->label;
00055 }
00056
00058
00060 std::complex<float>
00061 bound_coh_scatt_length() const
00062 {
00063 return std::complex<float>(record_->bound_coh_scatt_length_real,
00064 record_->bound_coh_scatt_length_imag);
00065 }
00066
00068
00072 float
00073 bound_coh_scatt_length_real() const
00074 {
00075 return record_->bound_coh_scatt_length_real;
00076 }
00077
00079
00083 float
00084 bound_coh_scatt_length_imag() const
00085 {
00086 return record_->bound_coh_scatt_length_imag;
00087 }
00088
00090
00092 float
00093 abs_cross_sect() const
00094 {
00095 return record_->abs_cross_sect;
00096 }
00097
00098 private:
00099 const detail::raw_record_neutron_news_1992* record_;
00100 friend class neutron_news_1992_table_iterator;
00101 };
00102
00105 class neutron_news_1992_table_iterator
00106 {
00107 public:
00109 neutron_news_1992_table_iterator();
00110
00112
00115 neutron_news_1992_table
00116 next();
00117
00118 private:
00119 neutron_news_1992_table current_;
00120 };
00121
00122 }}}
00123
00124 #endif // CCTBX_ELTBX_NEUTRON_H