27 #ifndef MLN_CORE_INTERNAL_IMAGE_BASE_HH
28 # define MLN_CORE_INTERNAL_IMAGE_BASE_HH
36 # include <mln/core/concept/image.hh>
37 # include <mln/core/grids.hh>
38 # include <mln/core/trait/qlf_value.hh>
39 # include <mln/core/internal/check/image_all.hh>
40 # include <mln/core/internal/data.hh>
41 # include <mln/core/internal/morpher_lvalue.hh>
42 # include <mln/util/tracked_ptr.hh>
43 # include <mln/value/set.hh>
44 # include <mln/value/super_value.hh>
69 public check::image_all_<E>,
81 template <
typename T,
typename S,
typename E>
84 public image_checked_<E>
94 const t_eligible_values_set& values_eligible()
const;
98 typename mln::value::super_value<T>::ret > t_values_space;
101 const t_values_space& values_space()
const;
108 typedef mln_psite(S) psite;
111 typedef mln_site(S) site;
115 typedef mln_fwd_piter(S) fwd_piter;
118 typedef mln_bkd_piter(S) bkd_piter;
123 typedef fwd_piter piter;
128 bool has(const psite& p) const;
131 std::
size_t nsites() const;
134 bool is_valid() const;
140 image_base& operator=(const image_base& rhs);
143 image_base(const image_base& rhs);
148 const
void* id_() const;
155 const util::tracked_ptr< internal::
data<E> >& hook_data_() const;
163 util::tracked_ptr< internal::
data<E> > data_;
168 # ifndef MLN_INCLUDE_ONLY
170 template <
typename T,
typename S,
typename E>
172 image_base<T, S, E>::image_base()
176 template <
typename T,
typename S,
typename E>
178 image_base<T, S, E>::image_base(
const image_base& rhs)
179 : image_checked_<E>()
181 mln_precondition(exact(rhs).is_valid());
182 this->data_ = rhs.data_;
185 template <
typename T,
typename S,
typename E>
188 image_base<T, S, E>::operator=(
const image_base<T, S, E>& rhs)
190 mln_precondition(exact(rhs).is_valid());
193 this->data_ = rhs.data_;
197 template <
typename T,
typename S,
typename E>
200 image_base<T, S, E>::id_()
const
205 template <
typename T,
typename S,
typename E>
208 image_base<T, S, E>::is_valid()
const
213 template <
typename T,
typename S,
typename E>
216 image_base<T, S, E>::has(
const psite& p)
const
218 mln_precondition(exact(
this)->is_valid());
219 return exact(
this)->domain().has(p);
222 template <
typename T,
typename S,
typename E>
225 image_base<T, S, E>::nsites()
const
227 mlc_equal(mln_trait_site_set_nsites(S),
228 mln::trait::site_set::nsites::known)::check();
229 mln_precondition(exact(
this)->is_valid());
230 return exact(
this)->domain().nsites();
233 template <
typename T,
typename S,
typename E>
235 const typename image_base<T, S, E>::t_eligible_values_set&
236 image_base<T, S, E>::values_eligible()
const
238 return t_eligible_values_set::the();
241 template <
typename T,
typename S,
typename E>
243 const typename image_base<T, S, E>::t_values_space&
244 image_base<T, S, E>::values_space()
const
246 return t_values_space::the();
249 template <
typename T,
typename S,
typename E>
252 image_base<T, S, E>::destroy()
257 template <
typename T,
typename S,
typename E>
259 const util::tracked_ptr< internal::data<E> >&
260 image_base<T, S, E>::hook_data_()
const
265 # endif // ! MLN_INCLUDE_ONLY
272 #endif // ! MLN_CORE_INTERNAL_IMAGE_BASE_HH