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
10 Oct '06
https://svn.lrde.epita.fr/svn/oln/trunk/olena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Fix sanity checks.
* oln/core/abstract/image/hybrid/classical.hh,
* oln/core/gen/neighb.hh, oln/core/gen/window.hh,
* oln/core/gen/fwd_qiter_win.hh, oln/core/gen/piter_isubset.hh,
* oln/core/gen/mapimage.hh,
* oln/core/internal/bbox_fwd_piter.hh,
* oln/core/internal/bbox_bkd_piter.hh,
* oln/core/fwd_piter.hh, oln/core/1d/point1d.hh,
* oln/core/1d/dpoint1d.hh, oln/core/2d/point2d.hh,
* oln/core/2d/dpoint2d.hh, oln/core/2d/neighb2d.hh,
* oln/core/3d/point3d.hh, oln/core/3d/dpoint3d.hh,
* oln/core/3d/neighb3d.hh,
* oln/morpher/add_isubset.hh, oln/morpher/add_neighborhood.hh,
* oln/debug/print.hh, oln/io/pnm.hh, oln/level/fill.hh:
Include needed (missing) headers.
* oln/core/1d/image1d.hh, oln/core/2d/image2d.hh,
* oln/core/3d/image3d.hh: Likewise.
Instantiate oln::bbox_ explicitly.
* oln/core/gen/bbox.hh
(oln/core/gen/bbox_fwd_piter.hh, oln/core/gen/bbox_bkd_piter.hh):
Don't include them.
* oln/core/gen/topo_bbox.hh (impl_has_large): Typo.
Reorganize the abstract::image hierarchy.
* oln/core/abstract/image/hierarchies.hh: Move inclusions of point
set abstractions...
* oln/core/abstract/image/all.hh: ...here (new file).
* oln/core/image_entry.hh: Adjust.
* oln/Makefile.am (nobase_oln_HEADERS): Adjust.
* oln/basics1d.hh, oln/basics2d.hh, oln/basics3d.hh: Remove
explicit template instantiations.
* oln/core/abstract/image.hh
(oln/core/abstract/image/hierarchies.hh): Don't include it.
* oln/core/abstract/image/dimension/hierarchy.hh
* oln/core/abstract/image/type/hierarchy.hh,
* oln/core/abstract/image/neighborhood/hierarchy.hh
* oln/core/abstract/image/bbox/hierarchy.hh
* oln/core/abstract/image/accessibility/hierarchy.hh
* oln/core/abstract/image/mutability/hierarchy.hh
* oln/core/abstract/image/hybrid/classical.hh
(oln/core/abstract/image/hierarchies.hh): Include it.
* oln/core/abstract/image/type/integre.hh
(oln::abstract::case_<image_hierarchy_wrt_type, E, 4>)
(oln::abstract::case_<image_hierarchy_wrt_type, E, 5>)
(oln::abstract::case_<image_hierarchy_wrt_type, E, 6>): Catch up
with image type hierarchy.
Reorganize the abstract::point_set hierarchy.
* oln/core/abstract/point_set_hierarchies.hh: Rename as...
* oln/core/abstract/point_set/hierarchies.hh: ...this.
Move inclusions of point set abstractions...
* oln/core/abstract/point_set/all.hh: ...here (new file).
* oln/core/point_set_entry.hh: Adjust.
* oln/core/abstract/point_set_being_connected.hh,
* oln/core/abstract/point_set_being_random_accessible.hh,
* oln/core/abstract/point_set_having_bbox.hh,
* oln/core/abstract/point_set_having_known_size.hh: Rename as...
* oln/core/abstract/point_set/point_set_being_connected.hh,
* oln/core/abstract/point_set/point_set_being_random_accessible.hh,
* oln/core/abstract/point_set/point_set_having_bbox.hh,
* oln/core/abstract/point_set/point_set_having_known_size.hh:
...these.
Adjust header guards and inclusions.
* oln/Makefile.am (nobase_oln_HEADERS): Adjust.
* oln/core/abstract/bbox.hh
(oln::case_<point_set_hierarchy_wrt_bbox, E, 1>)
(oln::case_<point_set_hierarchy_wrt_bbox, E, 2>): Move...
* oln/core/abstract/point_set/point_set_having_bbox.hh: ...here.
(oln::abstract::point_set_having_bbox):
s/oln_type_of/oln_check_type_of/g.
Reorganize the abstract::topology hierarchy.
* oln/core/abstract/topology_hierarchies.hh: Rename as...
* oln/core/abstract/topology/hierarchies.hh: ...this.
Move inclusions of topology abstractions...
* oln/core/abstract/topology/all.hh: ...here (new file).
* oln/core/topology_entry.hh: Adjust
* oln/core/abstract/topology_being_random_accessible.hh,
* oln/core/abstract/topology_having_bbox.hh,
* oln/core/abstract/topology_having_neighborhood.hh,
* oln/core/abstract/topology_having_subset.hh: Rename as...
* oln/core/abstract/topology/topology_being_random_accessible.hh,
* oln/core/abstract/topology/topology_having_bbox.hh,
* oln/core/abstract/topology/topology_having_neighborhood.hh,
* oln/core/abstract/topology/topology_having_subset.hh: ...these.
Adjust header guards and inclusions.
* oln/Makefile.am (nobase_oln_HEADERS): Adjust.
Makefile.am | 36 +++----
basics1d.hh | 7 -
basics2d.hh | 1
basics3d.hh | 7 -
core/1d/dpoint1d.hh | 3
core/1d/image1d.hh | 9 +
core/1d/neighb1d.hh | 2
core/1d/point1d.hh | 4
core/2d/dpoint2d.hh | 3
core/2d/image2d.hh | 9 +
core/2d/neighb2d.hh | 2
core/2d/point2d.hh | 4
core/3d/dpoint3d.hh | 2
core/3d/image3d.hh | 9 +
core/3d/neighb3d.hh | 2
core/3d/point3d.hh | 4
core/abstract/bbox.hh | 19 ----
core/abstract/image.hh | 3
core/abstract/image/accessibility/hierarchy.hh | 1
core/abstract/image/all.hh | 50 +++++++++++
core/abstract/image/bbox/hierarchy.hh | 13 +-
core/abstract/image/dimension/hierarchy.hh | 1
core/abstract/image/hierarchies.hh | 23 -----
core/abstract/image/hybrid/classical.hh | 5 +
core/abstract/image/mutability/hierarchy.hh | 9 +
core/abstract/image/neighborhood/hierarchy.hh | 15 +--
core/abstract/image/type/hierarchy.hh | 13 +-
core/abstract/image/type/integre.hh | 12 +-
core/abstract/point_set.hh | 5 -
core/abstract/point_set/all.hh | 45 +++++++++
core/abstract/point_set/hierarchies.hh | 9 -
core/abstract/point_set/point_set_being_connected.hh | 7 -
core/abstract/point_set/point_set_being_random_accessible.hh | 7 -
core/abstract/point_set/point_set_having_bbox.hh | 39 ++++++--
core/abstract/point_set/point_set_having_known_size.hh | 8 -
core/abstract/topology.hh | 5 -
core/abstract/topology/all.hh | 45 +++++++++
core/abstract/topology/hierarchies.hh | 15 ---
core/abstract/topology/topology_being_random_accessible.hh | 7 -
core/abstract/topology/topology_having_bbox.hh | 7 -
core/abstract/topology/topology_having_neighborhood.hh | 7 -
core/abstract/topology/topology_having_subset.hh | 7 -
core/fwd_piter.hh | 3
core/gen/bbox.hh | 4
core/gen/fwd_qiter_win.hh | 3
core/gen/mapimage.hh | 4
core/gen/neighb.hh | 1
core/gen/piter_isubset.hh | 3
core/gen/topo_bbox.hh | 4
core/gen/window.hh | 2
core/image_entry.hh | 2
core/internal/bbox_bkd_piter.hh | 1
core/internal/bbox_fwd_piter.hh | 1
core/point_set_entry.hh | 3
core/topology_entry.hh | 3
debug/print.hh | 3
io/pnm.hh | 6 +
level/fill.hh | 1
morpher/add_isubset.hh | 2
morpher/add_neighborhood.hh | 1
60 files changed, 332 insertions(+), 196 deletions(-)
Index: oln/debug/print.hh
--- oln/debug/print.hh (revision 616)
+++ oln/debug/print.hh (working copy)
@@ -30,6 +30,9 @@
# include <iostream>
# include <oln/core/abstract/image.hh>
+# include <oln/core/abstract/image/hybrid/classical.hh>
+# include <oln/core/abstract/iterator.hh>
+# include <oln/core/2d/point2d.hh>
namespace oln
Index: oln/level/fill.hh
--- oln/level/fill.hh (revision 616)
+++ oln/level/fill.hh (working copy)
@@ -33,6 +33,7 @@
# include <mlc/is_a.hh>
# include <oln/core/abstract/image.hh>
+# include <oln/core/abstract/iterator.hh>
# include <oln/core/automatic/image_being_mutable.hh>
Index: oln/basics1d.hh
--- oln/basics1d.hh (revision 616)
+++ oln/basics1d.hh (working copy)
@@ -35,25 +35,18 @@
# include <oln/core/1d/grid1d.hh>
# include <oln/core/1d/point1d.hh>
-namespace oln { template class point1d_<int>; }
# include <oln/core/1d/dpoint1d.hh>
-namespace oln { template class dpoint1d_<int>; }
# include <oln/core/gen/bbox.hh>
-namespace oln { template class bbox_<point1d>; }
# include <oln/core/gen/topo_lbbox.hh>
-namespace oln { template class topo_lbbox_<point1d>; }
# include <oln/core/gen/fwd_piter_bbox.hh>
-namespace oln { template class fwd_piter_bbox_<topo1d>; }
# include <oln/core/gen/bkd_piter_bbox.hh>
-namespace oln { template class bkd_piter_bbox_<topo1d>; }
# include <oln/core/gen/neighb.hh>
-namespace oln { template class neighb_<dpoint1d>; }
# include <oln/core/1d/neighb1d.hh>
# include <oln/core/1d/image1d.hh>
Index: oln/io/pnm.hh
--- oln/io/pnm.hh (revision 616)
+++ oln/io/pnm.hh (working copy)
@@ -33,6 +33,12 @@
# include <fstream>
# include <string>
+# include <oln/core/abstract/iterator.hh>
+# include <oln/core/gen/fwd_piter_bbox.hh>
+# include <oln/core/gen/bkd_piter_bbox.hh>
+# include <oln/core/fwd_piter.hh>
+# include <oln/core/2d/aliases.hh>
+# include <oln/core/2d/dpoint2d.hh>
# include <oln/core/2d/image2d.hh>
Index: oln/core/fwd_piter.hh
--- oln/core/fwd_piter.hh (revision 616)
+++ oln/core/fwd_piter.hh (working copy)
@@ -30,6 +30,9 @@
# include <oln/core/abstract/entry.hh>
# include <oln/core/abstract/image.hh>
+# include <oln/core/1d/aliases.hh>
+# include <oln/core/2d/aliases.hh>
+# include <oln/core/3d/aliases.hh>
namespace oln
Index: oln/core/point_set_entry.hh
--- oln/core/point_set_entry.hh (revision 616)
+++ oln/core/point_set_entry.hh (working copy)
@@ -29,8 +29,7 @@
# define OLN_CORE_POINT_SET_ENTRY_HH
# include <oln/core/abstract/entry.hh>
-# include <oln/core/abstract/point_set.hh>
-
+# include <oln/core/abstract/point_set/all.hh>
namespace oln
Index: oln/core/topology_entry.hh
--- oln/core/topology_entry.hh (revision 616)
+++ oln/core/topology_entry.hh (working copy)
@@ -29,8 +29,7 @@
# define OLN_CORE_TOPOLOGY_ENTRY_HH
# include <oln/core/abstract/entry.hh>
-# include <oln/core/abstract/topology.hh>
-
+# include <oln/core/abstract/topology/all.hh>
namespace oln
Index: oln/core/image_entry.hh
--- oln/core/image_entry.hh (revision 616)
+++ oln/core/image_entry.hh (working copy)
@@ -29,7 +29,7 @@
# define OLN_CORE_IMAGE_ENTRY_HH
# include <oln/core/abstract/entry.hh>
-# include <oln/core/abstract/image.hh>
+# include <oln/core/abstract/image/all.hh>
Index: oln/core/abstract/image.hh
--- oln/core/abstract/image.hh (revision 616)
+++ oln/core/abstract/image.hh (working copy)
@@ -179,7 +179,4 @@
} // end of namespace oln
-# include <oln/core/abstract/image/hierarchies.hh>
-
-
#endif // ! OLN_CORE_ABSTRACT_IMAGE_HH
Index: oln/core/abstract/image/hybrid/classical.hh
--- oln/core/abstract/image/hybrid/classical.hh (revision 616)
+++ oln/core/abstract/image/hybrid/classical.hh (working copy)
@@ -29,6 +29,7 @@
# define OLN_CORE_ABSTRACT_IMAGE_HYBRID_CLASSICAL_HH
# include <oln/core/abstract/image.hh>
+# include <oln/core/abstract/image/hierarchies.hh>
# include <oln/core/abstract/image/dimension/2d.hh>
# include <oln/core/abstract/image/bbox/hierarchy.hh>
@@ -77,6 +78,10 @@
} // end of namespace oln::abstract
+ // Fwd. decl.
+ class grid2d;
+
+
/// 2-D case.
template <typename E>
struct case_< image_hybrid_hierarchy_wrt_classical, E, 1 > :
Index: oln/core/abstract/image/type/integre.hh
--- oln/core/abstract/image/type/integre.hh (revision 616)
+++ oln/core/abstract/image/type/integre.hh (working copy)
@@ -108,34 +108,34 @@
/// Grey-level case.
template <typename E>
struct case_< image_hierarchy_wrt_type, E, 4 > :
- where_< mlc_is_a( mlc_comma_1(oln_type_of(E, value)), ntg::real_value ) >
+ where_< mlc_is_a( oln_type_of(E, value), ntg::real_value ) >
{
// Definition of the super class corresponding to this case
// (abstract::grey_level_image_ is the conjunction of
// abstract::grey_level_image and abstract::not_binary_image).
- typedef abstract::internal::grey_level_image_<E> ret;
+ typedef abstract::grey_level_image<E> ret;
};
/// Label case.
template <typename E>
struct case_< image_hierarchy_wrt_type, E, 5 > :
- where_< mlc_is_a( mlc_comma_1(oln_type_of(E, value)), ntg::enum_value ) >
+ where_< mlc_is_a( oln_type_of(E, value), ntg::enum_value ) >
{
// Definition of the super class corresponding to this case
// (abstract::label_image_ is the conjunction of
// abstract::label_image and abstract::not_binary_image).
- typedef abstract::internal::label_image_<E> ret;
+ typedef abstract::label_image<E> ret;
};
/// Color case.
template <typename E>
struct case_< image_hierarchy_wrt_type, E, 6 > :
- where_< mlc_is_a( mlc_comma_1(oln_type_of(E, value)), ntg::color_value ) >
+ where_< mlc_is_a( oln_type_of(E, value), ntg::color_value ) >
{
// Definition of the super class corresponding to this case
// (abstract::color_image_ is the conjunction of
// abstract::color_image and abstract::not_binary_image).
- typedef abstract::internal::color_image_<E> ret;
+ typedef abstract::color_image<E> ret;
};
/// \}
Index: oln/core/abstract/image/type/hierarchy.hh
--- oln/core/abstract/image/type/hierarchy.hh (revision 616)
+++ oln/core/abstract/image/type/hierarchy.hh (working copy)
@@ -28,8 +28,9 @@
#ifndef OLN_CORE_ABSTRACT_IMAGE_TYPE_HIERARCHY_HH
# define OLN_CORE_ABSTRACT_IMAGE_TYPE_HIERARCHY_HH
-# include <xtd/valtraits.hh>
# include <oln/core/abstract/image.hh>
+# include <oln/core/abstract/image/hierarchies.hh>
+# include <xtd/valtraits.hh>
/* Image ``type'' hierarchy (summary).
@@ -38,7 +39,7 @@
/image<I>/
^
|
- ,--------------+-------------+-------------+--------+
+ ,--------------+-------------+-------------+--------.
| | | | |
/grey_level_image/ /color_image/ /label_image/ /data_image/ ...
^ ^ ^ ^ ^ ^
@@ -46,10 +47,10 @@
| | | /binary_image/ | |
| | | ^ | |
| | | | | |
- ,----------------------------------------------------------.
- | The selection of the super class(es) is made according |
- | to the value of type_of(I, value). |
- `----------------------------------------------------------'
+ ,-------------------------------------------------------------.
+ | The selection of the super class(es) is made according to |
+ | the value of type_of(I, value). |
+ `-------------------------------------------------------------'
| | | | | |
o o o o o o
Index: oln/core/abstract/image/mutability/hierarchy.hh
--- oln/core/abstract/image/mutability/hierarchy.hh (revision 616)
+++ oln/core/abstract/image/mutability/hierarchy.hh (working copy)
@@ -29,6 +29,7 @@
# define OLN_CORE_ABSTRACT_IMAGE_MUTABILITY_HIERARCHY_HH
# include <oln/core/abstract/image.hh>
+# include <oln/core/abstract/image/hierarchies.hh>
# include <oln/core/automatic/image_being_mutable.hh>
@@ -37,7 +38,7 @@
{
/*-------------------------.
- | Dimension abstractions. |
+ | Mutability abstraction. |
`-------------------------*/
namespace abstract
@@ -105,9 +106,9 @@
} // end of namespace oln::abstract
- /*-------------------.
- | Dimension switch. |
- `-------------------*/
+ /*--------------------.
+ | Mutability switch. |
+ `--------------------*/
/// With mutability.
template <typename E>
Index: oln/core/abstract/image/hierarchies.hh
--- oln/core/abstract/image/hierarchies.hh (revision 616)
+++ oln/core/abstract/image/hierarchies.hh (working copy)
@@ -52,27 +52,4 @@
} // end of namespace oln
-
-// Hierarchy 1: image w.r.t. dimension.
-# include <oln/core/abstract/image/dimension/hierarchy.hh>
-
-// Hierarchy 2: image w.r.t. type of data.
-# include <oln/core/abstract/image/type/hierarchy.hh>
-
-// Hierarchy 3: image w.r.t. neighborhood.
-# include <oln/core/abstract/image/neighborhood/hierarchy.hh>
-
-// Hierarchy 4: image w.r.t. bounding box.
-# include <oln/core/abstract/image/bbox/hierarchy.hh>
-
-// Hierarchy 5: image w.r.t. accessibility.
-# include <oln/core/abstract/image/accessibility/hierarchy.hh>
-
-// Hierarchy 6: image w.r.t. data mutability.
-# include <oln/core/abstract/image/mutability/hierarchy.hh>
-
-// Hybrid hierarchy 7: image w.r.t. classical features.
-# include <oln/core/abstract/image/hybrid/classical.hh>
-
-
#endif // ! OLN_CORE_ABSTRACT_IMAGE_HIERARCHIES_HH
Index: oln/core/abstract/image/dimension/hierarchy.hh
--- oln/core/abstract/image/dimension/hierarchy.hh (revision 616)
+++ oln/core/abstract/image/dimension/hierarchy.hh (working copy)
@@ -29,6 +29,7 @@
# define OLN_CORE_ABSTRACT_IMAGE_DIMENSION_HIERARCHY_HH
# include <oln/core/abstract/image.hh>
+# include <oln/core/abstract/image/hierarchies.hh>
/* Image dimension hierarchy (summary).
Index: oln/core/abstract/image/all.hh
--- oln/core/abstract/image/all.hh (revision 0)
+++ oln/core/abstract/image/all.hh (revision 0)
@@ -0,0 +1,50 @@
+// Copyright (C) 2006 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef OLN_CORE_ABSTRACT_IMAGE_ALL_HH
+# define OLN_CORE_ABSTRACT_IMAGE_ALL_HH
+
+# include <oln/core/abstract/image.hh>
+
+# include <oln/core/abstract/image/hierarchies.hh>
+
+// Hierarchy 1: image w.r.t. dimension.
+# include <oln/core/abstract/image/dimension/hierarchy.hh>
+// Hierarchy 2: image w.r.t. type of data.
+# include <oln/core/abstract/image/type/hierarchy.hh>
+// Hierarchy 3: image w.r.t. neighborhood.
+# include <oln/core/abstract/image/neighborhood/hierarchy.hh>
+// Hierarchy 4: image w.r.t. bounding box.
+# include <oln/core/abstract/image/bbox/hierarchy.hh>
+// Hierarchy 5: image w.r.t. accessibility.
+# include <oln/core/abstract/image/accessibility/hierarchy.hh>
+// Hierarchy 6: image w.r.t. data mutability.
+# include <oln/core/abstract/image/mutability/hierarchy.hh>
+// Hybrid hierarchy 7: image w.r.t. classical features.
+# include <oln/core/abstract/image/hybrid/classical.hh>
+
+#endif // ! OLN_CORE_ABSTRACT_IMAGE_ALL_HH
Index: oln/core/abstract/image/accessibility/hierarchy.hh
--- oln/core/abstract/image/accessibility/hierarchy.hh (revision 616)
+++ oln/core/abstract/image/accessibility/hierarchy.hh (working copy)
@@ -29,6 +29,7 @@
# define OLN_CORE_ABSTRACT_IMAGE_ACCESSIBILITY_HIERARCHY_HH
# include <oln/core/abstract/image.hh>
+# include <oln/core/abstract/image/hierarchies.hh>
# include <oln/core/automatic/image_being_random_accessible.hh>
Index: oln/core/abstract/image/neighborhood/hierarchy.hh
--- oln/core/abstract/image/neighborhood/hierarchy.hh (revision 616)
+++ oln/core/abstract/image/neighborhood/hierarchy.hh (working copy)
@@ -29,13 +29,14 @@
# define OLN_CORE_ABSTRACT_IMAGE_NEIGHBORHOOD_HIERARCHY_HH
# include <oln/core/abstract/image.hh>
+# include <oln/core/abstract/image/hierarchies.hh>
# include <oln/core/automatic/image_having_neighborhood.hh>
/* Image having neighborhood hierarchy (summary).
-FIXME: TODO!
+ FIXME: TODO (diagram)!
Default case: If the neighborhood type returned by
@@ -46,9 +47,9 @@
namespace oln
{
- /*-------------------------.
- | Dimension abstractions. |
- `-------------------------*/
+ /*---------------------------.
+ | Neighborhood abstraction. |
+ `---------------------------*/
namespace abstract
{
@@ -109,9 +110,9 @@
} // end of namespace oln::abstract
- /*-------------------.
- | Dimension switch. |
- `-------------------*/
+ /*----------------------.
+ | Neighborhood switch. |
+ `----------------------*/
/// With neighborhood.
template <typename E>
Index: oln/core/abstract/image/bbox/hierarchy.hh
--- oln/core/abstract/image/bbox/hierarchy.hh (revision 616)
+++ oln/core/abstract/image/bbox/hierarchy.hh (working copy)
@@ -29,15 +29,16 @@
# define OLN_CORE_ABSTRACT_IMAGE_BBOX_HIERARCHY_HH
# include <oln/core/abstract/image.hh>
+# include <oln/core/abstract/image/hierarchies.hh>
# include <oln/core/abstract/bbox.hh>
namespace oln
{
- /*-------------------------.
- | Dimension abstractions. |
- `-------------------------*/
+ /*---------------------------.
+ | Bounding box abstraction. |
+ `---------------------------*/
namespace abstract
{
@@ -126,9 +127,9 @@
} // end of namespace oln::abstract
- /*-------------------.
- | Dimension switch. |
- `-------------------*/
+ /*----------------------.
+ | Bounding box switch. |
+ `----------------------*/
/// With bbox.
template <typename E>
Index: oln/core/abstract/bbox.hh
--- oln/core/abstract/bbox.hh (revision 616)
+++ oln/core/abstract/bbox.hh (working copy)
@@ -29,7 +29,7 @@
#ifndef OLN_CORE_ABSTRACT_BBOX_HH
# define OLN_CORE_ABSTRACT_BBOX_HH
-# include <oln/core/abstract/point_set_having_bbox.hh>
+# include <oln/core/abstract/point_set/point_set_having_bbox.hh>
namespace oln
@@ -98,23 +98,6 @@
} // end of namespace oln::abstract
-
- template <typename E>
- struct case_ < point_set_hierarchy_wrt_bbox, E, 1 >
- : where_< mlc::eq_< oln_type_of(E, bbox), E > >
- {
- typedef abstract::bbox<E> ret;
- };
-
-
- template <typename E>
- struct case_ < point_set_hierarchy_wrt_bbox, E, 2 >
- : where_< mlc::neq_< oln_type_of(E, bbox), mlc::none > >
- {
- typedef abstract::point_set_having_bbox<E> ret;
- };
-
-
} // end of namespace oln
Index: oln/core/abstract/point_set.hh
--- oln/core/abstract/point_set.hh (revision 616)
+++ oln/core/abstract/point_set.hh (working copy)
@@ -116,9 +116,4 @@
} // end of namespace oln
-
-# include <oln/core/abstract/point_set_hierarchies.hh>
-
-
-
#endif // ! OLN_CORE_ABSTRACT_POINT_SET_HH
Index: oln/core/abstract/point_set/point_set_being_random_accessible.hh
--- oln/core/abstract/point_set/point_set_being_random_accessible.hh (revision 0)
+++ oln/core/abstract/point_set/point_set_being_random_accessible.hh (working copy)
@@ -25,10 +25,11 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef OLN_CORE_ABSTRACT_POINT_SET_BEING_RANDOM_ACCESSIBLE_HH
-# define OLN_CORE_ABSTRACT_POINT_SET_BEING_RANDOM_ACCESSIBLE_HH
+#ifndef OLN_CORE_ABSTRACT_POINT_SET_POINT_SET_BEING_RANDOM_ACCESSIBLE_HH
+# define OLN_CORE_ABSTRACT_POINT_SET_POINT_SET_BEING_RANDOM_ACCESSIBLE_HH
# include <oln/core/abstract/point_set.hh>
+# include <oln/core/abstract/point_set/hierarchies.hh>
@@ -83,4 +84,4 @@
} // end of namespace oln
-#endif // ! OLN_CORE_ABSTRACT_POINT_SET_BEING_RANDOM_ACCESSIBLE_HH
+#endif // ! OLN_CORE_ABSTRACT_POINT_SET_POINT_SET_BEING_RANDOM_ACCESSIBLE_HH
Index: oln/core/abstract/point_set/point_set_having_known_size.hh
--- oln/core/abstract/point_set/point_set_having_known_size.hh (revision 0)
+++ oln/core/abstract/point_set/point_set_having_known_size.hh (working copy)
@@ -25,11 +25,11 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef OLN_CORE_ABSTRACT_POINT_SET_HAVING_KNOWN_SIZE_HH
-# define OLN_CORE_ABSTRACT_POINT_SET_HAVING_KNOWN_SIZE_HH
+#ifndef OLN_CORE_ABSTRACT_POINT_SET_POINT_SET_HAVING_KNOWN_SIZE_HH
+# define OLN_CORE_ABSTRACT_POINT_SET_POINT_SET_HAVING_KNOWN_SIZE_HH
# include <oln/core/abstract/point_set.hh>
-
+# include <oln/core/abstract/point_set/hierarchies.hh>
namespace oln
@@ -82,5 +82,5 @@
} // end of namespace oln
-#endif // ! OLN_CORE_ABSTRACT_POINT_SET_HAVING_KNOWN_SIZE_HH
+#endif // ! OLN_CORE_ABSTRACT_POINT_SET_POINT_SET_HAVING_KNOWN_SIZE_HH
Index: oln/core/abstract/point_set/hierarchies.hh
--- oln/core/abstract/point_set/hierarchies.hh (revision 0)
+++ oln/core/abstract/point_set/hierarchies.hh (working copy)
@@ -28,6 +28,7 @@
#ifndef OLN_CORE_ABSTRACT_POINT_SET_HIERARCHIES_HH
# define OLN_CORE_ABSTRACT_POINT_SET_HIERARCHIES_HH
+# include <oln/core/abstract/entry.hh>
# include <oln/core/abstract/point_set.hh>
@@ -42,13 +43,5 @@
} // end of namespace oln
-# include <oln/core/abstract/point_set_having_known_size.hh>
-# include <oln/core/abstract/point_set_being_random_accessible.hh>
-# include <oln/core/abstract/point_set_having_bbox.hh>
-# include <oln/core/abstract/bbox.hh>
-# include <oln/core/abstract/point_set_being_connected.hh>
-
-
-
#endif // ! OLN_CORE_ABSTRACT_POINT_SET_HIERARCHIES_HH
Index: oln/core/abstract/point_set/all.hh
--- oln/core/abstract/point_set/all.hh (revision 0)
+++ oln/core/abstract/point_set/all.hh (revision 0)
@@ -0,0 +1,45 @@
+// Copyright (C) 2006 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef OLN_CORE_ABSTRACT_POINT_SET_ALL_HH
+# define OLN_CORE_ABSTRACT_POINT_SET_ALL_HH
+
+# include <oln/core/abstract/point_set.hh>
+
+# include <oln/core/abstract/point_set/hierarchies.hh>
+
+// Hierarchy 1: point set w.r.t. size.
+# include <oln/core/abstract/point_set/point_set_having_known_size.hh>
+// Hierarchy 2: point set w.r.t. accessibility.
+# include <oln/core/abstract/point_set/point_set_being_random_accessible.hh>
+// Hierarchy 3: point set w.r.t. bbox.
+# include <oln/core/abstract/point_set/point_set_having_bbox.hh>
+# include <oln/core/abstract/bbox.hh>
+// Hierarchy 4: point set w.r.t. connexity.
+# include <oln/core/abstract/point_set/point_set_being_connected.hh>
+
+#endif // ! OLN_CORE_ABSTRACT_POINT_SET_ALL_HH
Index: oln/core/abstract/point_set/point_set_being_connected.hh
--- oln/core/abstract/point_set/point_set_being_connected.hh (revision 0)
+++ oln/core/abstract/point_set/point_set_being_connected.hh (working copy)
@@ -25,10 +25,11 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef OLN_CORE_ABSTRACT_POINT_SET_BEING_CONNECTED_HH
-# define OLN_CORE_ABSTRACT_POINT_SET_BEING_CONNECTED_HH
+#ifndef OLN_CORE_ABSTRACT_POINT_SET_POINT_SET_BEING_CONNECTED_HH
+# define OLN_CORE_ABSTRACT_POINT_SET_POINT_SET_BEING_CONNECTED_HH
# include <oln/core/abstract/point_set.hh>
+# include <oln/core/abstract/point_set/hierarchies.hh>
namespace oln
@@ -198,4 +199,4 @@
} // end of namespace oln
-#endif // ! OLN_CORE_ABSTRACT_POINT_SET_BEING_CONNECTED_HH
+#endif // ! OLN_CORE_ABSTRACT_POINT_SET_POINT_SET_BEING_CONNECTED_HH
Index: oln/core/abstract/point_set/point_set_having_bbox.hh
--- oln/core/abstract/point_set/point_set_having_bbox.hh (revision 0)
+++ oln/core/abstract/point_set/point_set_having_bbox.hh (working copy)
@@ -25,10 +25,11 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef OLN_CORE_ABSTRACT_POINT_SET_HAVING_BBOX_HH
-# define OLN_CORE_ABSTRACT_POINT_SET_HAVING_BBOX_HH
+#ifndef OLN_CORE_ABSTRACT_POINT_SET_POINT_SET_HAVING_BBOX_HH
+# define OLN_CORE_ABSTRACT_POINT_SET_POINT_SET_HAVING_BBOX_HH
# include <oln/core/abstract/point_set.hh>
+# include <oln/core/abstract/point_set/hierarchies.hh>
namespace oln
@@ -37,15 +38,14 @@
namespace abstract
{
-
template <typename E>
class point_set_having_bbox : public virtual point_set<E>
{
- typedef oln_type_of(E, point) point_t;
- typedef oln_type_of(E, bbox) bbox_t;
+ typedef oln_check_type_of(E, point) point_t;
+ typedef oln_check_type_of(E, bbox) bbox_t;
- typedef oln_type_of(point_t, coord) coord_t;
- typedef oln_type_of(point_t, dim) dim_t;
+ typedef oln_check_type_of(point_t, coord) coord_t;
+ typedef oln_check_type_of(point_t, dim) dim_t;
enum { n = mlc_value(dim_t) };
public:
@@ -129,11 +129,30 @@
} // end of namespace oln::abstract
- // an abstract sub-class of point_set_having_bbox<E> is abstract::bbox<E>;
- // the switch-case mechanism is in oln/core/abstract/bbox.hh
+ // Fwd. decl.
+ namespace abstract
+ {
+ template <typename E> class bbox;
+ }
+
+
+ template <typename E>
+ struct case_ < point_set_hierarchy_wrt_bbox, E, 1 >
+ : where_< mlc::eq_< oln_type_of(E, bbox), E > >
+ {
+ typedef abstract::bbox<E> ret;
+ };
+
+
+ template <typename E>
+ struct case_ < point_set_hierarchy_wrt_bbox, E, 2 >
+ : where_< mlc::neq_< oln_type_of(E, bbox), mlc::none > >
+ {
+ typedef abstract::point_set_having_bbox<E> ret;
+ };
} // end of namespace oln
-#endif // ! OLN_CORE_ABSTRACT_POINT_SET_HAVING_BBOX_HH
+#endif // ! OLN_CORE_ABSTRACT_POINT_SET_POINT_SET_HAVING_BBOX_HH
Index: oln/core/abstract/topology.hh
--- oln/core/abstract/topology.hh (revision 616)
+++ oln/core/abstract/topology.hh (working copy)
@@ -101,9 +101,4 @@
} // end of namespace oln
-
-# include <oln/core/abstract/topology_hierarchies.hh>
-
-
-
#endif // ! OLN_CORE_ABSTRACT_TOPOLOGY_HH
Index: oln/core/abstract/topology/topology_having_bbox.hh
--- oln/core/abstract/topology/topology_having_bbox.hh (revision 0)
+++ oln/core/abstract/topology/topology_having_bbox.hh (working copy)
@@ -25,10 +25,11 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef OLN_CORE_ABSTRACT_TOPOLOGY_HAVING_BBOX_HH
-# define OLN_CORE_ABSTRACT_TOPOLOGY_HAVING_BBOX_HH
+#ifndef OLN_CORE_ABSTRACT_TOPOLOGY_TOPOLOGY_HAVING_BBOX_HH
+# define OLN_CORE_ABSTRACT_TOPOLOGY_TOPOLOGY_HAVING_BBOX_HH
# include <oln/core/abstract/topology.hh>
+# include <oln/core/abstract/topology/hierarchies.hh>
# include <oln/core/automatic/topology_having_bbox.hh>
@@ -106,4 +107,4 @@
} // end of namespace oln
-#endif // ! OLN_CORE_ABSTRACT_TOPOLOGY_HAVING_BBOX_HH
+#endif // ! OLN_CORE_ABSTRACT_TOPOLOGY_TOPOLOGY_HAVING_BBOX_HH
Index: oln/core/abstract/topology/hierarchies.hh
--- oln/core/abstract/topology/hierarchies.hh (revision 0)
+++ oln/core/abstract/topology/hierarchies.hh (working copy)
@@ -28,6 +28,7 @@
#ifndef OLN_CORE_ABSTRACT_TOPOLOGY_HIERARCHIES_HH
# define OLN_CORE_ABSTRACT_TOPOLOGY_HIERARCHIES_HH
+# include <oln/core/abstract/entry.hh>
# include <oln/core/abstract/topology.hh>
@@ -42,19 +43,5 @@
} // end of namespace oln
-// Hierarchy 1: topology w.r.t. accessibility.
-# include <oln/core/abstract/topology_being_random_accessible.hh>
-
-// Hierarchy 2: topology w.r.t. bounding box.
-# include <oln/core/abstract/topology_having_bbox.hh>
-
-// Hierarchy 3: topology w.r.t. neighborhood.
-# include <oln/core/abstract/topology_having_neighborhood.hh>
-
-// Hierarchy 4: topology w.r.t. neighborhood.
-# include <oln/core/abstract/topology_having_subset.hh>
-
-
-
#endif // ! OLN_CORE_ABSTRACT_TOPOLOGY_HIERARCHIES_HH
Index: oln/core/abstract/topology/all.hh
--- oln/core/abstract/topology/all.hh (revision 0)
+++ oln/core/abstract/topology/all.hh (revision 0)
@@ -0,0 +1,45 @@
+// Copyright (C) 2006 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef OLN_CORE_ABSTRACT_TOPOLOGY_ALL_HH
+# define OLN_CORE_ABSTRACT_TOPOLOGY_ALL_HH
+
+# include <oln/core/abstract/topology.hh>
+
+# include <oln/core/abstract/topology/hierarchies.hh>
+
+// Hierarchy 1: topology w.r.t. accessibility.
+# include <oln/core/abstract/topology/topology_being_random_accessible.hh>
+// Hierarchy 2: topology w.r.t. bounding box.
+# include <oln/core/abstract/topology/topology_having_bbox.hh>
+// Hierarchy 3: topology w.r.t. neighborhood.
+# include <oln/core/abstract/topology/topology_having_neighborhood.hh>
+// Hierarchy 4: topology w.r.t. subset.
+# include <oln/core/abstract/topology/topology_having_subset.hh>
+
+#endif // ! OLN_CORE_ABSTRACT_TOPOLOGY_ALL_HH
+
Index: oln/core/abstract/topology/topology_being_random_accessible.hh
--- oln/core/abstract/topology/topology_being_random_accessible.hh (revision 0)
+++ oln/core/abstract/topology/topology_being_random_accessible.hh (working copy)
@@ -25,10 +25,11 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef OLN_CORE_ABSTRACT_TOPOLOGY_BEING_RANDOM_ACCESSIBLE_HH
-# define OLN_CORE_ABSTRACT_TOPOLOGY_BEING_RANDOM_ACCESSIBLE_HH
+#ifndef OLN_CORE_ABSTRACT_TOPOLOGY_TOPOLOGY_BEING_RANDOM_ACCESSIBLE_HH
+# define OLN_CORE_ABSTRACT_TOPOLOGY_TOPOLOGY_BEING_RANDOM_ACCESSIBLE_HH
# include <oln/core/abstract/topology.hh>
+# include <oln/core/abstract/topology/hierarchies.hh>
# include <oln/core/automatic/topology_being_random_accessible.hh>
@@ -94,4 +95,4 @@
} // end of namespace oln
-#endif // ! OLN_CORE_ABSTRACT_TOPOLOGY_BEING_RANDOM_ACCESSIBLE_HH
+#endif // ! OLN_CORE_ABSTRACT_TOPOLOGY_TOPOLOGY_BEING_RANDOM_ACCESSIBLE_HH
Index: oln/core/abstract/topology/topology_having_subset.hh
--- oln/core/abstract/topology/topology_having_subset.hh (revision 0)
+++ oln/core/abstract/topology/topology_having_subset.hh (working copy)
@@ -25,10 +25,11 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef OLN_CORE_ABSTRACT_TOPOLOGY_HAVING_SUBSET_HH
-# define OLN_CORE_ABSTRACT_TOPOLOGY_HAVING_SUBSET_HH
+#ifndef OLN_CORE_ABSTRACT_TOPOLOGY_TOPOLOGY_HAVING_SUBSET_HH
+# define OLN_CORE_ABSTRACT_TOPOLOGY_TOPOLOGY_HAVING_SUBSET_HH
# include <oln/core/abstract/topology.hh>
+# include <oln/core/abstract/topology/hierarchies.hh>
# include <oln/core/automatic/topology_having_subset.hh>
@@ -86,4 +87,4 @@
} // end of namespace oln
-#endif // ! OLN_CORE_ABSTRACT_TOPOLOGY_HAVING_SUBSET_HH
+#endif // ! OLN_CORE_ABSTRACT_TOPOLOGY_TOPOLOGY_HAVING_SUBSET_HH
Index: oln/core/abstract/topology/topology_having_neighborhood.hh
--- oln/core/abstract/topology/topology_having_neighborhood.hh (revision 0)
+++ oln/core/abstract/topology/topology_having_neighborhood.hh (working copy)
@@ -25,10 +25,11 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef OLN_CORE_ABSTRACT_TOPOLOGY_HAVING_NEIGHBORHOOD_HH
-# define OLN_CORE_ABSTRACT_TOPOLOGY_HAVING_NEIGHBORHOOD_HH
+#ifndef OLN_CORE_ABSTRACT_TOPOLOGY_TOPOLOGY_HAVING_NEIGHBORHOOD_HH
+# define OLN_CORE_ABSTRACT_TOPOLOGY_TOPOLOGY_HAVING_NEIGHBORHOOD_HH
# include <oln/core/abstract/topology.hh>
+# include <oln/core/abstract/topology/hierarchies.hh>
# include <oln/core/automatic/topology_having_neighborhood.hh>
@@ -97,4 +98,4 @@
} // end of namespace oln
-#endif // ! OLN_CORE_ABSTRACT_TOPOLOGY_HAVING_NEIGHBORHOOD_HH
+#endif // ! OLN_CORE_ABSTRACT_TOPOLOGY_TOPOLOGY_HAVING_NEIGHBORHOOD_HH
Index: oln/core/1d/neighb1d.hh
--- oln/core/1d/neighb1d.hh (revision 616)
+++ oln/core/1d/neighb1d.hh (working copy)
@@ -30,7 +30,7 @@
# define OLN_CORE_1D_NEIGHB1D_HH
# include <oln/core/gen/neighb.hh>
-# include <oln/core/1d/aliases.hh>
+# include <oln/core/1d/dpoint1d.hh>
namespace oln
Index: oln/core/1d/dpoint1d.hh
--- oln/core/1d/dpoint1d.hh (revision 616)
+++ oln/core/1d/dpoint1d.hh (working copy)
@@ -32,6 +32,8 @@
# include <mlc/int.hh>
# include <oln/core/1d/point1d.hh>
# include <oln/core/internal/dpoint_nd.hh>
+// For oln::dpoint1d and oln::dpoint1df.
+# include <oln/core/1d/aliases.hh>
namespace oln
@@ -95,4 +97,5 @@
} // end of namespace oln
+
#endif // ! OLN_CORE_1D_DPOINT1D_HH
Index: oln/core/1d/image1d.hh
--- oln/core/1d/image1d.hh (revision 616)
+++ oln/core/1d/image1d.hh (working copy)
@@ -31,12 +31,21 @@
# include <oln/core/image_entry.hh>
# include <oln/core/1d/array1d.hh>
+# include <oln/core/1d/point1d.hh>
+# include <oln/core/gen/topo_lbbox.hh>
# include <oln/core/internal/tracked_ptr.hh>
+// For topo1d.
+# include <oln/core/1d/aliases.hh>
namespace oln
{
+ // FIXME: Inexplicably, this explicit instantiation is required to
+ // have topo_lbbox_<point1d> work. See if we can get rid of it.
+ template class bbox_<point1d>;
+
+
// Forward declaration.
template <typename T> class image1d;
Index: oln/core/1d/point1d.hh
--- oln/core/1d/point1d.hh (revision 616)
+++ oln/core/1d/point1d.hh (working copy)
@@ -31,6 +31,8 @@
# include <mlc/int.hh>
# include <oln/core/internal/point_nd.hh>
+// For oln::point1d and oln::point1df.
+# include <oln/core/1d/aliases.hh>
namespace oln
@@ -102,7 +104,5 @@
} // end of namespace oln
-# include <oln/core/1d/dpoint1d.hh>
-
#endif // ! OLN_CORE_1D_POINT1D_HH
Index: oln/core/2d/neighb2d.hh
--- oln/core/2d/neighb2d.hh (revision 616)
+++ oln/core/2d/neighb2d.hh (working copy)
@@ -30,7 +30,7 @@
# define OLN_CORE_2D_NEIGHB2D_HH
# include <oln/core/gen/neighb.hh>
-# include <oln/core/2d/aliases.hh>
+# include <oln/core/2d/dpoint2d.hh>
namespace oln
Index: oln/core/2d/dpoint2d.hh
--- oln/core/2d/dpoint2d.hh (revision 616)
+++ oln/core/2d/dpoint2d.hh (working copy)
@@ -32,6 +32,8 @@
# include <mlc/int.hh>
# include <oln/core/2d/point2d.hh>
# include <oln/core/internal/dpoint_nd.hh>
+// For oln::dpoint2d and oln::dpoint2df.
+# include <oln/core/2d/aliases.hh>
namespace oln
@@ -121,6 +123,7 @@
# endif
+
} // end of namespace oln
Index: oln/core/2d/image2d.hh
--- oln/core/2d/image2d.hh (revision 616)
+++ oln/core/2d/image2d.hh (working copy)
@@ -31,12 +31,21 @@
# include <oln/core/image_entry.hh>
# include <oln/core/2d/array2d.hh>
+# include <oln/core/2d/point2d.hh>
+# include <oln/core/gen/topo_lbbox.hh>
# include <oln/core/internal/tracked_ptr.hh>
+// For topo2d.
+# include <oln/core/2d/aliases.hh>
namespace oln
{
+ // FIXME: Inexplicably, this explicit instantiation is required to
+ // have topo_lbbox_<point2d> work. See if we can get rid of it.
+ template class bbox_<point2d>;
+
+
// Forward declaration.
template <typename T> class image2d;
Index: oln/core/2d/point2d.hh
--- oln/core/2d/point2d.hh (revision 616)
+++ oln/core/2d/point2d.hh (working copy)
@@ -31,6 +31,8 @@
# include <mlc/int.hh>
# include <oln/core/internal/point_nd.hh>
+// For oln::point2d and oln::point2df.
+# include <oln/core/2d/aliases.hh>
namespace oln
@@ -140,7 +142,5 @@
} // end of namespace oln
-# include <oln/core/2d/dpoint2d.hh>
-
#endif // ! OLN_CORE_2D_POINT2D_HH
Index: oln/core/3d/neighb3d.hh
--- oln/core/3d/neighb3d.hh (revision 616)
+++ oln/core/3d/neighb3d.hh (working copy)
@@ -30,7 +30,7 @@
# define OLN_CORE_3D_NEIGHB3D_HH
# include <oln/core/gen/neighb.hh>
-# include <oln/core/3d/aliases.hh>
+# include <oln/core/3d/dpoint3d.hh>
namespace oln
Index: oln/core/3d/dpoint3d.hh
--- oln/core/3d/dpoint3d.hh (revision 616)
+++ oln/core/3d/dpoint3d.hh (working copy)
@@ -32,6 +32,8 @@
# include <mlc/int.hh>
# include <oln/core/3d/point3d.hh>
# include <oln/core/internal/dpoint_nd.hh>
+// For oln::dpoint3d and oln::dpoint3df.
+# include <oln/core/3d/aliases.hh>
namespace oln
Index: oln/core/3d/image3d.hh
--- oln/core/3d/image3d.hh (revision 616)
+++ oln/core/3d/image3d.hh (working copy)
@@ -31,12 +31,21 @@
# include <oln/core/image_entry.hh>
# include <oln/core/3d/array3d.hh>
+# include <oln/core/3d/point3d.hh>
+# include <oln/core/gen/topo_lbbox.hh>
# include <oln/core/internal/tracked_ptr.hh>
+// For topo3d.
+# include <oln/core/3d/aliases.hh>
namespace oln
{
+ // FIXME: Inexplicably, this explicit instantiation is required to
+ // have topo_lbbox_<point3d> work. See if we can get rid of it.
+ template class bbox_<point3d>;
+
+
// Forward declaration.
template <typename T> class image3d;
Index: oln/core/3d/point3d.hh
--- oln/core/3d/point3d.hh (revision 616)
+++ oln/core/3d/point3d.hh (working copy)
@@ -31,6 +31,8 @@
# include <mlc/int.hh>
# include <oln/core/internal/point_nd.hh>
+// For oln::point3d and oln::point3df.
+# include <oln/core/3d/aliases.hh>
namespace oln
@@ -108,7 +110,5 @@
} // end of namespace oln
-# include <oln/core/3d/dpoint3d.hh>
-
#endif // ! OLN_CORE_3D_POINT3D_HH
Index: oln/core/gen/piter_isubset.hh
--- oln/core/gen/piter_isubset.hh (revision 616)
+++ oln/core/gen/piter_isubset.hh (working copy)
@@ -28,8 +28,9 @@
#ifndef OLN_CORE_GEN_PITER_ISUBSET_HH
# define OLN_CORE_GEN_PITER_ISUBSET_HH
-# include <oln/core/abstract/topology.hh>
# include <oln/core/abstract/iterator_on_points.hh>
+# include <oln/core/abstract/topology.hh>
+# include <oln/core/gen/topo_add_isubset.hh>
namespace oln
Index: oln/core/gen/bbox.hh
--- oln/core/gen/bbox.hh (revision 616)
+++ oln/core/gen/bbox.hh (working copy)
@@ -262,8 +262,4 @@
} // end of namespace oln
-# include <oln/core/gen/bbox_fwd_piter.hh>
-# include <oln/core/gen/bbox_bkd_piter.hh>
-
-
#endif // ! OLN_CORE_GEN_BBOX_HH
Index: oln/core/gen/topo_bbox.hh
--- oln/core/gen/topo_bbox.hh (revision 616)
+++ oln/core/gen/topo_bbox.hh (working copy)
@@ -32,11 +32,9 @@
# include <oln/core/topology_entry.hh>
-
namespace oln
{
-
// Forward declarations.
template <typename point> class topo_bbox_;
@@ -137,7 +135,7 @@
bool
topo_bbox_<point>::impl_has_large(const point& p) const
{
- return lbb_.has(p);
+ return bb_.has(p);
}
# endif
Index: oln/core/gen/neighb.hh
--- oln/core/gen/neighb.hh (revision 616)
+++ oln/core/gen/neighb.hh (working copy)
@@ -32,6 +32,7 @@
# include <set>
# include <vector>
# include <oln/core/neighborhood_entry.hh>
+# include <oln/core/abstract/dpoint.hh>
namespace oln
Index: oln/core/gen/fwd_qiter_win.hh
--- oln/core/gen/fwd_qiter_win.hh (revision 616)
+++ oln/core/gen/fwd_qiter_win.hh (working copy)
@@ -28,9 +28,8 @@
#ifndef OLN_CORE_GEN_FWD_QITER_WIN_HH
# define OLN_CORE_GEN_FWD_QITER_WIN_HH
-# include <oln/core/abstract/topology.hh>
# include <oln/core/abstract/iterator_on_points.hh>
-# include <oln/core/gen/win.hh>
+# include <oln/core/gen/window.hh>
namespace oln
Index: oln/core/gen/window.hh
--- oln/core/gen/window.hh (revision 616)
+++ oln/core/gen/window.hh (working copy)
@@ -31,6 +31,8 @@
# include <set>
# include <vector>
+# include <mlc/assert.hh>
+# include <oln/core/abstract/dpoint.hh>
namespace oln
Index: oln/core/gen/mapimage.hh
--- oln/core/gen/mapimage.hh (revision 616)
+++ oln/core/gen/mapimage.hh (working copy)
@@ -29,9 +29,11 @@
#ifndef OLN_CORE_GEN_MAPIMAGE_HH
# define OLN_CORE_GEN_MAPIMAGE_HH
+# include <map>
# include <oln/core/image_entry.hh>
# include <oln/core/gen/topo_bbox.hh>
-# include <map>
+# include <oln/core/gen/fwd_piter_bbox.hh>
+# include <oln/core/gen/bkd_piter_bbox.hh>
namespace oln
Index: oln/core/internal/bbox_bkd_piter.hh
--- oln/core/internal/bbox_bkd_piter.hh (revision 616)
+++ oln/core/internal/bbox_bkd_piter.hh (working copy)
@@ -32,6 +32,7 @@
# include <oln/core/abstract/iterator_on_points.hh>
# include <oln/core/abstract/point.hh>
# include <oln/core/gen/bbox.hh>
+# include <oln/core/fwd_piter.hh>
namespace oln
Index: oln/core/internal/bbox_fwd_piter.hh
--- oln/core/internal/bbox_fwd_piter.hh (revision 616)
+++ oln/core/internal/bbox_fwd_piter.hh (working copy)
@@ -32,6 +32,7 @@
# include <oln/core/abstract/iterator_on_points.hh>
# include <oln/core/abstract/point.hh>
# include <oln/core/gen/bbox.hh>
+# include <oln/core/fwd_piter.hh>
namespace oln
Index: oln/basics2d.hh
--- oln/basics2d.hh (revision 616)
+++ oln/basics2d.hh (working copy)
@@ -38,7 +38,6 @@
# include <oln/core/2d/dpoint2d.hh>
# include <oln/core/gen/bbox.hh>
-namespace oln { template class bbox_<point2d>; }
# include <oln/core/gen/topo_lbbox.hh>
Index: oln/Makefile.am
--- oln/Makefile.am (revision 616)
+++ oln/Makefile.am (working copy)
@@ -29,15 +29,6 @@
\
core/abstract/image/accessibility/hierarchy.hh \
\
- core/abstract/any.hh \
- core/abstract/bbox.hh \
- core/abstract/dpoint.hh \
- core/abstract/entry.hh \
- core/abstract/fwd_decls.hh \
- core/abstract/grid.hh \
- core/abstract/image.hh \
- core/abstract/image/accessibility/hierarchy.hh \
- \
core/abstract/image/bbox/hierarchy.hh \
\
core/abstract/image/dimension/1d.hh \
@@ -46,6 +37,7 @@
core/abstract/image/dimension/hierarchy.hh \
\
core/abstract/image/hybrid/classical.hh \
+ \
core/abstract/image/mutability/hierarchy.hh \
\
core/abstract/image/neighborhood/hierarchy.hh \
@@ -58,14 +50,30 @@
core/abstract/image/type/integre.hh \
core/abstract/image/type/label.hh \
\
+ core/abstract/image/all.hh \
core/abstract/image/hierarchies.hh \
\
core/abstract/internal/image_impl.hh \
\
+ core/abstract/point_set/all.hh \
+ core/abstract/point_set/hierarchies.hh \
+ core/abstract/point_set/point_set_being_connected.hh \
+ core/abstract/point_set/point_set_being_random_accessible.hh \
+ core/abstract/point_set/point_set_having_bbox.hh \
+ core/abstract/point_set/point_set_having_known_size.hh \
+ \
+ core/abstract/topology/all.hh \
+ core/abstract/topology/hierarchies.hh \
+ core/abstract/topology/topology_being_random_accessible.hh \
+ core/abstract/topology/topology_having_bbox.hh \
+ core/abstract/topology/topology_having_neighborhood.hh \
+ core/abstract/topology/topology_having_subset.hh \
+ \
core/abstract/any.hh \
core/abstract/bbox.hh \
core/abstract/dpoint.hh \
core/abstract/entry.hh \
+ core/abstract/fwd_decls.hh \
core/abstract/grid.hh \
core/abstract/image.hh \
core/abstract/iterator.hh \
@@ -73,17 +81,7 @@
core/abstract/neighborhood.hh \
core/abstract/point.hh \
core/abstract/point_set.hh \
- core/abstract/point_set_being_connected.hh \
- core/abstract/point_set_being_random_accessible.hh \
- core/abstract/point_set_having_bbox.hh \
- core/abstract/point_set_having_known_size.hh \
- core/abstract/point_set_hierarchies.hh \
core/abstract/topology.hh \
- core/abstract/topology_being_random_accessible.hh \
- core/abstract/topology_having_bbox.hh \
- core/abstract/topology_having_neighborhood.hh \
- core/abstract/topology_having_subset.hh \
- core/abstract/topology_hierarchies.hh \
\
core/automatic/image.hh \
core/automatic/image_being_mutable.hh \
Index: oln/basics3d.hh
--- oln/basics3d.hh (revision 616)
+++ oln/basics3d.hh (working copy)
@@ -35,25 +35,18 @@
# include <oln/core/3d/grid3d.hh>
# include <oln/core/3d/point3d.hh>
-namespace oln { template class point3d_<int>; }
# include <oln/core/3d/dpoint3d.hh>
-namespace oln { template class dpoint3d_<int>; }
# include <oln/core/gen/bbox.hh>
-namespace oln { template class bbox_<point3d>; }
# include <oln/core/gen/topo_lbbox.hh>
-namespace oln { template class topo_lbbox_<point3d>; }
# include <oln/core/gen/fwd_piter_bbox.hh>
-namespace oln { template class fwd_piter_bbox_<topo3d>; }
# include <oln/core/gen/bkd_piter_bbox.hh>
-namespace oln { template class bkd_piter_bbox_<topo3d>; }
# include <oln/core/gen/neighb.hh>
-namespace oln { template class neighb_<dpoint3d>; }
# include <oln/core/3d/neighb3d.hh>
# include <oln/core/3d/image3d.hh>
Index: oln/morpher/add_isubset.hh
--- oln/morpher/add_isubset.hh (revision 616)
+++ oln/morpher/add_isubset.hh (working copy)
@@ -28,6 +28,8 @@
#ifndef OLN_MORPHER_ADD_ISUBSET
# define OLN_MORPHER_ADD_ISUBSET
+# include <oln/core/abstract/image.hh>
+# include <oln/core/abstract/image/type/binary.hh>
# include <oln/morpher/internal/image_extension.hh>
# include <oln/core/gen/topo_add_isubset.hh>
# include <oln/core/gen/piter_isubset.hh>
Index: oln/morpher/add_neighborhood.hh
--- oln/morpher/add_neighborhood.hh (revision 616)
+++ oln/morpher/add_neighborhood.hh (working copy)
@@ -30,6 +30,7 @@
# include <oln/morpher/internal/image_extension.hh>
# include <oln/core/gen/topo_add_nbh.hh>
+# include <oln/core/fwd_piter.hh>
# include <oln/core/gen/fwd_niter_neighb.hh>
1
0
10 Oct '06
2006-10-10 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Add xtd accessors (pure functions based on accessor methods).
* xtd/accessor.hh: New.
* xtd/vec.hh (operator<<): Move outside of class.
(operator<<): New specializations for 'unsigned char' and
'signed char' so that data is considered as number and
not as 'char'.
Index: xtd/accessor.hh
===================================================================
--- xtd/accessor.hh (revision 0)
+++ xtd/accessor.hh (revision 0)
@@ -0,0 +1,77 @@
+// Copyright (C) 2006 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef XTD_ACCESSOR_HH
+# define XTD_ACCESSOR_HH
+
+# include <xtd/abstract/plain_nary_fun.hh>
+# include <xtd/mfun.hh>
+
+
+# define xtd_decl_accessor(MethodName) \
+ \
+namespace xtd \
+{ \
+ \
+ namespace accessor \
+ { \
+ template <typename T> struct MethodName##_; \
+ } \
+ \
+ template <typename T> \
+ struct fun_traits_< accessor::MethodName##_<T> > \
+ { \
+ typedef T arg_type; \
+ typedef typename T::MethodName##_type res_type; \
+ }; \
+ \
+ namespace accessor \
+ { \
+ \
+ template <typename T> \
+ struct MethodName##_ \
+ : public xtd::abstract::plain_nary_fun_< 1, MethodName##_<T> > \
+ { \
+ xtd_res(MethodName##_<T>) impl_op(const T& arg) const \
+ { \
+ return arg.red(); \
+ } \
+ }; \
+ \
+ typedef xtd::m1fun_<MethodName##_> MethodName##_type; \
+ \
+ static const MethodName##_type MethodName; \
+ \
+ } \
+ \
+} \
+ \
+struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
+
+
+
+#endif // ! XTD_ACCESSOR_HH
Index: xtd/vec.hh
===================================================================
--- xtd/vec.hh (revision 615)
+++ xtd/vec.hh (working copy)
@@ -259,19 +259,37 @@
return tmp;
}
- friend
- std::ostream& operator<<(std::ostream& ostr, const vec<n,T>& v)
- {
- ostr << '(';
- for (unsigned i = 0; i < n; ++i)
- ostr << v[i] << (i == n - 1 ? ")" : ", ");
- return ostr;
- }
-
};
+ template <unsigned n, typename T>
+ std::ostream& operator<<(std::ostream& ostr, const vec<n,T>& v)
+ {
+ ostr << '(';
+ for (unsigned i = 0; i < n; ++i)
+ ostr << v[i] << (i == n - 1 ? ")" : ", ");
+ return ostr;
+ }
+ template <unsigned n>
+ std::ostream& operator<<(std::ostream& ostr, const vec<n,unsigned char>& v)
+ {
+ ostr << '(';
+ for (unsigned i = 0; i < n; ++i)
+ ostr << (unsigned int)(v[i]) << (i == n - 1 ? ")" : ", ");
+ return ostr;
+ }
+
+ template <unsigned n>
+ std::ostream& operator<<(std::ostream& ostr, const vec<n,signed char>& v)
+ {
+ ostr << '(';
+ for (unsigned i = 0; i < n; ++i)
+ ostr << (signed int)(v[i]) << (i == n - 1 ? ")" : ", ");
+ return ostr;
+ }
+
+
struct lexi_less_t
{
template <unsigned n, typename T>
1
0
2006-10-10 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Add i/o read for pbm and pgm formats.
* tests/io_pnm.cc: New.
* tests/Makefile.am (check_PROGRAMS): Update.
* oln/io: New directory.
* oln/io/pnm.hh: New.
* oln/core/image_entry.hh (coord_type): New single_vtype.
* oln/core/abstract/image.hh (decl): New comment.
* oln/core/2d/image2d.hh (adr_at): New.
* oln/basics2d.hh (include): Add fwd_piter.hh.
* oln/Makefile.am (nobase_oln_HEADERS): Update.
* img: New directory.
* img/chien.pbm: New.
* img/lena32.pgm: New.
Index: tests/io_pnm.cc
===================================================================
--- tests/io_pnm.cc (revision 0)
+++ tests/io_pnm.cc (revision 0)
@@ -0,0 +1,40 @@
+// Copyright (C) 2006 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+/// Test oln::io_pnm.cc.
+
+#include <cassert>
+#include <oln/basics2d.hh>
+#include <oln/io/pnm.hh>
+
+int
+main()
+{
+ // Fill a 2-d image using its iterator.
+ oln::image2d<bool> ima = oln::io::load_pbm("../img/chien.pbm");
+ oln::image2d<unsigned char> ima2 = oln::io::load_pgm("../img/lena32.pgm");
+}
Index: tests/Makefile.am
===================================================================
--- tests/Makefile.am (revision 614)
+++ tests/Makefile.am (working copy)
@@ -25,6 +25,7 @@
image1d \
image2d \
image3d \
+ io_pnm \
npoints \
\
identity_morpher \
Index: oln/io/pnm.hh
===================================================================
--- oln/io/pnm.hh (revision 0)
+++ oln/io/pnm.hh (revision 0)
@@ -0,0 +1,224 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 EPITA Research and
+// Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef OLN_IO_PNM_HH
+# define OLN_IO_PNM_HH
+
+# include <iostream>
+# include <fstream>
+# include <string>
+
+# include <oln/core/2d/image2d.hh>
+
+
+namespace oln {
+
+ namespace io {
+
+ namespace internal {
+
+ void abort()
+ {
+ std::cerr << " aborting." << std::endl;
+ exit(0);
+ }
+
+ bool read_pnm_header(std::istream& istr,
+ char& type,
+ int& nrows, int& ncols,
+ bool test = false)
+ {
+ // check magic
+ if (istr.get() != 'P' )
+ goto err;
+ type = istr.get();
+ if (type < '1' or type > '6')
+ goto err;
+ if (istr.get() != '\n')
+ goto err;
+
+ // skip comments
+ while (istr.peek() == '#')
+ {
+ std::string line;
+ std::getline(istr, line);
+ }
+
+ // get size
+ istr >> ncols >> nrows;
+ if (nrows <= 0 or ncols <= 0)
+ goto err;
+
+ // skip maxvalue
+ if (istr.get() != '\n')
+ goto err;
+ if (type != '1' and type != '4')
+ {
+ std::string line;
+ std::getline(istr, line);
+ }
+ return true;
+
+ err:
+ if (not test)
+ {
+ std::cerr << "error: badly formed header!";
+ abort();
+ }
+ return false;
+ }
+
+ void read_pnm_header(char ascii, char raw,
+ std::istream& istr,
+ char& type,
+ int& nrows, int& ncols)
+ {
+ read_pnm_header(istr, type, nrows, ncols);
+ if (not (type == ascii or type == raw))
+ {
+ std::cerr << "error: bad pnm type; "
+ << "expected P" << ascii
+ << " or P" << raw
+ << ", get P" << type << "!";
+ abort();
+ }
+ }
+
+
+ /// load_pbm_raw.
+ template <typename I>
+ void load_pbm_raw(std::ifstream& file, I& ima)
+ {
+ oln_type_of(I, coord) cols = 0;
+ unsigned bits = 0;
+ unsigned char c = 0;
+ oln_type_of(I, fwd_piter) p(ima.topo());
+ for_all(p)
+ {
+ if (bits == 0)
+ {
+ c = file.get();
+ bits = 8;
+ }
+ ima(p) = (c & (1 << --bits)) ? false : true;
+ if (++cols >= int(ima.bbox().ncols()))
+ cols = bits = 0;
+ }
+ }
+
+
+ /// load_pbm_ascii.
+ template <typename I>
+ void load_pbm_ascii(std::ifstream& file, I& ima)
+ {
+ oln_type_of(I, fwd_piter) p(ima.topo());
+ for_all(p)
+ ima(p) = (file.get() == '0');
+ }
+
+
+ /// load_ascii.
+ template <typename I>
+ void load_pnm_ascii(std::ifstream& file, I& ima)
+ {
+ oln_type_of(I, fwd_piter) p(ima.topo());
+ for_all(p)
+ {
+ oln_type_of(I, value) value;
+ file >> value;
+ ima(p) = value;
+ // FIXME: Test alt code below.
+ // file >> ima(p);
+ }
+ }
+
+
+ /// load_raw_2d.
+ template <typename I>
+ void load_pnm_raw_2d(std::ifstream& file, I& ima)
+ {
+ int col = ima.pmin().col();
+ size_t len = ima.bbox().ncols();
+ for (int row = ima.pmin().row(); row <= ima.pmax().row(); ++row)
+ file.read((char*)(ima.adr_at(row, col)),
+ len * sizeof(oln_type_of(I, value)));
+ }
+
+
+ } // end of namespace oln::io::internal
+
+
+ image2d<bool> load_pbm(const std::string& filename)
+ {
+ std::ifstream file(filename.c_str());
+ if (not file)
+ {
+ std::cerr << "error: file '" << filename
+ << "' not found!";
+ abort();
+ }
+ char type;
+ int nrows, ncols;
+ internal::read_pnm_header('1', '4', file, type, nrows, ncols);
+ image2d<bool> ima(nrows, ncols);
+ if (type == '4')
+ internal::load_pbm_raw(file, ima);
+ else
+ // type == '1'
+ internal::load_pbm_ascii(file, ima);
+ return ima;
+ }
+
+
+ image2d<unsigned char> load_pgm(const std::string& filename)
+ {
+ std::ifstream file(filename.c_str());
+ if (not file)
+ {
+ std::cerr << "error: file '" << filename
+ << "' not found!";
+ abort();
+ }
+ char type;
+ int nrows, ncols;
+ internal::read_pnm_header('2', '5', file, type, nrows, ncols);
+ image2d<unsigned char> ima(nrows, ncols);
+ if (type == '4')
+ internal::load_pnm_raw_2d(file, ima);
+ else
+ // type == '1'
+ internal::load_pnm_ascii(file, ima);
+ return ima;
+ }
+
+ } // end of namespace oln::io
+
+} // end of namespace oln
+
+
+#endif // ! OLN_IO_PNM_HH
Index: oln/core/image_entry.hh
===================================================================
--- oln/core/image_entry.hh (revision 614)
+++ oln/core/image_entry.hh (working copy)
@@ -67,6 +67,8 @@
typedef mlc::undefined topo_type;
typedef mlc::undefined grid_type;
+ // coord_type: see below.
+
// psite_type: see below.
typedef mlc::undefined point_type;
@@ -82,13 +84,23 @@
};
+ // Coord.
template <typename E>
+ struct single_vtype< image_entry<E>, typedef_::coord_type >
+ {
+ typedef oln_deduce_type_of(E, point, coord) ret;
+ };
+
+
+ // Psite.
+ template <typename E>
struct single_vtype< image_entry<E>, typedef_::psite_type >
{
typedef oln_type_of(E, point) ret;
};
+ // Piter.
template <typename E>
struct single_vtype< image_entry<E>, typedef_::piter_type >
{
@@ -96,6 +108,7 @@
};
+ // Rvalue.
template <typename E>
struct single_vtype< image_entry<E>, typedef_::rvalue_type >
{
Index: oln/core/abstract/image.hh
===================================================================
--- oln/core/abstract/image.hh (revision 614)
+++ oln/core/abstract/image.hh (working copy)
@@ -66,6 +66,8 @@
// oln_virtual_typedef(topo);
// oln_virtual_typedef(grid);
+// oln_virtual_typedef(coord);
+
// oln_virtual_typedef(psite);
// oln_virtual_typedef(point);
Index: oln/core/2d/image2d.hh
===================================================================
--- oln/core/2d/image2d.hh (revision 614)
+++ oln/core/2d/image2d.hh (working copy)
@@ -89,6 +89,9 @@
T& impl_op_readwrite(const point2d& p);
+ T* adr_at(int row, int col);
+ const T* adr_at(int row, int col) const;
+
private:
topo2d topo_;
@@ -143,6 +146,22 @@
return data_->operator()(p.row(), p.col());
}
+ template <typename T>
+ T* image2d<T>::adr_at(int row, int col)
+ {
+ precondition(data_ != 0);
+ precondition(data_->has(row, col));
+ return &(data_->operator()(row, col));
+ }
+
+ template <typename T>
+ const T* image2d<T>::adr_at(int row, int col) const
+ {
+ precondition(data_ != 0);
+ precondition(data_->has(row, col));
+ return &(data_->operator()(row, col));
+ }
+
# endif
} // end of namespace oln
Index: oln/basics2d.hh
===================================================================
--- oln/basics2d.hh (revision 614)
+++ oln/basics2d.hh (working copy)
@@ -50,5 +50,7 @@
# include <oln/core/2d/image2d.hh>
+# include <oln/core/fwd_piter.hh>
+
#endif // ! OLN_BASICS2D_HH
Index: oln/Makefile.am
===================================================================
--- oln/Makefile.am (revision 614)
+++ oln/Makefile.am (working copy)
@@ -132,6 +132,8 @@
\
debug/print.hh \
\
+ io/pnm.hh \
+ \
level/fill.hh \
\
morpher/internal/image_extension.hh \
Index: img/chien.pbm
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: img/chien.pbm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Index: img/lena32.pgm
===================================================================
--- img/lena32.pgm (revision 0)
+++ img/lena32.pgm (revision 0)
@@ -0,0 +1,4 @@
+P5
+32 32
+255
+€chmzt¹Šsy{{`£bgly~~~~vv Áw{Y3 ¡ `fkx}~
~~}wt³³uV40¡]dlw|ªysrÆp02.r Xbhsy{w}
«ºÀ°io@02<hk Ybhsxrs{ŠºÇÏÁqhdB/1FyYkYbhtvov«ÀÇËзo>yZ129uZkV`g{ynz¢Ž»ÁÇÉÑ SŠÁK12aao Ycf
xlx§¯±·ŸŸÅÁ¥ ¶ÎÉO-F`p£Zac
l|§ª«±µ²µŸÆÊÀ©<4v_r€Zaav±œÃÉ¿r.Scu¥Ya`¢z~r[fU[¢¿ÀŸ¥|B4wfs€X_a|ª|zbF>H]޶Ž|
F/H£fn£X`ep |vX@C;P°¬»¿mlF32e¡ dl£[cit
xT:6?Sª¥ÃÐRE6=
ck£[ci}naD:6C§y»²pJO4T_d£\`pUKI73j¯qVo«mEFU4n\]€blnZJOU/C®THX<
±NS¡brZSD>V;swv«±cFXM ÀÅHMfhV\D9UVuGu¡§V@^gºÉÍIX¡b]NYYAVrIIw£@>d ÇÎÐA^€f[DR_iQ5Jt d7@fªÏÑÓ7_ŠhSDdcp56Aa~?8Dj³ÕÓÒ1a£^HAdotB548Cbf2>Lmº×Ï·;Ra>A]jqM935>d ^AOo}~ÀÍOwY€Z8GKWse>59Go¡»ÁGqs}ÅTXsp€O1A:KkoI5<UqÃÎirªÇsac_t¢I1A4>foN:KewŠœÒ }Í®gc`Sz£M295@XY<7_hŽËÄ~
Ÿ\^Z[¢M075<^I,BakªÄÐWP«\W]Oi E39B>UA.Od~¡¹Ïa[iOU_FQ<9ANKJBFl|°È°esr`T_X?
\ No newline at end of file
1
0
2006-10-09 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
* oln/core/internal/tracked_ptr.hh (operator bool):
Fix signature.
(operator bool): Add line to remove warning.
Index: oln/core/internal/tracked_ptr.hh
===================================================================
--- oln/core/internal/tracked_ptr.hh (revision 613)
+++ oln/core/internal/tracked_ptr.hh (working copy)
@@ -94,7 +94,6 @@
# ifndef OLN_INCLUDE_ONLY
template <typename T>
- tracked_ptr<T>::
tracked_ptr<T>::operator bool() const
{
invariant_();
@@ -227,6 +226,7 @@
invariant(holders_->size() > 0);
tracked_ptr<T>* this_ = const_cast<tracked_ptr<T>*>(this);
invariant(holders_->find(this_) != holders_->end());
+ this_ = 0;
typename holders_t::const_iterator i;
for (i = holders_->begin(); i != holders_->end(); ++i)
invariant((*i)->ptr_ == ptr_);
1
0
https://svn.lrde.epita.fr/svn/oln/trunk
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Add sanity check to Olena.
* configure.ac: Configure olena/tests/check/Makefile,
olena/tests/check/defs, olena/tests/sanity/Makefile and
olena/tests/sanity/check.
Index: olena/ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Add sanity check to Olena.
* tests/sanity/check.in, tests/sanity/Makefile.am,
* tests/check/defs.in, tests/check/Makefile.flags,
* tests/check/Makefile.am: New.
* tests/Makefile.am (SUBDIRS): New.
configure.ac | 9 +++++-
olena/ChangeLog | 9 ++++++
olena/tests/Makefile.am | 2 +
olena/tests/check/Makefile.am | 56 +++++++++++++++++++++--------------------
olena/tests/sanity/Makefile.am | 16 ++++++++++-
olena/tests/sanity/check.in | 7 ++---
6 files changed, 67 insertions(+), 32 deletions(-)
Index: configure.ac
--- configure.ac (revision 612)
+++ configure.ac (working copy)
@@ -74,6 +74,13 @@
olena/oln/Makefile
dynamic/Makefile
])
+# FIXME: Should be performed through oln.m4 macros.
+AC_CONFIG_FILES([
+ olena/tests/check/Makefile
+ olena/tests/check/defs
+ olena/tests/sanity/Makefile
+])
+AC_CONFIG_FILES([olena/tests/sanity/check],
+ [chmod +x olena/tests/sanity/check])
-# Checks for library functions.
AC_OUTPUT
Index: olena/ChangeLog
--- olena/ChangeLog (revision 612)
+++ olena/ChangeLog (working copy)
@@ -1,3 +1,12 @@
+2006-10-09 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Add sanity check to Olena.
+
+ * tests/sanity/check.in, tests/sanity/Makefile.am,
+ * tests/check/defs.in, tests/check/Makefile.flags,
+ * tests/check/Makefile.am: New.
+ * tests/Makefile.am (SUBDIRS): New.
+
2006-10-09 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Change stc_virtual_typedef into oln_virtual_typedef.
Index: olena/tests/sanity/check.in
--- olena/tests/sanity/check.in (revision 612)
+++ olena/tests/sanity/check.in (working copy)
@@ -18,9 +18,10 @@
top_builddir=@abs_top_builddir@
file=$1
CPPFLAGS="$CPPFLAGS \
- -I$top_srcdir/metalic -I$top_builddir/metalic \
- -I$top_srcdir/integre -I$top_builddir/integre \
- -I$top_srcdir/olena -I$top_builddir/olena"
+ -I$top_srcdir/olena -I$top_builddir/olena \
+ -I$top_srcdir/extended -I$top_builddir/extended \
+ -I$top_srcdir/static -I$top_builddir/static \
+ -I$top_srcdir/metalic -I$top_builddir/metalic"
echo "#include <$file>" > incltest.cc
if $CXX $CPPFLAGS $CXXFLAGS -c incltest.cc; then
echo " PASS: $file"
Index: olena/tests/sanity/Makefile.am
--- olena/tests/sanity/Makefile.am (revision 612)
+++ olena/tests/sanity/Makefile.am (working copy)
@@ -1,4 +1,18 @@
-EXTRA_DIST = check.in includes.test
+## Process this file through Automake to create Makefile.in -*- Makefile -*-
+
+EXTRA_DIST = includes.test
+
+# FIXME: These should be defined by oln.m4.
+OLN_LOCAL_SRC = $(top_srcdir)/olena
+OLN_LOCAL_BUILD = $(top_builddir)/olena
+# FIXME: Likewise.
+OLN_LOCAL_CPPFLAGS = -I$(top_srcdir)/olena -I$(top_builddir)/olena
+XTD_LOCAL_CPPFLAGS = -I$(top_srcdir)/extended -I$(top_builddir)/extended
+STC_LOCAL_CPPFLAGS = -I$(top_srcdir)/static -I$(top_builddir)/static
+MLC_LOCAL_CPPFLAGS = -I$(top_srcdir)/metalic -I$(top_builddir)/metalic
+CPPFLAGS = \
+ $(OLN_LOCAL_CPPFLAGS) $(XTD_LOCAL_CPPFLAGS) \
+ $(STC_LOCAL_CPPFLAGS) $(MLC_LOCAL_CPPFLAGS)
check:
TOP_SRCDIR=$(top_srcdir) SRCDIR=$(srcdir) \
Index: olena/tests/Makefile.am
--- olena/tests/Makefile.am (revision 612)
+++ olena/tests/Makefile.am (working copy)
@@ -1,5 +1,7 @@
## Process this file through Automake to create Makefile.in -*- Makefile -*-
+SUBDIRS = check sanity
+
AM_CPPFLAGS = \
-I$(top_srcdir)/olena -I$(top_srcdir)/extended \
-I$(top_srcdir)/static -I$(top_srcdir)/metalic
Index: olena/tests/check/Makefile.am
--- olena/tests/check/Makefile.am (revision 0)
+++ olena/tests/check/Makefile.am (working copy)
@@ -1,32 +1,34 @@
## Process this file through Automake to create Makefile.in -*- Makefile -*-
-include Makefile.flags
+# FIXME: To be enabled when the test suite mechanism is available.
-AM_CPPFLAGS += -DCXX=\""$(CXX)"\" \
- -DCPPFLAGS=\""$(CPPFLAGS)"\" \
- -DCXXFLAGS=\""$(CXXFLAGS)"\" \
- -DOLN_EXTRA_CPPFLAGS=\""$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS)"\" \
- -DCXXFLAGS_OPTIMIZE=\""$(CXXFLAGS_OPTIMIZE)"\" \
- -DCXXFLAGS_STRICT=\""$(CXXFLAGS_STRICT)"\" \
- -DCXXFLAGS_STRICT_ERRORS=\""$(CXXFLAGS_STRICT_ERRORS)"\" \
- -DOLN_IMG_DIR=\"$(top_srcdir)/olena/img\"
-
-check_LIBRARIES = libolncheck.a
-
-COMMON_CHECK_SOURCES = \
- $(top_srcdir)/metalic/tests/check/check.hh \
- $(top_srcdir)/metalic/tests/check/main.cc \
- $(top_srcdir)/metalic/tests/check/srcdir.cc \
- $(top_srcdir)/metalic/tests/check/srcdir.hh \
- $(top_srcdir)/metalic/tests/check/verbose.cc \
- $(top_srcdir)/metalic/tests/check/verbose.hh \
- $(top_srcdir)/metalic/tests/check/compile.cc \
- $(top_srcdir)/metalic/tests/check/compile.hh
-
-libolncheck_a_SOURCES = \
- data.hh \
- data.cc \
- $(COMMON_CHECK_SOURCES)
+# include Makefile.flags
+# AM_CPPFLAGS += -DCXX=\""$(CXX)"\" \
+# -DCPPFLAGS=\""$(CPPFLAGS)"\" \
+# -DCXXFLAGS=\""$(CXXFLAGS)"\" \
+# -DOLN_EXTRA_CPPFLAGS=\""$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS)"\" \
+# -DCXXFLAGS_OPTIMIZE=\""$(CXXFLAGS_OPTIMIZE)"\" \
+# -DCXXFLAGS_STRICT=\""$(CXXFLAGS_STRICT)"\" \
+# -DCXXFLAGS_STRICT_ERRORS=\""$(CXXFLAGS_STRICT_ERRORS)"\" \
+# -DOLN_IMG_DIR=\"$(top_srcdir)/olena/img\"
+
+# check_LIBRARIES = libolncheck.a
+
+# COMMON_CHECK_SOURCES = \
+# $(top_srcdir)/metalic/tests/check/check.hh \
+# $(top_srcdir)/metalic/tests/check/main.cc \
+# $(top_srcdir)/metalic/tests/check/srcdir.cc \
+# $(top_srcdir)/metalic/tests/check/srcdir.hh \
+# $(top_srcdir)/metalic/tests/check/verbose.cc \
+# $(top_srcdir)/metalic/tests/check/verbose.hh \
+# $(top_srcdir)/metalic/tests/check/compile.cc \
+# $(top_srcdir)/metalic/tests/check/compile.hh
+
+# libolncheck_a_SOURCES = \
+# data.hh \
+# data.cc \
+# $(COMMON_CHECK_SOURCES)
-EXTRA_DIST = Makefile.flags Makefile.check Makefile.runtests
+
+# EXTRA_DIST = Makefile.flags Makefile.check Makefile.runtests
1
0
09 Oct '06
Since the topology types are not (so) exposed to the library clients,
the topology hierarchy can be simplified from the SCOOP 2 paradigm to
the SCOOP 1 one. Precisely, all abstract and *specific* interfaces
move from sub-abstractions to the top abstraction (abstract::topology).
As a result, the compilation of the code below decreases from 43 sec
to 31 sec. Several empirical compilation tests show that we save
between 20 and 30% of compilation time.
int main()
{
using namespace oln;
image2d<int> ima(3, 3);
local::iota(ima);
debug::println(ima, std::cout);
image2d<bool> msk(3, 3);
local::chessboard(msk);
msk(point2d(0,1)) = true;
debug::println(msk, std::cout);
debug::println(ima | msk, std::cout);
debug::println(ima + c4, std::cout);
local::bar((ima + c4) | msk); // iterates on p then on p's neighbors
}
Below the diff between this test version and the version 612.
tegucigalpa% \svn st
! olena/oln/core/automatic/topology_having_bbox.hh
! olena/oln/core/automatic/topology_being_random_accessible.hh
! olena/oln/core/automatic/topology_having_subset.hh
! olena/oln/core/automatic/topology_having_neighborhood.hh
! olena/oln/core/topology_entry.hh
! olena/oln/core/abstract/topology_having_bbox.hh
! olena/oln/core/abstract/topology_hierarchies.hh
! olena/oln/core/abstract/topology_being_random_accessible.hh
! olena/oln/core/abstract/topology_having_subset.hh
! olena/oln/core/abstract/topology_having_neighborhood.hh
M olena/oln/core/abstract/topology.hh
M olena/oln/core/gen/topo_bbox.hh
M olena/oln/core/gen/topo_lbbox.hh
M olena/oln/core/internal/topology_morpher.hh
Index: olena/oln/core/abstract/topology.hh
===================================================================
--- olena/oln/core/abstract/topology.hh (revision 612)
+++ olena/oln/core/abstract/topology.hh (working copy)
@@ -34,7 +34,23 @@
namespace oln
{
+ namespace abstract {
+ template <typename E> class topology;
+ }
+
+ template <typename E>
+ struct vtypes< abstract::topology<E> >
+ {
+ typedef mlc::undefined bbox_type;
+ typedef mlc::undefined is_random_accessible_type;
+ typedef mlc::undefined point_type;
+ typedef mlc::undefined neighborhood_type;
+ typedef mlc::undefined morpher_type;
+ };
+
+
+
namespace abstract
{
@@ -49,19 +65,29 @@
struct decl
{
oln_virtual_typedef(bbox);
- // for being bboxed; provides .bbox()
-
oln_virtual_typedef(is_random_accessible);
- // provides .has(p) and .has_large(p)
-
oln_virtual_typedef(point);
oln_virtual_typedef(neighborhood);
-
oln_virtual_typedef(morpher);
decl();
};
+
+ // Bbox.
+ const oln_type_of(E, bbox)& bbox() const;
+ oln_type_of(E, bbox)& bbox();
+
+ // Subset.
+ const oln_type_of(E, subset)& subset() const;
+
+ // Neighborhood.
+ const oln_type_of(E, neighborhood)& neighborhood() const;
+
+ // Random access.
+ bool has(const oln_type_of(E, point)& p) const;
+ bool has_large(const oln_type_of(E, point)& p) const;
+
protected:
topology();
@@ -77,9 +103,6 @@
template <typename E>
topology<E>::decl::decl()
{
- // constraint:
-// mlc::assert_< mlc::implies_< mlc::neq_< bbox, mlc::none >,
-// mlc_is_a(bbox, abstract::bbox) > >::check();
}
template <typename E>
@@ -93,17 +116,61 @@
decl();
}
-# endif
+ // Bbox.
+ template <typename E>
+ const oln_type_of(E, bbox)&
+ topology<E>::bbox() const
+ {
+ return this->exact().impl_bbox();
+ }
- } // end of namespace oln::abstract
+ template <typename E>
+ oln_type_of(E, bbox)&
+ topology<E>::bbox()
+ {
+ return this->exact().impl_bbox();
+ }
-} // end of namespace oln
+ // Subset.
+ template <typename E>
+ const oln_type_of(E, subset)&
+ topology<E>::subset() const
+ {
+ return this->exact().impl_subset();
+ }
+ // Neighborhood.
-# include <oln/core/abstract/topology_hierarchies.hh>
+ template <typename E>
+ const oln_type_of(E, neighborhood)&
+ topology<E>::neighborhood() const
+ {
+ return this->exact().impl_neighborhood();
+ }
+ // Random access.
+ template <typename E>
+ bool topology<E>::has(const oln_type_of(E, point)& p) const
+ {
+ return this->exact().impl_has(p);
+ }
+ template <typename E>
+ bool topology<E>::has_large(const oln_type_of(E, point)& p) const
+ {
+ return this->exact().impl_has_large(p);
+ }
+
+# endif
+
+
+ } // end of namespace oln::abstract
+
+
+} // end of namespace oln
+
+
#endif // ! OLN_CORE_ABSTRACT_TOPOLOGY_HH
Index: olena/oln/core/gen/topo_bbox.hh
===================================================================
--- olena/oln/core/gen/topo_bbox.hh (revision 612)
+++ olena/oln/core/gen/topo_bbox.hh (working copy)
@@ -29,7 +29,7 @@
# define OLN_CORE_GEN_TOPO_BBOX_HH
# include <oln/core/gen/bbox.hh>
-# include <oln/core/topology_entry.hh>
+# include <oln/core/abstract/topology.hh>
@@ -41,15 +41,6 @@
template <typename point> class topo_bbox_;
- // Super type declaration.
- template <typename point>
- struct set_super_type< topo_bbox_<point> >
- {
- typedef topo_bbox_<point> self_t;
- typedef topology_entry<self_t> ret;
- };
-
-
/// Virtual types associated to oln::bbox_<point>.
template <typename point>
struct vtypes< topo_bbox_<point> >
@@ -57,12 +48,14 @@
typedef bbox_<point> bbox_type;
typedef point point_type;
typedef mlc::true_ is_random_accessible_type;
+ typedef mlc::none neighborhood_type;
+ typedef mlc::none morpher_type;
};
/// Bounding box topology based on a point class.
template <typename point>
- class topo_bbox_ : public topology_entry< topo_bbox_<point> >
+ class topo_bbox_ : public abstract::topology< topo_bbox_<point> >
{
typedef topo_bbox_<point> self_t;
typedef topology_entry<self_t> super_t;
Index: olena/oln/core/gen/topo_lbbox.hh
===================================================================
--- olena/oln/core/gen/topo_lbbox.hh (revision 612)
+++ olena/oln/core/gen/topo_lbbox.hh (working copy)
@@ -29,7 +29,7 @@
# define OLN_CORE_GEN_TOPO_LBBOX_HH
# include <oln/core/gen/bbox.hh>
-# include <oln/core/topology_entry.hh>
+# include <oln/core/abstract/topology.hh>
@@ -41,15 +41,6 @@
template <typename point> class topo_lbbox_;
- // Super type declaration.
- template <typename point>
- struct set_super_type< topo_lbbox_<point> >
- {
- typedef topo_lbbox_<point> self_t;
- typedef topology_entry<self_t> ret;
- };
-
-
/// Virtual types associated to oln::bbox_<point>.
template <typename point>
struct vtypes< topo_lbbox_<point> >
@@ -57,12 +48,14 @@
typedef bbox_<point> bbox_type;
typedef point point_type;
typedef mlc::true_ is_random_accessible_type;
+ typedef mlc::none neighborhood_type;
+ typedef mlc::none morpher_type;
};
/// Bounding box topology based on a point class.
template <typename point>
- class topo_lbbox_ : public topology_entry< topo_lbbox_<point> >
+ class topo_lbbox_ : public abstract::topology< topo_lbbox_<point> >
{
typedef bbox_<point> bbox_t;
Index: olena/oln/core/internal/tracked_ptr.hh
===================================================================
--- olena/oln/core/internal/tracked_ptr.hh (revision 612)
+++ olena/oln/core/internal/tracked_ptr.hh (working copy)
@@ -94,7 +94,6 @@
# ifndef OLN_INCLUDE_ONLY
template <typename T>
- tracked_ptr<T>::
tracked_ptr<T>::operator bool() const
{
invariant_();
@@ -227,6 +226,7 @@
invariant(holders_->size() > 0);
tracked_ptr<T>* this_ = const_cast<tracked_ptr<T>*>(this);
invariant(holders_->find(this_) != holders_->end());
+ this_ = 0;
typename holders_t::const_iterator i;
for (i = holders_->begin(); i != holders_->end(); ++i)
invariant((*i)->ptr_ == ptr_);
Index: olena/oln/core/internal/topology_morpher.hh
===================================================================
--- olena/oln/core/internal/topology_morpher.hh (revision 612)
+++ olena/oln/core/internal/topology_morpher.hh (working copy)
@@ -28,7 +28,7 @@
#ifndef OLN_CORE_INTERNAL_TOPOLOGY_MORPHER_HH
# define OLN_CORE_INTERNAL_TOPOLOGY_MORPHER_HH
-# include <oln/core/topology_entry.hh>
+# include <oln/core/abstract/topology.hh>
@@ -42,17 +42,18 @@
} // end of namespace oln::internal
+
template <typename Topo, typename E>
- struct set_pseudosuper_type< internal::topology_morpher<Topo, E> >
+ struct vtypes< internal::topology_morpher<Topo, E> >
{
- typedef Topo ret;
- };
+ typedef oln_type_of(Topo, bbox) bbox_type;
+ typedef oln_type_of(Topo, is_random_accessible) is_random_accessible_type;
+ typedef oln_type_of(Topo, point) point_type;
+ typedef oln_type_of(Topo, neighborhood) neighborhood_type;
- template <typename Topo, typename E>
- struct single_vtype< internal::topology_morpher<Topo, E>, typedef_::morpher_type >
- {
- typedef morpher::tag::identity ret;
+ typedef morpher::tag::identity morpher_type;
};
+
template <typename Topo, typename E>
struct single_vtype< internal::topology_morpher<Topo, E>, typedef_::delegated_type >
@@ -67,8 +68,28 @@
/// Base internal class for morphers on topology.
template <typename Topo, typename E>
- struct topology_morpher : public topology_entry<E>
+ struct topology_morpher : public abstract::topology<E>
{
+ public:
+
+ // Bbox.
+
+ const oln_type_of(E, bbox)& impl_bbox() const;
+ oln_type_of(E, bbox)& impl_bbox();
+
+ // Subset.
+
+ const oln_type_of(E, subset)& impl_subset() const;
+
+ // Neighborhood.
+
+ const oln_type_of(E, neighborhood)& impl_neighborhood() const;
+
+ // Random access.
+
+ bool impl_has(const oln_type_of(E, point)& p) const;
+ bool impl_has_large(const oln_type_of(E, point)& p) const;
+
protected:
topology_morpher();
};
@@ -80,6 +101,56 @@
{
}
+ // Bbox.
+
+ template <typename Topo, typename E>
+ const oln_type_of(E, bbox)&
+ topology_morpher<Topo, E>::impl_bbox() const
+ {
+ return this->exact().delegate().bbox();
+ }
+
+ template <typename Topo, typename E>
+ oln_type_of(E, bbox)&
+ topology_morpher<Topo, E>::impl_bbox()
+ {
+ return this->exact().delegate().bbox();
+ }
+
+ // Subset.
+
+ template <typename Topo, typename E>
+ const oln_type_of(E, subset)&
+ topology_morpher<Topo, E>::impl_subset() const
+ {
+ return this->exact().delegate().subset();
+ }
+
+ // Neighborhood.
+
+ template <typename Topo, typename E>
+ const oln_type_of(E, neighborhood)&
+ topology_morpher<Topo, E>::impl_neighborhood() const
+ {
+ return this->exact().delegate().neighborhood();
+ }
+
+ // Random access.
+
+ template <typename Topo, typename E>
+ bool
+ topology_morpher<Topo, E>::impl_has(const oln_type_of(E, point)& p) const
+ {
+ return this->exact().delegate().has(p);
+ }
+
+ template <typename Topo, typename E>
+ bool
+ topology_morpher<Topo, E>::impl_has_large(const oln_type_of(E, point)& p) const
+ {
+ return this->exact().delegate().has_large(p);
+ }
+
# endif
} // end of namespace oln::internal
1
0
2006-10-09 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
* stc/scoop.hh (stc_virtual_typedef): Remove this macro which
cannot be consistent wrt to client namespaces.
Index: stc/scoop.hh
===================================================================
--- stc/scoop.hh (revision 611)
+++ stc/scoop.hh (working copy)
@@ -1027,12 +1027,4 @@
>::ret
-
-/// Declare the vtype \a Typedef in an abstract class (see sample code
-/// for details). Warning: this macro assumes that the exact type
-/// parameter is named 'E'.
-#define stc_virtual_typedef(Typedef) \
- typedef stc_check_direct_type_of(E, Typedef) Typedef
-
-
#endif // ! STC_SCOOP_HH
1
0
2006-10-09 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Change stc_virtual_typedef into oln_virtual_typedef.
* oln/core/macros.hh (oln_virtual_typedef): New macro.
It replaces stc_virtual_typedef.
* oln/core/abstract/image.hh: Update.
* oln/core/abstract/image/mutability/hierarchy.hh: Update.
* oln/core/abstract/image/neighborhood/hierarchy.hh: Update.
* oln/core/abstract/image/bbox/hierarchy.hh: Update.
* oln/core/abstract/point_set.hh: Update.
* oln/core/abstract/neighborhood.hh: Update.
* oln/core/abstract/topology.hh: Update.
Index: oln/core/macros.hh
===================================================================
--- oln/core/macros.hh (revision 610)
+++ oln/core/macros.hh (working copy)
@@ -135,4 +135,12 @@
stc_check_direct_type_of_(oln, void, OlnType, Alias)
+
+/// Declare the vtype \a Typedef in an abstract class (see sample code
+/// for details). Warning: this macro assumes that the exact type
+/// parameter is named 'E'.
+#define oln_virtual_typedef(Typedef) \
+ typedef stc_check_direct_type_of(oln, void, E, Typedef) Typedef
+
+
#endif // ! OLN_CORE_MACROS_HH
Index: oln/core/abstract/image.hh
===================================================================
--- oln/core/abstract/image.hh (revision 610)
+++ oln/core/abstract/image.hh (working copy)
@@ -63,22 +63,22 @@
struct decl
{
-// stc_virtual_typedef(topo);
-// stc_virtual_typedef(grid);
+// oln_virtual_typedef(topo);
+// oln_virtual_typedef(grid);
-// stc_virtual_typedef(psite);
-// stc_virtual_typedef(point);
+// oln_virtual_typedef(psite);
+// oln_virtual_typedef(point);
-// // stc_virtual_typedef(piter);
-// // stc_virtual_typedef(fwd_piter);
-// // stc_virtual_typedef(bkd_piter);
+// // oln_virtual_typedef(piter);
+// // oln_virtual_typedef(fwd_piter);
+// // oln_virtual_typedef(bkd_piter);
-// stc_virtual_typedef(value);
-// stc_virtual_typedef(rvalue);
+// oln_virtual_typedef(value);
+// oln_virtual_typedef(rvalue);
-// stc_virtual_typedef(concrete);
+// oln_virtual_typedef(concrete);
-// stc_virtual_typedef(morpher);
+// oln_virtual_typedef(morpher);
decl();
};
Index: oln/core/abstract/image/mutability/hierarchy.hh
===================================================================
--- oln/core/abstract/image/mutability/hierarchy.hh (revision 610)
+++ oln/core/abstract/image/mutability/hierarchy.hh (working copy)
@@ -58,7 +58,7 @@
struct decl
{
- stc_virtual_typedef(lvalue);
+ oln_virtual_typedef(lvalue);
};
/*! \brief Gives writable access to the value stored at \a p in
Index: oln/core/abstract/image/neighborhood/hierarchy.hh
===================================================================
--- oln/core/abstract/image/neighborhood/hierarchy.hh (revision 610)
+++ oln/core/abstract/image/neighborhood/hierarchy.hh (working copy)
@@ -65,9 +65,9 @@
public:
struct decl {
- // stc_virtual_typedef(niter);
- stc_virtual_typedef(fwd_niter);
- stc_virtual_typedef(bkd_niter);
+ // oln_virtual_typedef(niter);
+ oln_virtual_typedef(fwd_niter);
+ oln_virtual_typedef(bkd_niter);
};
const neighborhood_t& neighborhood() const;
Index: oln/core/abstract/image/bbox/hierarchy.hh
===================================================================
--- oln/core/abstract/image/bbox/hierarchy.hh (revision 610)
+++ oln/core/abstract/image/bbox/hierarchy.hh (working copy)
@@ -57,7 +57,7 @@
struct decl
{
- stc_virtual_typedef(bbox);
+ oln_virtual_typedef(bbox);
decl();
};
Index: oln/core/abstract/point_set.hh
===================================================================
--- oln/core/abstract/point_set.hh (revision 610)
+++ oln/core/abstract/point_set.hh (working copy)
@@ -49,21 +49,21 @@
struct decl
{
- stc_virtual_typedef(point);
+ oln_virtual_typedef(point);
- stc_virtual_typedef(piter);
- stc_virtual_typedef(fwd_piter);
- stc_virtual_typedef(bkd_piter);
+ oln_virtual_typedef(piter);
+ oln_virtual_typedef(fwd_piter);
+ oln_virtual_typedef(bkd_piter);
- stc_virtual_typedef(bbox); // provides .bbox()
- stc_virtual_typedef(is_random_accessible); // provides .has(p)
- stc_virtual_typedef(has_known_size); // provides .npoints()
- stc_virtual_typedef(is_connected); // provides, e.g., .nrows()
+ oln_virtual_typedef(bbox); // provides .bbox()
+ oln_virtual_typedef(is_random_accessible); // provides .has(p)
+ oln_virtual_typedef(has_known_size); // provides .npoints()
+ oln_virtual_typedef(is_connected); // provides, e.g., .nrows()
// derived from point:
- stc_virtual_typedef(coord);
- stc_virtual_typedef(grid);
- stc_virtual_typedef(dim);
+ oln_virtual_typedef(coord);
+ oln_virtual_typedef(grid);
+ oln_virtual_typedef(dim);
decl();
};
Index: oln/core/abstract/neighborhood.hh
===================================================================
--- oln/core/abstract/neighborhood.hh (revision 610)
+++ oln/core/abstract/neighborhood.hh (working copy)
@@ -49,7 +49,7 @@
struct decl
{
- stc_virtual_typedef(grid);
+ oln_virtual_typedef(grid);
decl();
};
Index: oln/core/abstract/topology.hh
===================================================================
--- oln/core/abstract/topology.hh (revision 610)
+++ oln/core/abstract/topology.hh (working copy)
@@ -48,16 +48,16 @@
struct decl
{
- stc_virtual_typedef(bbox);
+ oln_virtual_typedef(bbox);
// for being bboxed; provides .bbox()
- stc_virtual_typedef(is_random_accessible);
+ oln_virtual_typedef(is_random_accessible);
// provides .has(p) and .has_large(p)
- stc_virtual_typedef(point);
- stc_virtual_typedef(neighborhood);
+ oln_virtual_typedef(point);
+ oln_virtual_typedef(neighborhood);
- stc_virtual_typedef(morpher);
+ oln_virtual_typedef(morpher);
decl();
};
1
0
2006-10-09 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
* oln/debug/print.hh: Separate definition from declaration.
* oln/core/automatic/topology_being_random_accessible.hh
(impl_has_large): Fix signature.
Index: oln/debug/print.hh
===================================================================
--- oln/debug/print.hh (revision 609)
+++ oln/debug/print.hh (working copy)
@@ -43,7 +43,12 @@
template <typename I>
void print(const abstract::image<I>& input, std::ostream& ostr);
+ /// Fwd decl.
+ template <typename I>
+ void println(const abstract::image<I>& input, std::ostream& ostr);
+# ifndef OLN_INCLUDE_ONLY
+
namespace impl
{
@@ -97,6 +102,7 @@
ostr << std::endl;
}
+# endif // ! OLN_INCLUDE_ONLY
} // end of namespace oln::debug
Index: oln/core/automatic/topology_being_random_accessible.hh
===================================================================
--- oln/core/automatic/topology_being_random_accessible.hh (revision 609)
+++ oln/core/automatic/topology_being_random_accessible.hh (working copy)
@@ -76,6 +76,7 @@
return this->exact().delegate().has(p);
}
+ template <typename E>
bool
set_impl< abstract::topology_being_random_accessible, morpher::tag::identity, E>::impl_has_large(const typename set_impl< abstract::topology_being_random_accessible, morpher::tag::identity, E>::point_t& p) const
{
1
0
2006-10-09 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
* stc/scoop.hh (stc_virtual_typedef): Fix macro.
Index: stc/scoop.hh
===================================================================
--- stc/scoop.hh (revision 606)
+++ stc/scoop.hh (working copy)
@@ -1032,7 +1032,7 @@
/// for details). Warning: this macro assumes that the exact type
/// parameter is named 'E'.
#define stc_virtual_typedef(Typedef) \
- typedef oln_check_type_of(E, Typedef) Typedef
+ typedef stc_check_direct_type_of(E, Typedef) Typedef
#endif // ! STC_SCOOP_HH
1
0