27 #ifndef MLN_CORE_SITE_SET_P_VERTICES_PSITE_HH
28 # define MLN_CORE_SITE_SET_P_VERTICES_PSITE_HH
34 # include <mln/core/concept/pseudo_site.hh>
35 # include <mln/core/internal/graph_psite_base.hh>
36 # include <mln/util/vertex.hh>
43 template <
typename G,
typename F>
class p_vertices;
47 template <
typename Subject,
typename E>
struct subject_impl;
52 template <
typename G,
typename F>
53 class p_vertices_psite :
54 public internal::graph_psite_base< p_vertices<G,F>, p_vertices_psite<G,F> >
56 typedef p_vertices_psite<G,F> self_;
57 typedef internal::graph_psite_base<p_vertices<G,F>, self_> super_;
61 typedef p_vertices<G,F> target_t;
64 p_vertices_psite(
const p_vertices<G,F>& s);
65 p_vertices_psite(
const p_vertices<G,F>& s,
unsigned id);
67 const util::vertex<G>& v()
const;
71 template <
typename G,
typename F>
73 operator==(
const p_vertices_psite<G,F>& lhs,
const p_vertices_psite<G,F>& rhs);
75 template <
typename G,
typename F>
77 operator!=(
const p_vertices_psite<G,F>& lhs,
const p_vertices_psite<G,F>& rhs);
79 template <
typename G,
typename F>
81 operator<(const p_vertices_psite<G,F>& lhs,
const p_vertices_psite<G,F>& rhs);
89 template <
typename G,
typename F,
typename E>
90 struct subject_impl< const p_vertices_psite<G,F>&, E >
91 : subject_impl< const graph_psite_base< p_vertices<G,F>,
92 p_vertices_psite<G,F> >&, E >
94 const util::vertex<G>& v()
const;
97 const E& exact_()
const;
100 template <
typename G,
typename F,
typename E>
101 struct subject_impl< p_vertices_psite<G,F>&, E >
102 : subject_impl< const p_vertices_psite<G,F>&, E >,
103 subject_impl< graph_psite_base< p_vertices<G,F>,
104 p_vertices_psite<G,F> >&, E >
112 # ifndef MLN_INCLUDE_ONLY
114 template <
typename G,
typename F>
116 p_vertices_psite<G, F>::p_vertices_psite()
120 template <
typename G,
typename F>
122 p_vertices_psite<G, F>::p_vertices_psite(
const p_vertices<G,F>& s)
127 template <
typename G,
typename F>
129 p_vertices_psite<G, F>::p_vertices_psite(
const p_vertices<G,F>& s,
unsigned i)
134 template <
typename G,
typename F>
136 const util::vertex<G>&
137 p_vertices_psite<G, F>::v()
const
146 template <
typename G,
typename F>
148 operator==(
const p_vertices_psite<G,F>& lhs,
const p_vertices_psite<G,F>& rhs)
150 mln_assertion(lhs.target_() == rhs.target_());
151 return lhs.id() == rhs.id();
154 template <
typename G,
typename F>
156 operator!=(
const p_vertices_psite<G,F>& lhs,
const p_vertices_psite<G,F>& rhs)
158 mln_assertion(lhs.target_() == rhs.target_());
159 return lhs.id() != rhs.id();
162 template <
typename G,
typename F>
164 operator<(const p_vertices_psite<G,F>& lhs,
const p_vertices_psite<G,F>& rhs)
166 mln_assertion(lhs.target_() == rhs.target_());
167 return lhs.id() < rhs.id();
178 template <
typename G,
typename F,
typename E>
181 subject_impl< const p_vertices_psite<G,F>&, E >::exact_()
const
183 return internal::force_exact<const E>(*this);
186 template <
typename G,
typename F,
typename E>
188 const util::vertex<G>&
189 subject_impl< const p_vertices_psite<G,F>&, E >::v()
const
191 return exact_().get_subject().v();
197 # endif // ! MLN_INCLUDE_ONLY
202 #endif // ! MLN_CORE_SITE_SET_P_VERTICES_PSITE_HH