27 #ifndef MLN_CORE_SITE_SET_P_IF_HH
28 # define MLN_CORE_SITE_SET_P_IF_HH
37 # include <mln/core/internal/site_set_base.hh>
38 # include <mln/core/concept/function.hh>
45 template <
typename S,
typename F>
class p_if;
46 template <
typename Pi,
typename S,
typename F>
struct p_if_piter_;
52 template <
typename S,
typename F>
53 struct site_set_< p_if<S,F> >
55 typedef trait::site_set::nsites::unknown
nsites;
56 typedef trait::site_set::bbox::unknown
bbox;
57 typedef trait::site_set::contents::fixed
contents;
58 typedef mln_trait_site_set_arity(S)
arity;
72 template <typename S, typename F>
74 operator | (const Site_Set<S>& s, const Function_v2b<F>& f);
85 template <typename S, typename F>
86 class
p_if : public internal::site_set_base_< mln_psite(S),
p_if<S,F> >
110 p_if(const S& s, const F& f);
117 bool is_valid() const;
121 bool has(const psite&
p) const;
124 const S& overset() const;
127 bool pred(const psite&
p) const;
130 const F& predicate() const;
134 std::
size_t memory_size() const;
144 # ifndef MLN_INCLUDE_ONLY
147 template <
typename S,
typename F>
159 template <
typename S,
typename F>
164 return s_.
has(p) && f_(p) ==
true;
167 template <
typename S,
typename F>
170 p_if<S,F>::is_valid()
const
172 return s_.is_valid();
175 template <
typename S,
typename F>
178 p_if<S,F>::overset()
const
183 template <
typename S,
typename F>
186 p_if<S,F>::pred(
const psite& p)
const
191 template <
typename S,
typename F>
193 p_if<S,F>::p_if(
const S& s,
const F& f)
199 template <
typename S,
typename F>
205 template <
typename S,
typename F>
213 template <
typename S,
typename F>
218 return s_.memory_size() +
sizeof(f_);
221 # endif // ! MLN_INCLUDE_ONLY
227 # include <mln/core/site_set/p_if_piter.hh>
231 #endif // ! MLN_CORE_SITE_SET_P_IF_HH