https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Nicolas Ballas <ballas(a)lrde.epita.fr>
Add the values_space method to image base.
* tests/core/image/flat_image.cc: update test
* mln/core/image/cast_image.hh,
* mln/core/image/decorated_image.hh,
* mln/core/image/obased_rle_image.hh,
* mln/core/image/value_enc_image.hh,
* mln/core/image/graph_image.hh,
* mln/core/image/line_graph_image.hh,
* mln/core/image/rle_image.hh,
* mln/core/image/tr_image.hh,
* mln/core/image/flat_image.hh,
* mln/core/image/mono_obased_rle_image.hh,
* mln/core/image/interpolated.hh,
* mln/core/image/sparse_image.hh,
* mln/core/image/bgraph_image.hh,
* mln/core/image/t_image.hh,
* mln/core/image/image1d.hh,
* mln/core/image/image2d.hh,
* mln/core/image/fi_adaptor.hh,
* mln/core/image/image3d.hh,
* mln/core/image/complex_image.hh,
* mln/core/image/mono_rle_image.hh: delete the values method.
* mln/core/macros.hh: update (mln_vset returns now t_eligible_values).
* mln/core/internal/image_base.hh: add the values_space method.
* mln/core/internal/image_identity.hh,
* mln/core/internal/image_domain_morpher.hh: update.
* mln/core/internal/image_value_morpher.hh: fix compile bug.
* mln/core/concept/image.hh: add interface check.
* mln/value/super_value.hh: New trait that return the super value type.
mln/core/concept/image.hh | 16 +++++---
mln/core/image/bgraph_image.hh | 14 -------
mln/core/image/cast_image.hh | 15 -------
mln/core/image/complex_image.hh | 13 ------
mln/core/image/decorated_image.hh | 4 --
mln/core/image/fi_adaptor.hh | 14 -------
mln/core/image/flat_image.hh | 19 ---------
mln/core/image/graph_image.hh | 13 ------
mln/core/image/image1d.hh | 15 -------
mln/core/image/image2d.hh | 15 -------
mln/core/image/image3d.hh | 16 --------
mln/core/image/interpolated.hh | 16 --------
mln/core/image/line_graph_image.hh | 13 ------
mln/core/image/mono_obased_rle_image.hh | 12 ------
mln/core/image/mono_rle_image.hh | 12 ------
mln/core/image/obased_rle_image.hh | 12 ------
mln/core/image/rle_image.hh | 12 ------
mln/core/image/sparse_image.hh | 18 ---------
mln/core/image/t_image.hh | 16 --------
mln/core/image/tr_image.hh | 4 --
mln/core/image/value_enc_image.hh | 12 ------
mln/core/internal/image_base.hh | 24 ++++++++++--
mln/core/internal/image_domain_morpher.hh | 19 ---------
mln/core/internal/image_identity.hh | 16 --------
mln/core/internal/image_value_morpher.hh | 12 +++---
mln/core/macros.hh | 4 +-
mln/value/super_value.hh | 59 ++++++++++++++++++++++++++++++
tests/core/image/flat_image.cc | 1
28 files changed, 99 insertions(+), 317 deletions(-)
Index: tests/core/image/flat_image.cc
--- tests/core/image/flat_image.cc (revision 2195)
+++ tests/core/image/flat_image.cc (working copy)
@@ -42,6 +42,7 @@
flat_image<short, box2d> test;
std::cout << test.values_eligible() << std::endl;
+ std::cout << test.values_space() << std::endl;
// flat_image<short, box2d>::t_eligible_value_set::fwd_viter
viter(test.values_eligible());
}
Index: mln/core/image/cast_image.hh
--- mln/core/image/cast_image.hh (revision 2195)
+++ mln/core/image/cast_image.hh (working copy)
@@ -92,10 +92,6 @@
/// Return type of read-write access.
typedef T lvalue;
- /// Value set associated type.
- typedef mln::value::set<T> vset;
-
-
/// Skeleton.
typedef cast_image_< tag::value_<T>, tag::image_<I> > skeleton;
@@ -109,9 +105,6 @@
/// Mutable access is only OK for reading (not writing).
T operator()(const mln_psite(I)& p);
-
- /// Give the set of values of the image.
- const vset& values() const;
};
@@ -172,14 +165,6 @@
return mln::value::cast<T>( this->data_->ima_(p) );
}
- template <typename T, typename I>
- inline
- const mln::value::set<T>&
- cast_image_<T,I>::values() const
- {
- return vset::the();
- }
-
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
Index: mln/core/image/decorated_image.hh
--- mln/core/image/decorated_image.hh (revision 2195)
+++ mln/core/image/decorated_image.hh (working copy)
@@ -104,10 +104,6 @@
/// Dtor
~decorated_image();
-
- /// Value_Set associated type.
- typedef mln_vset(I) vset;
-
/// Skeleton.
typedef decorated_image< tag::image_<I>, tag::data_<D> > skeleton;
Index: mln/core/image/obased_rle_image.hh
--- mln/core/image/obased_rle_image.hh (revision 2195)
+++ mln/core/image/obased_rle_image.hh (working copy)
@@ -119,7 +119,6 @@
typedef T& lvalue;
typedef const T rvalue;
typedef runs_psite<P> psite;
- typedef mln::value::set<T> vset;
typedef p_runs_<P> pset;
@@ -141,9 +140,6 @@
/// Test if this image has been initialized.
bool has_data() const;
- /// Give the set of values of the image.
- const vset& values() const;
-
/// Give the definition domain.
const pset& domain() const;
@@ -210,14 +206,6 @@
template <typename P, typename T>
inline
- const typename obased_rle_image<P, T>::vset&
- obased_rle_image<P, T>::values() const
- {
- return vset::the();
- }
-
- template <typename P, typename T>
- inline
void
obased_rle_image<P, T>::insert(const p_run<P>& pr, T value)
{
Index: mln/core/image/value_enc_image.hh
--- mln/core/image/value_enc_image.hh (revision 2195)
+++ mln/core/image/value_enc_image.hh (working copy)
@@ -108,7 +108,6 @@
typedef T value;
typedef T& lvalue;
typedef const T rvalue;
- typedef typename std::vector<T> vset;
/// Domain related typedefs
typedef pset_array_psite< runs_psite<P> > psite;
@@ -137,9 +136,6 @@
/// Test if this image has been initialized.
bool has_data() const;
- /// Give the set of values of the image.
- const vset& values() const;
-
/// Give the definition domain.
const pset& domain() const;
};
@@ -178,14 +174,6 @@
template <typename P, typename T>
inline
- const typename value_enc_image<P, T>::vset&
- value_enc_image<P, T>::values() const
- {
- return this->data_->values_;
- }
-
- template <typename P, typename T>
- inline
void
value_enc_image<P, T>::insert(const p_runs_<P>& ps, T value)
{
Index: mln/core/image/graph_image.hh
--- mln/core/image/graph_image.hh (revision 2195)
+++ mln/core/image/graph_image.hh (working copy)
@@ -111,9 +111,6 @@
/// Return type of read-only access.
typedef typename std::vector<V>::const_reference rvalue;
- /// Value set associated type.
- typedef mln::value::set<value> vset;
-
/// Skeleton.
typedef graph_image< tag::psite_<P>, tag::value_<V> > skeleton;
@@ -137,8 +134,6 @@
/// \{
/// Return the domain of psites od the image.
const p_graph<P>& domain() const;
- /// Return the domain of values of the image.
- const vset& values() const;
/// Return the array of values associated to the vertices.
const std::vector<V>& vertex_values() const;
@@ -254,14 +249,6 @@
template <typename P, typename V>
inline
- const mln::value::set<V> &
- graph_image<P, V>::values() const
- {
- return vset::the();
- }
-
- template <typename P, typename V>
- inline
const std::vector<V>&
graph_image<P, V>::vertex_values() const
{
Index: mln/core/image/line_graph_image.hh
--- mln/core/image/line_graph_image.hh (revision 2195)
+++ mln/core/image/line_graph_image.hh (working copy)
@@ -128,9 +128,6 @@
/// Return type of read-only access.
typedef typename std::vector<V>::const_reference rvalue;
- /// Value set associated type.
- typedef mln::value::set<value> vset;
-
/// Skeleton.
typedef line_graph_image< tag::psite_<P>, tag::value_<V> >
skeleton;
@@ -158,8 +155,6 @@
/// \{
/// Return the domain of psites od the image.
const p_line_graph<P>& domain() const;
- /// Return the domain of values of the image.
- const vset& values() const;
/// Return the array of values associated to the edges.
const std::vector<V>& edge_values() const;
@@ -287,14 +282,6 @@
template <typename P, typename V>
inline
- const mln::value::set<V> &
- line_graph_image<P, V>::values() const
- {
- return vset::the();
- }
-
- template <typename P, typename V>
- inline
const std::vector<V>&
line_graph_image<P, V>::edge_values() const
{
Index: mln/core/image/rle_image.hh
--- mln/core/image/rle_image.hh (revision 2195)
+++ mln/core/image/rle_image.hh (working copy)
@@ -109,7 +109,6 @@
typedef T& lvalue;
typedef const T rvalue;
typedef runs_psite<P> psite;
- typedef mln::value::set<T> vset;
typedef p_runs_<P> pset;
@@ -131,9 +130,6 @@
/// Test if this image has been initialized.
bool has_data() const;
- /// Give the set of values of the image.
- const vset& values() const;
-
/// Give the definition domain.
const pset& domain() const;
@@ -188,14 +184,6 @@
template <typename P, typename T>
inline
- const typename rle_image<P, T>::vset&
- rle_image<P, T>::values() const
- {
- return vset::the();
- }
-
- template <typename P, typename T>
- inline
void
rle_image<P, T>::insert(const p_run<P>& pr, T value)
{
Index: mln/core/image/tr_image.hh
--- mln/core/image/tr_image.hh (revision 2195)
+++ mln/core/image/tr_image.hh (working copy)
@@ -88,10 +88,6 @@
/// Return type of read-only access.
typedef mln_rvalue(I) rvalue;
- /// Value set associated type.
- typedef mln::value::set<value> vset;
-
-
/// Skeleton.
typedef tr_image< T, tag::image_<I> > skeleton;
Index: mln/core/image/flat_image.hh
--- mln/core/image/flat_image.hh (revision 2195)
+++ mln/core/image/flat_image.hh (working copy)
@@ -138,17 +138,6 @@
const T& operator()(const mln_psite(S)& p);
- // FIXME: Weird...
-
- /// Value_Set associated type.
- typedef mln::value::set<T> vset;
-
- /// Give the set of values of the image.
- const mln::value::set<T>& values() const;
-
- // end of FIXME
-
-
/// Change the image value.
void change_value(const T& old_val, const T& new_val);
};
@@ -251,14 +240,6 @@
template <typename T, typename S>
inline
- const mln::value::set<T>&
- flat_image<T,S>::values() const
- {
- return vset::the();
- }
-
- template <typename T, typename S>
- inline
void
flat_image<T,S>::change_value(const T& old_val, const T& new_val)
{
Index: mln/core/image/mono_obased_rle_image.hh
--- mln/core/image/mono_obased_rle_image.hh (revision 2195)
+++ mln/core/image/mono_obased_rle_image.hh (working copy)
@@ -114,7 +114,6 @@
typedef T& lvalue;
typedef const T rvalue;
typedef runs_psite<P> psite;
- typedef mln::value::set<T> vset;
typedef p_runs_<P> pset;
@@ -136,9 +135,6 @@
/// Test if this image has been initialized.
bool has_data() const;
- /// Give the set of values of the image.
- const vset& values() const;
-
/// Give the definition domain.
const pset& domain() const;
@@ -200,14 +196,6 @@
template <typename P, typename T>
inline
- const typename mono_obased_rle_image<P, T>::vset&
- mono_obased_rle_image<P, T>::values() const
- {
- return vset::the();
- }
-
- template <typename P, typename T>
- inline
void
mono_obased_rle_image<P, T>::insert(const p_run<P>& pr, T value)
{
Index: mln/core/image/interpolated.hh
--- mln/core/image/interpolated.hh (revision 2195)
+++ mln/core/image/interpolated.hh (working copy)
@@ -83,10 +83,6 @@
/// Return type of read-only access.
typedef mln_rvalue(I) rvalue;
- /// Value set associated type.
- typedef mln::value::set<value> vset;
-
-
/// Skeleton.
typedef interpolated< tag::image_<I> > skeleton;
@@ -112,8 +108,6 @@
mln_value(I) operator()(const mln::algebra::vec<I::point::dim, float>& v)
const;
- /// Give the set of values of the image.
- const vset& values() const;
};
@@ -178,16 +172,6 @@
return this->data_->ima_(p);
}
- // FIXME : Should we remove this method? (and inherit it from
- // identity morpher)
- template <typename I>
- inline
- const mln::value::set<mln_value(I) >&
- interpolated<I>::values() const
- {
- return vset::the();
- }
-
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
Index: mln/core/image/sparse_image.hh
--- mln/core/image/sparse_image.hh (revision 2195)
+++ mln/core/image/sparse_image.hh (working copy)
@@ -122,11 +122,6 @@
/// Return type of read-write access.
typedef T& lvalue;
-
- /// Value_Set associated type.
- typedef mln::value::set<T> vset;
-
-
/// Skeleton.
typedef sparse_image< tag::psite_<P>, tag::value_<T> > skeleton;
@@ -153,11 +148,6 @@
/// Read-write access to the image value located at point \p p.
lvalue operator()(const psite& p);
-
- /// Give the set of values of the image.
- const vset& values() const;
-
-
/// Give the definition domain.
const p_set_of< p_run<P> >& domain() const;
};
@@ -200,14 +190,6 @@
template <typename P, typename T>
inline
- const typename sparse_image<P,T>::vset&
- sparse_image<P,T>::values() const
- {
- return vset::the();
- }
-
- template <typename P, typename T>
- inline
void
sparse_image<P,T>::insert(const p_run<P>& r, const
std::vector<T>& vals)
{
Index: mln/core/image/bgraph_image.hh
--- mln/core/image/bgraph_image.hh (revision 2195)
+++ mln/core/image/bgraph_image.hh (working copy)
@@ -114,10 +114,6 @@
/// Return type of read-only access.
typedef typename std::vector<V>::const_reference rvalue;
- /// Value set associated type.
- typedef mln::value::set<value> vset;
-
-
/// Skeleton.
typedef bgraph_image< tag::psite_<P>, tag::value_<V> > skeleton;
@@ -141,8 +137,6 @@
/// \{
/// Return the domain of psites od the image.
const p_bgraph<P>& domain() const;
- /// Return the domain of values of the image.
- const vset& values() const;
/// Return the array of values associated to the nodes.
const std::vector<V>& node_values() const;
@@ -253,14 +247,6 @@
template <typename P, typename V>
inline
- const mln::value::set<V> &
- bgraph_image<P, V>::values() const
- {
- return vset::the();
- }
-
- template <typename P, typename V>
- inline
const std::vector<V>&
bgraph_image<P, V>::node_values() const
{
Index: mln/core/image/t_image.hh
--- mln/core/image/t_image.hh (revision 2195)
+++ mln/core/image/t_image.hh (working copy)
@@ -100,10 +100,6 @@
/// Return type of read-only access.
typedef mln_rvalue(I) rvalue;
- /// Value set associated type.
- typedef mln::value::set<value> vset;
-
-
/// Skeleton.
typedef t_image< tag::image_<I> > skeleton;
@@ -138,8 +134,6 @@
/// Read-write access of pixel value at point site \p p.
mln_morpher_lvalue(I) operator()(const mln_psite(I)& p);
- /// Give the set of values of the image.
- const vset& values() const;
protected:
/// Exchange components \a dim1_ and \a dim2_ of point \a p.
@@ -266,16 +260,6 @@
template <typename I>
inline
- const typename t_image<I>::vset&
- t_image<I>::values() const
- {
- mln_precondition(this->delegatee_() != 0);
- return this->delegatee_()->values();
- }
-
-
- template <typename I>
- inline
t_image<I>
swap_coords(Image<I>& ima, unsigned dim1, unsigned dim2)
{
Index: mln/core/image/image1d.hh
--- mln/core/image/image1d.hh (revision 2195)
+++ mln/core/image/image1d.hh (working copy)
@@ -140,10 +140,6 @@
typedef image1d< tag::value_<T> > skeleton;
- /// Value_Set associated type.
- typedef mln::value::set<T> vset;
-
-
/// Constructor without argument.
image1d();
@@ -162,9 +158,6 @@
/// Test if \p p is valid.
bool has(const point1d& p) const;
- /// Give the set of values of the image.
- const vset& values() const;
-
/// Give the definition domain.
const box1d& domain() const;
@@ -354,14 +347,6 @@
template <typename T>
inline
- const typename image1d<T>::vset&
- image1d<T>::values() const
- {
- return vset::the();
- }
-
- template <typename T>
- inline
const box1d&
image1d<T>::domain() const
{
Index: mln/core/image/image2d.hh
--- mln/core/image/image2d.hh (revision 2195)
+++ mln/core/image/image2d.hh (working copy)
@@ -146,10 +146,6 @@
typedef image2d< tag::value_<T> > skeleton;
- /// Value_Set associated type.
- typedef mln::value::set<T> vset;
-
-
/// Constructor without argument.
image2d();
@@ -169,9 +165,6 @@
/// Test if \p p is valid.
bool has(const point2d& p) const;
- /// Give the set of values of the image.
- const vset& values() const;
-
/// Give the definition domain.
const box2d& domain() const;
@@ -418,14 +411,6 @@
template <typename T>
inline
- const typename image2d<T>::vset&
- image2d<T>::values() const
- {
- return vset::the();
- }
-
- template <typename T>
- inline
const box2d&
image2d<T>::domain() const
{
Index: mln/core/image/fi_adaptor.hh
--- mln/core/image/fi_adaptor.hh (revision 2195)
+++ mln/core/image/fi_adaptor.hh (working copy)
@@ -157,10 +157,6 @@
/// Skeleton.
typedef fi_adaptor< tag::value_<T> > skeleton;
- /// Value_Set associated type.
- typedef mln::value::set<T> vset;
-
-
/// Constructor without argument.
fi_adaptor();
@@ -170,9 +166,6 @@
/// Initialize an empty image.
void init_();
- /// Give the set of values of the image.
- const vset& values() const;
-
/// Give the definition domain.
const box2d& domain() const;
@@ -305,13 +298,6 @@
}
template <typename I>
- const typename fi_adaptor<I>::vset&
- fi_adaptor<I>::values() const
- {
- return vset::the();
- }
-
- template <typename I>
const box2d&
fi_adaptor<I>::domain() const
{
Index: mln/core/image/image3d.hh
--- mln/core/image/image3d.hh (revision 2195)
+++ mln/core/image/image3d.hh (working copy)
@@ -142,11 +142,6 @@
/// Skeleton.
typedef image3d< tag::value_<T> > skeleton;
-
- /// Value_Set associated type.
- typedef mln::value::set<T> vset;
-
-
/// Constructor without argument.
image3d();
@@ -166,9 +161,6 @@
/// Test if \p p is valid.
bool has(const point3d& p) const;
- /// Give the set of values of the image.
- const vset& values() const;
-
/// Give the definition domain.
const box3d& domain() const;
@@ -391,14 +383,6 @@
template <typename T>
inline
- const typename image3d<T>::vset&
- image3d<T>::values() const
- {
- return vset::the();
- }
-
- template <typename T>
- inline
const box3d&
image3d<T>::domain() const
{
Index: mln/core/image/complex_image.hh
--- mln/core/image/complex_image.hh (revision 2195)
+++ mln/core/image/complex_image.hh (working copy)
@@ -120,9 +120,6 @@
/// Return type of read-only access.
typedef typename std::vector<V>::const_reference rvalue;
- /// Value set associated type.
- typedef mln::value::set<value> vset;
-
/// Skeleton.
typedef complex_image< D, tag::psite_<P>, tag::value_<V> >
skeleton;
@@ -148,8 +145,6 @@
/// \{
/// Return the domain of psites od the image.
const p_complex<D, P>& domain() const;
- /// Return the domain of values of the image.
- const vset& values() const;
/// Return the array of values associated to the faces.
const metal::vec<D + 1, std::vector<V> >& face_values() const;
@@ -270,14 +265,6 @@
template <unsigned D, typename P, typename V>
inline
- const mln::value::set<V> &
- complex_image<D, P, V>::values() const
- {
- return vset::the();
- }
-
- template <unsigned D, typename P, typename V>
- inline
const metal::vec< D + 1, std::vector<V> >&
complex_image<D, P, V>::face_values() const
{
Index: mln/core/image/mono_rle_image.hh
--- mln/core/image/mono_rle_image.hh (revision 2195)
+++ mln/core/image/mono_rle_image.hh (working copy)
@@ -110,7 +110,6 @@
typedef T& lvalue;
typedef const T rvalue;
typedef runs_psite<P> psite;
- typedef mln::value::set<T> vset;
typedef p_runs_<P> pset;
@@ -135,9 +134,6 @@
/// Give the uniq value of the image.
rvalue get_value() const;
- /// Give the set of values of the image.
- const vset& values() const;
-
/// Give the definition domain.
const pset& domain() const;
@@ -193,14 +189,6 @@
template <typename P, typename T>
inline
- const typename mono_rle_image<P, T>::vset&
- mono_rle_image<P, T>::values() const
- {
- return vset::the();
- }
-
- template <typename P, typename T>
- inline
void
mono_rle_image<P, T>::insert(const p_run<P>& pr)
{
Index: mln/core/macros.hh
--- mln/core/macros.hh (revision 2195)
+++ mln/core/macros.hh (working copy)
@@ -353,8 +353,8 @@
/// Shortcuts to access the type of value set (vset) associated to T.
/// \{
-# define mln_vset(T) typename T::vset
-# define mln_vset_(T) T::vset
+# define mln_vset(T) typename T::t_eligible_value_set
+# define mln_vset_(T) T::t_eligible_value_set
/// \}
/// Shortcuts to access the viter type associated to T.
Index: mln/core/internal/image_base.hh
--- mln/core/internal/image_base.hh (revision 2195)
+++ mln/core/internal/image_base.hh (working copy)
@@ -41,6 +41,7 @@
# include <mln/core/internal/morpher_lvalue.hh>
# include <mln/util/tracked_ptr.hh>
# include <mln/value/set.hh>
+# include <mln/value/super_value.hh>
// image_base
// ^
@@ -85,10 +86,17 @@
typedef T value;
/// Eligible-value-set associated type.
- typedef mln::value::set<T> t_eligible_value_set;
+ typedef mln::value::set<T> t_eligible_values_set;
// Return the set of the image eligigle values
- const t_eligible_value_set& values_eligible() const;
+ const t_eligible_values_set& values_eligible() const;
+
+ /// Value space associated type.
+ typedef mln::value::set<
+ typename mln::value::super_value<T>::ret > t_values_space;
+
+ /// Return the value space of the image.
+ const t_values_space& values_space() const;
/// Site_Set associated type.
@@ -222,10 +230,18 @@
template <typename T, typename S, typename E>
inline
- const typename image_base<T, S, E>::t_eligible_value_set&
+ const typename image_base<T, S, E>::t_eligible_values_set&
image_base<T, S, E>::values_eligible() const
{
- return t_eligible_value_set::the();
+ return t_eligible_values_set::the();
+ }
+
+ template <typename T, typename S, typename E>
+ inline
+ const typename image_base<T, S, E>::t_values_space&
+ image_base<T, S, E>::values_space() const
+ {
+ return t_values_space::the();
}
template <typename T, typename S, typename E>
Index: mln/core/internal/image_identity.hh
--- mln/core/internal/image_identity.hh (revision 2195)
+++ mln/core/internal/image_identity.hh (working copy)
@@ -133,9 +133,6 @@
{
public:
- /// Value_Set associated type.
- typedef mln_vset(I) vset;
-
/// Value associated type.
typedef mln_value(I) value;
@@ -145,10 +142,6 @@
/// Return type of read-write access.
typedef mln_morpher_lvalue(I) lvalue;
-
- /// Give the set of values.
- const vset& values() const;
-
/// Read-only access of pixel value at point site \p p.
rvalue operator()(const mln_psite(S)& p) const;
@@ -177,15 +170,6 @@
template <typename I, typename S, typename E>
inline
- const mln_vset(I)&
- image_identity<I, S, E>::values() const
- {
- mln_precondition(this->delegatee_() != 0);
- return this->delegatee_()->values();
- }
-
- template <typename I, typename S, typename E>
- inline
mln_rvalue(I)
image_identity<I, S, E>::operator()(const mln_psite(S)& p) const
{
Index: mln/core/internal/image_domain_morpher.hh
--- mln/core/internal/image_domain_morpher.hh (revision 2195)
+++ mln/core/internal/image_domain_morpher.hh (working copy)
@@ -55,16 +55,6 @@
{
public:
- /// Value_Set associated type.
- typedef mln_vset(I) vset;
-
- /// Give the set of values.
- const vset& values() const;
-
-
- /// Value associated type.
- typedef mln_value(I) value;
-
/// Return type of read-only access.
typedef mln_rvalue(I) rvalue;
@@ -95,15 +85,6 @@
template <typename I, typename S, typename E>
inline
- const mln_vset(I)&
- image_domain_morpher<I,S,E>::values() const
- {
- mln_precondition(this->delegatee_() != 0);
- return this->delegatee_()->values();
- }
-
- template <typename I, typename S, typename E>
- inline
mln_rvalue(I)
image_domain_morpher<I,S,E>::operator()(const mln_psite(S)& p) const
{
Index: mln/core/internal/image_value_morpher.hh
--- mln/core/internal/image_value_morpher.hh (revision 2195)
+++ mln/core/internal/image_value_morpher.hh (working copy)
@@ -65,25 +65,25 @@
# ifndef MLN_INCLUDE_ONLY
- template <typename I, typename E>
+ template <typename I, typename T, typename E>
inline
- image_value_morpher<I,E>::image_value_morpher()
+ image_value_morpher<I,T,E>::image_value_morpher()
{
}
- template <typename I, typename E>
+ template <typename I, typename T, typename E>
inline
const mln_pset(I)&
- image_value_morpher<I,E>::domain() const
+ image_value_morpher<I,T,E>::domain() const
{
mln_precondition(this->delegatee_() != 0);
return this->delegatee_()->domain();
}
- template <typename I, typename E>
+ template <typename I, typename T, typename E>
inline
bool
- image_value_morpher<I,E>::has(const mln_psite(I)& p) const
+ image_value_morpher<I,T,E>::has(const mln_psite(I)& p) const
{
mln_precondition(this->delegatee_() != 0);
return this->delegatee_()->has(p);
Index: mln/core/concept/image.hh
--- mln/core/concept/image.hh (revision 2195)
+++ mln/core/concept/image.hh (working copy)
@@ -162,11 +162,14 @@
typedef mln_value(E) value;
typedef mln_rvalue(E) rvalue;
typedef mln_lvalue(E) lvalue;
- typedef typename E::t_eligible_value_set t_eligible_value_set;
+ typedef typename E::t_eligible_values_set t_eligible_values_set;
+ typedef typename E::t_values_space t_values_space;
- typedef mln_vset(E) vset;
- const vset& (E::*m5)() const = & E::values;
- m5 = 0;
+
+ // FIXME Doc
+ //typedef mln_vset(E) vset;
+ //const vset& (E::*m5)() const = & E::values;
+ //m5 = 0;
rvalue (E::*m6)(const psite& p) const = & E::operator();
m6 = 0;
@@ -176,9 +179,12 @@
const pset& (E::*m8)() const = & E::domain;
m8 = 0;
- const t_eligible_value_set& (E::*m9)() const = & E::values_eligible;
+ const t_eligible_values_set& (E::*m9)() const = & E::values_eligible;
m9 = 0;
+ const t_values_space& (E::*m10)() const = & E::values_space;
+ m10 = 0;
+
typedef typename E::skeleton skeleton;
/// Optional interface:
Index: mln/value/super_value.hh
--- mln/value/super_value.hh (revision 0)
+++ mln/value/super_value.hh (revision 0)
@@ -0,0 +1,59 @@
+// Copyright (C) 2008 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_VALUE_SUPER_VALUE_HH
+# define MLN_VALUE_SUPER_VALUE_HH
+
+/*! \file mln/value/super_value.hh
+ *
+ * \brief Definition of the mln::super_value trait.
+ */
+
+namespace mln
+{
+
+ namespace value
+ {
+
+ /*
+ * \brief Return the super value type associated to the parameter \p T
+ * By default, the super value type of the parameter \p T, is T itself.
+ */
+ template <typename T>
+ struct super_value
+ {
+ typedef T ret;
+ };
+
+ /// Specialization
+ ///
+
+ }
+
+}
+
+#endif // !MLN_VALUE_SUPER_VALUE_HH