26 #ifndef MLN_CORE_SITE_SET_P_GRAPH_PITER_HH
27 # define MLN_CORE_SITE_SET_P_GRAPH_PITER_HH
33 # include <mln/core/internal/site_set_iterator_base.hh>
40 template <
typename S,
typename I>
class graph_psite;
43 template <
typename G>
class edge;
44 template <
typename G>
class vertex;
54 template <
typename S,
typename I>
56 :
public internal::site_set_iterator_base< S,
60 typedef internal::site_set_iterator_base< S, self_ > super_;
74 bool is_valid_()
const;
88 const typename S::graph_t&
graph()
const;
91 const iter& hook_elt_()
const;
116 template <
typename S,
typename I,
typename E>
119 typedef typename S::graph_t graph_t;
121 const graph_t& graph()
const;
126 const E& exact_()
const;
129 template <
typename S,
typename I,
typename E>
130 struct subject_impl< p_graph_piter<S,I>&, E >
131 : subject_impl< const p_graph_piter<S,I>&, E >
133 mln_q_subject(I) element();
143 # ifndef MLN_INCLUDE_ONLY
149 template <
typename S,
typename I>
153 mln_postcondition(! this->is_valid());
156 template <
typename S,
typename I>
161 this->change_target(pv);
162 mln_postcondition(! this->is_valid());
165 template <
typename S,
typename I>
168 p_graph_piter<S,I>::is_valid_()
const
170 return iter_.is_valid();
173 template <
typename S,
typename I>
176 p_graph_piter<S,I>::invalidate_()
181 template <
typename S,
typename I>
184 p_graph_piter<S,I>::start_()
187 if (this->is_valid())
191 template <
typename S,
typename I>
194 p_graph_piter<S,I>::next_()
197 if (this->is_valid())
201 template <
typename S,
typename I>
204 p_graph_piter<S,I>::element()
206 return this->subj_();
209 template <
typename S,
typename I>
211 const typename S::graph_t&
214 return this->site_set().graph();
217 template <
typename S,
typename I>
225 template <
typename S,
typename I>
233 template <
typename S,
typename I>
238 mln_precondition(this->is_valid());
240 p_.update_id(iter_.id());
250 template <
typename S,
typename I,
typename E>
253 subject_impl< const p_graph_piter<S,I>&, E >::exact_()
const
255 return internal::force_exact<const E>(*this);
258 template <
typename S,
typename I,
typename E>
260 const typename subject_impl< const p_graph_piter<S,I>&, E >::graph_t&
261 subject_impl< const p_graph_piter<S,I>&, E >::graph()
const
263 return exact_().get_subject().graph();
266 template <
typename S,
typename I,
typename E>
269 subject_impl< const p_graph_piter<S,I>&, E >::id()
const
271 return exact_().get_subject().id();
274 template <
typename S,
typename I,
typename E>
276 util::edge<typename S::graph_t>
277 subject_impl< const p_graph_piter<S,I>&, E >::edge_with(
const util::vertex<graph_t>& v)
const
279 return exact_().get_subject().element().edge_with(v);
282 template <
typename S,
typename I,
typename E>
285 subject_impl< p_graph_piter<S,I>&, E >::exact_()
287 return internal::force_exact<E>(*this);
290 template <
typename S,
typename I,
typename E>
293 subject_impl< p_graph_piter<S,I>&, E >::element()
295 return exact_().get_subject().element();
300 # endif // ! MLN_INCLUDE_ONLY
305 #endif // ! MLN_CORE_SITE_SET_P_GRAPH_PITER_HH