26 #ifndef MLN_CORE_SITE_SET_P_CENTERED_HH
27 # define MLN_CORE_SITE_SET_P_CENTERED_HH
38 # include <mln/core/internal/site_set_base.hh>
39 # include <mln/core/internal/site_set_iterator_base.hh>
46 template <
typename W>
class p_centered;
47 template <
typename W>
class p_centered_piter;
54 struct site_set_< p_centered<W> >
56 typedef trait::site_set::nsites::unknown
nsites;
57 typedef trait::site_set::bbox::unknown bbox;
58 typedef trait::site_set::contents::fixed contents;
59 typedef trait::site_set::arity::unique arity;
77 class p_centered :
public internal::site_set_base_< mln_psite(W), p_centered<W> >,
78 private mlc_is_a(W, Window)::check_t
107 p_centered(const W& win, const mln_psite(W)& c);
111 template <typename P>
112 bool has(const P& p) const;
121 const mln_psite(W)&
center() const;
133 template <typename W>
134 class p_centered_piter : public internal::site_set_iterator_base<
p_centered<W>,
135 p_centered_piter<W> >
137 typedef p_centered_piter<W> self_;
138 typedef internal::site_set_iterator_base< p_centered<W>, self_ > super_;
148 bool is_valid_()
const;
168 # ifndef MLN_INCLUDE_ONLY
172 template <
typename W>
180 template <
typename W>
186 template <
typename W>
195 template <
typename W>
196 template <
typename P>
201 mln_precondition(is_valid());
205 template <
typename W>
210 return sizeof(*this);
213 template <
typename W>
221 template <
typename W>
247 template <
typename W>
249 p_centered_piter<W>::p_centered_piter()
253 template <
typename W>
255 p_centered_piter<W>::p_centered_piter(
const p_centered<W>& s)
257 this->change_target(s);
258 q_.center_at(s.center());
259 q_.change_target(s.window_());
262 template <
typename W>
265 p_centered_piter<W>::is_valid_()
const
267 return q_.is_valid();
270 template <
typename W>
273 p_centered_piter<W>::invalidate_()
278 template <
typename W>
281 p_centered_piter<W>::start_()
288 template <
typename W>
291 p_centered_piter<W>::next_()
298 # endif // ! MLN_INCLUDE_ONLY
303 #endif // ! MLN_CORE_SITE_SET_P_CENTERED_HH