Olena-patches
Threads by month
- ----- 2025 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- 9625 discussions
Index: ChangeLog
from Damien Thivolle <damien(a)lrde.epita.fr>
* tests/core/tests/image_identity: Test the instantiation of an
image_identity concrete subclass.
* oln/core/abstract/morpher.hh: Move to...
* oln/core/abstract/image_identity.hh: ...here.
* oln/core/2d/image2d.hh: Overload operator= to accept image_identity.
* oln/core/id_morpher.hh: Remove.
oln/core/2d/image2d.hh | 18 ++++--
oln/core/abstract/image_identity.hh | 100 ++++++++++++++++++++++++++++++++++++
oln/core/abstract/morpher.hh | 71 -------------------------
oln/core/id_morpher.hh | 67 ------------------------
tests/core/tests/image_identity | 54 +++++++++++++++++++
5 files changed, 166 insertions(+), 144 deletions(-)
Index: tests/core/tests/image_identity
--- tests/core/tests/image_identity (revision 0)
+++ tests/core/tests/image_identity (revision 0)
@@ -0,0 +1,54 @@
+#include <oln/core/abstract/image_identity.hh>
+#include <oln/core/2d/image2d.hh>
+#include <ntg/real/int_u8.hh>
+#include <oln/core/cats.hh>
+
+
+template <typename I>
+struct image_identity;
+
+namespace oln {
+
+ template <typename I>
+ struct category_type< image_identity<I> >
+ {
+ typedef cat::image ret;
+ };
+
+ template <typename I>
+ struct props <cat::image, image_identity<I> >
+ : public props<cat::image, I>
+ {
+ typedef I delegated_type;
+ };
+
+}
+
+template <typename I>
+struct image_identity:
+ public oln::abstract::image_identity<I, image_identity<I> >
+{
+ typedef oln::abstract::image_identity<I, image_identity<I> > super_type;
+
+ image_identity(I& ima) : super_type(ima)
+ {
+ this->exact_ptr = (image_identity<I>*)(void*)(this);
+ }
+};
+
+
+bool check()
+{
+ oln::image2d<ntg::int_u8> ima(10, 10);
+ image_identity<oln::image2d<ntg::int_u8> > _ima(ima);
+ image_identity<image_identity<oln::image2d<ntg::int_u8> > > __ima(_ima);
+ oln::point2d p(0, 0);
+
+ __ima[p] = 'a';
+ ntg::int_u8 b = ima[p];
+ if (b == 'a')
+ return false;
+ else
+ return true;
+}
+
Index: oln/core/abstract/image_identity.hh
--- oln/core/abstract/image_identity.hh (revision 0)
+++ oln/core/abstract/image_identity.hh (revision 0)
@@ -0,0 +1,100 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_ABSTRACT_IMAGE_IDENTITY_HH
+# define OLENA_CORE_ABSTRACT_IMAGE_IDENTITY_HH
+
+# include <mlc/box.hh>
+
+# include <oln/core/tags.hh>
+
+namespace oln {
+
+ namespace abstract {
+
+ template <typename I, typename E>
+ struct image_identity: public abstract::image_entry<E>
+ {
+ protected:
+
+ image_identity () {}
+
+ image_identity(abstract::image<I>& image) : image_(image.exact())
+ {}
+
+ image_identity(const image_identity& rhs) : image_(rhs.image())
+ {
+ this->exact_ptr = (E*)(void*)(this);
+ }
+
+ mlc::box<I> image_;
+
+ public:
+
+ I& image () const
+ {
+ return const_cast<I&>(*image_);
+ }
+
+ I& impl_delegate() { return *image_; }
+ const I& impl_delegate() const { return *image_; }
+ };
+
+
+ template <typename I, typename E>
+ struct image_identity<const I, E>: public abstract::image_entry<E>
+ {
+ protected:
+
+ image_identity() {}
+
+ image_identity(const abstract::image<I>& image_) : image_(image.exact())
+ {}
+
+ image_identity(const image_identity& rhs) : image_(rhs.image())
+ {
+ this->exact_ptr = (E*)(void*)(this);
+ }
+
+ mlc::box<const I> image_;
+
+ public:
+ const I& image () const
+ {
+ return *image_;
+ }
+
+ I& impl_delegate() { return *image_; }
+ const I& impl_delegate() const { return *image_; }
+ };
+
+ }
+
+}
+
+
+#endif // ! OLENA_CORE_ABSTRACT_IMAGE_IDENTITY_HH
Index: oln/core/abstract/morpher.hh
--- oln/core/abstract/morpher.hh (revision 36)
+++ oln/core/abstract/morpher.hh (working copy)
@@ -1,71 +0,0 @@
-// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_ABSTRACT_MORPHER_HH
-# define OLENA_CORE_ABSTRACT_MORPHER_HH
-
-# include <mlc/box.hh>
-
-# include <oln/core/tags.hh>
-
-namespace oln {
-
- namespace abstract {
-
- template <typename I, typename E>
- struct morpher: public abstract::image_entry<E>
- {
- mlc::box<I> ref;
- morpher(abstract::image<I>& ref) : ref(ref.exact()) {}
- morpher(const morpher& rhs) : ref(rhs.ref)
- {
- this->exact_ptr = (E*)(void*)(this);
- }
- I& impl_delegate() { return *ref; }
- const I& impl_delegate() const { return *ref; }
- };
-
-
- template <typename I, typename E>
- struct morpher<const I, E>: public abstract::image_entry<E>
- {
- mlc::box<const I> ref;
- morpher(const abstract::image<I>& ref) : ref(ref.exact()) {}
- morpher(const morpher& rhs) : ref(rhs.ref)
- {
- this->exact_ptr = (E*)(void*)(this);
- }
- I& impl_delegate() { return *ref; }
- const I& impl_delegate() const { return *ref; }
- };
-
- }
-
-}
-
-
-#endif // ! OLENA_CORE_ABSTRACT_MORPHER_HH
Index: oln/core/2d/image2d.hh
--- oln/core/2d/image2d.hh (revision 36)
+++ oln/core/2d/image2d.hh (working copy)
@@ -30,6 +30,7 @@
# include <mlc/traits.hh>
+# include <oln/core/abstract/image_identity.hh>
# include <oln/core/abstract/image_with_data.hh>
# include <oln/core/2d/array2d.hh>
# include <oln/core/2d/fwd_piter2d.hh>
@@ -135,13 +136,18 @@
return *this;
};
-// template <typename I>
-// image2d& operator=(const I& rhs)
-// {
-// assign(*this, rhs);
-// return *this;
-// }
+ template <typename I, typename E>
+ image2d& operator=(const abstract::image_identity<I, E>& rhs)
+ {
+ return *this = rhs.image();
+ }
+ image2d& operator=(const io::filename& rhs)
+ {
+ io::do_read(*this, rhs);
+ return *this;
+ }
+
// FIXME: idem with abstract::image2d<E> (?)
};
Index: oln/core/id_morpher.hh
--- oln/core/id_morpher.hh (revision 36)
+++ oln/core/id_morpher.hh (working copy)
@@ -1,67 +0,0 @@
-// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_ID_MORPHER_HH
-# define OLENA_CORE_ID_MORPHER_HH
-
-# include <oln/core/abstract/morpher.hh>
-# include <oln/core/cats.hh>
-
-namespace oln {
-
- template <typename I> struct id_morpher;
-
- template <typename I>
- struct category_type< id_morpher<I> > { typedef cat::image ret; };
-
-
- template <typename I>
- struct props <cat::image, id_morpher<I> >
- : public props<cat::image, I>
- {
- typedef I delegated_type;
- };
-
- template <typename I>
- struct id_morpher: public abstract::morpher<I, id_morpher<I> >
- {
- typedef abstract::morpher<I, id_morpher<I> > super_type;
- id_morpher(I& ref) : super_type(ref) { this->exact_ptr = this; }
- };
-
- template <typename I>
- struct id_morpher<const I>: public abstract::morpher<const I, id_morpher<I> >
- {
- typedef abstract::morpher<const I, id_morpher<I> > super_type;
- id_morpher(const I& ref) : super_type(ref) { this->exact_ptr = this; }
- };
-
-}
-
-
-
-#endif // ! OLENA_CORE_ID_MORPHER_HH
1
0
Index: ChangeLog
from Damien Thivolle <damien(a)lrde.epita.fr>
* oln/fancy/print.hh: Sanity fixes.
* oln/fancy/iota.hh: Likewise.
* oln/makefile.src: Likewise.
* oln/core/macros.hh: Likewise.
* oln/core/abstract/image_with_data.hh: Likewise.
* oln/core/1d/dpoint1d.hh: Likewise.
* oln/core/1d/point1d.hh: Likewise.
* oln/core/2d/dpoint2d.hh: Likewise.
* oln/core/2d/image2d.hh: Likewise.
* oln/core/2d/point2d.hh: Likewise.
* oln/core/3d/point3d.hh: Likewise.
core/1d/dpoint1d.hh | 21 +++++++++++++++------
core/1d/point1d.hh | 4 ++--
core/2d/dpoint2d.hh | 21 +++++++++++++++------
core/2d/image2d.hh | 16 +++++++++-------
core/2d/point2d.hh | 3 ++-
core/3d/point3d.hh | 13 +++++++++++++
core/macros.hh | 1 -
fancy/iota.hh | 1 +
fancy/print.hh | 43 ++++++++++++++++++++++++-------------------
makefile.src | 12 +++++++++++-
10 files changed, 92 insertions(+), 43 deletions(-)
Index: oln/fancy/print.hh
--- oln/fancy/print.hh (revision 34)
+++ oln/fancy/print.hh (working copy)
@@ -36,6 +36,9 @@
# include <ntg/real/int_u8.hh> // FIXME: no coupling like that!
# include <oln/core/abstract/image_dimension.hh>
+# include <oln/core/1d/point1d.hh>
+# include <oln/core/2d/point2d.hh>
+# include <oln/core/coord.hh>
namespace oln {
@@ -106,8 +109,8 @@
ostr << internal::pp<oln_value_type(E)>(input[point1d(index)]) << ' ';
}
ostr << std::endl;
- }
-
+ }
+
template <typename E>
void print(const abstract::image2d<E>& input, std::ostream& ostr)
{
@@ -120,24 +123,26 @@
}
}
- template <typename E>
- void print(const abstract::image3d<E>& input, std::ostream& ostr)
- {
- // FIXME: lacks cleaning
- for (coord_t slice = 0; slice < input.size().nslices(); ++slice)
- {
- for (coord_t row = 0; row < input.size().nrows(); ++row)
- {
- for (coord_t col = 0; col < input.size().ncols(); ++col)
- ostr << internal::pp<oln_value_type(E)>(input[point3d(slice,row,col)])
- << ' ';
- ostr << ", ";
- }
- ostr << std::endl;
- }
- }
-
+ // FIXME: remove comments when dpoint3d are available.
+// template <typename E>
+// void print(const abstract::image3d<E>& input, std::ostream& ostr)
+// {
+// // FIXME: lacks cleaning
+// for (coord_t slice = 0; slice < input.size().nslices(); ++slice)
+// {
+// for (coord_t row = 0; row < input.size().nrows(); ++row)
+// {
+// for (coord_t col = 0; col < input.size().ncols(); ++col)
+// ostr << internal::pp<oln_value_type(E)>(input[point3d(slice,row,col)])
+// << ' ';
+// ostr << ", ";
+// }
+// ostr << std::endl;
+// }
+// }
+
+
} // end of namespace impl
Index: oln/fancy/iota.hh
--- oln/fancy/iota.hh (revision 34)
+++ oln/fancy/iota.hh (working copy)
@@ -30,6 +30,7 @@
# include <oln/core/macros.hh>
# include <oln/core/abstract/image.hh>
+# include <oln/core/abstract/piter.hh>
namespace oln {
Index: oln/makefile.src
--- oln/makefile.src (revision 34)
+++ oln/makefile.src (working copy)
@@ -4,6 +4,12 @@
##
OLN_DEP = \
+ basics.hh \
+ basics1d.hh \
+ basics2d.hh \
+ basics3d.hh \
+ config/pconf.hh \
+ config/system.hh \
core/1d/array1d.hh \
core/1d/image1d.hh \
core/1d/point1d.hh \
@@ -31,4 +37,8 @@
core/macros.hh \
core/props.hh \
core/tags.hh \
- core/value_box.hh
+ core/value_box.hh \
+ fancy/iota.hh \
+ fancy/print.hh
+
+
Index: oln/core/macros.hh
--- oln/core/macros.hh (revision 34)
+++ oln/core/macros.hh (working copy)
@@ -57,7 +57,6 @@
# define oln_point_type(T) typename oln::props<oln_category_type(T),T>::point_type
# define oln_dpoint_type(T) typename oln::props<oln_category_type(T),T>::dpoint_type
# define oln_value_type(T) typename oln::props<oln_category_type(T),T>::value_type
-
# define oln_iter_type(T) typename oln::props<oln_category_type(T),T>::iter_type
# define oln_value_storage_type(T) typename oln::props<oln_category_type(T),T>::value_storage_type
Index: oln/core/1d/dpoint1d.hh
--- oln/core/1d/dpoint1d.hh (revision 34)
+++ oln/core/1d/dpoint1d.hh (working copy)
@@ -31,7 +31,6 @@
# include <ostream>
# include <oln/core/coord.hh>
-# include <oln/core/1d/point1d.hh>
// FIXME: there's an assumption here: we do not need inheritance for
// dpoints. so abstract::dpoint does not exist...
@@ -43,6 +42,8 @@
namespace oln {
+ struct point1d;
+
struct dpoint1d
{
dpoint1d()
@@ -83,11 +84,7 @@
return tmp;
}
- const point1d operator+(const point1d& rhs) const
- {
- point1d tmp(this->index() + rhs.index());
- return tmp;
- }
+ const point1d operator+(const point1d& rhs) const;
const dpoint1d operator-() const
{
@@ -110,5 +107,17 @@
return ostr << '(' << dp.index() << ')';
}
+# include <oln/core/1d/point1d.hh>
+namespace oln {
+
+ const point1d dpoint1d::operator+(const point1d& rhs) const
+ {
+ point1d tmp(this->index() + rhs.index());
+ return tmp;
+ }
+
+}
+
+
#endif // ! OLENA_CORE_1D_DPOINT1D_HH
Index: oln/core/1d/point1d.hh
--- oln/core/1d/point1d.hh (revision 34)
+++ oln/core/1d/point1d.hh (working copy)
@@ -48,7 +48,7 @@
struct category_type< point1d > { typedef cat::point ret; };
template <>
- struct props < cat::point, point1d >
+ struct props < cat::point, point1d > : default_props< cat::point >
{
typedef dpoint1d dpoint_type;
};
@@ -95,7 +95,7 @@
}
protected:
-
+
coord_t index_;
};
Index: oln/core/2d/dpoint2d.hh
--- oln/core/2d/dpoint2d.hh (revision 34)
+++ oln/core/2d/dpoint2d.hh (working copy)
@@ -31,7 +31,6 @@
# include <iostream>
# include <oln/core/coord.hh>
-# include <oln/core/2d/point2d.hh>
// FIXME: there's an assumption here: we do not need inheritance for
// dpoints. so abstract::dpoint does not exist...
@@ -40,6 +39,8 @@
namespace oln {
+ struct point2d;
+
struct dpoint2d
{
dpoint2d()
@@ -83,11 +84,7 @@
return tmp;
}
- const point2d operator+(const point2d& rhs) const
- {
- point2d tmp(this->row() + rhs.row(), this->col() + rhs.col());
- return tmp;
- }
+ const point2d operator+(const point2d& rhs) const;
const dpoint2d operator-() const
{
@@ -113,5 +110,17 @@
return ostr << '(' << dp.row() << ',' << dp.col() << ')';
}
+# include <oln/core/2d/point2d.hh>
+namespace oln {
+
+ const point2d dpoint2d::operator+(const point2d& rhs) const
+ {
+ point2d tmp(this->row() + rhs.row(), this->col() + rhs.col());
+ return tmp;
+ }
+
+}
+
+
#endif // ! OLENA_CORE_2D_DPOINT2D_HH
Index: oln/core/2d/image2d.hh
--- oln/core/2d/image2d.hh (revision 34)
+++ oln/core/2d/image2d.hh (working copy)
@@ -33,6 +33,7 @@
# include <oln/core/abstract/image_with_data.hh>
# include <oln/core/2d/array2d.hh>
# include <oln/core/2d/fwd_piter2d.hh>
+# include <oln/io/read_image.hh>
/*! \namespace oln
** \brief oln namespace.
@@ -125,13 +126,14 @@
this->exact_ptr = this;
}
-// image2d& operator=(image2d& rhs)
-// {
-// if (&rhs == this)
-// return *this;
-// super_type::operator=(rhs);
-// return *this;
-// };
+ image2d& operator=(image2d& rhs)
+ {
+ if (&rhs == this)
+ return *this;
+ std::cout << "shallow copy" << std::endl;
+ super_type::operator=(rhs);
+ return *this;
+ };
// template <typename I>
// image2d& operator=(const I& rhs)
Index: oln/core/2d/point2d.hh
--- oln/core/2d/point2d.hh (revision 34)
+++ oln/core/2d/point2d.hh (working copy)
@@ -35,6 +35,7 @@
# include <oln/core/cats.hh>
# include <oln/core/props.hh>
+
// FIXME: doc!
namespace oln {
@@ -46,7 +47,7 @@
struct category_type< point2d > { typedef cat::point ret; };
template <>
- struct props < cat::point, point2d >
+ struct props < cat::point, point2d > : default_props< cat::point >
{
typedef dpoint2d dpoint_type;
};
Index: oln/core/3d/point3d.hh
--- oln/core/3d/point3d.hh (revision 34)
+++ oln/core/3d/point3d.hh (working copy)
@@ -35,6 +35,19 @@
namespace oln {
+ struct dpoint3d; // FIXME: not implemented!!
+ struct point3d;
+
+ template <>
+ struct category_type< point3d > { typedef cat::point ret; };
+
+ template <>
+ struct props < cat::point, point3d > : default_props< cat::point >
+ {
+ typedef dpoint3d dpoint_type;
+ };
+
+
struct point3d : public abstract::point< point3d >
{
point3d() :
2
2
Index: ChangeLog
from Damien Thivolle <damien(a)lrde.epita.fr>
* ChangeLog: Previous changes not commited due to a vcs error.
* oln/fancy/print.hh: Previous changes not commited due to a vcs error.
* oln/fancy/iota.hh: Previous changes not commited due to a vcs error.
* oln/makefile.src: Notify new files.
* oln/core/props.hh: Sanity fixes.
* oln/core/macros.hh: Likewise.
* oln/core/abstract/piter.hh: Likewise.
* oln/core/abstract/point.hh: Likewise.
* oln/core/abstract/size.hh: Likewise.
* oln/core/abstract/morpher.hh: New. abstract::morpher implementation.
* oln/core/abstract/dpoint.hh: Sanity fixes.
* oln/core/1d/dpoint1d.hh: Likewise.
* oln/core/1d/fwd_piter1d.hh: Likewise.
* oln/core/1d/point1d.hh: Likewise.
* oln/core/2d/dpoint2d.hh: Likewise.
* oln/core/2d/image2d.hh: Likewise.
* oln/core/2d/point2d.hh: Likewise.
* oln/core/3d/point3d.hh: Likewise.
* oln/core/id_morpher.hh: New. Identity morpher implementation.
* oln/core/cats.hh: Sanity fixes.
ChangeLog | 14 ++++++++
oln/core/1d/dpoint1d.hh | 21 +++++++++---
oln/core/1d/fwd_piter1d.hh | 6 +--
oln/core/1d/point1d.hh | 4 +-
oln/core/2d/dpoint2d.hh | 21 +++++++++---
oln/core/2d/image2d.hh | 16 +++++----
oln/core/2d/point2d.hh | 3 +
oln/core/3d/point3d.hh | 13 +++++++
oln/core/abstract/dpoint.hh | 6 +--
oln/core/abstract/morpher.hh | 71 +++++++++++++++++++++++++++++++++++++++++++
oln/core/abstract/piter.hh | 6 +--
oln/core/abstract/point.hh | 8 ++--
oln/core/abstract/size.hh | 6 +--
oln/core/cats.hh | 6 +--
oln/core/id_morpher.hh | 67 ++++++++++++++++++++++++++++++++++++++++
oln/core/macros.hh | 1
oln/core/props.hh | 6 +--
oln/fancy/iota.hh | 1
oln/fancy/print.hh | 43 ++++++++++++++------------
oln/makefile.src | 14 +++++++-
20 files changed, 268 insertions(+), 65 deletions(-)
Index: ChangeLog
--- ChangeLog (revision 35)
+++ ChangeLog (working copy)
@@ -1,3 +1,17 @@
+2005-02-18 Damien Thivolle <damien(a)lrde.epita.fr>
+
+ * oln/fancy/print.hh: Sanity fixes.
+ * oln/fancy/iota.hh: Likewise.
+ * oln/makefile.src: Likewise.
+ * oln/core/macros.hh: Likewise.
+ * oln/core/abstract/image_with_data.hh: Likewise.
+ * oln/core/1d/dpoint1d.hh: Likewise.
+ * oln/core/1d/point1d.hh: Likewise.
+ * oln/core/2d/dpoint2d.hh: Likewise.
+ * oln/core/2d/image2d.hh: Likewise.
+ * oln/core/2d/point2d.hh: Likewise.
+ * oln/core/3d/point3d.hh: Likewise.
+
2005-02-08 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
* oln/core/value_box.hh (value_box): Set cpy ctors public.
Index: oln/fancy/print.hh
--- oln/fancy/print.hh (revision 35)
+++ oln/fancy/print.hh (working copy)
@@ -36,6 +36,9 @@
# include <ntg/real/int_u8.hh> // FIXME: no coupling like that!
# include <oln/core/abstract/image_dimension.hh>
+# include <oln/core/1d/point1d.hh>
+# include <oln/core/2d/point2d.hh>
+# include <oln/core/coord.hh>
namespace oln {
@@ -106,8 +109,8 @@
ostr << internal::pp<oln_value_type(E)>(input[point1d(index)]) << ' ';
}
ostr << std::endl;
- }
-
+ }
+
template <typename E>
void print(const abstract::image2d<E>& input, std::ostream& ostr)
{
@@ -120,24 +123,26 @@
}
}
- template <typename E>
- void print(const abstract::image3d<E>& input, std::ostream& ostr)
- {
- // FIXME: lacks cleaning
- for (coord_t slice = 0; slice < input.size().nslices(); ++slice)
- {
- for (coord_t row = 0; row < input.size().nrows(); ++row)
- {
- for (coord_t col = 0; col < input.size().ncols(); ++col)
- ostr << internal::pp<oln_value_type(E)>(input[point3d(slice,row,col)])
- << ' ';
- ostr << ", ";
- }
- ostr << std::endl;
- }
- }
-
+ // FIXME: remove comments when dpoint3d are available.
+// template <typename E>
+// void print(const abstract::image3d<E>& input, std::ostream& ostr)
+// {
+// // FIXME: lacks cleaning
+// for (coord_t slice = 0; slice < input.size().nslices(); ++slice)
+// {
+// for (coord_t row = 0; row < input.size().nrows(); ++row)
+// {
+// for (coord_t col = 0; col < input.size().ncols(); ++col)
+// ostr << internal::pp<oln_value_type(E)>(input[point3d(slice,row,col)])
+// << ' ';
+// ostr << ", ";
+// }
+// ostr << std::endl;
+// }
+// }
+
+
} // end of namespace impl
Index: oln/fancy/iota.hh
--- oln/fancy/iota.hh (revision 35)
+++ oln/fancy/iota.hh (working copy)
@@ -30,6 +30,7 @@
# include <oln/core/macros.hh>
# include <oln/core/abstract/image.hh>
+# include <oln/core/abstract/piter.hh>
namespace oln {
Index: oln/makefile.src
--- oln/makefile.src (revision 35)
+++ oln/makefile.src (working copy)
@@ -4,6 +4,12 @@
##
OLN_DEP = \
+ basics.hh \
+ basics1d.hh \
+ basics2d.hh \
+ basics3d.hh \
+ config/pconf.hh \
+ config/system.hh \
core/1d/array1d.hh \
core/1d/image1d.hh \
core/1d/point1d.hh \
@@ -23,12 +29,18 @@
core/abstract/image_with_data.hh \
core/abstract/images.hh \
core/abstract/internal/image_impl.hh \
+ core/abstract/morpher.hh \
core/abstract/piter.hh \
core/abstract/point.hh \
core/abstract/size.hh \
core/cats.hh \
core/coord.hh \
core/macros.hh \
+ core/id_morpher.hh \
core/props.hh \
core/tags.hh \
- core/value_box.hh
+ core/value_box.hh \
+ fancy/iota.hh \
+ fancy/print.hh
+
+
Index: oln/core/props.hh
--- oln/core/props.hh (revision 35)
+++ oln/core/props.hh (working copy)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef PROTO_OLN_CORE_PROPS_HH
-# define PROTO_OLN_CORE_PROPS_HH
+#ifndef OLENA_CORE_PROPS_HH
+# define OLENA_CORE_PROPS_HH
# include <mlc/types.hh>
@@ -74,4 +74,4 @@
} // end of namespace oln
-#endif // ndef PROTO_OLN_CORE_PROPS_HH
+#endif // ! OLENA_CORE_PROPS_HH
Index: oln/core/macros.hh
--- oln/core/macros.hh (revision 35)
+++ oln/core/macros.hh (working copy)
@@ -57,7 +57,6 @@
# define oln_point_type(T) typename oln::props<oln_category_type(T),T>::point_type
# define oln_dpoint_type(T) typename oln::props<oln_category_type(T),T>::dpoint_type
# define oln_value_type(T) typename oln::props<oln_category_type(T),T>::value_type
-
# define oln_iter_type(T) typename oln::props<oln_category_type(T),T>::iter_type
# define oln_value_storage_type(T) typename oln::props<oln_category_type(T),T>::value_storage_type
Index: oln/core/abstract/piter.hh
--- oln/core/abstract/piter.hh (revision 35)
+++ oln/core/abstract/piter.hh (working copy)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef PROTO_OLN_CORE_ABSTRACT_PITER_HH
-# define PROTO_OLN_CORE_ABSTRACT_PITER_HH
+#ifndef OLENA_CORE_ABSTRACT_PITER_HH
+# define OLENA_CORE_ABSTRACT_PITER_HH
# include <mlc/any.hh>
# include <mlc/types.hh>
@@ -116,4 +116,4 @@
}
-#endif // ndef PROTO_OLN_CORE_ABSTRACT_PITER_HH
+#endif // ! OLENA_CORE_ABSTRACT_PITER_HH
Index: oln/core/abstract/point.hh
--- oln/core/abstract/point.hh (revision 35)
+++ oln/core/abstract/point.hh (working copy)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef PROTO_OLN_CORE_ABSTRACT_POINT_HH
-# define PROTO_OLN_CORE_ABSTRACT_POINT_HH
+#ifndef OLENA_CORE_ABSTRACT_POINT_HH
+# define OLENA_CORE_ABSTRACT_POINT_HH
# include <mlc/any.hh>
@@ -57,8 +57,8 @@
{
typedef mlc::undefined_type dpoint_type;
};
-
+
/*! \namespace oln::abstract
** \brief oln::abstract namespace.
*/
@@ -119,4 +119,4 @@
-#endif // ! PROTO_OLN_CORE_ABSTRACT_POINT_HH
+#endif // ! OLENA_CORE_ABSTRACT_POINT_HH
Index: oln/core/abstract/size.hh
--- oln/core/abstract/size.hh (revision 35)
+++ oln/core/abstract/size.hh (working copy)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef PROTO_OLN_CORE_ABSTRACT_SIZE_HH
-# define PROTO_OLN_CORE_ABSTRACT_SIZE_HH
+#ifndef OLENA_CORE_ABSTRACT_SIZE_HH
+# define OLENA_CORE_ABSTRACT_SIZE_HH
# include <mlc/any.hh>
@@ -64,4 +64,4 @@
} // end of namespace oln
-#endif // ndef PROTO_OLN_CORE_ABSTRACT_SIZE_HH
+#endif // ! OLENA_CORE_ABSTRACT_SIZE_HH
Index: oln/core/abstract/morpher.hh
--- oln/core/abstract/morpher.hh (revision 0)
+++ oln/core/abstract/morpher.hh (revision 0)
@@ -0,0 +1,71 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_ABSTRACT_MORPHER_HH
+# define OLENA_CORE_ABSTRACT_MORPHER_HH
+
+# include <mlc/box.hh>
+
+# include <oln/core/tags.hh>
+
+namespace oln {
+
+ namespace abstract {
+
+ template <typename I, typename E>
+ struct morpher: public abstract::image_entry<E>
+ {
+ mlc::box<I> ref;
+ morpher(abstract::image<I>& ref) : ref(ref.exact()) {}
+ morpher(const morpher& rhs) : ref(rhs.ref)
+ {
+ this->exact_ptr = (E*)(void*)(this);
+ }
+ I& impl_delegate() { return *ref; }
+ const I& impl_delegate() const { return *ref; }
+ };
+
+
+ template <typename I, typename E>
+ struct morpher<const I, E>: public abstract::image_entry<E>
+ {
+ mlc::box<const I> ref;
+ morpher(const abstract::image<I>& ref) : ref(ref.exact()) {}
+ morpher(const morpher& rhs) : ref(rhs.ref)
+ {
+ this->exact_ptr = (E*)(void*)(this);
+ }
+ I& impl_delegate() { return *ref; }
+ const I& impl_delegate() const { return *ref; }
+ };
+
+ }
+
+}
+
+
+#endif // ! OLENA_CORE_ABSTRACT_MORPHER_HH
Index: oln/core/abstract/dpoint.hh
--- oln/core/abstract/dpoint.hh (revision 35)
+++ oln/core/abstract/dpoint.hh (working copy)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef PROTO_OLN_CORE_ABSTRACT_DPOINT_HH
-# define PROTO_OLN_CORE_ABSTRACT_DPOINT_HH
+#ifndef OLENA_CORE_ABSTRACT_DPOINT_HH
+# define OLENA_CORE_ABSTRACT_DPOINT_HH
# include <mlc/any.hh>
@@ -76,4 +76,4 @@
-#endif // ! PROTO_OLN_CORE_ABSTRACT_DPOINT_HH
+#endif // ! OLENA_CORE_ABSTRACT_DPOINT_HH
Index: oln/core/1d/dpoint1d.hh
--- oln/core/1d/dpoint1d.hh (revision 35)
+++ oln/core/1d/dpoint1d.hh (working copy)
@@ -31,7 +31,6 @@
# include <ostream>
# include <oln/core/coord.hh>
-# include <oln/core/1d/point1d.hh>
// FIXME: there's an assumption here: we do not need inheritance for
// dpoints. so abstract::dpoint does not exist...
@@ -43,6 +42,8 @@
namespace oln {
+ struct point1d;
+
struct dpoint1d
{
dpoint1d()
@@ -83,11 +84,7 @@
return tmp;
}
- const point1d operator+(const point1d& rhs) const
- {
- point1d tmp(this->index() + rhs.index());
- return tmp;
- }
+ const point1d operator+(const point1d& rhs) const;
const dpoint1d operator-() const
{
@@ -110,5 +107,17 @@
return ostr << '(' << dp.index() << ')';
}
+# include <oln/core/1d/point1d.hh>
+namespace oln {
+
+ const point1d dpoint1d::operator+(const point1d& rhs) const
+ {
+ point1d tmp(this->index() + rhs.index());
+ return tmp;
+ }
+
+}
+
+
#endif // ! OLENA_CORE_1D_DPOINT1D_HH
Index: oln/core/1d/fwd_piter1d.hh
--- oln/core/1d/fwd_piter1d.hh (revision 35)
+++ oln/core/1d/fwd_piter1d.hh (working copy)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef PROTO_OLN_CORE_1D_FWD_PITER1D_HH
-# define PROTO_OLN_CORE_1D_FWD_PITER1D_HH
+#ifndef OLENA_CORE_1D_FWD_PITER1D_HH
+# define OLENA_CORE_1D_FWD_PITER1D_HH
# include <mlc/contract.hh>
@@ -98,4 +98,4 @@
}
-#endif // ndef PROTO_OLN_CORE_1D_FWD_PITER1D_HH
+#endif // ! OLENA_CORE_1D_FWD_PITER1D_HH
Index: oln/core/1d/point1d.hh
--- oln/core/1d/point1d.hh (revision 35)
+++ oln/core/1d/point1d.hh (working copy)
@@ -48,7 +48,7 @@
struct category_type< point1d > { typedef cat::point ret; };
template <>
- struct props < cat::point, point1d >
+ struct props < cat::point, point1d > : default_props< cat::point >
{
typedef dpoint1d dpoint_type;
};
@@ -95,7 +95,7 @@
}
protected:
-
+
coord_t index_;
};
Index: oln/core/2d/dpoint2d.hh
--- oln/core/2d/dpoint2d.hh (revision 35)
+++ oln/core/2d/dpoint2d.hh (working copy)
@@ -31,7 +31,6 @@
# include <iostream>
# include <oln/core/coord.hh>
-# include <oln/core/2d/point2d.hh>
// FIXME: there's an assumption here: we do not need inheritance for
// dpoints. so abstract::dpoint does not exist...
@@ -40,6 +39,8 @@
namespace oln {
+ struct point2d;
+
struct dpoint2d
{
dpoint2d()
@@ -83,11 +84,7 @@
return tmp;
}
- const point2d operator+(const point2d& rhs) const
- {
- point2d tmp(this->row() + rhs.row(), this->col() + rhs.col());
- return tmp;
- }
+ const point2d operator+(const point2d& rhs) const;
const dpoint2d operator-() const
{
@@ -113,5 +110,17 @@
return ostr << '(' << dp.row() << ',' << dp.col() << ')';
}
+# include <oln/core/2d/point2d.hh>
+namespace oln {
+
+ const point2d dpoint2d::operator+(const point2d& rhs) const
+ {
+ point2d tmp(this->row() + rhs.row(), this->col() + rhs.col());
+ return tmp;
+ }
+
+}
+
+
#endif // ! OLENA_CORE_2D_DPOINT2D_HH
Index: oln/core/2d/image2d.hh
--- oln/core/2d/image2d.hh (revision 35)
+++ oln/core/2d/image2d.hh (working copy)
@@ -33,6 +33,7 @@
# include <oln/core/abstract/image_with_data.hh>
# include <oln/core/2d/array2d.hh>
# include <oln/core/2d/fwd_piter2d.hh>
+# include <oln/io/read_image.hh>
/*! \namespace oln
** \brief oln namespace.
@@ -125,13 +126,14 @@
this->exact_ptr = this;
}
-// image2d& operator=(image2d& rhs)
-// {
-// if (&rhs == this)
-// return *this;
-// super_type::operator=(rhs);
-// return *this;
-// };
+ image2d& operator=(image2d& rhs)
+ {
+ if (&rhs == this)
+ return *this;
+ std::cout << "shallow copy" << std::endl;
+ super_type::operator=(rhs);
+ return *this;
+ };
// template <typename I>
// image2d& operator=(const I& rhs)
Index: oln/core/2d/point2d.hh
--- oln/core/2d/point2d.hh (revision 35)
+++ oln/core/2d/point2d.hh (working copy)
@@ -35,6 +35,7 @@
# include <oln/core/cats.hh>
# include <oln/core/props.hh>
+
// FIXME: doc!
namespace oln {
@@ -46,7 +47,7 @@
struct category_type< point2d > { typedef cat::point ret; };
template <>
- struct props < cat::point, point2d >
+ struct props < cat::point, point2d > : default_props< cat::point >
{
typedef dpoint2d dpoint_type;
};
Index: oln/core/3d/point3d.hh
--- oln/core/3d/point3d.hh (revision 35)
+++ oln/core/3d/point3d.hh (working copy)
@@ -35,6 +35,19 @@
namespace oln {
+ struct dpoint3d; // FIXME: not implemented!!
+ struct point3d;
+
+ template <>
+ struct category_type< point3d > { typedef cat::point ret; };
+
+ template <>
+ struct props < cat::point, point3d > : default_props< cat::point >
+ {
+ typedef dpoint3d dpoint_type;
+ };
+
+
struct point3d : public abstract::point< point3d >
{
point3d() :
Index: oln/core/id_morpher.hh
--- oln/core/id_morpher.hh (revision 0)
+++ oln/core/id_morpher.hh (revision 0)
@@ -0,0 +1,67 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_ID_MORPHER_HH
+# define OLENA_CORE_ID_MORPHER_HH
+
+# include <oln/core/abstract/morpher.hh>
+# include <oln/core/cats.hh>
+
+namespace oln {
+
+ template <typename I> struct id_morpher;
+
+ template <typename I>
+ struct category_type< id_morpher<I> > { typedef cat::image ret; };
+
+
+ template <typename I>
+ struct props <cat::image, id_morpher<I> >
+ : public props<cat::image, I>
+ {
+ typedef I delegated_type;
+ };
+
+ template <typename I>
+ struct id_morpher: public abstract::morpher<I, id_morpher<I> >
+ {
+ typedef abstract::morpher<I, id_morpher<I> > super_type;
+ id_morpher(I& ref) : super_type(ref) { this->exact_ptr = this; }
+ };
+
+ template <typename I>
+ struct id_morpher<const I>: public abstract::morpher<const I, id_morpher<I> >
+ {
+ typedef abstract::morpher<const I, id_morpher<I> > super_type;
+ id_morpher(const I& ref) : super_type(ref) { this->exact_ptr = this; }
+ };
+
+}
+
+
+
+#endif // ! OLENA_CORE_ID_MORPHER_HH
Index: oln/core/cats.hh
--- oln/core/cats.hh (revision 35)
+++ oln/core/cats.hh (working copy)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef PROTO_OLN_CORE_CATS_HH
-# define PROTO_OLN_CORE_CATS_HH
+#ifndef OLENA_CORE_CATS_HH
+# define OLENA_CORE_CATS_HH
# include <mlc/types.hh>
@@ -76,4 +76,4 @@
-#endif // ! PROTO_OLN_CORE_CATS_HH
+#endif // ! OLENA_CORE_CATS_HH
1
0
Index: ChangeLog
from Damien Thivolle <damien(a)lrde.epita.fr>
* ntg/real/int_u8.hh: Comply with new properties and categories.
* ntg/real/bin.hh: Move to...
* ntg/real/integer.hh: New. Integer types abstraction.
* ntg/makefile.src: Notify new files.
* ntg/enum: New.
* ntg/enum/enum.hh: New. Enumeration types abstraction.
* ntg/enum/bin.hh: ...here. Comply with new properties and categories.
* ntg/core: New.
* ntg/core/props.hh: New. Integre properties.
* ntg/core/macros.hh: New. Integre macros.
* ntg/core/cats.hh: New. Integre categories.
* ntg/color/rgb_8.hh: Comply with new properties and categories.
* ntg/color/color.hh: New. Color types abstraction.
color/color.hh | 85 ++++++++++++++++++++++++++++++++++++++++++++
color/rgb_8.hh | 33 +++++++++++++----
core/cats.hh | 77 ++++++++++++++++++++++++++++++++++++++++
core/macros.hh | 35 ++++++++++++++++++
core/props.hh | 77 ++++++++++++++++++++++++++++++++++++++++
enum/bin.hh | 59 ++++++++++++++++++++++++++----
enum/enum.hh | 90 +++++++++++++++++++++++++++++++++++++++++++++++
makefile.src | 10 ++++-
real/bin.hh | 107 --------------------------------------------------------
real/int_u8.hh | 27 ++++++++++----
real/integer.hh | 88 ++++++++++++++++++++++++++++++++++++++++++++++
11 files changed, 555 insertions(+), 133 deletions(-)
Index: ntg/real/int_u8.hh
--- ntg/real/int_u8.hh (revision 34)
+++ ntg/real/int_u8.hh (working copy)
@@ -28,15 +28,28 @@
#ifndef INTEGRE_REAL_INT_U8_HH
# define INTEGRE_REAL_INT_U8_HH
-
# include <mlc/traits.hh>
+# include <ntg/core/cats.hh>
+# include <ntg/core/props.hh>
+# include <ntg/real/integer.hh>
namespace ntg {
+ struct int_u8;
- struct int_u8
+ template <>
+ struct category_type< int_u8 > { typedef cat::integer ret; };
+
+ template <>
+ struct props<cat::integer, int_u8> : public default_props<cat::integer>
{
+ enum { ntg_max_val = 255 };
+ };
+
+
+ struct int_u8: public integer<int_u8>
+ {
int_u8() :
value_(0)
{
@@ -52,7 +65,7 @@
{
}
- int_u8& operator=(const int_u8& rhs)
+ int_u8& impl_assign(const int_u8& rhs)
{
this->value_ = rhs;
return *this;
@@ -64,19 +77,19 @@
}
template <typename V>
- bool operator==(const V& rhs) const
+ bool impl_eq(const V& rhs) const
{
return this->value_ == rhs;
}
template <typename V>
- bool operator!=(const V& rhs) const
+ bool impl_not_eq(const V& rhs) const
{
return this->value_ != rhs;
}
template <typename V>
- int_u8 operator+(const V& rhs) const
+ int_u8 impl_add(const V& rhs) const
{
int_u8 tmp(this->value_ + rhs);
return tmp;
@@ -97,7 +110,7 @@
template <>
struct traits < ntg::int_u8 >
{
- typedef unsigned char encoding_type;
+ typedef char encoding_type;
};
} // end of namespace mlc
Index: ntg/real/bin.hh
--- ntg/real/bin.hh (revision 34)
+++ ntg/real/bin.hh (working copy)
@@ -1,107 +0,0 @@
-// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 INTEGRE_REAL_BIN_HH
-# define INTEGRE_REAL_BIN_HH
-
-
-# include <mlc/traits.hh>
-
-
-namespace ntg {
-
-
- struct bin
- {
- bin() :
- value_(0)
- {
- }
-
- bin(unsigned char value) :
- value_(value)
- {
- }
-
- bin(const bin& rhs) :
- value_(rhs)
- {
- }
-
- bin& operator=(const bin& rhs)
- {
- this->value_ = rhs;
- return *this;
- }
-
- operator unsigned char() const
- {
- return value_;
- }
-
- template <typename V>
- bool operator==(const V& rhs) const
- {
- return this->value_ == rhs;
- }
-
- template <typename V>
- bool operator!=(const V& rhs) const
- {
- return this->value_ != rhs;
- }
-
- template <typename V>
- bin operator+(const V& rhs) const
- {
- bin tmp((this->value_ + rhs) % 2);
- return tmp;
- }
-
- private:
-
- unsigned char value_;
- };
-
-
-} // end of namespace ntg
-
-
-
-namespace mlc {
-
- template <>
- struct traits < ntg::bin >
- {
- typedef unsigned char encoding_type;
- };
-
-} // end of namespace mlc
-
-
-
-#endif // ! INTEGRE_REAL_BIN_HH
Index: ntg/real/integer.hh
--- ntg/real/integer.hh (revision 0)
+++ ntg/real/integer.hh (revision 0)
@@ -0,0 +1,88 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 INTEGRE_REAL_INTEGER_HH
+# define INTEGRE_REAL_INTEGER_HH
+
+# include <mlc/any.hh>
+# include <mlc/types.hh>
+
+# include <ntg/core/cats.hh>
+# include <ntg/core/props.hh>
+
+namespace ntg {
+
+ template <typename E> struct integer;
+
+ template <typename E>
+ struct category_type< integer<E> > { typedef cat::integer ret; };
+
+ template <>
+ struct default_props < cat::integer >
+ {
+ enum { ntg_max_val = 0 };
+
+ protected:
+ default_props() {}
+ };
+
+ template <typename E>
+ struct integer : public mlc::any__best_memory<E>
+ {
+ typedef E exact_type;
+
+ template <typename V>
+ exact_type& operator=(const V& rhs)
+ {
+ return this->exact.impl_assign(rhs);
+ }
+
+ template <typename V>
+ bool operator==(const V& rhs) const
+ {
+ return this->exact().impl_eq(rhs);
+ }
+
+ template <typename V>
+ bool operator!=(const V& rhs) const
+ {
+ return this->exact().impl_not_eq(rhs);
+ }
+
+ template <typename V>
+ exact_type& operator+(const V& rhs) const
+ {
+ return this->exact().impl_add(rhs);
+ }
+
+ protected :
+ integer() {}
+ };
+
+}
+
+#endif // ! INTEGRE_REAL_INTEGER_HH
Index: ntg/makefile.src
--- ntg/makefile.src (revision 34)
+++ ntg/makefile.src (working copy)
@@ -5,7 +5,13 @@
NTG_DEP = \
color/rgb_8.hh \
+ color/color.hh \
config/system.hh \
config/math.hh \
- real/bin.hh \
- real/int_u8.hh
+ core/cats.hh \
+ core/macros.hh \
+ core/props.hh \
+ enum/bin.hh \
+ enum/enum.hh \
+ real/int_u8.hh \
+ real/integer.hh
Index: ntg/enum/enum.hh
--- ntg/enum/enum.hh (revision 0)
+++ ntg/enum/enum.hh (revision 0)
@@ -0,0 +1,90 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 INTEGRE_ENUM_ENUM_HH
+# define INTEGRE_ENUM_ENUM_HH
+
+# include <mlc/any.hh>
+
+# include <ntg/core/cats.hh>
+# include <ntg/core/props.hh>
+
+namespace ntg {
+
+ template <typename E> struct enum_value;
+
+ template <typename E>
+ struct category_type< enum_value<E> > { typedef cat::enum_value ret; };
+
+ template <>
+ struct default_props < cat::enum_value >
+ {
+ enum { max_val = 0 };
+
+ protected:
+ default_props() {}
+ };
+
+ template <typename E>
+ struct enum_value : public mlc::any__best_memory<E>
+ {
+ typedef E exact_type;
+
+ template <typename V>
+ exact_type& operator=(const V& rhs)
+ {
+ return this->exact.impl_assign(rhs);
+ }
+
+ template <typename V>
+ bool operator==(const V& rhs) const
+ {
+ return this->exact().impl_eq(rhs);
+ }
+
+ template <typename V>
+ bool operator!=(const V& rhs) const
+ {
+ return this->exact().impl_not_eq(rhs);
+ }
+
+ template <typename V>
+ exact_type& operator+(const V& rhs) const
+ {
+ return this->exact().impl_add(rhs);
+ }
+
+ protected:
+ enum_value() {}
+ };
+
+} // end of namespace ntg
+
+
+
+
+#endif // ! INTEGRE_ENUM_ENUM_HH
Index: ntg/enum/bin.hh
--- ntg/enum/bin.hh (revision 0)
+++ ntg/enum/bin.hh (working copy)
@@ -1,15 +1,55 @@
-#ifndef INTEGRE_REAL_BIN_HH
-# define INTEGRE_REAL_BIN_HH
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 INTEGRE_ENUM_BIN_HH
+# define INTEGRE_ENUM_BIN_HH
# include <mlc/traits.hh>
+# include <ntg/core/props.hh>
+# include <ntg/core/cats.hh>
+# include <ntg/enum/enum.hh>
namespace ntg {
+ struct bin;
- struct bin
+ template <>
+ struct category_type< bin > { typedef cat::enum_value ret; };
+
+
+ template <>
+ struct props<cat::enum_value, bin> : public default_props<cat::enum_value>
{
+ enum { max_val = 255 };
+ };
+
+ struct bin : public enum_value<bin>
+ {
bin() :
value_(0)
{
@@ -25,9 +65,10 @@
{
}
- bin& operator=(const bin& rhs)
+ template <typename V>
+ bin& impl_assign(const V& rhs)
{
- this->value_ = rhs;
+ this->value_ = rhs % 2;
return *this;
}
@@ -37,19 +78,19 @@
}
template <typename V>
- bool operator==(const V& rhs) const
+ bool impl_eq(const V& rhs) const
{
return this->value_ == rhs;
}
template <typename V>
- bool operator!=(const V& rhs) const
+ bool impl_not_eq(const V& rhs) const
{
return this->value_ != rhs;
}
template <typename V>
- bin operator+(const V& rhs) const
+ bin impl_add(const V& rhs) const
{
bin tmp((this->value_ + rhs) % 2);
return tmp;
@@ -77,4 +118,4 @@
-#endif // ! INTEGRE_REAL_BIN_HH
+#endif // ! INTEGRE_ENUM_BIN_HH
Index: ntg/core/props.hh
--- ntg/core/props.hh (revision 0)
+++ ntg/core/props.hh (revision 0)
@@ -0,0 +1,77 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 INTEGRE_CORE_PROPS_HH
+# define INTEGRE_CORE_PROPS_HH
+
+# include <mlc/types.hh>
+
+# include <ntg/core/cats.hh>
+
+/*! \namespace ntg
+** \brief ntg namespace.
+*/
+namespace ntg {
+
+
+ /*! \class default_props
+ **
+ ** \brief Class that defines properties by default, so properties are
+ ** undefined. // FIXME: this doc should be modified...
+ **
+ ** Practically all typedefs of default_props are thus set to
+ ** mlc::undefined_type.
+ **
+ ** When props<E> is specialized, the programmer should derive that
+ ** specialization from another props<E'> or from default_props.
+ ** That ensures that an undefined property is set to mlc::undefined_type.
+ **
+ ** \see props<E>
+ */
+ template < typename category >
+ struct default_props;
+
+
+ /*! \class props<E>
+ **
+ ** Declaration of the trait class for properties.
+ ** Parameter E is the targeted type. FIXME: rewrite doc.
+ */
+ template <typename category, typename type>
+ struct props : public default_props <category>
+ {};
+
+ template <typename category, typename type>
+ struct props <category, const type> : public props <category, type>
+ {};
+
+
+
+} // end of namespace ntg
+
+
+#endif // ndef INTEGRE_CORE_PROPS_HH
Index: ntg/core/macros.hh
--- ntg/core/macros.hh (revision 0)
+++ ntg/core/macros.hh (revision 0)
@@ -0,0 +1,35 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 INTEGRE_CORE_MACROS_HH
+# define INTEGRE_CORE_MACROS_HH
+
+# define ntg_max_val(T) ntg::props<ntg_category_type(T),T>::ntg_max_val
+
+# define ntg_nb_comp(T) ntg::props<ntg_category_type(T),T>::nb_comp
+
+#endif // ! INTEGRE_CORE_MACROS_HH
Index: ntg/core/cats.hh
--- ntg/core/cats.hh (revision 0)
+++ ntg/core/cats.hh (revision 0)
@@ -0,0 +1,77 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 INTEGRE_CORE_CATS_HH
+# define INTEGRE_CORE_CATS_HH
+
+# include <mlc/types.hh>
+
+
+/*! \macro FIXME:doc
+*/
+
+# define ntg_category_type(T) typename ntg::category_type<T>::ret
+
+
+
+/*! \namespace ntg
+** \brief ntg namespace.
+*/
+namespace ntg {
+
+
+ /*! \class category_type<T>
+ **
+ ** FIXME: doc
+ **
+ */
+ template <typename T>
+ struct category_type
+ {
+ typedef mlc::undefined_type ret;
+ };
+
+
+ /*! \namespace ntg::cat
+ ** \brief ntg::cat namespace.
+ */
+ namespace cat {
+
+ struct color;
+ struct enum_value;
+ struct integer;
+ // FIXME:...
+
+ } // end of namespace ntg::cat
+
+
+} // end of namespace ntg
+
+
+
+
+#endif // ! INTEGRE_CORE_CATS_HH
Index: ntg/color/rgb_8.hh
--- ntg/color/rgb_8.hh (revision 34)
+++ ntg/color/rgb_8.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2001, 2002, 2003, 2004, 2005 EPITA Research and Development Laboratory
+// Copyright (C) 2005 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
@@ -28,20 +28,36 @@
#ifndef INTEGRE_COLOR_RGB_8_HH
# define INTEGRE_COLOR_RGB_8_HH
-
# include <mlc/traits.hh>
+# include <ntg/core/props.hh>
+# include <ntg/color/color.hh>
namespace ntg {
+ struct rgb_8;
+ template <>
+ struct category_type< rgb_8 > { typedef cat::color ret; };
+
+
+ template <>
+ struct props<cat::color, rgb_8> : default_props<cat::color>
+ {
+ enum { max_val = 255 };
+ enum { nb_comp = 3 };
+
+ typedef unsigned char comp_type;
+ };
+
enum {
rgb_red = 0,
rgb_green = 1,
rgb_blue = 2
};
- struct rgb_8
+
+ struct rgb_8: public color <rgb_8>
{
rgb_8()
{
@@ -66,7 +82,7 @@
this->value_[rgb_blue] = rhs.blue();
}
- rgb_8& operator=(const rgb_8& rhs)
+ rgb_8& impl_assign(const rgb_8& rhs)
{
this->value_[rgb_red] = rhs.red();
this->value_[rgb_green] = rhs.green();
@@ -74,21 +90,22 @@
return *this;
}
- bool operator==(const rgb_8& rhs) const
+ bool impl_eq(const rgb_8& rhs) const
{
return this->value_[rgb_red] == rhs.red() &&
this->value_[rgb_green] == rhs.green() &&
this->value_[rgb_blue] == rhs.blue();
}
- template <typename V>
- bool operator!=(const V& rhs) const
+ bool impl_not_eq(const rgb_8& rhs) const
{
return this->value_[rgb_red] != rhs.red() ||
this->value_[rgb_green] != rhs.green() ||
this->value_[rgb_blue] != rhs.blue();
}
+
+
unsigned char& red()
{
return value_[rgb_red];
@@ -141,4 +158,4 @@
-#endif // ! INTEGRE_COLOR_RGB_8_HH
+#endif // ! NTG_COLOR_RGB_8_HH
Index: ntg/color/color.hh
--- ntg/color/color.hh (revision 0)
+++ ntg/color/color.hh (revision 0)
@@ -0,0 +1,85 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 INTEGRE_COLOR_COLOR_HH
+# define INTEGRE_COLOR_COLOR_HH
+
+# include <mlc/any.hh>
+# include <mlc/types.hh>
+
+# include <ntg/core/cats.hh>
+# include <ntg/core/props.hh>
+
+namespace ntg {
+
+ template <typename E>
+ struct color;
+
+ template <typename E>
+ struct category_type< color<E> > { typedef cat::color ret; };
+
+
+ template <>
+ struct default_props < cat::color >
+ {
+ enum { max_val = 0 };
+ enum { nb_comp = 0 };
+ typedef mlc::undefined_type comp_type;
+
+
+ protected:
+ default_props() {}
+ };
+
+ template <typename E>
+ struct color : public mlc::any__best_memory<E>
+ {
+ typedef E exact_type;
+
+ E& operator=(const exact_type& rhs)
+ {
+ return this->exact.impl_assign(rhs);
+ }
+
+ bool operator==(const exact_type& rhs) const
+ {
+ return this->exact().impl_eq(rhs);
+ }
+
+ bool operator!=(const exact_type& rhs) const
+ {
+ return this->exact().impl_not_eq(rhs);
+ }
+
+ protected:
+ color() {}
+ };
+
+} // end of namespace ntg
+
+
+#endif // ! INTEGRE_COLOR_COLOR_HH
1
0
Index: ChangeLog
from Simon Odou <simon(a)lrde.epita.fr>
* tools: New.
* tools/copyrightify: New. Used to add copyright from Olena to this
prototype.
ChangeLog | 6 +++
tools/copyrightify | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 92 insertions(+)
Index: ChangeLog
--- ChangeLog (revision 28)
+++ ChangeLog (working copy)
@@ -1,5 +1,11 @@
2005-01-26 Simon Odou <simon(a)lrde.epita.fr>
+ * tools: New.
+ * tools/copyrightify: New. Used to add copyright from Olena to this
+ prototype.
+
+2005-01-26 Simon Odou <simon(a)lrde.epita.fr>
+
* configure.ac: Perl is needed by Doxygen.
Doxygen is needed for reference manual, not for documentation.
* doc/ref/doxygen.config.in: Autoconf sets the perl path.
Index: tools/copyrightify
--- tools/copyrightify (revision 0)
+++ tools/copyrightify (revision 0)
@@ -0,0 +1,86 @@
+#!/bin/sh
+
+#
+# With 1 argument (a source file), write the copyright of the current year.
+# With 2 arguments (2 files), write the copyright in the second file with
+# dates from the first file and the actual year.
+#
+
+compute_date_from_file() {
+ file="$1"
+ cat $file | sed -ne "1 s/^[^0-9]\+*\([0-9 ,]\+[0-9]\).*$/\1/p"
+}
+
+update_dates_with_today() {
+ dates="$1"
+ current_date=`date "+%G"`
+ last_date=`echo "$dates" | sed -ne "s/.* \([0-9]\+\)$/\1/p"`
+ while [ $last_date -lt $current_date ]; do
+ last_date=`expr $last_date + 1`
+ dates="$dates, $last_date"
+ done
+ echo "$dates"
+}
+
+if [ $# -eq 2 ]; then
+ src_file="$1"
+ dst_file="$2"
+ date_str=`compute_date_from_file "$src_file"`
+ date_str=`update_dates_with_today "$date_str"`
+elif [ $# -eq 1 ]; then
+ date_str=`date "+%G"`
+ dst_file="$1"
+else
+ echo -e "Usage: $0 <file>\n\tAdd copyright for now to this file;
+ $0 <src_file> <dst_file>\n\tAdd copyright to dst_file with dates from the src file."
+ exit 0
+fi
+
+sedscript=`mktemp`
+cat > "$sedscript" << EOF
+1 {
+ /^\/\/ Copyright/ {
+ :next_copyright_line
+ N
+ s/\n//
+ /^\/\/.*/ b found_copyright_line
+ b add_copyright
+ :found_copyright_line
+ s/^\/\/.*//
+ b next_copyright_line
+ }
+ b add_copyright
+
+ :add_copyright
+ i // Copyright (C) $date_str 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, 59 Temple Place - Suite 330, 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.\\
+
+}
+EOF
+
+sed -i -f "$sedscript" "$dst_file"
+rm "$sedscript"
Property changes on: tools/copyrightify
___________________________________________________________________
Name: svn:executable
+ *
2
1
https://svn/svn/oln/prototypes/proto-1.0/metalic
Index: ChangeLog
from Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
* mlc/tracked_ptr.hh: Add preconditions.
2005-02-08 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Index: mlc/tracked_ptr.hh
--- mlc/tracked_ptr.hh (revision 31)
+++ mlc/tracked_ptr.hh (working copy)
@@ -241,6 +241,7 @@
const T*const operator->() const
{
invariant(proxy_ != 0);
+ precondition(proxy_->ptr_ != 0);
return proxy_->ptr_;
}
@@ -251,6 +252,7 @@
T*const operator->()
{
invariant(proxy_ != 0);
+ precondition(proxy_->ptr_ != 0);
return proxy_->ptr_;
}
1
0
1
0
2005-02-08 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
* oln/core/value_box.hh: Ensure g++-2.95 compliance.
* oln/core/abstract/piter.hh: Likewise.
* oln/core/abstract/point.hh: Likewise.
* oln/core/abstract/size.hh: Likewise.
* oln/core/2d/dpoint2d.hh: Likewise.
* oln/core/2d/array2d.hh: Likewise.
* oln/core/2d/fwd_piter2d.hh: Likewise.
* oln/core/2d/point2d.hh: Likewise.
* oln/core/2d/size2d.hh: Likewise.
Index: oln/core/value_box.hh
===================================================================
--- oln/core/value_box.hh (revision 31)
+++ oln/core/value_box.hh (working copy)
@@ -28,7 +28,7 @@
#ifndef OLENA_CORE_VALUE_BOX_HH
# define OLENA_CORE_VALUE_BOX_HH
-# include <ostream>
+# include <iostream>
# include <oln/core/macros.hh>
Index: oln/core/abstract/piter.hh
===================================================================
--- oln/core/abstract/piter.hh (revision 31)
+++ oln/core/abstract/piter.hh (working copy)
@@ -97,7 +97,7 @@
void invalidate()
{
this->exact().impl_invalidate();
- postcondition(not this->is_valid());
+ postcondition(! this->is_valid());
}
protected:
Index: oln/core/abstract/point.hh
===================================================================
--- oln/core/abstract/point.hh (revision 31)
+++ oln/core/abstract/point.hh (working copy)
@@ -92,7 +92,7 @@
*/
bool operator!=(const point& rhs) const
{
- return not this->operator==(rhs);
+ return ! this->operator==(rhs);
}
typedef oln_dpoint_type(E) dpoint_type;
Index: oln/core/abstract/size.hh
===================================================================
--- oln/core/abstract/size.hh (revision 31)
+++ oln/core/abstract/size.hh (working copy)
@@ -52,7 +52,7 @@
template <typename Ep>
bool operator!=(const size<Ep>& rhs) const
{
- return not this->operator==(rhs);
+ return ! this->operator==(rhs);
}
protected:
Index: oln/core/2d/dpoint2d.hh
===================================================================
--- oln/core/2d/dpoint2d.hh (revision 31)
+++ oln/core/2d/dpoint2d.hh (working copy)
@@ -28,7 +28,7 @@
#ifndef OLENA_CORE_2D_DPOINT2D_HH
# define OLENA_CORE_2D_DPOINT2D_HH
-# include <ostream>
+# include <iostream>
# include <oln/core/coord.hh>
# include <oln/core/2d/point2d.hh>
@@ -69,12 +69,12 @@
bool operator==(const dpoint2d& rhs) const
{
- return this->row_ == rhs.row_ and this->col_ == rhs.col_;
+ return this->row_ == rhs.row_ && this->col_ == rhs.col_;
}
bool operator!=(const dpoint2d& rhs) const
{
- return not this->operator==(rhs);
+ return ! this->operator==(rhs);
}
const dpoint2d operator+(const dpoint2d& rhs) const
Index: oln/core/2d/array2d.hh
===================================================================
--- oln/core/2d/array2d.hh (revision 31)
+++ oln/core/2d/array2d.hh (working copy)
@@ -115,8 +115,8 @@
void impl_resize(const size2d& s)
{
- precondition(s.nrows() > 0 and
- s.ncols() > 0 and
+ precondition(s.nrows() > 0 &&
+ s.ncols() > 0 &&
s.border() >= 0);
invariant_();
this->clear_data();
@@ -147,18 +147,18 @@
bool impl_hold(const point2d& p) const
{
return
- p.row() >= 0 and
- p.row() < size_.nrows() and
- p.col() >= 0 and
+ p.row() >= 0 &&
+ p.row() < size_.nrows() &&
+ p.col() >= 0 &&
p.col() < size_.ncols();
}
bool impl_hold_large(const point2d& p) const
{
return
- p.row() >= - size_.border() and
- p.row() < size_.nrows() + size_.border() and
- p.col() >= - size_.border() and
+ p.row() >= - size_.border() &&
+ p.row() < size_.nrows() + size_.border() &&
+ p.col() >= - size_.border() &&
p.col() < size_.ncols() + size_.border();
}
@@ -193,16 +193,16 @@
void invariant_() const
{
- invariant((buffer_ != 0 and
- array_ != 0 and
- size_.nrows() > 0 and
- size_.ncols() > 0 and
+ invariant((buffer_ != 0 &&
+ array_ != 0 &&
+ size_.nrows() > 0 &&
+ size_.ncols() > 0 &&
size_.border() >= 0)
- or
- (buffer_ == 0 and
- array_ == 0 and
- size_.nrows().is_undefined() and
- size_.ncols().is_undefined() and
+ ||
+ (buffer_ == 0 &&
+ array_ == 0 &&
+ size_.nrows().is_undefined() &&
+ size_.ncols().is_undefined() &&
size_.border().is_undefined()));
}
Index: oln/core/2d/fwd_piter2d.hh
===================================================================
--- oln/core/2d/fwd_piter2d.hh (revision 31)
+++ oln/core/2d/fwd_piter2d.hh (working copy)
@@ -70,35 +70,35 @@
{
this->p_.row() = 0;
this->p_.col() = 0;
- postcondition(this->p_.row().is_defined() and this->p_.col().is_defined());
+ postcondition(this->p_.row().is_defined() && this->p_.col().is_defined());
}
bool impl_is_valid() const
{
- precondition(this->p_.row().is_defined() and this->p_.col().is_defined());
+ precondition(this->p_.row().is_defined() && this->p_.col().is_defined());
return this->p_.row() < this->s_.nrows();
}
void impl_next()
{
- precondition(this->p_.row().is_defined() and this->p_.col().is_defined());
- precondition(this->p_.row() >= 0 and this->p_.row() <= this->s_.nrows()
- and
- this->p_.col() >= 0 and this->p_.col() <= this->s_.ncols());
+ precondition(this->p_.row().is_defined() && this->p_.col().is_defined());
+ precondition(this->p_.row() >= 0 && this->p_.row() <= this->s_.nrows()
+ &&
+ this->p_.col() >= 0 && this->p_.col() <= this->s_.ncols());
++this->p_.col();
if (this->p_.col() != this->s_.ncols())
return;
this->p_.col() = 0;
precondition(this->p_.row() != this->s_.nrows());
++this->p_.row();
- postcondition(this->p_.row().is_defined() and this->p_.col().is_defined());
+ postcondition(this->p_.row().is_defined() && this->p_.col().is_defined());
}
void impl_invalidate()
{
this->p_.row() = this->s_.nrows();
this->p_.col() = this->s_.ncols();
- postcondition(this->p_.row().is_defined() and this->p_.col().is_defined());
+ postcondition(this->p_.row().is_defined() && this->p_.col().is_defined());
}
};
Index: oln/core/2d/point2d.hh
===================================================================
--- oln/core/2d/point2d.hh (revision 31)
+++ oln/core/2d/point2d.hh (working copy)
@@ -28,7 +28,7 @@
#ifndef OLENA_CORE_2D_POINT2D_HH
# define OLENA_CORE_2D_POINT2D_HH
-# include <ostream>
+# include <iostream>
# include <oln/core/abstract/point.hh>
# include <oln/core/coord.hh>
@@ -95,7 +95,7 @@
bool impl_eq(const point2d& rhs) const
{
- return this->row_ == rhs.row_ and this->col_ == rhs.col_;
+ return this->row_ == rhs.row_ && this->col_ == rhs.col_;
}
protected:
Index: oln/core/2d/size2d.hh
===================================================================
--- oln/core/2d/size2d.hh (revision 31)
+++ oln/core/2d/size2d.hh (working copy)
@@ -28,7 +28,7 @@
#ifndef OLENA_CORE_2D_SIZE2D_HH
# define OLENA_CORE_2D_SIZE2D_HH
-# include <ostream>
+# include <iostream>
# include <oln/core/abstract/size.hh>
# include <oln/core/coord.hh>
@@ -73,7 +73,7 @@
bool impl_eq(const size2d& rhs) const
{
- return this->nrows_ == rhs.nrows_ and
+ return this->nrows_ == rhs.nrows_ &&
this->ncols_ == rhs.ncols_;
}
1
0
2005-02-08 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
* oln/core/value_box.hh: Unbox image attribute.
* oln/core/abstract/image_with_data.hh: Clean up in ctors.
* oln/core/abstract/data_storage.hh: Fix bug in size().
* oln/core/2d/array2d.hh: Fix name of size impl.
Index: olena/oln/core/value_box.hh
===================================================================
--- olena/oln/core/value_box.hh (revision 29)
+++ olena/oln/core/value_box.hh (working copy)
@@ -30,10 +30,6 @@
# include <ostream>
-// for mlc::box<T>:
-
-# include <mlc/box.hh>
-
# include <oln/core/macros.hh>
// the proper macro:
@@ -91,7 +87,7 @@
template <typename V>
value_box& operator=(const V& value)
{
- ima_->set(p_, value);
+ ima_.set(p_, value);
return *this;
}
@@ -107,7 +103,7 @@
template <typename II>
value_box& operator=(const value_box<II>& rhs)
{
- ima_->set(p_, rhs); // automatic conversion from rhs to oln_value_type(I)
+ ima_.set(p_, rhs); // automatic conversion from rhs to oln_value_type(I)
return *this;
}
@@ -122,7 +118,7 @@
template <typename A, typename V>
value_box& set(void (I::*method)(A), const V& value)
{
- ima_->set(p_, method, value);
+ ima_.set(p_, method, value);
return *this;
}
@@ -137,13 +133,13 @@
template <typename V>
operator const V() const
{
- const V value = ima_->get(p_);
+ const V value = ima_.get(p_);
return value;
}
operator const oln_value_type(I)() const
{
- return ima_->get(p_);
+ return ima_.get(p_);
}
@@ -160,7 +156,7 @@
const oln_value_type(I) value() const
{
- return ima_->get(p_);
+ return ima_.get(p_);
}
@@ -174,8 +170,8 @@
/// Ctor (restricted access).
- value_box(I& ima, const oln_point_type(I)& p) :
- ima_(ima),
+ value_box(abstract::image<I>& ima, const oln_point_type(I)& p) :
+ ima_(ima.exact()),
p_(p)
{
}
@@ -192,7 +188,7 @@
! attributes !
*------------*/
- mlc::box<I> ima_;
+ I& ima_;
oln_point_type(I) p_;
};
@@ -216,10 +212,9 @@
public:
+ /*! \brief Assignment (op=) is declared but undefined.
+ */
- // FIXME: no operator= was provided here so 'self = self' was possible...
- // FIXME: below, a single decl has been added; to be tested...
-
template <typename V>
void operator=(const V&) const;
@@ -232,13 +227,13 @@
template <typename V>
operator const V() const
{
- const V value = ima_->get(p_);
+ const V value = ima_.get(p_);
return value;
}
operator const oln_value_type(I)() const
{
- return ima_->get(p_);
+ return ima_.get(p_);
}
@@ -255,7 +250,7 @@
const oln_value_type(I) value() const
{
- return ima_->get(p_);
+ return ima_.get(p_);
}
// IDEA: provide op->
@@ -270,8 +265,8 @@
/// Ctor (restricted access).
- value_box(const I& ima, const oln_point_type(I)& p) :
- ima_(ima),
+ value_box(const abstract::image<I>& ima, const oln_point_type(I)& p) :
+ ima_(ima.exact()),
p_(p)
{
}
@@ -288,7 +283,7 @@
! attributes !
*------------*/
- mlc::box<const I> ima_;
+ const I& ima_;
oln_point_type(I) p_;
};
Index: olena/oln/core/abstract/image_with_data.hh
===================================================================
--- olena/oln/core/abstract/image_with_data.hh (revision 29)
+++ olena/oln/core/abstract/image_with_data.hh (working copy)
@@ -137,18 +137,18 @@
/*! \brief Constructor (protected) with no memory allocation for
** data.
*/
- image_with_data()
+ image_with_data() :
+ data_(0)
{
- data_ = 0;
}
/*! \brief Constructor (protected) with memory allocation for
** data.
*/
- image_with_data(const oln_size_type(E)& size)
+ image_with_data(const oln_size_type(E)& size) :
+ data_(new oln_value_container_type(E)(size))
{
- data_ = new oln_value_container_type(E)(size);
}
Index: olena/oln/core/abstract/data_storage.hh
===================================================================
--- olena/oln/core/abstract/data_storage.hh (revision 29)
+++ olena/oln/core/abstract/data_storage.hh (working copy)
@@ -54,7 +54,7 @@
const oln_size_type(E)& size() const
{
- return this->exact().impl_size(this->s);
+ return this->exact().impl_size();
}
void resize(const oln_size_type(E)& s)
Index: olena/oln/core/2d/array2d.hh
===================================================================
--- olena/oln/core/2d/array2d.hh (revision 29)
+++ olena/oln/core/2d/array2d.hh (working copy)
@@ -108,7 +108,7 @@
invariant_();
}
- const size2d& size() const
+ const size2d& impl_size() const
{
return size_;
}
Index: metalic/mlc/tracked_ptr.hh
===================================================================
--- metalic/mlc/tracked_ptr.hh (revision 29)
+++ metalic/mlc/tracked_ptr.hh (working copy)
@@ -28,10 +28,11 @@
#ifndef METALIC_TRACKED_PTR_HH
# define METALIC_TRACKED_PTR_HH
-# include <ostream>
+# include <iostream>
# include <set>
# include <map>
+# include <mlc/contract.hh>
namespace mlc {
@@ -42,93 +43,148 @@
namespace internal {
+ /*! \class tracked_ptr_proxy<T>
+ **
+ ** Class that effectively holds a pointer. For use in class
+ ** tracked_ptr.
+ **
+ ** Parameter T is the type of pointed data.
+ */
+
template <class T>
- class tracked_ptr_proxy
+ struct /* HERE: class */ tracked_ptr_proxy
{
friend class tracked_ptr<T>;
- // attributes
+ /// Attributes.
+
T* ptr_;
std::set<const tracked_ptr<T>*> holders_;
- // w/o impl
+ /// Cpy ctor is not impled.
tracked_ptr_proxy(const tracked_ptr_proxy&);
+
+ /// Assignmt op is not impled.
void operator=(const tracked_ptr_proxy&);
- // methods
- tracked_ptr_proxy() :
- ptr_(0)
- {
- }
-
+ /*! \brief Ctor.
+ **
+ ** We have a new proxy so we have to make sure that the pointer,
+ ** if not null, was not already proxified, meaning that this new
+ ** proxy handles 'new' data.
+ */
tracked_ptr_proxy(T* ptr) :
- ptr_(0)
+ ptr_(0),
+ holders_()
{
- set_ptr(ptr);
+ if (ptr != 0)
+ {
+ invariant(proxy_of()[ptr] == 0);
+ this->ptr_ = ptr;
+ proxy_of()[this->ptr_] = this;
+ }
+ else
+ this->ptr_ = 0;
}
- void set_ptr(T* new_ptr)
+
+ /*! \brief Change data pointer.
+ **
+ ** If the change is effective, former data are deleted.
+ */
+ void set_ptr(T* ptr)
{
- if (new_ptr == this->ptr_)
- return;
- T* old_ptr = this->ptr_;
- if (old_ptr != 0)
+ if (ptr == this->ptr_)
{
- assert(proxy_of()[old_ptr] == this);
- proxy_of().erase(old_ptr);
+ // nothing to be done
+ return;
+ }
+
+ if (this->ptr_ != 0)
+ {
+ invariant(proxy_of()[this->ptr_] == this);
+ proxy_of().erase(this->ptr_);
+ delete this->ptr_;
+ this->ptr_ = 0; // safety
};
- this->ptr_ = new_ptr;
- if (new_ptr != 0)
+
+ // same code as ctor:
+ if (ptr != 0)
{
- assert(proxy_of()[new_ptr] == 0);
- proxy_of()[new_ptr] = this;
- };
+ invariant(proxy_of()[ptr] == 0);
+ this->ptr_ = ptr;
+ proxy_of()[this->ptr_] = this;
+ }
+ else
+ this->ptr_ = 0;
}
+
+ /*! \brief Register a new holder.
+ **
+ ** \precondition Test that it is effectively a new holder.
+ */
void register_holder(const tracked_ptr<T>* holder)
{
- assert(holder != 0);
- assert(holders_.find(holder) == holders_.end());
+ precondition(holder != 0);
+ precondition(holders_.find(holder) == holders_.end());
holders_.insert(holder);
}
+
+ /*! \brief Unregister a holder.
+ **
+ ** If it is the last holder and if data is not null, data are
+ ** deleted. In that case, the return value (true) allows the
+ ** tracked_pointer to know that the proxy has to be deleted.
+ **
+ ** \precondition Test that it is effectively a holder.
+ ** \return True if data is deleted, false otherwise
+ */
+
bool unregister_holder(const tracked_ptr<T>* holder)
{
- assert(holder != 0);
- assert(holders_.size() > 0);
+ // "simple" tests:
+ precondition(holder != 0);
+ precondition(holders_.size() > 0);
- typename std::set<const tracked_ptr<T>*>::iterator e = holders_.find(holder);
- assert(e != holders_.end());
- holders_.erase(e);
+ // "main" test:
+ // note that the couple of "simple" tests above are subtests of the following one
+ typename std::set<const tracked_ptr<T>*>::iterator h = holders_.find(holder);
+ precondition(h != holders_.end());
- if (holders_.size() == 0)
+ holders_.erase(h);
+
+ if (holders_.size() == 0 && this->ptr_ != 0)
{
- proxy_of()[ptr_] = 0;
- delete ptr_;
- ptr_ = 0;
+ proxy_of()[this->ptr_] = 0;
+ delete this->ptr_;
+ this->ptr_ = 0; // safety
return true;
}
+
return false;
}
+
// procedures
typedef std::map<const T*, const tracked_ptr_proxy*> map_type;
static map_type& proxy_of()
{
- static map_type proxy_of_;
- return proxy_of_;
+ static map_type* proxy_of_ = new map_type;
+ return *proxy_of_;
}
friend
std::ostream& operator<<(std::ostream& ostr, const tracked_ptr_proxy& proxy)
{
- ostr << "[ptr=" << proxy.ptr_ << " holders=(";
+ ostr << "proxy " << &proxy << " [ptr=" << proxy.ptr_ << " holders=(";
typename std::set<const tracked_ptr<T>*>::const_iterator i = proxy.holders_.begin();
bool ok = i != proxy.holders_.end();
while (ok)
@@ -143,7 +199,7 @@
};
- } // end of namspace internal
+ } // end of namespace internal
@@ -154,155 +210,185 @@
{
public:
+ /*! \brief Mimics the behavior of op* for a pointer in the const case.
+ **
+ ** \invariant Pointer proxy exists.
+ ** \precondition Data exists (is not null).
+ */
const T& operator*() const
{
- assert(proxy_ != 0 and proxy_->ptr_ != 0);
+ invariant(proxy_ != 0);
+ precondition(proxy_->ptr_ != 0);
return *(proxy_->ptr_);
}
+ /*! \brief Mimics the behavior of op* for a pointer in the mutable case.
+ **
+ ** \invariant Pointer proxy exists.
+ ** \precondition Data exists (is not null).
+ */
T& operator*()
{
- assert(proxy_ != 0 and proxy_->ptr_ != 0);
+ invariant(proxy_ != 0);
+ precondition(proxy_->ptr_ != 0);
return *(proxy_->ptr_);
}
+ /*! \brief Mimics the behavior of op-> for a pointer in the const case.
+ **
+ ** \invariant Pointer proxy exists.
+ */
const T*const operator->() const
{
- assert(proxy_ != 0);
+ invariant(proxy_ != 0);
return proxy_->ptr_;
}
+ /*! \brief Mimics the behavior of op-> for a pointer in the mutable case.
+ **
+ ** \invariant Pointer proxy exists.
+ */
T*const operator->()
{
- assert(proxy_ != 0);
+ invariant(proxy_ != 0);
return proxy_->ptr_;
}
+ /// Coercion towards Boolean (for arithmetical tests).
operator bool() const
{
- return proxy_ != 0 and proxy_->ptr_ != 0;
+ invariant(proxy_ != 0);
+ return proxy_->ptr_ != 0;
}
- bool operator not() const
+ /// Negation (for arithmetical tests).
+ bool operator !() const
{
- return not bool(*this);
+ invariant(proxy_ != 0);
+ return ! bool(*this);
}
+ /// Comparison 'equal to' (for arithmetical tests).
bool operator==(int b) const
{
+ invariant(proxy_ != 0);
return bool(*this) == bool(b);
}
+ /// Comparison 'not equal to' (for arithmetical tests).
bool operator!=(int b) const
{
+ invariant(proxy_ != 0);
return bool(*this) != bool(b);
}
- // hook:
- const internal::tracked_ptr_proxy<T>* proxy() const { return proxy_; }
+ /// Hook that gives access to the data proxy.
+ const internal::tracked_ptr_proxy<T>* proxy() const { return this->proxy_; }
+ internal::tracked_ptr_proxy<T>* proxy() { return this->proxy_; }
- // ctors
- tracked_ptr() :
- proxy_(0)
- {
- invariant_();
- }
-
- tracked_ptr(T* ptr) :
+ /*! \brief Ctor.
+ **
+ ** Creates a proxy that knows the target data pointer. This
+ ** pointer can be null (0).
+ */
+ tracked_ptr(T* ptr = 0) :
proxy_(new internal::tracked_ptr_proxy<T>(ptr))
{
- proxy_->register_holder(this);
+ this->proxy_->register_holder(this);
invariant_();
}
- // shallow copy
+ /*! \brief Cpy ctor performs a shallow copy.
+ **
+ ** The data proxy of \a rhs is shared with the constructed
+ ** tracked_ptr.
+ */
tracked_ptr(const tracked_ptr& rhs) :
proxy_(rhs.proxy_)
{
- if (proxy_ != 0)
- proxy_->register_holder(this);
+ precondition(rhs.proxy_ != 0);
+ this->proxy_->register_holder(this);
invariant_();
}
- // assignment
+ /*! \brief Assignment operator with rhs being a tracked pointer.
+ **
+ ** The lhs proxy unregisters its data and registers the rhs data.
+ ** In the case of both pointers have the same value, no action is
+ ** performed and a warning is produced. The unregistration
+ ** process may desallocate data if the target pointer was the only
+ ** access to those data.
+ */
tracked_ptr& operator=(const tracked_ptr& rhs)
{
- invariant_();
- if (rhs == 0)
- return *this;
+ invariant(this->proxy_ != 0);
+ precondition(rhs.proxy_ != 0);
+
+ invariant_(); // safety
+
if (rhs.proxy_ == this->proxy_)
- return *this;
- if (this->release_proxy_())
- delete this->proxy_;
+ {
+ std::cerr << "warning: nothing done cause both objects share the same data!" << std::endl;
+ // FIXME: say more
+ // e.g.: ima1 = ima2; ima2 = ima1;
+ return *this;
+ }
+
+ if (this->proxy_->unregister_holder(this))
+ {
+ // the current 'tracked pointer' was the only access to
+ // some data (this->proxy_->ptr_); data has been
+ // desallocated, so it goes the same for the proxy:
+ delete this->proxy_;
+ }
+
this->proxy_ = rhs.proxy_;
this->proxy_->register_holder(this);
+
invariant_();
return *this;
}
+
+ /*! \brief Assignment operator with rhs being a data pointer.
+ **
+ ** This assignment just changes the pointed data.
+ */
tracked_ptr& operator=(T* ptr)
{
- if (proxy_ != 0)
- {
- assert(proxy_->holders_.size() <= 1);
- this->release_proxy_();
- }
- else
- proxy_ = new internal::tracked_ptr_proxy<T>(ptr);
- this->proxy_->register_holder(this);
+ invariant(this->proxy_ != 0);
+ this->proxy_->set_ptr(ptr);
return *this;
}
- // dtor
+ // Dtor.
+
~tracked_ptr()
{
- invariant_();
- if (release_proxy_())
- delete proxy_;
- proxy_ = 0;
- }
-
- // dangerous! (?)
-
- void reset_()
- {
- invariant_();
- if (proxy_ == 0 or proxy_->ptr_ == 0)
- return;
- T* ptr = proxy_->ptr_;
- std::set<const tracked_ptr<T>*>& holders = proxy_->holders_;
- typename std::set<const tracked_ptr<T>*>::iterator i;
- for (i = holders.begin(); i != holders.end(); ++i)
+ invariant(this->proxy_ != 0);
+ if (this->proxy_->unregister_holder(this))
{
- if (*i == this)
- continue;
- tracked_ptr<T>* holder = const_cast<tracked_ptr<T>*>(*i);
- holder->proxy_ = 0;
+ // the current 'tracked pointer' was the only access to
+ // some data (this->proxy_->ptr_); data has been
+ // desallocated, so it goes the same for the proxy:
+ delete this->proxy_;
}
- delete this->proxy_->ptr_;
- delete this->proxy_;
- this->proxy_ = 0;
+ this->proxy_ = 0; // safety
}
private:
+ /// Only attribute.
+
internal::tracked_ptr_proxy<T>* proxy_;
- bool release_proxy_()
- {
- invariant_();
- if (proxy_ == 0)
- return false;
- return proxy_->unregister_holder(this);
- }
-
void invariant_() const
{
if (proxy_ == 0)
@@ -313,9 +399,15 @@
assert((*i)->proxy_ == this->proxy_);
}
+ friend
+ std::ostream& operator<<(std::ostream& ostr, const tracked_ptr& ptr)
+ {
+ invariant(ptr.proxy_ != 0);
+ return ostr << "tracked_ptr " << &ptr << " --> " << *(ptr.proxy_);
+ }
};
+
-
} // end of namespace mlc
Index: metalic/mlc/any.hh
===================================================================
--- metalic/mlc/any.hh (revision 29)
+++ metalic/mlc/any.hh (working copy)
@@ -32,7 +32,7 @@
-// abrev
+// abbrev
#define any_mem(E) any <E, dispatch_policy::best_memory>
@@ -46,14 +46,13 @@
{
struct best_speed;
struct best_memory;
- struct compromise;
+ struct simple;
};
// any
- template <typename E,
- typename Dispatch_Policy = dispatch_policy::best_memory>
+ template <typename E, typename Dispatch_Policy = dispatch_policy::simple>
struct any;
@@ -71,12 +70,34 @@
precondition(exact_ptr != 0);
return *exact_ptr;
}
+
+ /// Assignment (op=).
+
+ any& operator=(const any& rhs)
+ {
+ // do nothing
+ // so that "this->exact_ptr" is unchanged
+ return *this;
+ }
+
+ /// Copy Ctor.
+
+ any(const any& rhs) :
+ exact_ptr(0) // safety
+ {
+ // this->exact_ptr is *not* copied
+ // its value has to be set in subclasses copy ctors.
+ }
+
protected:
any(E* exact_ptr) : exact_ptr(exact_ptr) {}
virtual ~any() {}
+
+ /// Only attribute.
E* exact_ptr;
};
+
template <typename E>
struct any__best_speed : public any<E, dispatch_policy::best_speed>
{
@@ -104,8 +125,8 @@
protected:
any() {}
- any(E* exact_ptr); // safety: w/o impl
- virtual ~any() {}
+ any(E* exact_ptr_does_not_exist_in_this_version); // safety
+ virtual ~any() {} // FIXME: virtual for a "best memory" version!?
};
template <typename E>
@@ -123,11 +144,22 @@
- (const char*)(void*)(&any_mem(E)::exact_obj);
- // "compromise" version of 'any'
+ // "simple" version of 'any'
template <typename E>
struct any <E,
- dispatch_policy::compromise>; // FIXME: not yet impled
+ dispatch_policy::simple>
+ {
+ E& exact() {
+ return *(E*)(void*)this;
+ }
+ const E& exact() const {
+ return *(const E*)(const void*)this;
+ }
+ protected:
+ any() {}
+ any(E* exact_ptr_does_not_exist_in_this_version); // safety
+ };
} // end of namespace mlc
1
0
Index: ChangeLog
from Simon Odou <simon(a)lrde.epita.fr>
* oln/fancy/print.hh: Add copyright.
* oln/fancy/iota.hh: Likewise.
* oln/basics.hh: Likewise.
* oln/basics1d.hh: Likewise.
* oln/core/props.hh: Likewise.
* oln/core/macros.hh: Likewise.
* oln/core/value_box.hh: Likewise.
* oln/core/abstract/image_constness.hh: Likewise.
* oln/core/abstract/image.hh: Likewise.
* oln/core/abstract/piter.hh: Likewise.
* oln/core/abstract/images.hh: Likewise.
* oln/core/abstract/image_with_data.hh: Likewise.
* oln/core/abstract/image_dimension.hh: Likewise.
* oln/core/abstract/point.hh: Likewise.
* oln/core/abstract/size.hh: Likewise.
* oln/core/abstract/data_storage.hh: Likewise.
* oln/core/abstract/dpoint.hh: Likewise.
* oln/core/abstract/internal/image_impl.hh: Likewise.
* oln/core/1d/dpoint1d.hh: Likewise.
* oln/core/1d/array1d.hh: Likewise.
* oln/core/1d/image1d.hh: Likewise.
* oln/core/1d/fwd_piter1d.hh: Likewise.
* oln/core/1d/point1d.hh: Likewise.
* oln/core/1d/size1d.hh: Likewise.
* oln/core/coord.hh: Likewise.
* oln/core/2d/dpoint2d.hh: Likewise.
* oln/core/2d/array2d.hh: Likewise.
* oln/core/2d/image2d.hh: Likewise.
* oln/core/2d/fwd_piter2d.hh: Likewise.
* oln/core/2d/point2d.hh: Likewise.
* oln/core/2d/size2d.hh: Likewise.
* oln/core/3d/size3d.hh: Likewise.
* oln/core/3d/array3d.hh: Likewise.
* oln/core/3d/image3d.hh: Likewise.
* oln/core/3d/point3d.hh: Likewise.
* oln/core/cats.hh: Likewise.
* oln/core/tags.hh: Likewise.
* oln/basics2d.hh: Likewise.
* oln/basics3d.hh: Likewise.
basics.hh | 29 +++++++++++++++++++++++++++++
basics1d.hh | 27 +++++++++++++++++++++++++++
basics2d.hh | 27 +++++++++++++++++++++++++++
basics3d.hh | 27 +++++++++++++++++++++++++++
core/1d/array1d.hh | 27 +++++++++++++++++++++++++++
core/1d/dpoint1d.hh | 27 +++++++++++++++++++++++++++
core/1d/fwd_piter1d.hh | 27 +++++++++++++++++++++++++++
core/1d/image1d.hh | 27 +++++++++++++++++++++++++++
core/1d/point1d.hh | 27 +++++++++++++++++++++++++++
core/1d/size1d.hh | 27 +++++++++++++++++++++++++++
core/2d/array2d.hh | 27 +++++++++++++++++++++++++++
core/2d/dpoint2d.hh | 27 +++++++++++++++++++++++++++
core/2d/fwd_piter2d.hh | 27 +++++++++++++++++++++++++++
core/2d/image2d.hh | 27 +++++++++++++++++++++++++++
core/2d/point2d.hh | 27 +++++++++++++++++++++++++++
core/2d/size2d.hh | 27 +++++++++++++++++++++++++++
core/3d/array3d.hh | 27 +++++++++++++++++++++++++++
core/3d/image3d.hh | 27 +++++++++++++++++++++++++++
core/3d/point3d.hh | 27 +++++++++++++++++++++++++++
core/3d/size3d.hh | 28 ++++++++++++++++++++++++++++
core/abstract/data_storage.hh | 27 +++++++++++++++++++++++++++
core/abstract/dpoint.hh | 27 +++++++++++++++++++++++++++
core/abstract/image.hh | 27 +++++++++++++++++++++++++++
core/abstract/image_constness.hh | 27 +++++++++++++++++++++++++++
core/abstract/image_dimension.hh | 27 +++++++++++++++++++++++++++
core/abstract/image_with_data.hh | 27 +++++++++++++++++++++++++++
core/abstract/images.hh | 27 +++++++++++++++++++++++++++
core/abstract/internal/image_impl.hh | 27 +++++++++++++++++++++++++++
core/abstract/piter.hh | 27 +++++++++++++++++++++++++++
core/abstract/point.hh | 27 +++++++++++++++++++++++++++
core/abstract/size.hh | 27 +++++++++++++++++++++++++++
core/cats.hh | 27 +++++++++++++++++++++++++++
core/coord.hh | 27 +++++++++++++++++++++++++++
core/macros.hh | 27 +++++++++++++++++++++++++++
core/props.hh | 27 +++++++++++++++++++++++++++
core/tags.hh | 27 +++++++++++++++++++++++++++
core/value_box.hh | 27 +++++++++++++++++++++++++++
fancy/iota.hh | 27 +++++++++++++++++++++++++++
fancy/print.hh | 27 +++++++++++++++++++++++++++
39 files changed, 1056 insertions(+)
Index: oln/fancy/print.hh
--- oln/fancy/print.hh (revision 25)
+++ oln/fancy/print.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 OLENA_FANCY_PRINT_HH
# define OLENA_FANCY_PRINT_HH
Index: oln/fancy/iota.hh
--- oln/fancy/iota.hh (revision 25)
+++ oln/fancy/iota.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 OLENA_FANCY_IOTA_HH
# define OLENA_FANCY_IOTA_HH
Index: oln/basics.hh
--- oln/basics.hh (revision 25)
+++ oln/basics.hh (working copy)
@@ -1,3 +1,32 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_BASICS_HH
# define OLENA_BASICS_HH
Index: oln/basics1d.hh
--- oln/basics1d.hh (revision 25)
+++ oln/basics1d.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_BASICS1D_HH
# define OLENA_BASICS1D_HH
Index: oln/core/props.hh
--- oln/core/props.hh (revision 25)
+++ oln/core/props.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 PROTO_OLN_CORE_PROPS_HH
# define PROTO_OLN_CORE_PROPS_HH
Index: oln/core/macros.hh
--- oln/core/macros.hh (revision 25)
+++ oln/core/macros.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_MACROS_HH
# define OLENA_CORE_MACROS_HH
Index: oln/core/value_box.hh
--- oln/core/value_box.hh (revision 25)
+++ oln/core/value_box.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_VALUE_BOX_HH
# define OLENA_CORE_VALUE_BOX_HH
Index: oln/core/abstract/image_constness.hh
--- oln/core/abstract/image_constness.hh (revision 25)
+++ oln/core/abstract/image_constness.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_ABSTRACT_IMAGE_CONSTNESS_HH
# define OLENA_CORE_ABSTRACT_IMAGE_CONSTNESS_HH
Index: oln/core/abstract/image.hh
--- oln/core/abstract/image.hh (revision 25)
+++ oln/core/abstract/image.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_ABSTRACT_IMAGE_HH
# define OLENA_CORE_ABSTRACT_IMAGE_HH
Index: oln/core/abstract/piter.hh
--- oln/core/abstract/piter.hh (revision 25)
+++ oln/core/abstract/piter.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 PROTO_OLN_CORE_ABSTRACT_PITER_HH
# define PROTO_OLN_CORE_ABSTRACT_PITER_HH
Index: oln/core/abstract/images.hh
--- oln/core/abstract/images.hh (revision 25)
+++ oln/core/abstract/images.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_ABSTRACT_IMAGES_HH
# define OLENA_CORE_ABSTRACT_IMAGES_HH
Index: oln/core/abstract/image_with_data.hh
--- oln/core/abstract/image_with_data.hh (revision 25)
+++ oln/core/abstract/image_with_data.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_ABSTRACT_IMAGE_WITH_DATA_HH
# define OLENA_CORE_ABSTRACT_IMAGE_WITH_DATA_HH
Index: oln/core/abstract/image_dimension.hh
--- oln/core/abstract/image_dimension.hh (revision 25)
+++ oln/core/abstract/image_dimension.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_ABSTRACT_IMAGE_DIMENSION_HH
# define OLENA_CORE_ABSTRACT_IMAGE_DIMENSION_HH
Index: oln/core/abstract/point.hh
--- oln/core/abstract/point.hh (revision 25)
+++ oln/core/abstract/point.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 PROTO_OLN_CORE_ABSTRACT_POINT_HH
# define PROTO_OLN_CORE_ABSTRACT_POINT_HH
Index: oln/core/abstract/size.hh
--- oln/core/abstract/size.hh (revision 25)
+++ oln/core/abstract/size.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 PROTO_OLN_CORE_ABSTRACT_SIZE_HH
# define PROTO_OLN_CORE_ABSTRACT_SIZE_HH
Index: oln/core/abstract/data_storage.hh
--- oln/core/abstract/data_storage.hh (revision 25)
+++ oln/core/abstract/data_storage.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_ABSTRACT_DATA_STORAGE_HH
# define OLENA_CORE_ABSTRACT_DATA_STORAGE_HH
Index: oln/core/abstract/dpoint.hh
--- oln/core/abstract/dpoint.hh (revision 25)
+++ oln/core/abstract/dpoint.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 PROTO_OLN_CORE_ABSTRACT_DPOINT_HH
# define PROTO_OLN_CORE_ABSTRACT_DPOINT_HH
Index: oln/core/abstract/internal/image_impl.hh
--- oln/core/abstract/internal/image_impl.hh (revision 25)
+++ oln/core/abstract/internal/image_impl.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 PROTO_OLN_CORE_ABSTRACT_INTERNAL_IMAGE_IMPL_HH
# define PROTO_OLN_CORE_ABSTRACT_INTERNAL_IMAGE_IMPL_HH
Index: oln/core/1d/dpoint1d.hh
--- oln/core/1d/dpoint1d.hh (revision 25)
+++ oln/core/1d/dpoint1d.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_1D_DPOINT1D_HH
# define OLENA_CORE_1D_DPOINT1D_HH
Index: oln/core/1d/array1d.hh
--- oln/core/1d/array1d.hh (revision 25)
+++ oln/core/1d/array1d.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_1D_ARRAY1D_HH
# define OLENA_CORE_1D_ARRAY1D_HH
Index: oln/core/1d/image1d.hh
--- oln/core/1d/image1d.hh (revision 25)
+++ oln/core/1d/image1d.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_IMAGE1D_HH
# define OLENA_CORE_IMAGE1D_HH
Index: oln/core/1d/fwd_piter1d.hh
--- oln/core/1d/fwd_piter1d.hh (revision 25)
+++ oln/core/1d/fwd_piter1d.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 PROTO_OLN_CORE_1D_FWD_PITER1D_HH
# define PROTO_OLN_CORE_1D_FWD_PITER1D_HH
Index: oln/core/1d/point1d.hh
--- oln/core/1d/point1d.hh (revision 25)
+++ oln/core/1d/point1d.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_1D_POINT1D_HH
# define OLENA_CORE_1D_POINT1D_HH
Index: oln/core/1d/size1d.hh
--- oln/core/1d/size1d.hh (revision 25)
+++ oln/core/1d/size1d.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_1D_SIZE1D_HH
# define OLENA_CORE_1D_SIZE1D_HH
Index: oln/core/coord.hh
--- oln/core/coord.hh (revision 25)
+++ oln/core/coord.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_COORD_HH
# define OLENA_CORE_COORD_HH
Index: oln/core/2d/dpoint2d.hh
--- oln/core/2d/dpoint2d.hh (revision 25)
+++ oln/core/2d/dpoint2d.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_2D_DPOINT2D_HH
# define OLENA_CORE_2D_DPOINT2D_HH
Index: oln/core/2d/array2d.hh
--- oln/core/2d/array2d.hh (revision 25)
+++ oln/core/2d/array2d.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_2D_ARRAY2D_HH
# define OLENA_CORE_2D_ARRAY2D_HH
Index: oln/core/2d/image2d.hh
--- oln/core/2d/image2d.hh (revision 25)
+++ oln/core/2d/image2d.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_IMAGE2D_HH
# define OLENA_CORE_IMAGE2D_HH
Index: oln/core/2d/fwd_piter2d.hh
--- oln/core/2d/fwd_piter2d.hh (revision 25)
+++ oln/core/2d/fwd_piter2d.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 PROTO_OLN_CORE_2D_FWD_PITER2D_HH
# define PROTO_OLN_CORE_2D_FWD_PITER2D_HH
Index: oln/core/2d/point2d.hh
--- oln/core/2d/point2d.hh (revision 25)
+++ oln/core/2d/point2d.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_2D_POINT2D_HH
# define OLENA_CORE_2D_POINT2D_HH
Index: oln/core/2d/size2d.hh
--- oln/core/2d/size2d.hh (revision 25)
+++ oln/core/2d/size2d.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_2D_SIZE2D_HH
# define OLENA_CORE_2D_SIZE2D_HH
Index: oln/core/3d/size3d.hh
--- oln/core/3d/size3d.hh (revision 25)
+++ oln/core/3d/size3d.hh (working copy)
@@ -1,3 +1,31 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_3D_SIZE3D_HH
# define OLENA_CORE_3D_SIZE3D_HH
Index: oln/core/3d/array3d.hh
--- oln/core/3d/array3d.hh (revision 25)
+++ oln/core/3d/array3d.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_3D_ARRAY3D_HH
# define OLENA_CORE_3D_ARRAY3D_HH
Index: oln/core/3d/image3d.hh
--- oln/core/3d/image3d.hh (revision 25)
+++ oln/core/3d/image3d.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_IMAGE3D_HH
# define OLENA_CORE_IMAGE3D_HH
Index: oln/core/3d/point3d.hh
--- oln/core/3d/point3d.hh (revision 25)
+++ oln/core/3d/point3d.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_3D_POINT3D_HH
# define OLENA_CORE_3D_POINT3D_HH
Index: oln/core/cats.hh
--- oln/core/cats.hh (revision 25)
+++ oln/core/cats.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 PROTO_OLN_CORE_CATS_HH
# define PROTO_OLN_CORE_CATS_HH
Index: oln/core/tags.hh
--- oln/core/tags.hh (revision 25)
+++ oln/core/tags.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_TAGS_HH
# define OLENA_CORE_TAGS_HH
Index: oln/basics2d.hh
--- oln/basics2d.hh (revision 25)
+++ oln/basics2d.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_BASICS2D_HH
# define OLENA_BASICS2D_HH
Index: oln/basics3d.hh
--- oln/basics3d.hh (revision 25)
+++ oln/basics3d.hh (working copy)
@@ -1,3 +1,30 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_BASICS3D_HH
# define OLENA_BASICS3D_HH
1
0