26 #ifndef MLN_CORE_SITE_SET_P_EDGES_PSITE_HH
27 # define MLN_CORE_SITE_SET_P_EDGES_PSITE_HH
33 # include <mln/core/internal/graph_psite_base.hh>
34 # include <mln/util/edge.hh>
41 template <
typename G,
typename F>
class p_edges;
42 namespace util {
template <
typename G>
class vertex; }
43 namespace internal {
template <
typename T,
typename E>
struct subject_impl; }
46 template <
typename G,
typename F>
48 public internal::graph_psite_base< p_edges<G,F>, p_edges_psite<G,F> >
50 typedef p_edges_psite<G,F> self_;
51 typedef internal::graph_psite_base<p_edges<G,F>, self_> super_;
55 typedef p_edges<G,F> target_t;
60 p_edges_psite(
const p_edges<G,F>& s);
61 p_edges_psite(
const p_edges<G,F>& s,
unsigned);
67 const util::edge<G>& e()
const;
68 util::vertex<G> v1()
const;
69 util::vertex<G> v2()
const;
75 template <
typename G,
typename F>
77 operator==(
const p_edges_psite<G,F>& lhs,
const p_edges_psite<G,F>& rhs);
79 template <
typename G,
typename F>
81 operator!=(
const p_edges_psite<G,F>& lhs,
const p_edges_psite<G,F>& rhs);
83 template <
typename G,
typename F>
85 operator<(const p_edges_psite<G,F>& lhs,
const p_edges_psite<G,F>& rhs);
94 template <
typename G,
typename F,
typename E>
95 struct subject_impl< const p_edges_psite<G,F>&, E >
96 : subject_impl< const graph_psite_base< p_edges<G,F>,
97 p_edges_psite<G,F> >&, E >
99 const util::edge<G>& e()
const;
100 util::vertex<G> v1()
const;
101 util::vertex<G> v2()
const;
104 const E& exact_()
const;
107 template <
typename G,
typename F,
typename E>
108 struct subject_impl< p_edges_psite<G,F>&, E >
109 : subject_impl< const p_edges_psite<G,F>&, E >,
110 subject_impl< graph_psite_base< p_edges<G,F>,
111 p_edges_psite<G,F> >&, E >
120 # ifndef MLN_INCLUDE_ONLY
122 template <
typename G,
typename F>
124 p_edges_psite<G, F>::p_edges_psite()
128 template <
typename G,
typename F>
130 p_edges_psite<G, F>::p_edges_psite(
const p_edges<G,F>& s)
135 template <
typename G,
typename F>
137 p_edges_psite<G, F>::p_edges_psite(
const p_edges<G,F>& s,
unsigned id)
142 template <
typename G,
typename F>
145 p_edges_psite<G, F>::e()
const
150 template <
typename G,
typename F>
153 p_edges_psite<G, F>::v1()
const
155 return this->elt_.graph().vertex(this->elt_.v1());
158 template <
typename G,
typename F>
161 p_edges_psite<G, F>::v2()
const
163 return this->elt_.graph().vertex(this->elt_.v2());
171 template <
typename G,
typename F>
173 operator==(
const p_edges_psite<G,F>& lhs,
const p_edges_psite<G,F>& rhs)
175 mln_assertion(lhs.target_() == rhs.target_());
176 return lhs.id() == rhs.id();
179 template <
typename G,
typename F>
181 operator!=(
const p_edges_psite<G,F>& lhs,
const p_edges_psite<G,F>& rhs)
183 mln_assertion(lhs.target_() == rhs.target_());
184 return lhs.id() != rhs.id();
187 template <
typename G,
typename F>
189 operator<(const p_edges_psite<G,F>& lhs,
const p_edges_psite<G,F>& rhs)
191 mln_assertion(lhs.target_() == rhs.target_());
192 return lhs.id() < rhs.id();
202 template <
typename G,
typename F,
typename E>
205 subject_impl< const p_edges_psite<G,F>&, E >::exact_()
const
207 return internal::force_exact<const E>(*this);
210 template <
typename G,
typename F,
typename E>
213 subject_impl< const p_edges_psite<G,F>&, E >::e()
const
215 return exact_().get_subject().e();
218 template <
typename G,
typename F,
typename E>
221 subject_impl< const p_edges_psite<G,F>&, E >::v1()
const
223 return exact_().get_subject().v1();
226 template <
typename G,
typename F,
typename E>
229 subject_impl< const p_edges_psite<G,F>&, E >::v2()
const
231 return exact_().get_subject().v2();
236 # endif // ! MLN_INCLUDE_ONLY
241 #endif // ! MLN_CORE_SITE_SET_P_EDGES_PSITE_HH