26 #ifndef MLN_CORE_INTERNAL_P_COMPLEX_PITER_BASE_HH
27 # define MLN_CORE_INTERNAL_P_COMPLEX_PITER_BASE_HH
33 # include <mln/core/internal/site_set_iterator_base.hh>
58 template <
typename I,
typename S,
typename P,
typename E>
59 class p_complex_piter_base_
60 :
public internal::site_set_iterator_base< S, E >
62 typedef p_complex_piter_base_< I, S, P, E > self_;
63 typedef internal::site_set_iterator_base< S, E > super_;
71 p_complex_piter_base_();
72 p_complex_piter_base_(
const S& pc);
79 bool is_valid_()
const;
89 void change_target_(
const S& pc);
105 template <
typename I,
typename S,
typename P,
typename E>
108 operator<<(std::ostream& ostr, const p_complex_piter_base_<I, S, P, E>& p);
112 # ifndef MLN_INCLUDE_ONLY
118 template <
typename I,
typename S,
typename P,
typename E>
120 p_complex_piter_base_<I, S, P, E>::p_complex_piter_base_()
122 mln_postcondition(!this->is_valid());
125 template <
typename I,
typename S,
typename P,
typename E>
127 p_complex_piter_base_<I, S, P, E>::p_complex_piter_base_(
const S& pc)
129 this->change_target(pc);
130 mln_postcondition(!this->is_valid());
133 template <
typename I,
typename S,
typename P,
typename E>
136 p_complex_piter_base_<I, S, P, E>::change_target_(
const S& pc)
138 iter_.set_cplx(pc.cplx());
141 template <
typename I,
typename S,
typename P,
typename E>
144 p_complex_piter_base_<I, S, P, E>::is_valid_()
const
146 return iter_.is_valid();
149 template <
typename I,
typename S,
typename P,
typename E>
152 p_complex_piter_base_<I, S, P, E>::invalidate_()
157 template <
typename I,
typename S,
typename P,
typename E>
160 p_complex_piter_base_<I, S, P, E>::start_()
163 if (this->is_valid())
167 template <
typename I,
typename S,
typename P,
typename E>
170 p_complex_piter_base_<I, S, P, E>::next_()
173 if (this->is_valid())
177 template <
typename I,
typename S,
typename P,
typename E>
180 p_complex_piter_base_<I, S, P, E>::update_()
182 mln_precondition(this->is_valid());
184 typedef mln_psite(S) psite;
185 p_ = psite(exact(this)->site_set(), iter_);
189 template <typename I, typename S, typename P, typename E>
192 operator<<(std::ostream& ostr, const p_complex_piter_base_<I, S, P, E>& p)
194 return ostr << p.unproxy_();
197 # endif // ! MLN_INCLUDE_ONLY
204 #endif // ! MLN_CORE_INTERNAL_P_COMPLEX_PITER_BASE_HH