00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 namespace more {
00031 namespace phys {
00032
00033 template<typename LevelTraits>
00034 struct level_graph
00035 {
00036 typedef LevelTraits level_traits;
00037
00038 private:
00039 struct level_node;
00040
00041 struct radiation_node
00042 {
00043 bool operator<(radiation_node const& rhs) const
00044 { return m_rad < rhs.m_rad; }
00045
00046 radiation_type m_rad;
00047 level_node* m_initial;
00048 level_node* m_final;
00049 };
00050
00051 struct level_node
00052 {
00053 bool operator<(level_node const& rhs) const
00054 { return m_lev < rhs.m_lev; }
00055
00056 level_type m_lev;
00057 std::set<radiation_node> m_radiations;
00058 };
00059
00060 public:
00061 typedef std::set<level_node>::iterator vertex_descriptor;
00062 typedef std::pair<vertex_descriptor, std::set<radiation_node>::iterator
00063
00064 struct level_iterator
00065 : std::bidirectional_iterator<level_type, std::ptrdiff_t>
00066 {
00067 level_iterator() {}
00068 explicit level_iterator(std::set<level_node>::iterator it)
00069 : m_it_lev(it) {}
00070
00071 level_iterator& operator++() { ++m_it_lev; return *this; }
00072 level_iterator& operator--() { --m_it_lev; return *this; }
00073 level_iterator operator++(int)
00074 { level_iterator tmp = *this; ++*this; return tmp; }
00075 level_iterator operator--(int)
00076 { level_iterator tmp = *this; ++*this; return tmp; }
00077
00078 bool operator==(level_iterator const& rhs) const
00079 { return m_it_lev == rhs.m_it_lev; }
00080 bool operator!=(level_iterator const& rhs) const
00081 { return m_it_lev != rhs.m_it_lev; }
00082
00083 level_type const& operator*() { return m_it_lev->m_lev; }
00084 level_type const* operator->() { return &m_it_lev->m_lev; }
00085
00086 private:
00087 std::set<level_node>::iterator m_it_lev;
00088 };
00089 typedef level_iterator const_level_iterator;
00090
00091 struct radiation_iterator
00092 {
00093 };
00094
00095 level_iterator
00096
00097 private:
00098 std::set<level_node> m_levels;
00099 };
00100
00101 }}