27 #ifndef MLN_CORE_SITE_SET_COMPLEX_PSITE_HH
28 # define MLN_CORE_SITE_SET_COMPLEX_PSITE_HH
34 # include <mln/core/internal/pseudo_site_base.hh>
36 # include <mln/topo/complex.hh>
53 template <
unsigned D,
typename G>
class p_complex;
60 template <
unsigned D,
typename G>
109 const mln_site(G)&
subj_();
168 template <
unsigned D, typename G>
180 template <
unsigned D, typename G>
194 template <
unsigned D, typename G>
201 template <
unsigned D, typename G>
208 # ifndef MLN_INCLUDE_ONLY
210 template <
unsigned D,
typename G>
218 template <
unsigned D,
typename G>
228 mln_precondition(pc.
cplx() == face.
cplx());
234 template <
unsigned D,
typename G>
237 unsigned n,
unsigned face_id)
239 face_(pc.cplx(), n, face_id)
245 template <
unsigned D,
typename G>
252 mln_invariant(!pc_ || pc_.cplx() == face_.cplx());
254 return face_.is_valid();
257 template <
unsigned D,
typename G>
262 return face_.invalidate();
265 template <
unsigned D,
typename G>
267 const p_complex<D, G>&
270 mln_precondition(target_());
274 template <
unsigned D,
typename G>
276 const p_complex<D, G>*
281 mln_invariant(!pc_ || pc_.cplx() == face_.cplx());
286 template <
unsigned D,
typename G>
293 face_.set_cplx(new_target.cplx());
299 template <
unsigned D,
typename G>
307 template <
unsigned D,
typename G>
315 template <
unsigned D,
typename G>
323 template <
unsigned D,
typename G>
328 return face_.face_id();
331 template <
unsigned D,
typename G>
334 complex_psite<D, G>::update_()
336 mln_precondition(is_valid());
339 mln_invariant(!pc_ || pc_.cplx() == face_.cplx());
351 template <
unsigned D,
typename G>
354 const complex_psite<D, G>& rhs)
356 mln_precondition(&lhs.site_set() == &rhs.site_set());
357 return lhs.face() == rhs.face();
360 template <
unsigned D,
typename G>
363 const complex_psite<D, G>& rhs)
365 mln_precondition(&lhs.site_set() == &rhs.site_set());
366 return lhs.face() != rhs.face();
369 template <
unsigned D,
typename G>
371 operator< (const complex_psite<D, G>& lhs,
372 const complex_psite<D, G>&
rhs)
374 mln_precondition(&lhs.site_set() == &rhs.site_set());
375 return lhs.face() < rhs.face();
383 template <
unsigned D,
typename G>
386 operator<<(std::ostream& ostr, const complex_psite<D, G>&
p)
388 return ostr << p.face();
391 # endif // ! MLN_INCLUDE_ONLY
395 #endif // ! MLN_CORE_SITE_SET_COMPLEX_PSITE_HH