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 #ifndef MLN_CORE_INTERNAL_SITE_SET_ITERATOR_BASE_HH
00028 # define MLN_CORE_INTERNAL_SITE_SET_ITERATOR_BASE_HH
00029
00034
00035 # include <mln/core/internal/site_iterator_base.hh>
00036
00037
00038 namespace mln
00039 {
00040
00041 namespace internal
00042 {
00043
00051
00052 template <typename S, typename E>
00053 class site_set_iterator_base : public site_iterator_base<S, E>
00054 {
00055 public:
00056
00058 typedef S pset;
00059
00061 const S& site_set() const;
00062
00064 const mln_psite(S)& p_hook_() const;
00065
00067 void change_target(const S& s);
00068
00071 void change_target_(const S& s);
00072
00073 protected:
00074
00076 mln_psite(S) p_;
00077
00079 site_set_iterator_base();
00080 };
00081
00082
00083 #ifndef MLN_INCLUDE_ONLY
00084
00085 template <typename S, typename E>
00086 inline
00087 site_set_iterator_base<S, E>::site_set_iterator_base()
00088 {
00089 }
00090
00091 template <typename S, typename E>
00092 inline
00093 const S&
00094 site_set_iterator_base<S, E>::site_set() const
00095 {
00096 mln_precondition(this->s_ != 0);
00097 return *this->s_;
00098 }
00099
00100 template <typename S, typename E>
00101 inline
00102 void
00103 site_set_iterator_base<S, E>::change_target(const S& s)
00104 {
00105 this->s_ = & s;
00106
00107
00108 if_possible::change_target(p_, s);
00109
00110 exact(this)->change_target_(s);
00111
00112 this->invalidate();
00113 }
00114
00115 template <typename S, typename E>
00116 inline
00117 void
00118 site_set_iterator_base<S, E>::change_target_(const S& s)
00119 {
00120 (void) s;
00121
00122 }
00123
00124 template <typename S, typename E>
00125 inline
00126 const mln_psite(S)&
00127 site_set_iterator_base<S, E>::p_hook_() const
00128 {
00129 return p_;
00130 }
00131
00132 #endif // ! MLN_INCLUDE_ONLY
00133
00134 }
00135
00136 }
00137
00138
00139 #endif // ! MLN_CORE_INTERNAL_SITE_SET_ITERATOR_BASE_HH