26 #ifndef MLN_CORE_SITE_SET_P_RUN_PITER_HH
27 # define MLN_CORE_SITE_SET_P_RUN_PITER_HH
34 # include <mln/core/site_set/p_run.hh>
35 # include <mln/core/internal/site_set_iterator_base.hh>
45 class p_run_fwd_piter_
47 public internal::site_set_iterator_base< p_run<P>,
50 typedef p_run_fwd_piter_<P> self_;
51 typedef internal::site_set_iterator_base< p_run<P>, self_ > super_;
58 p_run_fwd_piter_(
const p_run<P>& r);
61 bool is_valid_()
const;
83 class p_run_bkd_piter_
85 public internal::site_set_iterator_base< p_run<P>,
88 typedef p_run_bkd_piter_<P> self_;
89 typedef internal::site_set_iterator_base< p_run<P>, self_ > super_;
96 p_run_bkd_piter_(
const p_run<P>& r);
99 bool is_valid_()
const;
117 # ifndef MLN_INCLUDE_ONLY
121 template <
typename P>
123 p_run_fwd_piter_<P>::p_run_fwd_piter_()
127 template <
typename P>
129 p_run_fwd_piter_<P>::p_run_fwd_piter_(
const p_run<P>& r)
131 this->change_target(r);
134 template <
typename P>
137 p_run_fwd_piter_<P>::is_valid_()
const
139 mln_invariant(p_.index() >= 0);
140 return p_.index() < int(s_->length());
143 template <
typename P>
146 p_run_fwd_piter_<P>::invalidate_()
148 p_.change_index(s_->length());
151 template <
typename P>
154 p_run_fwd_piter_<P>::start_()
159 template <
typename P>
162 p_run_fwd_piter_<P>::next_()
170 template <
typename P>
172 p_run_bkd_piter_<P>::p_run_bkd_piter_()
176 template <
typename P>
178 p_run_bkd_piter_<P>::p_run_bkd_piter_(
const p_run<P>& r)
180 this->change_target(r);
183 template <
typename P>
186 p_run_bkd_piter_<P>::is_valid_()
const
188 mln_invariant(p_.index() < int(s_->length()));
189 return p_.index() >= 0;
192 template <
typename P>
195 p_run_bkd_piter_<P>::invalidate_()
200 template <
typename P>
203 p_run_bkd_piter_<P>::start_()
205 p_.change_index(s_->length() - 1);
208 template <
typename P>
211 p_run_bkd_piter_<P>::next_()
217 # endif // ! MLN_INCLUDE_ONLY
222 #endif // ! MLN_CORE_SITE_SET_P_RUN_PITER_HH