26 #ifndef MLN_CORE_SITE_SET_P_IF_HH
27 # define MLN_CORE_SITE_SET_P_IF_HH
36 # include <mln/core/internal/site_set_base.hh>
37 # include <mln/core/concept/function.hh>
44 template <
typename S,
typename F>
class p_if;
45 template <
typename Pi,
typename S,
typename F>
struct p_if_piter_;
51 template <
typename S,
typename F>
52 struct site_set_< p_if<S,F> >
54 typedef trait::site_set::nsites::unknown
nsites;
55 typedef trait::site_set::bbox::unknown bbox;
56 typedef trait::site_set::contents::fixed contents;
57 typedef mln_trait_site_set_arity(S) arity;
69 template <typename S, typename F>
71 operator | (const Site_Set<S>& s, const Function_v2b<F>& f);
82 template <typename S, typename F>
83 class
p_if : public internal::site_set_base_< mln_psite(S),
p_if<S,F> >
86 typedef internal::site_set_base_<mln_psite(S), self_> super_;
97 typedef p_if_piter_<mln_fwd_piter(S), S, F>
fwd_piter;
107 p_if(const S& s, const F& f);
114 bool is_valid() const;
118 bool has(const psite& p) const;
121 const S& overset() const;
124 bool pred(const psite& p) const;
127 const F& predicate() const;
131 std::
size_t memory_size() const;
141 # ifndef MLN_INCLUDE_ONLY
144 template <
typename S,
typename F>
156 template <
typename S,
typename F>
161 return s_.has(p) && f_(p) ==
true;
164 template <
typename S,
typename F>
169 return s_.is_valid();
172 template <
typename S,
typename F>
180 template <
typename S,
typename F>
188 template <
typename S,
typename F>
196 template <
typename S,
typename F>
202 template <
typename S,
typename F>
210 template <
typename S,
typename F>
215 return s_.memory_size() +
sizeof(f_);
218 # endif // ! MLN_INCLUDE_ONLY
224 # include <mln/core/site_set/p_if_piter.hh>
228 #endif // ! MLN_CORE_SITE_SET_P_IF_HH