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: