URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-10-05 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
Add float_f value.
* mln/value/float01_f.hh: New.
* tests/value_float01_f.cc: New.
---
mln/value/float01_f.hh | 129 +++++++++++++++++++++++++++++++++++++++++++++++
tests/value_float01_f.cc | 39 ++++++++++++++
2 files changed, 168 insertions(+)
Index: trunk/milena/tests/value_float01_f.cc
===================================================================
--- trunk/milena/tests/value_float01_f.cc (revision 0)
+++ trunk/milena/tests/value_float01_f.cc (revision 1258)
@@ -0,0 +1,39 @@
+// Copyright (C) 2007 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.
+
+#include <iostream>
+#include <mln/value/float01_f.hh>
+
+int main()
+{
+ using typename mln::value::float01_f;
+ float01_f x = 0.5;
+
+ std::cout << x + 21.25 << std::endl;
+
+ x = x + 34;
+}
Index: trunk/milena/mln/value/float01_f.hh
===================================================================
--- trunk/milena/mln/value/float01_f.hh (revision 0)
+++ trunk/milena/mln/value/float01_f.hh (revision 1258)
@@ -0,0 +1,129 @@
+// Copyright (C) 2006, 2007 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_CORE_VALUE_FLOAT01_F_HH
+# define MLN_CORE_VALUE_FLOAT01_F_HH
+
+# include <iostream>
+# include <mln/value/internal/value_like.hh>
+# include <mln/value/concept/floating.hh>
+# include <mln/value/props.hh>
+
+namespace mln
+{
+
+ namespace value
+ {
+
+ /// Fwd decl.
+ class float01;
+
+
+ /// General float01-level class on n bits.
+ class float01_f
+ : public Floating< float01_f >,
+ public internal::value_like_< float,
+ float01_f >
+ {
+ public:
+
+ /// Ctor.
+ float01_f();
+
+ /// Ctor.
+ float01_f(const float val);
+
+ /// Access to std type.
+ float value() const;
+
+ /// Op encoding_t.
+ operator float() const;
+
+ float01_f& operator=(const float val);
+ /// Op==.
+ // bool operator==(const float01_f& rhs) const;
+
+ protected:
+ float val_;
+ };
+
+ template <>
+ struct props< float01_f >
+ {
+ static const std::size_t card_ = 0;
+ static const float min() { return 0; }
+ static const float max() { return 1; }
+ //static const unsigned nbits = n;
+ typedef trait::kind::data kind;
+ typedef float sum;
+ typedef float interop;
+ };
+
+# ifndef MLN_INCLUDE_ONLY
+
+ // Float01_F.
+
+ float01_f::float01_f()
+ : val_(0)
+ {
+ }
+
+ float01_f::float01_f(const float val)
+ : val_(val)
+ {
+ mln_precondition(val >= 0);
+ mln_precondition(val <= 1);
+ }
+
+ float
+ float01_f::value() const
+ {
+ return (val_);
+ }
+
+ float01_f&
+ float01_f::operator=(const float val)
+ {
+ mln_precondition(val >= 0);
+ mln_precondition(val <= 1);
+ this->val_ = val;
+ return *this;
+ }
+
+ float01_f::operator float() const
+ {
+ return val_;
+ }
+
+# endif
+
+
+ } // end of namespace mln::value
+
+} // end of namespace mln
+
+#endif // ! MLN_CORE_VALUE_FLOAT01_F_HH
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Prepare the 'fetch impl / check impl' image mechanism.
* mln/core/internal/image_base.hh (image_checked_): New.
(image_impled_): New.
(image_base_): Change inheritance to image_impled_.
The plug to select_image_concept_---soon obsolete---is
now handled by image_checked_.
(super_): Remove.
* mln/core/internal/check: New directory.
* mln/core/internal/check/image_all.hh: New.
* mln/core/concept/fastest_image.hh: Move static checks into...
* mln/core/internal/check/image_fastest.hh: ...this new file.
* mln/core/concept/image.hh: Include extra metal files.
concept/fastest_image.hh | 41 --------------------
concept/image.hh | 3 +
internal/check/image_all.hh | 68 +++++++++++++++++++++++++++++++++
internal/check/image_fastest.hh | 82 ++++++++++++----------------------------
internal/image_base.hh | 36 +++++++++++++----
5 files changed, 125 insertions(+), 105 deletions(-)
Index: mln/core/internal/image_base.hh
--- mln/core/internal/image_base.hh (revision 1254)
+++ mln/core/internal/image_base.hh (working copy)
@@ -35,8 +35,8 @@
# include <mln/core/concept/image.hh>
# include <mln/core/grids.hh>
+# include <mln/core/internal/check/image_all.hh>
# include <mln/util/tracked_ptr.hh>
-# include <mln/metal/equal.hh>
@@ -97,6 +97,29 @@
+ template <typename E>
+ struct image_checked_
+ :
+ public check::image_all_<E>,
+
+ // FIXME: first check impl w.r.t. properties, then:
+ public select_image_concept_< typename mlc_equal(mln_trait_image_speed(E),
+ trait::speed::fastest)::eval,
+ E > // FIXME: Change to Image<E>
+ {
+ };
+
+
+ template <typename E>
+ struct image_impled_
+ :
+ // FIXME: first fetch default impl w.r.t. properties, then:
+ image_checked_<E>
+ {
+ };
+
+
+
/*! \brief A base class for images.
*
* Parameter \p S is a point set type.
@@ -105,10 +128,9 @@
*/
template <typename S, typename E>
struct image_base_
+ :
+ public image_impled_<E>
- : public select_image_concept_< typename mlc_equal(mln_trait_image_speed(E),
- trait::speed::fastest)::eval,
- E >
{
/// Point_Set associated type.
typedef S pset;
@@ -171,10 +193,6 @@
// Internal data, sharable by several images.
util::tracked_ptr< internal::data_<E> > data_;
-
- typedef select_image_concept_< typename mlc_equal(mln_trait_image_speed(E),
- trait::speed::fastest)::eval,
- E > super_;
};
@@ -188,7 +206,7 @@
template <typename S, typename E>
image_base_<S,E>::image_base_(const image_base_& rhs)
- : super_()
+ : image_impled_<E>()
{
mln_precondition(exact(rhs).has_data()); // FIXME: Is-it too restrictive?
this->data_ = rhs.data_;
Index: mln/core/internal/check/image_all.hh
--- mln/core/internal/check/image_all.hh (revision 0)
+++ mln/core/internal/check/image_all.hh (revision 0)
@@ -0,0 +1,68 @@
+// Copyright (C) 2007 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_CORE_INTERNAL_CHECK_IMAGE_ALL_HH
+# define MLN_CORE_INTERNAL_CHECK_IMAGE_ALL_HH
+
+/*! \file mln/core/internal/check/image_all.hh
+ *
+ * \brief File that includes all image-related internal checks.
+ */
+
+
+# include <mln/core/internal/check/image_fastest.hh>
+// ...
+
+
+namespace mln
+{
+
+ namespace internal
+ {
+
+ /*! Namespace of all image-related internal checks.
+ */
+ namespace check
+ {
+
+ template <typename E>
+ struct image_all_
+ :
+ public image_fastest_< E, typename mlc_equal(mln_trait_image_speed(E),
+ trait::speed::fastest)::eval >
+ // , ...
+ {
+ };
+
+ } // end of namespace mln::internal::check
+
+ } // end of namespace mln::internal
+
+} // end of namespace mln
+
+
+#endif // ! MLN_CORE_INTERNAL_CHECK_IMAGE_ALL_HH
Index: mln/core/internal/check/image_fastest.hh
--- mln/core/internal/check/image_fastest.hh (revision 0)
+++ mln/core/internal/check/image_fastest.hh (working copy)
@@ -25,83 +25,47 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_CONCEPT_FASTEST_IMAGE_HH
-# define MLN_CORE_CONCEPT_FASTEST_IMAGE_HH
+#ifndef MLN_CORE_INTERNAL_CHECK_IMAGE_FASTEST_HH
+# define MLN_CORE_INTERNAL_CHECK_IMAGE_FASTEST_HH
/*! \file mln/core/concept/fastest_image.hh
* \brief Definition of the concept of mln::Fastest_Image.
*/
-# include <mln/core/concept/image.hh>
-# include <mln/core/concept/generalized_point.hh>
-# include <mln/core/trait/qlf_value.hh>
-
namespace mln
{
- /*! \brief Base class for implementation of fastest image classes.
+ namespace internal
+ {
+
+ namespace check
+ {
+
+ /*! \brief FIXME
*
* \see mln::doc::Fastest_Image for a complete documentation of this
* class contents.
*/
- template <typename E>
- struct Fastest_Image : public Image<E>
+ template < typename E, typename B = metal::true_ >
+ struct image_fastest_
{
- /*
- unsigned border();
-
- int offset(const dpoint& dp) const; // FIXME: std::ptr_diff_t?
- point point_at_offset(unsigned o) const;
-
- mln_qlf_value(E)* buffer();
- const value* buffer() const;
-
- rvalue operator[](unsigned o) const;
- lvalue operator[](unsigned o);
-
- std::size_t ncells() const;
- */
+ protected:
+ image_fastest_();
+ };
- /*! \brief Give the offset of the point \p p.
- *
- * \param[in] p A generalized point.
- *
- * \warning This method is final.
- *
- * \pre The image has to be initialized and to own the point \p p.
- * \post p = point_at_offset(result)
- */
- template <typename P>
- unsigned
- offset_at(const Generalized_Point<P>& p) const;
-
- protected:
- Fastest_Image();
+ template <typename E>
+ struct image_fastest_< E, metal::false_ >
+ {
+ // Nothing.
};
# ifndef MLN_INCLUDE_ONLY
- template <typename E>
- template <typename P>
- unsigned // FIXME: std::size_t?
- Fastest_Image<E>::offset_at(const Generalized_Point<P>& p_) const
- {
- // FIXME: check that P is mln_point(E)
- const E* this_ = exact(this);
- const P& p = internal::force_exact<P>(p_);
- mln_precondition(this_->has_data());
- mln_precondition(this_->owns_(p));
-
- unsigned o = & this_->operator()(p) - this_->buffer();
- mln_postcondition(p = this_->point_at_offset(o));
- return o;
- }
-
- template <typename E>
- Fastest_Image<E>::Fastest_Image()
+ template <typename E, typename B>
+ image_fastest_<E,B>::image_fastest_()
{
typedef mln_point(E) point;
typedef mln_dpoint(E) dpoint;
@@ -139,7 +103,11 @@
# endif // ! MLN_INCLUDE_ONLY
+ } // end of namespace mln::internal::check
+
+ } // end of namespace mln::internal
+
} // end of namespace mln
-#endif // ! MLN_CORE_CONCEPT_FASTEST_IMAGE_HH
+#endif // ! MLN_CORE_INTERNAL_CHECK_IMAGE_FASTEST_HH
Index: mln/core/concept/image.hh
--- mln/core/concept/image.hh (revision 1254)
+++ mln/core/concept/image.hh (working copy)
@@ -36,10 +36,13 @@
# include <mln/core/concept/mesh.hh>
# include <mln/core/trait/all.hh> // FIXME: Move out of core!
+# include <mln/core/macros.hh>
# include <mln/trait/concrete.hh> // FIXME: Should be in all.hh!
# include <mln/trait/images.hh>
# include <mln/metal/is_a.hh>
+# include <mln/metal/equal.hh>
+
# include <mln/tag/init.hh>
Index: mln/core/concept/fastest_image.hh
--- mln/core/concept/fastest_image.hh (revision 1254)
+++ mln/core/concept/fastest_image.hh (working copy)
@@ -77,13 +77,13 @@
unsigned
offset_at(const Generalized_Point<P>& p) const;
- protected:
- Fastest_Image();
};
# ifndef MLN_INCLUDE_ONLY
+ // FIXME: Move in internal/image/impl...
+
template <typename E>
template <typename P>
unsigned // FIXME: std::size_t?
@@ -100,43 +100,6 @@
return o;
}
- template <typename E>
- Fastest_Image<E>::Fastest_Image()
- {
- typedef mln_point(E) point;
- typedef mln_dpoint(E) dpoint;
-
- typedef mln_fwd_pixter(E) fwd_pixter;
- typedef mln_bkd_pixter(E) bkd_pixter;
-
- int (E::*m1)(const dpoint&) const = & E::offset;
- m1 = 0;
- point (E::*m2)(unsigned) const = & E::point_at_offset;
- m2 = 0;
- unsigned (E::*m3)() const = & E::border;
- m3 = 0;
-
- typedef mln_value(E) value;
-
- mln_qlf_value(E)* (E::*m4)() = & E::buffer;
- m4 = 0;
- const value* (E::*m5)() const = & E::buffer;
- m5 = 0;
-
- typedef mln_rvalue(E) rvalue;
- typedef mln_lvalue(E) lvalue;
-
- rvalue (E::*m6)(unsigned) const = & E::operator[];
- m6 = 0;
- lvalue (E::*m7)(unsigned) = & E::operator[];
- m7 = 0;
-
- std::size_t (E::*m8)() const = & E::ncells;
- m8 = 0;
-
- // FIXME: how to check that qixter are defined when W is unknown!
- }
-
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-10-05 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
Move value concepts into value/concept directory.
* mln/value/concept: New.
* mln/value/internal/floating.hh,
* mln/value/internal/scalar.hh,
* mln/value/internal/structured.hh,
* mln/value/internal/symbolic.hh,
* mln/value/internal/vectoriel.hh: Rename as ...
* mln/value/concept/floating.hh,
* mln/value/concept/integer.hh,
* mln/value/concept/scalar.hh,
* mln/value/concept/structured.hh,
* mln/value/concept/symbolic.hh,
* mln/value/concept/vectorial.hh: ... This.
Update value types inheritance and concept includes.
* mln/value/float01_.hh,
* mln/value/gray.hh,
* mln/value/graylevel.hh,
* mln/value/int_s.hh,
* mln/value/int_u.hh,
* mln/value/int_u_sat.hh,
* mln/value/label.hh,
* mln/value/quat.hh,
* mln/value/rgb.hh: Update.
Add a missing test for float01 values.
* tests/value_float01.hh: New.
---
mln/value/concept/floating.hh | 59 ++++++++++++++++++++++++++++++++++++++
mln/value/concept/integer.hh | 59 ++++++++++++++++++++++++++++++++++++++
mln/value/concept/scalar.hh | 59 ++++++++++++++++++++++++++++++++++++++
mln/value/concept/structured.hh | 59 ++++++++++++++++++++++++++++++++++++++
mln/value/concept/symbolic.hh | 61 ++++++++++++++++++++++++++++++++++++++++
mln/value/concept/vectorial.hh | 61 ++++++++++++++++++++++++++++++++++++++++
mln/value/float01_.hh | 4 +-
mln/value/gray.hh | 4 +-
mln/value/graylevel.hh | 4 +-
mln/value/int_s.hh | 4 +-
mln/value/int_u.hh | 4 +-
mln/value/int_u_sat.hh | 4 +-
mln/value/label.hh | 4 +-
mln/value/quat.hh | 4 +-
mln/value/rgb.hh | 4 +-
tests/value_float01.hh | 53 ++++++++++++++++++++++++++++++++++
16 files changed, 429 insertions(+), 18 deletions(-)
Index: trunk/milena/tests/value_float01.hh
===================================================================
--- trunk/milena/tests/value_float01.hh (revision 0)
+++ trunk/milena/tests/value_float01.hh (revision 1252)
@@ -0,0 +1,53 @@
+// Copyright (C) 2007 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.
+
+#include <iostream>
+#include <mln/value/float01_8.hh>
+#include <mln/value/float01_16.hh>
+
+int main()
+{
+ using namespace mln::value;
+
+// float01_8 a;
+
+ std::cout << "a = " << std::endl;
+ std::cout << "testsetestest\n"<< std::endl;
+
+// gl8 a = white;
+// gl16 b = white;
+// assert((a == b) == true);
+// gl8 c = (a + b) / 2;
+// assert(c == white);
+// c = a;
+// assert(c == white);
+
+// c = (a * 2) / 2;
+// assert(c == white);
+
+ std::cout << "testsetestest\n"<< std::endl;
+}
Index: trunk/milena/mln/value/int_u_sat.hh
===================================================================
--- trunk/milena/mln/value/int_u_sat.hh (revision 1251)
+++ trunk/milena/mln/value/int_u_sat.hh (revision 1252)
@@ -36,7 +36,7 @@
# include <mln/metal/math.hh>
# include <mln/value/internal/value_like.hh>
-# include <mln/value/internal/integer.hh>
+# include <mln/value/concept/integer.hh>
# include <mln/value/internal/encoding.hh>
# include <mln/value/props.hh>
# include <mln/debug/format.hh>
@@ -55,7 +55,7 @@
*/
template <unsigned n>
struct int_u_sat
- : public internal::Integer< int_u_sat<n> >,
+ : public Integer< int_u_sat<n> >,
public internal::value_like_< typename internal::encoding_unsigned_<n>::ret,
int_u_sat<n> >
{
Index: trunk/milena/mln/value/graylevel.hh
===================================================================
--- trunk/milena/mln/value/graylevel.hh (revision 1251)
+++ trunk/milena/mln/value/graylevel.hh (revision 1252)
@@ -33,7 +33,7 @@
# include <mln/metal/math.hh>
# include <mln/metal/bexpr.hh>
# include <mln/value/internal/value_like.hh>
-# include <mln/value/internal/integer.hh>
+# include <mln/value/concept/integer.hh>
# include <mln/value/internal/encoding.hh>
# include <mln/value/gray.hh>
# include <mln/value/props.hh>
@@ -51,7 +51,7 @@
/// General gray-level class on n bits.
template <unsigned n>
class graylevel
- : public internal::Integer< graylevel<n> >,
+ : public Integer< graylevel<n> >,
public internal::value_like_< typename internal::encoding_unsigned_<n>::ret,
graylevel<n> >
{
Index: trunk/milena/mln/value/concept/symbolic.hh
===================================================================
--- trunk/milena/mln/value/concept/symbolic.hh (revision 0)
+++ trunk/milena/mln/value/concept/symbolic.hh (revision 1252)
@@ -0,0 +1,61 @@
+// Copyright (C) 2007 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_SYMBOLIC_HH
+# define MLN_VALUE_SYMBOLIC_HH
+
+/*! \file mln/value/symbolic.hh
+ *
+ * \brief Define a generic class for symbolic values.
+ */
+
+# include <mln/core/concept/value.hh>
+
+namespace mln
+{
+
+ namespace trait
+ {
+
+ // FIXME
+
+ } // end of namespace mln::trait
+
+ namespace value
+ {
+
+ template <typename E>
+ struct Symbolic : public Value<E>
+ {
+ };
+
+ } // end of namespace mln::value
+
+} // end of namespace mln
+
+
+#endif // ! MLN_VALUE_SYMBOLIC_HH
Index: trunk/milena/mln/value/concept/floating.hh
===================================================================
--- trunk/milena/mln/value/concept/floating.hh (revision 0)
+++ trunk/milena/mln/value/concept/floating.hh (revision 1252)
@@ -0,0 +1,59 @@
+// Copyright (C) 2007 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_FLOATING_HH
+# define MLN_VALUE_FLOATING_HH
+
+/*! \file mln/value/floating.hh
+ *
+ * \brief Define a generic class for float values.
+ */
+
+# include <mln/value/concept/scalar.hh>
+
+namespace mln
+{
+
+ namespace trait
+ {
+ // FIXME
+ } // end of namespace mln::trait
+
+ namespace value
+ {
+
+ template <typename E>
+ struct Floating : public Scalar<E>
+ {
+ };
+
+ } // end of namespace mln::value
+
+} // end of namespace mln
+
+
+#endif // ! MLN_VALUE_FLOATING_HH
Index: trunk/milena/mln/value/concept/structured.hh
===================================================================
--- trunk/milena/mln/value/concept/structured.hh (revision 0)
+++ trunk/milena/mln/value/concept/structured.hh (revision 1252)
@@ -0,0 +1,59 @@
+// Copyright (C) 2007 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_STRUCTURED_HH
+# define MLN_VALUE_STRUCTURED_HH
+
+/*! \file mln/value/structured.hh
+ *
+ * \brief Define a generic class for structured values.
+ */
+
+# include <mln/core/concept/value.hh>
+
+namespace mln
+{
+
+ namespace trait
+ {
+ // FIXME
+ } // end of namespace mln::trait
+
+ namespace value
+ {
+
+ template <typename E>
+ struct Structured : public Value<E>
+ {
+ };
+
+ } // end of namespace mln::value
+
+} // end of namespace mln
+
+
+#endif // ! MLN_VALUE_STRUCTURED_HH
Index: trunk/milena/mln/value/concept/scalar.hh
===================================================================
--- trunk/milena/mln/value/concept/scalar.hh (revision 0)
+++ trunk/milena/mln/value/concept/scalar.hh (revision 1252)
@@ -0,0 +1,59 @@
+// Copyright (C) 2007 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_SCALAR_HH
+# define MLN_VALUE_SCALAR_HH
+
+/*! \file mln/value/scalar.hh
+ *
+ * \brief Define a generic class for scalar values.
+ */
+
+# include <mln/core/concept/value.hh>
+
+namespace mln
+{
+
+ namespace trait
+ {
+ // FIXME
+ } // end of namespace mln::trait
+
+ namespace value
+ {
+
+ template <typename E>
+ struct Scalar : public Value<E>
+ {
+ };
+
+ } // end of namespace mln::value
+
+} // end of namespace mln
+
+
+#endif // ! MLN_VALUE_SCALAR_HH
Index: trunk/milena/mln/value/concept/vectorial.hh
===================================================================
--- trunk/milena/mln/value/concept/vectorial.hh (revision 0)
+++ trunk/milena/mln/value/concept/vectorial.hh (revision 1252)
@@ -0,0 +1,61 @@
+// Copyright (C) 2007 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_VECTORIEL_HH
+# define MLN_VALUE_VECTORIEL_HH
+
+/*! \file mln/value/vectorial.hh
+ *
+ * \brief Define a generic class for vectorial values.
+ */
+
+# include <mln/core/concept/value.hh>
+
+namespace mln
+{
+
+ namespace trait
+ {
+
+ // FIXME
+
+ } // end of namespace mln::trait
+
+ namespace value
+ {
+
+ template <typename E>
+ struct Vectorial : public Value<E>
+ {
+ };
+
+ } // end of namespace mln::value
+
+} // end of namespace mln
+
+
+#endif // ! MLN_VALUE_VECTORIEL_HH
Index: trunk/milena/mln/value/concept/integer.hh
===================================================================
--- trunk/milena/mln/value/concept/integer.hh (revision 0)
+++ trunk/milena/mln/value/concept/integer.hh (revision 1252)
@@ -0,0 +1,59 @@
+// Copyright (C) 2007 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_INTEGER_HH
+# define MLN_VALUE_INTEGER_HH
+
+/*! \file mln/value/integer.hh
+ *
+ * \brief Define a generic class for integer values.
+ */
+
+# include <mln/value/concept/scalar.hh>
+
+namespace mln
+{
+
+ namespace trait
+ {
+ // FIXME
+ } // end of namespace mln::trait
+
+ namespace value
+ {
+
+ template <typename E>
+ struct Integer : public Scalar<E>
+ {
+ };
+
+ } // end of namespace mln::value
+
+} // end of namespace mln
+
+
+#endif // ! MLN_VALUE_INTEGER_HH
Index: trunk/milena/mln/value/gray.hh
===================================================================
--- trunk/milena/mln/value/gray.hh (revision 1251)
+++ trunk/milena/mln/value/gray.hh (revision 1252)
@@ -31,7 +31,7 @@
# include <iostream>
# include <mln/value/graylevel.hh>
-# include <mln/value/internal/integer.hh>
+# include <mln/value/concept/integer.hh>
namespace mln
@@ -46,7 +46,7 @@
/// General gray-level class where n bits is not know at compile-time.
/// This class is used for exchange between gray-level types purpose.
- class gray : public internal::Integer< gray >
+ class gray : public Integer< gray >
{
public:
Index: trunk/milena/mln/value/float01_.hh
===================================================================
--- trunk/milena/mln/value/float01_.hh (revision 1251)
+++ trunk/milena/mln/value/float01_.hh (revision 1252)
@@ -33,7 +33,7 @@
# include <mln/metal/math.hh>
# include <mln/metal/bexpr.hh>
# include <mln/value/internal/value_like.hh>
-# include <mln/value/internal/floating.hh>
+# include <mln/value/concept/floating.hh>
# include <mln/value/internal/encoding.hh>
# include <mln/value/float01.hh>
# include <mln/value/props.hh>
@@ -51,7 +51,7 @@
/// General float01-level class on n bits.
template <unsigned n>
class float01_
- : public internal::Floating< float01_<n> >,
+ : public Floating< float01_<n> >,
public internal::value_like_< float,
float01_<n> >
{
Index: trunk/milena/mln/value/rgb.hh
===================================================================
--- trunk/milena/mln/value/rgb.hh (revision 1251)
+++ trunk/milena/mln/value/rgb.hh (revision 1252)
@@ -34,7 +34,7 @@
* 8-bit encoded.
*/
-# include <mln/value/internal/structured.hh>
+# include <mln/value/concept/structured.hh>
# include <mln/value/int_u8.hh>
@@ -54,7 +54,7 @@
* 8-bit encoded.
*/
template <unsigned n>
- struct rgb : public internal::Structured< rgb<n> >
+ struct rgb : public Structured< rgb<n> >
{
public:
Index: trunk/milena/mln/value/quat.hh
===================================================================
--- trunk/milena/mln/value/quat.hh (revision 1251)
+++ trunk/milena/mln/value/quat.hh (revision 1252)
@@ -33,7 +33,7 @@
# include <mln/metal/vec.hh>
# include <mln/norm/l2.hh>
# include <mln/value/props.hh>
-# include <mln/value/internal/vectoriel.hh>
+# include <mln/value/concept/vectorial.hh>
namespace mln
{
@@ -42,7 +42,7 @@
{
//FIXME doesn't compile
- class quat :// public internal::Vectoriel< quat >,
+ class quat :// public Vectorial< quat >,
public metal::vec<4, float>
{
typedef metal::vec<4, float> super_;
Index: trunk/milena/mln/value/int_s.hh
===================================================================
--- trunk/milena/mln/value/int_s.hh (revision 1251)
+++ trunk/milena/mln/value/int_s.hh (revision 1252)
@@ -35,7 +35,7 @@
# include <mln/metal/math.hh>
# include <mln/value/internal/value_like.hh>
-# include <mln/value/internal/integer.hh>
+# include <mln/value/concept/integer.hh>
# include <mln/value/internal/encoding.hh>
# include <mln/value/props.hh>
# include <mln/trait/all.hh>
@@ -96,7 +96,7 @@
*/
template <unsigned n>
struct int_s
- : public internal::Integer< int_s<n> >,
+ : public Integer< int_s<n> >,
public internal::value_like_< typename internal::encoding_signed_<n>::ret,
int_s<n> >
{
Index: trunk/milena/mln/value/internal/symbolic.hh (deleted)
===================================================================
Index: trunk/milena/mln/value/internal/floating.hh (deleted)
===================================================================
Index: trunk/milena/mln/value/internal/structured.hh (deleted)
===================================================================
Index: trunk/milena/mln/value/internal/scalar.hh (deleted)
===================================================================
Index: trunk/milena/mln/value/internal/vectoriel.hh (deleted)
===================================================================
Index: trunk/milena/mln/value/int_u.hh
===================================================================
--- trunk/milena/mln/value/int_u.hh (revision 1251)
+++ trunk/milena/mln/value/int_u.hh (revision 1252)
@@ -36,7 +36,7 @@
# include <mln/metal/math.hh>
# include <mln/value/internal/value_like.hh>
# include <mln/value/internal/encoding.hh>
-# include <mln/value/internal/integer.hh>
+# include <mln/value/concept/integer.hh>
# include <mln/value/props.hh>
# include <mln/trait/all.hh>
# include <mln/debug/format.hh>
@@ -93,7 +93,7 @@
*/
template <unsigned n>
struct int_u
- : public internal::Integer< int_u<n> >,
+ : public Integer< int_u<n> >,
public internal::value_like_< typename internal::encoding_unsigned_<n>::ret,
int_u<n> >
{
Index: trunk/milena/mln/value/label.hh
===================================================================
--- trunk/milena/mln/value/label.hh (revision 1251)
+++ trunk/milena/mln/value/label.hh (revision 1252)
@@ -35,7 +35,7 @@
# include <mln/metal/math.hh>
# include <mln/value/internal/value_like.hh>
-# include <mln/value/internal/symbolic.hh>
+# include <mln/value/concept/symbolic.hh>
# include <mln/value/internal/encoding.hh>
# include <mln/value/props.hh>
@@ -53,7 +53,7 @@
* The parameter \c n is the number of encoding bits.
*/
template <unsigned n>
- struct label : public internal::Symbolic< label<n> >
+ struct label : public Symbolic< label<n> >
{
public:
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-10-05 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
Fix on accumulators.
* mln/accu/min.hh,
* mln/accu/p.hh: Fix.
New hierachy on value types in order to factorise the traits
declarations.
Value
^
|
---------------------------
| | | |
Scalar Vectoriel Symbolic Structured
^
|
--------
| |
Integer Floating
* mln/value/internal/floating.hh: New.
* mln/value/internal/integer.hh: New.
* mln/value/internal/scalar.hh: New.
* mln/value/internal/structured.hh: New.
* mln/value/internal/symbolic.hh: New.
* mln/value/internal/value_like.hh,
* mln/value/internal/vectoriel.hh: New.
Update value types inheritance.
* mln/value/float01_.hh,
* mln/value/gray.hh,
* mln/value/graylevel.hh,
* mln/value/int_s.hh,
* mln/value/int_u.hh,
* mln/value/int_u_sat.hh,
* mln/value/label.hh,
* mln/value/quat.hh,
* mln/value/rgb.hh: Update.
---
accu/min.hh | 15 ---------
accu/p.hh | 2 -
value/float01_.hh | 4 +-
value/gray.hh | 6 +--
value/graylevel.hh | 8 +++--
value/int_s.hh | 4 +-
value/int_u.hh | 4 +-
value/int_u_sat.hh | 8 +++--
value/internal/floating.hh | 64 +++++++++++++++++++++++++++++++++++++++++
value/internal/integer.hh | 64 +++++++++++++++++++++++++++++++++++++++++
value/internal/scalar.hh | 64 +++++++++++++++++++++++++++++++++++++++++
value/internal/structured.hh | 66 +++++++++++++++++++++++++++++++++++++++++++
value/internal/symbolic.hh | 66 +++++++++++++++++++++++++++++++++++++++++++
value/internal/value_like.hh | 2 -
value/internal/vectoriel.hh | 66 +++++++++++++++++++++++++++++++++++++++++++
value/label.hh | 6 +++
value/quat.hh | 11 ++++++-
value/rgb.hh | 4 +-
18 files changed, 430 insertions(+), 34 deletions(-)
Index: trunk/milena/mln/accu/min.hh
===================================================================
--- trunk/milena/mln/accu/min.hh (revision 1250)
+++ trunk/milena/mln/accu/min.hh (revision 1251)
@@ -86,21 +86,6 @@
-// // FIXME: Sample code.
-
-// template <typename T>
-// struct p_min_ : public p_< min_<T> >
-// {
-// };
-
-// struct p_min : public Meta_Accumulator< p_min >
-// {
-// template <typename T>
-// struct with
-// {
-// typedef p_min_<T> ret;
-// };
-// };
Index: trunk/milena/mln/accu/p.hh
===================================================================
--- trunk/milena/mln/accu/p.hh (revision 1250)
+++ trunk/milena/mln/accu/p.hh (revision 1251)
@@ -53,7 +53,7 @@
template <typename A>
struct p_ : public mln::accu::internal::base_< mln_result(A) , p_<A> >
{
- typedef mln_value(A) argument;
+ typedef mln_argument(A) argument;
typedef mln_result(A) result;
Index: trunk/milena/mln/value/int_u_sat.hh
===================================================================
--- trunk/milena/mln/value/int_u_sat.hh (revision 1250)
+++ trunk/milena/mln/value/int_u_sat.hh (revision 1251)
@@ -36,6 +36,7 @@
# include <mln/metal/math.hh>
# include <mln/value/internal/value_like.hh>
+# include <mln/value/internal/integer.hh>
# include <mln/value/internal/encoding.hh>
# include <mln/value/props.hh>
# include <mln/debug/format.hh>
@@ -54,17 +55,18 @@
*/
template <unsigned n>
struct int_u_sat
- : public internal::value_like_< typename internal::encoding_unsigned_<n>::ret,
+ : public internal::Integer< int_u_sat<n> >,
+ public internal::value_like_< typename internal::encoding_unsigned_<n>::ret,
int_u_sat<n> >
{
protected:
typedef internal::value_like_< typename internal::encoding_unsigned_<n>::ret,
- int_u_sat<n> > super;
+ int_u_sat<n> > like;
public:
/// Encoding associated type.
- typedef typename super::enc enc;
+ typedef typename like::enc enc;
/// Constructor without argument.
int_u_sat();
Index: trunk/milena/mln/value/graylevel.hh
===================================================================
--- trunk/milena/mln/value/graylevel.hh (revision 1250)
+++ trunk/milena/mln/value/graylevel.hh (revision 1251)
@@ -33,6 +33,7 @@
# include <mln/metal/math.hh>
# include <mln/metal/bexpr.hh>
# include <mln/value/internal/value_like.hh>
+# include <mln/value/internal/integer.hh>
# include <mln/value/internal/encoding.hh>
# include <mln/value/gray.hh>
# include <mln/value/props.hh>
@@ -50,17 +51,18 @@
/// General gray-level class on n bits.
template <unsigned n>
class graylevel
- : public internal::value_like_< typename internal::encoding_unsigned_<n>::ret,
+ : public internal::Integer< graylevel<n> >,
+ public internal::value_like_< typename internal::encoding_unsigned_<n>::ret,
graylevel<n> >
{
protected:
typedef internal::value_like_< typename internal::encoding_unsigned_<n>::ret,
- graylevel<n> > super;
+ graylevel<n> > like;
public:
/// Encoding associated type.
- typedef typename super::enc enc;
+ typedef typename like::enc enc;
/// Ctor.
graylevel();
Index: trunk/milena/mln/value/gray.hh
===================================================================
--- trunk/milena/mln/value/gray.hh (revision 1250)
+++ trunk/milena/mln/value/gray.hh (revision 1251)
@@ -30,9 +30,8 @@
# include <iostream>
-# include <mln/core/concept/value.hh>
# include <mln/value/graylevel.hh>
-
+# include <mln/value/internal/integer.hh>
namespace mln
@@ -47,7 +46,7 @@
/// General gray-level class where n bits is not know at compile-time.
/// This class is used for exchange between gray-level types purpose.
- class gray : public Value<gray>
+ class gray : public internal::Integer< gray >
{
public:
@@ -142,7 +141,6 @@
template <unsigned N>
gray operator/(const graylevel<N>& lhs, int s)
{
- std::cout << "div div " << s << std::endl;
mln_precondition(s > 0);
gray tmp(N, lhs.value() / s);
return tmp;
Index: trunk/milena/mln/value/float01_.hh
===================================================================
--- trunk/milena/mln/value/float01_.hh (revision 1250)
+++ trunk/milena/mln/value/float01_.hh (revision 1251)
@@ -33,6 +33,7 @@
# include <mln/metal/math.hh>
# include <mln/metal/bexpr.hh>
# include <mln/value/internal/value_like.hh>
+# include <mln/value/internal/floating.hh>
# include <mln/value/internal/encoding.hh>
# include <mln/value/float01.hh>
# include <mln/value/props.hh>
@@ -50,7 +51,8 @@
/// General float01-level class on n bits.
template <unsigned n>
class float01_
- : public internal::value_like_< float,
+ : public internal::Floating< float01_<n> >,
+ public internal::value_like_< float,
float01_<n> >
{
public:
Index: trunk/milena/mln/value/rgb.hh
===================================================================
--- trunk/milena/mln/value/rgb.hh (revision 1250)
+++ trunk/milena/mln/value/rgb.hh (revision 1251)
@@ -34,7 +34,7 @@
* 8-bit encoded.
*/
-# include <mln/core/concept/value.hh>
+# include <mln/value/internal/structured.hh>
# include <mln/value/int_u8.hh>
@@ -54,7 +54,7 @@
* 8-bit encoded.
*/
template <unsigned n>
- struct rgb : public Value< rgb<n> >
+ struct rgb : public internal::Structured< rgb<n> >
{
public:
Index: trunk/milena/mln/value/quat.hh
===================================================================
--- trunk/milena/mln/value/quat.hh (revision 1250)
+++ trunk/milena/mln/value/quat.hh (revision 1251)
@@ -33,6 +33,7 @@
# include <mln/metal/vec.hh>
# include <mln/norm/l2.hh>
# include <mln/value/props.hh>
+# include <mln/value/internal/vectoriel.hh>
namespace mln
{
@@ -40,13 +41,21 @@
namespace value
{
- class quat : public metal::vec<4, float>
+ //FIXME doesn't compile
+ class quat :// public internal::Vectoriel< quat >,
+ public metal::vec<4, float>
{
typedef metal::vec<4, float> super_;
using super_::data_;
public:
+ /// Encoding associated type.
+ typedef float enc;
+
+ /// Equivalent associated type.
+ typedef float equiv[4];
+
// ctors
quat();
Index: trunk/milena/mln/value/int_s.hh
===================================================================
--- trunk/milena/mln/value/int_s.hh (revision 1250)
+++ trunk/milena/mln/value/int_s.hh (revision 1251)
@@ -35,6 +35,7 @@
# include <mln/metal/math.hh>
# include <mln/value/internal/value_like.hh>
+# include <mln/value/internal/integer.hh>
# include <mln/value/internal/encoding.hh>
# include <mln/value/props.hh>
# include <mln/trait/all.hh>
@@ -95,7 +96,8 @@
*/
template <unsigned n>
struct int_s
- : public internal::value_like_< typename internal::encoding_signed_<n>::ret,
+ : public internal::Integer< int_s<n> >,
+ public internal::value_like_< typename internal::encoding_signed_<n>::ret,
int_s<n> >
{
protected:
Index: trunk/milena/mln/value/internal/symbolic.hh
===================================================================
--- trunk/milena/mln/value/internal/symbolic.hh (revision 0)
+++ trunk/milena/mln/value/internal/symbolic.hh (revision 1251)
@@ -0,0 +1,66 @@
+// Copyright (C) 2007 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_SYMBOLIC_HH
+# define MLN_VALUE_SYMBOLIC_HH
+
+/*! \file mln/value/symbolic.hh
+ *
+ * \brief Define a generic class for symbolic values.
+ */
+
+# include <mln/core/concept/value.hh>
+
+namespace mln
+{
+
+ namespace trait
+ {
+
+ // FIXME
+
+ } // end of namespace mln::trait
+
+ namespace value
+ {
+
+ namespace internal
+ {
+
+ template <typename E>
+ struct Symbolic : public Value<E>
+ {
+ };
+
+ } // end of namespace mln::value::internal
+
+ } // end of namespace mln::value
+
+} // end of namespace mln
+
+
+#endif // ! MLN_VALUE_SYMBOLIC_HH
Index: trunk/milena/mln/value/internal/floating.hh
===================================================================
--- trunk/milena/mln/value/internal/floating.hh (revision 0)
+++ trunk/milena/mln/value/internal/floating.hh (revision 1251)
@@ -0,0 +1,64 @@
+// Copyright (C) 2007 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_FLOATING_HH
+# define MLN_VALUE_FLOATING_HH
+
+/*! \file mln/value/floating.hh
+ *
+ * \brief Define a generic class for float values.
+ */
+
+# include <mln/value/internal/scalar.hh>
+
+namespace mln
+{
+
+ namespace trait
+ {
+ // FIXME
+ } // end of namespace mln::trait
+
+ namespace value
+ {
+
+ namespace internal
+ {
+
+ template <typename E>
+ struct Floating : public Scalar<E>
+ {
+ };
+
+ } // end of namespace mln::value::internal
+
+ } // end of namespace mln::value
+
+} // end of namespace mln
+
+
+#endif // ! MLN_VALUE_FLOATING_HH
Index: trunk/milena/mln/value/internal/structured.hh
===================================================================
--- trunk/milena/mln/value/internal/structured.hh (revision 0)
+++ trunk/milena/mln/value/internal/structured.hh (revision 1251)
@@ -0,0 +1,66 @@
+// Copyright (C) 2007 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_STRUCTURED_HH
+# define MLN_VALUE_STRUCTURED_HH
+
+/*! \file mln/value/structured.hh
+ *
+ * \brief Define a generic class for structured values.
+ */
+
+# include <mln/core/concept/value.hh>
+
+namespace mln
+{
+
+ namespace trait
+ {
+ // FIXME
+ } // end of namespace mln::trait
+
+ namespace value
+ {
+
+
+ namespace internal
+ {
+
+ template <typename E>
+ struct Structured : public Value<E>
+ {
+ };
+
+
+ } // end of namespace mln::value::internal
+
+ } // end of namespace mln::value
+
+} // end of namespace mln
+
+
+#endif // ! MLN_VALUE_STRUCTURED_HH
Index: trunk/milena/mln/value/internal/scalar.hh
===================================================================
--- trunk/milena/mln/value/internal/scalar.hh (revision 0)
+++ trunk/milena/mln/value/internal/scalar.hh (revision 1251)
@@ -0,0 +1,64 @@
+// Copyright (C) 2007 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_SCALAR_HH
+# define MLN_VALUE_SCALAR_HH
+
+/*! \file mln/value/scalar.hh
+ *
+ * \brief Define a generic class for scalar values.
+ */
+
+# include <mln/core/concept/value.hh>
+
+namespace mln
+{
+
+ namespace trait
+ {
+ // FIXME
+ } // end of namespace mln::trait
+
+ namespace value
+ {
+
+ namespace internal
+ {
+
+ template <typename E>
+ struct Scalar : public Value<E>
+ {
+ };
+
+ } // end of namespace mln::value::internal
+
+ } // end of namespace mln::value
+
+} // end of namespace mln
+
+
+#endif // ! MLN_VALUE_SCALAR_HH
Index: trunk/milena/mln/value/internal/vectoriel.hh
===================================================================
--- trunk/milena/mln/value/internal/vectoriel.hh (revision 0)
+++ trunk/milena/mln/value/internal/vectoriel.hh (revision 1251)
@@ -0,0 +1,66 @@
+// Copyright (C) 2007 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_VECTORIEL_HH
+# define MLN_VALUE_VECTORIEL_HH
+
+/*! \file mln/value/vectoriel.hh
+ *
+ * \brief Define a generic class for vectoriel values.
+ */
+
+# include <mln/core/concept/value.hh>
+
+namespace mln
+{
+
+ namespace trait
+ {
+
+ // FIXME
+
+ } // end of namespace mln::trait
+
+ namespace value
+ {
+
+ namespace internal
+ {
+
+ template <typename E>
+ struct Vectoriel : public Value<E>
+ {
+ };
+
+ } // end of namespace mln::value::internal
+
+ } // end of namespace mln::value
+
+} // end of namespace mln
+
+
+#endif // ! MLN_VALUE_VECTORIEL_HH
Index: trunk/milena/mln/value/internal/integer.hh
===================================================================
--- trunk/milena/mln/value/internal/integer.hh (revision 0)
+++ trunk/milena/mln/value/internal/integer.hh (revision 1251)
@@ -0,0 +1,64 @@
+// Copyright (C) 2007 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_INTEGER_HH
+# define MLN_VALUE_INTEGER_HH
+
+/*! \file mln/value/integer.hh
+ *
+ * \brief Define a generic class for integer values.
+ */
+
+# include <mln/value/internal/scalar.hh>
+
+namespace mln
+{
+
+ namespace trait
+ {
+ // FIXME
+ } // end of namespace mln::trait
+
+ namespace value
+ {
+
+ namespace internal
+ {
+
+ template <typename E>
+ struct Integer : public Scalar<E>
+ {
+ };
+
+ } // end of namespace mln::value::internal
+
+ } // end of namespace mln::value
+
+} // end of namespace mln
+
+
+#endif // ! MLN_VALUE_INTEGER_HH
Index: trunk/milena/mln/value/internal/value_like.hh
===================================================================
--- trunk/milena/mln/value/internal/value_like.hh (revision 1250)
+++ trunk/milena/mln/value/internal/value_like.hh (revision 1251)
@@ -56,7 +56,7 @@
* exact value type.
*/
template <typename V, typename E>
- struct value_like_ : public Value<E>
+ struct value_like_ // FIXME :Remove -> : public Value<E>
{
/// Encoding associated type.
typedef V enc;
Index: trunk/milena/mln/value/int_u.hh
===================================================================
--- trunk/milena/mln/value/int_u.hh (revision 1250)
+++ trunk/milena/mln/value/int_u.hh (revision 1251)
@@ -36,6 +36,7 @@
# include <mln/metal/math.hh>
# include <mln/value/internal/value_like.hh>
# include <mln/value/internal/encoding.hh>
+# include <mln/value/internal/integer.hh>
# include <mln/value/props.hh>
# include <mln/trait/all.hh>
# include <mln/debug/format.hh>
@@ -92,7 +93,8 @@
*/
template <unsigned n>
struct int_u
- : public internal::value_like_< typename internal::encoding_unsigned_<n>::ret,
+ : public internal::Integer< int_u<n> >,
+ public internal::value_like_< typename internal::encoding_unsigned_<n>::ret,
int_u<n> >
{
protected:
Index: trunk/milena/mln/value/label.hh
===================================================================
--- trunk/milena/mln/value/label.hh (revision 1250)
+++ trunk/milena/mln/value/label.hh (revision 1251)
@@ -35,6 +35,7 @@
# include <mln/metal/math.hh>
# include <mln/value/internal/value_like.hh>
+# include <mln/value/internal/symbolic.hh>
# include <mln/value/internal/encoding.hh>
# include <mln/value/props.hh>
@@ -52,13 +53,16 @@
* The parameter \c n is the number of encoding bits.
*/
template <unsigned n>
- struct label
+ struct label : public internal::Symbolic< label<n> >
{
public:
/// Encoding associated type.
typedef typename internal::encoding_unsigned_<n>::ret enc;
+ /// Equivalent associated type.
+ typedef typename internal::encoding_unsigned_<n>::ret equiv;
+
/// Constructor without argument.
label();