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
13 Sep '06
2006-09-13 Roland Levillain <roland(a)lrde.epita.fr>
Prevent recursive traversals accross directories.
* oln/lrde/ufmt/bin/inc: Remove this symbolic link.
* oln/lrde/ufmt/bin/gpp, oln/lrde/ufmt/bin/gppo: Adjust.
--- 10.256/olena/oln/lrde/ufmt/bin/gppo Thu, 03 Aug 2006 16:06:43 +0200 theo (oln/x/2_gppo 1.1 755)
+++ 10.257/olena/oln/lrde/ufmt/bin/gppo Wed, 13 Sep 2006 13:11:27 +0200 levill_r (oln/x/2_gppo 1.1.1.1 755)
@@ -1 +1,5 @@
-g++-4.0 -Wall -Werror -ansi -pedantic -Iinc/metalic -Iinc/integre -Iinc/olena -DNDEBUG -O3 $1
+#! /bin/sh
+
+inc="../../../../.."
+
+g++-4.0 -Wall -Werror -ansi -pedantic -I$inc/metalic -I$inc/integre -I$inc/olena -DNDEBUG -O3 $1
--- 10.256/olena/oln/lrde/ufmt/bin/gpp Thu, 03 Aug 2006 16:06:43 +0200 theo (oln/x/3_gpp 1.1 755)
+++ 10.257/olena/oln/lrde/ufmt/bin/gpp Wed, 13 Sep 2006 13:11:27 +0200 levill_r (oln/x/3_gpp 1.1.1.1 755)
@@ -1 +1,5 @@
-g++-4.0 -Wall -Werror -ansi -pedantic -Iinc/metalic -Iinc/integre -Iinc/olena $1
+#! /bin/sh
+
+inc="../../../../.."
+
+g++-4.0 -Wall -Werror -ansi -pedantic -I$inc/metalic -I$inc/integre -I$inc/olena $1
--- 10.256/oln.prj
+++ 10.257/oln.prj
@@ -1,26 +1,18 @@
;; -*- Prcs -*-
(Created-By-Prcs-Version 1 3 3)
(Project-Description "Olena")
-(Project-Version oln 10 256)
-(Parent-Version oln 10 251)
-(Version-Log "2006-08-29 Roland Levillain <roland(a)lrde.epita.fr>
-
- Add a third version of the computation of a the max-tree based on
- Fiorio's and Gustedt's labelling algorithm.
-
- * oln/lrde/ufmt/fiorio-3.hh: New file.
- * oln/lrde/ufmt/bin/fiorio.cc: Handle fiorio-3.hh.
- Add copyright notice.
- * oln/lrde/ufmt/bin/Makefile.am (AM_CXXFLAGS): Add -DNDEBUG.
- (check_PROGRAMS): Add fiorio-3.
- (fiorio_3_SOURCES, fiorio_3_CPPFLAGS): New.
- * oln/lrde/ufmt/Makefile.am (noinst_HEADERS): Add fiorio-3.hh.
- * oln/lrde/ufmt/fiorio-1.hh, oln/lrde/ufmt/fiorio-2.hh: Typo in
- comment.
- * oln/lrde/ufmt/README: Update.
+(Project-Version oln 10 257)
+(Parent-Version oln 10 256)
+(Version-Log "2006-09-13 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Prevent recursive traversals accross directories.
+
+ * oln/lrde/ufmt/bin/inc: Remove this symbolic link.
+ * oln/lrde/ufmt/bin/gpp, oln/lrde/ufmt/bin/gppo: Adjust.
+
")
(New-Version-Log "")
-(Checkin-Time "Tue, 29 Aug 2006 14:48:46 +0200")
+(Checkin-Time "Wed, 13 Sep 2006 13:11:27 +0200")
(Checkin-Login levill_r)
;; diff-ignore tests/data/.*pbm$
;; diff-ignore .*\.pbm$
@@ -137,7 +129,7 @@
(doc/ChangeLog (oln/o/31_ChangeLog 1.38.1.7.1.5.1.14.1.17 600))
(integre/ChangeLog (oln/q/35_ChangeLog 1.12.1.2.1.51 600))
(metalic/ChangeLog (oln/q/30_ChangeLog 1.3.1.44 600))
- (olena/ChangeLog (oln/o/30_ChangeLog 1.27.1.36.1.3.1.11.1.5.1.64.1.47.1.93.1.27.2.18 600))
+ (olena/ChangeLog (oln/o/30_ChangeLog 1.27.1.36.1.3.1.11.1.5.1.64.1.47.1.93.1.27.2.18.1.1 600))
(tools/ChangeLog (oln/o/32_ChangeLog 1.10.1.17 600))
(tools/swilena/ChangeLog (oln/n/37_ChangeLog 1.7.1.48 600))
@@ -1542,9 +1534,9 @@
(olena/oln/lrde/ufmt/basic_salembier.hh (oln/w/51_basic_sale 1.1 644))
(olena/oln/lrde/ufmt/bin/basic_maxtree.cc (oln/x/0_basic_maxt 1.2 644))
(olena/oln/lrde/ufmt/bin/basic_salembier.cc (oln/x/1_basic_sale 1.2 644))
- (olena/oln/lrde/ufmt/bin/gppo (oln/x/2_gppo 1.1 755))
- (olena/oln/lrde/ufmt/bin/gpp (oln/x/3_gpp 1.1 755))
- (olena/oln/lrde/ufmt/bin/inc (../../../../../) :symlink)
+ (olena/oln/lrde/ufmt/bin/gppo (oln/x/2_gppo 1.1.1.1 755))
+ (olena/oln/lrde/ufmt/bin/gpp (oln/x/3_gpp 1.1.1.1 755))
+
(olena/oln/lrde/ufmt/basic_maxtree.hh (oln/x/4_basic_maxt 1.2 644))
(olena/oln/lrde/ufmt/log.hh (oln/x/5_log.hh 1.2 644))
(olena/oln/lrde/ufmt/img/lena64.pgm (oln/x/6_lena64.pgm 1.1 644))
@@ -1627,18 +1619,11 @@
;; to version 10.251(w), by levill_r:
(olena/oln/lrde/ufmt/fiorio-3.hh (oln/x/44_fiorio-3.h 1.1 644))
+
+;; Files deleted by depopulate at Wed, 13 Sep 2006 13:10:40 +0200,
+;; from version 10.256(w), by levill_r:
+
+ ; (olena/oln/lrde/ufmt/bin/inc () :symlink)
)
-(Merge-Parents
- (10.255 complete
- (olena/ChangeLog olena/ChangeLog olena/ChangeLog r) (olena/oln/lrde/ufmt/utils.hh olena/oln/lrde/ufmt/utils.hh olena/oln/lrde/ufmt/utils.hh r)
- (olena/oln/lrde/ufmt/rpc_maxtree.hh olena/oln/lrde/ufmt/rpc_maxtree.hh olena/oln/lrde/ufmt/rpc_maxtree.hh r) (olena/oln/lrde/ufmt/hpc_maxtree.hh olena/oln/lrde/ufmt/hpc_maxtree.hh olena/oln/lrde/ufmt/hpc_maxtree.hh r)
- (olena/oln/lrde/ufmt/README olena/oln/lrde/ufmt/README olena/oln/lrde/ufmt/README m) (olena/oln/lrde/ufmt/Makefile.am olena/oln/lrde/ufmt/Makefile.am olena/oln/lrde/ufmt/Makefile.am m)
- (olena/oln/lrde/ufmt/bin/Makefile.am olena/oln/lrde/ufmt/bin/Makefile.am olena/oln/lrde/ufmt/bin/Makefile.am m) (() () olena/oln/lrde/ufmt/hpx_maxtree.hh a)
- (() () olena/oln/lrde/ufmt/attributes.hh a) (() () olena/oln/lrde/ufmt/hdx_maxtree.hh a)
- (() () olena/oln/lrde/ufmt/attributes_bis.hh a) (() () olena/oln/lrde/ufmt/bin/hdx_maxtree.cc a)
- (() () olena/oln/lrde/ufmt/bin/gen_worst_salembier.cc a) (() () olena/oln/lrde/ufmt/bin/hpx_maxtree.cc a)
- (() () olena/oln/lrde/ufmt/bin/sp_maxtree.cc a) (() () olena/oln/lrde/ufmt/bin/spx_maxtree.cc a)
- (() () olena/oln/lrde/ufmt/spx_maxtree.hh a) (() () olena/oln/lrde/ufmt/sp_maxtree.hh a)
- (() () olena/oln/lrde/ufmt/basic_najman.hh a) (() () olena/oln/lrde/ufmt/bin/basic_najman.cc a))
-)
+(Merge-Parents)
(New-Merge-Parents)
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/static
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Remove packed_vtypes.
* stc/vtypes.hh (packed_vtypes_in_category, packed_vtypes):
Remove.
* tests/vtypes.cc
(my::packed_vtypes_in_category<category::my_cat, T>): Remove
(my::A::~A, , my::B::~B, my::C::~C): Remove dtors.
* tests/vtypes-and-exact.cc
(my::packed_vtypes_in_category<category::my_cat, T>): Remove.
(my::A::~A, , my::B::~B, my::C::~C): Remove dtors.
* tests/vtypes-multiple-supers.cc
(my::packed_vtypes_in_category<category::my_cat, T>): Remove.
(my::A::~A, , my::B::~B, my::C::~C): Remove dtors.
stc/vtypes.hh | 26 --------------------------
tests/vtypes-and-exact.cc | 34 ----------------------------------
tests/vtypes-multiple-supers.cc | 30 ------------------------------
tests/vtypes.cc | 34 ----------------------------------
4 files changed, 124 deletions(-)
Index: tests/vtypes-and-exact.cc
--- tests/vtypes-and-exact.cc (revision 530)
+++ tests/vtypes-and-exact.cc (working copy)
@@ -73,22 +73,6 @@
struct my_cat;
}
- /// Packing of virtual types of any class belonging to the category my::cat.
- template <typename T>
- struct packed_vtypes_in_category<category::my_cat, T>
- {
- typedef my_type_of(T, foo) foo_type;
- typedef my_type_of(T, bar) bar_type;
- typedef my_type_of(T, baz) baz_type;
-
- static void ensure()
- {
- mlc::assert_< mlc_is_ok(foo_type) >::check();
- mlc::assert_< mlc_is_ok(bar_type) >::check();
- mlc::assert_< mlc_is_ok(baz_type) >::check();
- }
- };
-
/*----------------------------------------.
| A<Exact> --|> stc::any__simple<Exact>. |
@@ -118,12 +102,6 @@
typedef my_type_of(A, foo) foo_type;
typedef my_type_of(A, bar) bar_type;
typedef my_type_of(A, baz) baz_type;
-
- ~A()
- {
- // packed_vtypes_in_category< category::my, A<Exact> > is not checked
- // here, since A's baz_type virtual type is undefined.
- }
};
@@ -172,12 +150,6 @@
typedef my_type_of(B, baz) baz_type;
typedef my_type_of(B, quux) quux_type;
typedef my_type_of(B, yin) yin_type;
-
- // Check B's vtypes.
- ~B()
- {
- packed_vtypes_in_category< category::my_cat, B<Exact> >::ensure();
- }
};
@@ -205,12 +177,6 @@
typedef my_type_of_(C, foo) foo_type;
typedef my_type_of_(C, quux) quux_type;
typedef my_type_of_(C, zorg) zorg_type;
-
- // Check C's vtypes.
- ~C()
- {
- packed_vtypes_in_category<category::my_cat, C>::ensure();
- }
};
} // end of namespace my
Index: tests/vtypes-multiple-supers.cc
--- tests/vtypes-multiple-supers.cc (revision 530)
+++ tests/vtypes-multiple-supers.cc (working copy)
@@ -81,18 +81,6 @@
struct my_cat;
}
- /// Packing of virtual types of any class belonging to the category my::cat.
- template <typename T>
- struct packed_vtypes_in_category<category::my_cat, T>
- {
- typedef my_type_of(T, foo) foo_type;
-
- static void ensure()
- {
- mlc::assert_< mlc_is_ok(foo_type) >::check();
- }
- };
-
/*----.
| A. |
@@ -114,12 +102,6 @@
// Aliases.
typedef my_type_of_(A, foo) foo_type;
typedef my_type_of_(A, bar) bar_type;
-
- // Check A's vtypes.
- ~A()
- {
- packed_vtypes_in_category<category::my_cat, A>::ensure();
- }
};
@@ -143,12 +125,6 @@
// Aliases.
typedef my_type_of_(B, foo) foo_type;
typedef my_type_of_(B, baz) baz_type;
-
- // Check B's vtypes.
- ~B()
- {
- packed_vtypes_in_category<category::my_cat, B>::ensure();
- }
};
@@ -182,12 +158,6 @@
typedef my_type_of_(C, foo) foo_type;
typedef my_type_of_(C, bar) bar_type;
typedef my_type_of_(C, baz) baz_type;
-
- // Check C's vtypes.
- ~C()
- {
- packed_vtypes_in_category<category::my_cat, C>::ensure();
- }
};
} // end of namespace my
Index: tests/vtypes.cc
--- tests/vtypes.cc (revision 530)
+++ tests/vtypes.cc (working copy)
@@ -71,22 +71,6 @@
struct my_cat;
}
- /// Packing of virtual types of any class belonging to the category my::cat.
- template <typename T>
- struct packed_vtypes_in_category<category::my_cat, T>
- {
- typedef my_type_of(T, foo) foo_type;
- typedef my_type_of(T, bar) bar_type;
- typedef my_type_of(T, baz) baz_type;
-
- static void ensure()
- {
- mlc::assert_< mlc_is_ok(foo_type) >::check();
- mlc::assert_< mlc_is_ok(bar_type) >::check();
- mlc::assert_< mlc_is_ok(baz_type) >::check();
- }
- };
-
/*----.
| A. |
@@ -115,12 +99,6 @@
typedef my_type_of_(A, foo) foo_type;
typedef my_type_of_(A, bar) bar_type;
typedef my_type_of_(A, baz) baz_type;
-
- ~A()
- {
- // packed_vtypes_in_category<category::my, A> is not checked here,
- // since A's baz_type virtual type is undefined.
- }
};
@@ -163,12 +141,6 @@
typedef my_type_of_(B, baz) baz_type;
typedef my_type_of_(B, quux) quux_type;
typedef my_type_of_(B, yin) yin_type;
-
- // Check B's vtype.
- ~B()
- {
- packed_vtypes_in_category<category::my_cat, B>::ensure();
- }
};
@@ -204,12 +176,6 @@
typedef my_type_of_(Z, quux) quux_type;
typedef my_type_of_(Z, yin) yin_type;
typedef my_type_of_(Z, zorg) zorg_type;
-
- // Check C's vtypes.
- ~Z()
- {
- packed_vtypes_in_category<category::my_cat, Z>::ensure();
- }
};
} // end of namespace my
Index: stc/vtypes.hh
--- stc/vtypes.hh (revision 530)
+++ stc/vtypes.hh (working copy)
@@ -367,32 +367,6 @@
/* \} */ \
\
\
- /* -------------------------- */ \
- /* Packing of virtual types. */ \
- /* -------------------------- */ \
- \
- /** Optional packing structure, to be specialized by the user. */ \
- /** See tests/vtypes.cc for an example of use. */ \
- template <typename category, typename from_type> \
- struct packed_vtypes_in_category \
- { \
- }; \
- \
- /** Optional packing structure, to be specialized by the user. */ \
- /** Version for types without category. */ \
- template <typename from_type> \
- struct packed_vtypes \
- { \
- }; \
- \
- /** Specialization of packed_vtypes for types without category. */ \
- template <typename from_type> \
- struct packed_vtypes_in_category<void, from_type> : \
- public packed_vtypes<from_type> \
- { \
- }; \
- \
- \
/* -------------------- */ \
/* Internal machinery. */ \
/* -------------------- */ \
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/olena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
No longer categories nor packed_vtypes.
* oln/core/abstract/image.hh (oln::category::grid): Remove
declaration.
* oln/core/abstract/grid.hh
(oln::packed_vtypes_in_category<category::grid, G>):
(oln::grid::~grid): Remove dtor.
(oln::category::grid): Remove declaration.
grid.hh | 47 -----------------------------------------------
image.hh | 7 -------
2 files changed, 54 deletions(-)
Index: oln/core/abstract/image.hh
--- oln/core/abstract/image.hh (revision 529)
+++ oln/core/abstract/image.hh (working copy)
@@ -36,13 +36,6 @@
namespace oln
{
- /// Category image.
- namespace category
- {
- struct image;
- }
-
-
/*! \namespace oln::abstract
** \brief oln::abstract namespace.
*/
Index: oln/core/abstract/grid.hh
--- oln/core/abstract/grid.hh (revision 529)
+++ oln/core/abstract/grid.hh (working copy)
@@ -37,13 +37,6 @@
namespace oln {
-
- /// Category grid.
- namespace category
- {
- struct grid;
- }
-
// Forward declaration.
namespace abstract
{
@@ -61,41 +54,6 @@
typedef mlc::undefined dimvalue_type;
};
-
- template <typename G>
- struct packed_vtypes_in_category<category::grid, G>
- {
- typedef oln_type_of(G, point) point_type;
- typedef oln_type_of(G, dpoint) dpoint_type;
- typedef oln_type_of(G, coord) coord_type;
- typedef oln_type_of(G, size) size_type;
- typedef oln_type_of(G, dimvalue) dimvalue_type;
-
- static void echo(std::ostream& ostr)
- {
- ostr
- << "vtypes_in_category(oln::category::grid, " << mlc_to_string(G) << ") ="
- << std::endl
- << "{" << std::endl
- << " point_type = " << mlc_to_string(point_type) << std::endl
- << " dpoint_type = " << mlc_to_string(dpoint_type) << std::endl
- << " coord_type = " << mlc_to_string(coord_type) << std::endl
- << " size_type = " << mlc_to_string(size_type) << std::endl
- << " dimvalue_type = " << mlc_to_string(dimvalue_type) << std::endl
- << "}" << std::endl;
- }
-
- static void ensure()
- {
- mlc::assert_< mlc_is_ok(point_type) >::check();
- mlc::assert_< mlc_is_ok(dpoint_type) >::check();
- mlc::assert_< mlc_is_ok(coord_type) >::check();
- mlc::assert_< mlc_is_ok(size_type) >::check();
- mlc::assert_< mlc_is_ok(dimvalue_type) >::check();
- }
- };
-
-
namespace abstract {
template <typename E>
@@ -104,11 +62,6 @@
protected:
grid()
{}
-
- ~grid()
- {
- packed_vtypes_in_category<category::grid, E>::ensure();
- }
};
} // end of namespace oln::abstract
1
0
13 Sep '06
2006-09-13 Roland Levillain <roland(a)lrde.epita.fr>
Prevent recursive traversals accross directories.
* oln/lrde/ufmt/bin/inc: Remove this symbolic link.
* oln/lrde/ufmt/bin/gpp, oln/lrde/ufmt/bin/gppo: Adjust.
--- 10.256/olena/oln/lrde/ufmt/bin/gppo Thu, 03 Aug 2006 16:06:43 +0200 theo (oln/x/2_gppo 1.1 755)
+++ 10.257/olena/oln/lrde/ufmt/bin/gppo Wed, 13 Sep 2006 13:11:27 +0200 levill_r (oln/x/2_gppo 1.1.1.1 755)
@@ -1 +1,5 @@
-g++-4.0 -Wall -Werror -ansi -pedantic -Iinc/metalic -Iinc/integre -Iinc/olena -DNDEBUG -O3 $1
+#! /bin/sh
+
+inc="../../../../.."
+
+g++-4.0 -Wall -Werror -ansi -pedantic -I$inc/metalic -I$inc/integre -I$inc/olena -DNDEBUG -O3 $1
--- 10.256/olena/oln/lrde/ufmt/bin/gpp Thu, 03 Aug 2006 16:06:43 +0200 theo (oln/x/3_gpp 1.1 755)
+++ 10.257/olena/oln/lrde/ufmt/bin/gpp Wed, 13 Sep 2006 13:11:27 +0200 levill_r (oln/x/3_gpp 1.1.1.1 755)
@@ -1 +1,5 @@
-g++-4.0 -Wall -Werror -ansi -pedantic -Iinc/metalic -Iinc/integre -Iinc/olena $1
+#! /bin/sh
+
+inc="../../../../.."
+
+g++-4.0 -Wall -Werror -ansi -pedantic -I$inc/metalic -I$inc/integre -I$inc/olena $1
--- 10.256/oln.prj
+++ 10.257/oln.prj
@@ -1,26 +1,18 @@
;; -*- Prcs -*-
(Created-By-Prcs-Version 1 3 3)
(Project-Description "Olena")
-(Project-Version oln 10 256)
-(Parent-Version oln 10 251)
-(Version-Log "2006-08-29 Roland Levillain <roland(a)lrde.epita.fr>
-
- Add a third version of the computation of a the max-tree based on
- Fiorio's and Gustedt's labelling algorithm.
-
- * oln/lrde/ufmt/fiorio-3.hh: New file.
- * oln/lrde/ufmt/bin/fiorio.cc: Handle fiorio-3.hh.
- Add copyright notice.
- * oln/lrde/ufmt/bin/Makefile.am (AM_CXXFLAGS): Add -DNDEBUG.
- (check_PROGRAMS): Add fiorio-3.
- (fiorio_3_SOURCES, fiorio_3_CPPFLAGS): New.
- * oln/lrde/ufmt/Makefile.am (noinst_HEADERS): Add fiorio-3.hh.
- * oln/lrde/ufmt/fiorio-1.hh, oln/lrde/ufmt/fiorio-2.hh: Typo in
- comment.
- * oln/lrde/ufmt/README: Update.
+(Project-Version oln 10 257)
+(Parent-Version oln 10 256)
+(Version-Log "2006-09-13 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Prevent recursive traversals accross directories.
+
+ * oln/lrde/ufmt/bin/inc: Remove this symbolic link.
+ * oln/lrde/ufmt/bin/gpp, oln/lrde/ufmt/bin/gppo: Adjust.
+
")
(New-Version-Log "")
-(Checkin-Time "Tue, 29 Aug 2006 14:48:46 +0200")
+(Checkin-Time "Wed, 13 Sep 2006 13:11:27 +0200")
(Checkin-Login levill_r)
;; diff-ignore tests/data/.*pbm$
;; diff-ignore .*\.pbm$
@@ -137,7 +129,7 @@
(doc/ChangeLog (oln/o/31_ChangeLog 1.38.1.7.1.5.1.14.1.17 600))
(integre/ChangeLog (oln/q/35_ChangeLog 1.12.1.2.1.51 600))
(metalic/ChangeLog (oln/q/30_ChangeLog 1.3.1.44 600))
- (olena/ChangeLog (oln/o/30_ChangeLog 1.27.1.36.1.3.1.11.1.5.1.64.1.47.1.93.1.27.2.18 600))
+ (olena/ChangeLog (oln/o/30_ChangeLog 1.27.1.36.1.3.1.11.1.5.1.64.1.47.1.93.1.27.2.18.1.1 600))
(tools/ChangeLog (oln/o/32_ChangeLog 1.10.1.17 600))
(tools/swilena/ChangeLog (oln/n/37_ChangeLog 1.7.1.48 600))
@@ -1542,9 +1534,9 @@
(olena/oln/lrde/ufmt/basic_salembier.hh (oln/w/51_basic_sale 1.1 644))
(olena/oln/lrde/ufmt/bin/basic_maxtree.cc (oln/x/0_basic_maxt 1.2 644))
(olena/oln/lrde/ufmt/bin/basic_salembier.cc (oln/x/1_basic_sale 1.2 644))
- (olena/oln/lrde/ufmt/bin/gppo (oln/x/2_gppo 1.1 755))
- (olena/oln/lrde/ufmt/bin/gpp (oln/x/3_gpp 1.1 755))
- (olena/oln/lrde/ufmt/bin/inc (../../../../../) :symlink)
+ (olena/oln/lrde/ufmt/bin/gppo (oln/x/2_gppo 1.1.1.1 755))
+ (olena/oln/lrde/ufmt/bin/gpp (oln/x/3_gpp 1.1.1.1 755))
+
(olena/oln/lrde/ufmt/basic_maxtree.hh (oln/x/4_basic_maxt 1.2 644))
(olena/oln/lrde/ufmt/log.hh (oln/x/5_log.hh 1.2 644))
(olena/oln/lrde/ufmt/img/lena64.pgm (oln/x/6_lena64.pgm 1.1 644))
@@ -1627,18 +1619,11 @@
;; to version 10.251(w), by levill_r:
(olena/oln/lrde/ufmt/fiorio-3.hh (oln/x/44_fiorio-3.h 1.1 644))
+
+;; Files deleted by depopulate at Wed, 13 Sep 2006 13:10:40 +0200,
+;; from version 10.256(w), by levill_r:
+
+ ; (olena/oln/lrde/ufmt/bin/inc () :symlink)
)
-(Merge-Parents
- (10.255 complete
- (olena/ChangeLog olena/ChangeLog olena/ChangeLog r) (olena/oln/lrde/ufmt/utils.hh olena/oln/lrde/ufmt/utils.hh olena/oln/lrde/ufmt/utils.hh r)
- (olena/oln/lrde/ufmt/rpc_maxtree.hh olena/oln/lrde/ufmt/rpc_maxtree.hh olena/oln/lrde/ufmt/rpc_maxtree.hh r) (olena/oln/lrde/ufmt/hpc_maxtree.hh olena/oln/lrde/ufmt/hpc_maxtree.hh olena/oln/lrde/ufmt/hpc_maxtree.hh r)
- (olena/oln/lrde/ufmt/README olena/oln/lrde/ufmt/README olena/oln/lrde/ufmt/README m) (olena/oln/lrde/ufmt/Makefile.am olena/oln/lrde/ufmt/Makefile.am olena/oln/lrde/ufmt/Makefile.am m)
- (olena/oln/lrde/ufmt/bin/Makefile.am olena/oln/lrde/ufmt/bin/Makefile.am olena/oln/lrde/ufmt/bin/Makefile.am m) (() () olena/oln/lrde/ufmt/hpx_maxtree.hh a)
- (() () olena/oln/lrde/ufmt/attributes.hh a) (() () olena/oln/lrde/ufmt/hdx_maxtree.hh a)
- (() () olena/oln/lrde/ufmt/attributes_bis.hh a) (() () olena/oln/lrde/ufmt/bin/hdx_maxtree.cc a)
- (() () olena/oln/lrde/ufmt/bin/gen_worst_salembier.cc a) (() () olena/oln/lrde/ufmt/bin/hpx_maxtree.cc a)
- (() () olena/oln/lrde/ufmt/bin/sp_maxtree.cc a) (() () olena/oln/lrde/ufmt/bin/spx_maxtree.cc a)
- (() () olena/oln/lrde/ufmt/spx_maxtree.hh a) (() () olena/oln/lrde/ufmt/sp_maxtree.hh a)
- (() () olena/oln/lrde/ufmt/basic_najman.hh a) (() () olena/oln/lrde/ufmt/bin/basic_najman.cc a))
-)
+(Merge-Parents)
(New-Merge-Parents)
1
0
529: Fix the current implementation of image_entry, as well as some tests.
by Roland Levillain 12 Sep '06
by Roland Levillain 12 Sep '06
12 Sep '06
https://svn.lrde.epita.fr/svn/oln/trunk/olena
I've fixed some ChangeLog entries in the previous commit, and did not
post the diffs; that's why it didn't show up on the list/newsgroup.
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Fix the current implementation of image_entry, as well as some
tests.
* oln/core/abstract/internal/image_impl.hh (oln::category::image):
Move this declaration...
* oln/core/abstract/image.hh: ...here.
* oln/core/case.hh: New file.
* oln/core/abstract/image_abstractions.hh,
* olena/oln/core/abstract/entry.hh,
* oln/core/traits.hh: Use it.
* oln/Makefile.am (nobase_oln_HEADERS): Add core/case.hh.
* oln/core/abstract/image_dimension.hh
(oln::ERROR::UNKNOWN_GRID_TYPE): New.
(oln::default_case_<grid_dim_tag, grid_type): Use it.
(ext_vtype_in_category): Turn into...
(ext_vtype): ...this.
* oln/core/abstract/image_typeness.hh (ext_vtype_in_category):
Turn into...
(ext_vtype): ...this.
* oln/core/typedefs.hh (oln_type_of, oln_type_of_): Move
these macros...
* oln/core/abstract/macros.hh: ...here, and replace the previous
ones.
Rename file as...
* oln/core/macros.hh: ...this.
Adjust header guards.
* oln/core/abstract/internal/image_impl.hh: Adjust users.
* oln/Makefile.am (nobase_oln_HEADERS): Remove
core/abstract/macros.hh.
Add core/macros.hh
* oln/core/abstract/grid.hh (oln_grd_type_of, oln_grd_type_of_):
Remove macros.
(vtypes_in_category< category::grid, abstract::grid<G> >): Turn
into...
(vtypes< abstract::grid<G> >): ...this.
(packed_vtypes_in_category<category::grid, G>):
s/oln_grd_type_of/oln_type_of/g.
* oln/core/1d/grid1d.hh, oln/core/2d/grid2d.hh,
* oln/core/3d/grid3d.hh (vtypes_in_category): Turn into...
(vtypes): ...this.
* tests/grid.cc: s/oln_grd_type_of_/oln_type_of_/g
* tests/image_entry.cc (my::dummy): New declaration.
(vtypes_in_category<category::image, my::image>): Turn into...
(vtypes<my::image>): ...this.
Add missing virtual types.
(my::image): Fix base class.
(main): Remove any references to
packed_vtypes_in_category<oln::category::image, my::image>, since
it no longer exists.
* tests/Makefile.am (AM_CPPFLAGS): Add -I$(top_srcdir)/extended.
oln/Makefile.am | 9 +++---
oln/core/1d/grid1d.hh | 2 -
oln/core/2d/grid2d.hh | 2 -
oln/core/3d/grid3d.hh | 2 -
oln/core/abstract/entry.hh | 2 -
oln/core/abstract/grid.hh | 19 ++++----------
oln/core/abstract/image.hh | 8 +++++-
oln/core/abstract/image_abstractions.hh | 5 ---
oln/core/abstract/image_dimension.hh | 23 +++++++++++++++--
oln/core/abstract/image_typeness.hh | 3 --
oln/core/abstract/internal/image_impl.hh | 8 ------
oln/core/case.hh | 40 +++++++++++++++++++++++++++++++
oln/core/macros.hh | 28 +++++++++++++--------
oln/core/traits.hh | 6 ----
oln/core/typedefs.hh | 16 +-----------
tests/Makefile.am | 4 +--
tests/grid.cc | 6 ++--
tests/image_entry.cc | 26 +++++++++++++-------
18 files changed, 127 insertions(+), 82 deletions(-)
Index: tests/image_entry.cc
--- tests/image_entry.cc (revision 528)
+++ tests/image_entry.cc (working copy)
@@ -34,11 +34,13 @@
#include <oln/core/1d/grid1d.hh>
#include <oln/core/abstract/image_entry.hh>
-
namespace my
{
// Forward declaration.
- class image;
+ struct image;
+
+ // Dummy type.
+ struct dummy;
}
namespace oln
@@ -48,7 +50,7 @@
/// Virtual types associated to my::image.
template<>
- struct vtypes_in_category<category::image, my::image>
+ struct vtypes<my::image>
{
// The switch for image_dimension (above image_entry) plugs the
// inheritance relation to the right abstract::image_dimension
@@ -59,13 +61,23 @@
// Likewise, for the switch of image_typeness using the type of
// the value of the image.
typedef char value_type;
+
+ // FIXME: Dummy values.
+ typedef my::dummy topo_type;
+ typedef my::dummy psite_type;
+ typedef my::dummy rvalue_type;
+ typedef my::dummy point_type;
+ typedef my::dummy piter_type;
+ typedef my::dummy fwd_piter_type;
+ typedef my::dummy bkd_piter_type;
+ typedef my::dummy concrete_type;
};
}
namespace my
{
// A very simple 1-D image.
- class image : public oln::set_super_type<my::image>::ret
+ class image : public oln::get_super_types<my::image>::ret
{
public:
typedef image self_type;
@@ -78,6 +90,7 @@
};
}
+
int
main()
{
@@ -102,9 +115,4 @@
// Ensure we can instantiate it.
my::image i;
-
- // Print my::image's vtypes.
- // FIXME: To be removed in the final version.
- oln::packed_vtypes_in_category< oln::category::image,
- my::image >::echo (std::cout);
}
Index: tests/Makefile.am
--- tests/Makefile.am (revision 528)
+++ tests/Makefile.am (working copy)
@@ -1,8 +1,8 @@
## Process this file through Automake to create Makefile.in -*- Makefile -*-
AM_CPPFLAGS = \
- -I$(top_srcdir)/olena -I$(top_srcdir)/static \
- -I$(top_srcdir)/metalic
+ -I$(top_srcdir)/olena -I$(top_srcdir)/extended \
+ -I$(top_srcdir)/static -I$(top_srcdir)/metalic
# FIXME: Add
#
# AM_CXXFLAGS = $(CXXFLAGS_STRICT) $(CXXFLAGS_OPTIMIZE) -ggdb
Index: tests/grid.cc
--- tests/grid.cc (revision 528)
+++ tests/grid.cc (working copy)
@@ -38,7 +38,7 @@
// The extra pairs of parenthesis around mlc_value are needed to
// prevent the assert macro from interpreting the arguments of
// mlc_value as its own.
- assert((mlc_value(oln_grd_type_of_(oln::grid1d, dimvalue))) == 1);
- assert((mlc_value(oln_grd_type_of_(oln::grid2d, dimvalue))) == 2);
- assert((mlc_value(oln_grd_type_of_(oln::grid3d, dimvalue))) == 3);
+ assert((mlc_value(oln_type_of_(oln::grid1d, dimvalue))) == 1);
+ assert((mlc_value(oln_type_of_(oln::grid2d, dimvalue))) == 2);
+ assert((mlc_value(oln_type_of_(oln::grid3d, dimvalue))) == 3);
}
Index: oln/core/typedefs.hh
--- oln/core/typedefs.hh (revision 528)
+++ oln/core/typedefs.hh (working copy)
@@ -44,20 +44,8 @@
# include <stc/vtypes.hh>
# include <oln/core/type.hh>
-
-
-/*! \macro oln_type_of(OlnType, Alias)
-**
-** Macro to retrieve an associated type \Alias from an oln type
-** \OlnType whose category is not specified.
-*/
-
-# define oln_type_of(OlnType, Alias) \
-stc_type_of(oln, void, OlnType, Alias)
-
-# define oln_type_of_(OlnType, Alias) \
-stc_type_of_(oln, void, OlnType, Alias)
-
+// FIXME: Move to oln/core.
+# include <oln/core/macros.hh>
namespace oln
Index: oln/core/macros.hh
--- oln/core/macros.hh (revision 521)
+++ oln/core/macros.hh (working copy)
@@ -25,17 +25,23 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef OLENA_CORE_ABSTRACT_MACROS_HH
-# define OLENA_CORE_ABSTRACT_MACROS_HH
+#ifndef OLENA_CORE_MACROS_HH
+# define OLENA_CORE_MACROS_HH
-/// \def Shortcuts for virtual types associated to images (version to
-// be used inside a template).
-# define oln_type_of(ImageType, Alias) \
-stc_type_of(oln, oln::category::image, ImageType, Alias)
+/// \def oln_type_of(OlnType, Alias)
+///
+/// Macro to retrieve an associated type \a Alias from an oln type
+/// \a OlnType whose category is not specified (version to be used inside
+/// a template).
+# define oln_type_of(OlnType, Alias) \
+stc_type_of(oln, void, OlnType, Alias)
-/// \def Shortcuts for virtual types associated to images (version to
-// be used outside a template).
-# define oln_type_of_(ImageType, Alias) \
-stc_type_of_(oln, oln::category::image, ImageType, Alias)
+/// \def oln_type_of(OlnType, Alias)
+///
+/// Macro to retrieve an associated type \a Alias from an oln type
+/// \a OlnType whose category is not specified (version to be used
+/// outside a template).
+# define oln_type_of_(OlnType, Alias) \
+stc_type_of_(oln, void, OlnType, Alias)
-#endif // ! OLENA_CORE_ABSTRACT_MACROS_HH
+#endif // ! OLENA_CORE_MACROS_HH
Index: oln/core/abstract/image.hh
--- oln/core/abstract/image.hh (revision 528)
+++ oln/core/abstract/image.hh (working copy)
@@ -33,10 +33,16 @@
// # include <oln/core/abstract/internal/image_impl.hh>
-
namespace oln
{
+ /// Category image.
+ namespace category
+ {
+ struct image;
+ }
+
+
/*! \namespace oln::abstract
** \brief oln::abstract namespace.
*/
Index: oln/core/abstract/grid.hh
--- oln/core/abstract/grid.hh (revision 528)
+++ oln/core/abstract/grid.hh (working copy)
@@ -35,13 +35,6 @@
# include <oln/core/typedefs.hh>
-# define oln_grd_type_of(GridType, Alias) \
-stc_type_of(oln, oln::category::grid, GridType, Alias)
-
-# define oln_grd_type_of_(GridType, Alias) \
-stc_type_of_(oln, oln::category::grid, GridType, Alias)
-
-
namespace oln {
@@ -59,7 +52,7 @@
/// Virtual types associated to oln::abstract::image.
template <typename G>
- struct vtypes_in_category< category::grid, abstract::grid<G> >
+ struct vtypes< abstract::grid<G> >
{
typedef mlc::undefined point_type;
typedef mlc::none dpoint_type;
@@ -72,11 +65,11 @@
template <typename G>
struct packed_vtypes_in_category<category::grid, G>
{
- typedef oln_grd_type_of(G, point) point_type;
- typedef oln_grd_type_of(G, dpoint) dpoint_type;
- typedef oln_grd_type_of(G, coord) coord_type;
- typedef oln_grd_type_of(G, size) size_type;
- typedef oln_grd_type_of(G, dimvalue) dimvalue_type;
+ typedef oln_type_of(G, point) point_type;
+ typedef oln_type_of(G, dpoint) dpoint_type;
+ typedef oln_type_of(G, coord) coord_type;
+ typedef oln_type_of(G, size) size_type;
+ typedef oln_type_of(G, dimvalue) dimvalue_type;
static void echo(std::ostream& ostr)
{
Index: oln/core/abstract/image_dimension.hh
--- oln/core/abstract/image_dimension.hh (revision 528)
+++ oln/core/abstract/image_dimension.hh (working copy)
@@ -107,6 +107,24 @@
} // end of namespace oln
+/*-----------------.
+| Error messages. |
+`-----------------*/
+
+namespace oln
+{
+ /// Error messages raised by static assertions.
+ namespace ERROR
+ {
+
+ template <typename Grid>
+ struct UNKNOWN_GRID_TYPE;
+
+ } // end of namespace oln::ERROR
+
+} // end of namespace oln
+
+
/*-------------------.
| Dimension switch. |
`-------------------*/
@@ -176,7 +194,7 @@
template <typename grid_type>
struct default_case_<grid_dim_tag, grid_type>
{
- typedef mlc::abort_<grid_dim_tag> ret;
+ typedef mlc::abort_< grid_dim_tag, ERROR::UNKNOWN_GRID_TYPE<grid_type> > ret;
};
/// \}
@@ -192,8 +210,7 @@
{
/// Image dimension type as an extended vtype of abstract::image.
template <typename I>
- struct ext_vtype_in_category< category::image,
- abstract::image<I>,
+ struct ext_vtype< abstract::image<I>,
// FIXME: Get rid of this typedef_:: qualifier.
typedef_::image_dimension_type >
{
Index: oln/core/abstract/image_abstractions.hh
--- oln/core/abstract/image_abstractions.hh (revision 528)
+++ oln/core/abstract/image_abstractions.hh (working copy)
@@ -28,10 +28,7 @@
#ifndef OLENA_CORE_ABSTRACT_IMAGE_ABSTRACTIONS_HH
# define OLENA_CORE_ABSTRACT_IMAGE_ABSTRACTIONS_HH
-# include <mlc/case.hh>
-
-// Add switch/case equipment in the oln namespace.
-mlc_case_equipment_for_namespace(oln);
+# include <oln/core/case.hh>
namespace oln
Index: oln/core/abstract/entry.hh
--- oln/core/abstract/entry.hh (revision 528)
+++ oln/core/abstract/entry.hh (working copy)
@@ -29,7 +29,7 @@
# define OLENA_CORE_ABSTRACT_ENTRY_HH
# include <oln/core/typedefs.hh>
-
+# include <oln/core/case.hh>
namespace oln
{
Index: oln/core/abstract/image_typeness.hh
--- oln/core/abstract/image_typeness.hh (revision 528)
+++ oln/core/abstract/image_typeness.hh (working copy)
@@ -308,8 +308,7 @@
{
/// Image ``typeness'' as an extended vtype of abstract::image.
template <typename I>
- struct ext_vtype_in_category< category::image,
- abstract::image<I>,
+ struct ext_vtype< abstract::image<I>,
// FIXME: Get rid of this typedef_:: qualifier.
typedef_::image_typeness_type >
{
Index: oln/core/abstract/internal/image_impl.hh
--- oln/core/abstract/internal/image_impl.hh (revision 528)
+++ oln/core/abstract/internal/image_impl.hh (working copy)
@@ -31,19 +31,13 @@
# include <mlc/flags.hh>
# include <oln/core/typedefs.hh>
# include <oln/core/abstract/any.hh>
-# include <oln/core/abstract/macros.hh>
+# include <oln/core/macros.hh>
// FIXME: To be rewtitten using Metalic's switch/case?
namespace oln
{
- /// Category image.
- namespace category
- {
- struct image;
- }
-
namespace abstract
{
Index: oln/core/1d/grid1d.hh
--- oln/core/1d/grid1d.hh (revision 528)
+++ oln/core/1d/grid1d.hh (working copy)
@@ -47,7 +47,7 @@
/// Virtual types associated to oln::grid1d.
template <>
- struct vtypes_in_category<category::grid, grid1d>
+ struct vtypes<grid1d>
{
typedef point1d point_type;
typedef dpoint1d dpoint_type;
Index: oln/core/traits.hh
--- oln/core/traits.hh (revision 528)
+++ oln/core/traits.hh (working copy)
@@ -30,16 +30,12 @@
# include <mlc/assert.hh>
-# include <mlc/case.hh>
# include <mlc/abort.hh>
# include <xtd/optraits.hh>
# include <stc/exact.hh>
# include <oln/core/type.hh>
-
-
-mlc_case_equipment_for_namespace(oln);
-
+# include <oln/core/case.hh>
namespace oln
Index: oln/core/2d/grid2d.hh
--- oln/core/2d/grid2d.hh (revision 528)
+++ oln/core/2d/grid2d.hh (working copy)
@@ -47,7 +47,7 @@
/// Virtual types associated to oln::grid2d.
template <>
- struct vtypes_in_category<category::grid, grid2d>
+ struct vtypes<grid2d>
{
typedef point2d point_type;
typedef dpoint2d dpoint_type;
Index: oln/core/3d/grid3d.hh
--- oln/core/3d/grid3d.hh (revision 528)
+++ oln/core/3d/grid3d.hh (working copy)
@@ -47,7 +47,7 @@
/// Virtual types associated to oln::grid3d.
template <>
- struct vtypes_in_category<category::grid, grid3d>
+ struct vtypes<grid3d>
{
typedef point3d point_type;
typedef dpoint3d dpoint_type;
Index: oln/core/case.hh
--- oln/core/case.hh (revision 0)
+++ oln/core/case.hh (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.
+
+/** \file oln/core/case.hh
+ \brief Switch/case equipment for the oln namespace.
+
+ Use this file to avoid unnecessary (duplicated) expansions of case_. */
+
+#ifndef OLENA_CORE_CASE_HH
+# define OLENA_CORE_CASE_HH
+
+# include <mlc/case.hh>
+
+mlc_case_equipment_for_namespace(oln);
+
+#endif // ! OLENA_CORE_CASE_HH
Index: oln/Makefile.am
--- oln/Makefile.am (revision 528)
+++ oln/Makefile.am (working copy)
@@ -2,8 +2,6 @@
olndir = $(includedir)/oln
nobase_oln_HEADERS = \
- core/typedefs.hh \
- \
core/1d/grid1d.hh \
\
core/2d/grid2d.hh \
@@ -18,6 +16,9 @@
core/abstract/image_dimension.hh \
core/abstract/image_typeness.hh \
core/abstract/image_typeness_integre.hh \
- core/abstract/macros.hh \
\
- core/abstract/internal/image_impl.hh
+ core/abstract/internal/image_impl.hh \
+ \
+ core/case.hh \
+ core/macros.hh \
+ core/typedefs.hh
1
0
2006-09-07 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Add image2d and fix topo-related classes.
* olena/tests/npoints.cc: New.
* olena/tests/Makefile.am: Update.
* olena/oln/core/image_entry.hh: New.
* olena/oln/core/2d/image2d.hh: New.
* olena/oln/basics2d.hh: Force instantiation and include
oln/core/2d/image2d.hh.
* olena/oln/core/typedefs.hh: Include mlc/assert.hh and
mlc/to_string.hh.
(piter_type): Uncomment.
(rvalue_type): New.
(psite_type): New.
(concrete_type): Uncomment.
(size_type): Add comment.
(topo_type): New.
* olena/oln/core/abstract/topo.hh (bbox): Remove this method which
is redundant with the one of topo_with_bbox.
* olena/oln/core/abstract/topo_with_bbox.hh (bbox): Fix typo.
* olena/oln/core/abstract/entry.hh (next_entry_node): New
specialization to handle the specific and rare case of having no
sub-hierarchy.
* olena/oln/core/abstract/topo_ra.hh: Fix cut n paste errors.
* olena/oln/core/abstract/pset.hh (piter): New vtype decl.
* olena/oln/core/gen/fwd_piter.hh (fwd_piter_): Add commented
forthcoming ctors.
* olena/oln/core/gen/bbox_topo.hh: Cosmetics.
* olena/oln/core/pset_entry.hh (piter_type): New.
* olena/oln/core/abstract/image.hh: Update.
Index: tests/Makefile.am
===================================================================
--- tests/Makefile.am (revision 526)
+++ tests/Makefile.am (working copy)
@@ -11,9 +11,11 @@
check_PROGRAMS = \
grid \
- image_entry
+ image_entry \
+ npoints
+grid_SOURCES = grid.cc
image_entry_SOURCES = image_entry.cc
-grid_SOURCES = grid.cc
+npoints_SOURCES = npoints.cc
TESTS = $(check_PROGRAMS)
Index: tests/npoints.cc
===================================================================
--- tests/npoints.cc (revision 0)
+++ tests/npoints.cc (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.
+
+/// Test image2d.
+
+#include <cassert>
+#include <oln/basics2d.hh>
+
+
+template <typename I>
+unsigned npoints(const oln::abstract::image<I>& input)
+{
+ oln_type_of(I, piter) p(input.topo());
+ unsigned count = 0;
+ for_all(p)
+ ++count;
+ return count;
+}
+
+
+int
+main()
+{
+ oln::image2d<int> ima(3, 17);
+ assert(npoints(ima) == 51);
+}
Index: oln/core/typedefs.hh
===================================================================
--- oln/core/typedefs.hh (revision 526)
+++ oln/core/typedefs.hh (working copy)
@@ -30,12 +30,14 @@
# include <iostream>
+# include <mlc/assert.hh>
# include <mlc/contract.hh>
# include <mlc/flags.hh>
# include <mlc/is_a.hh>
# include <mlc/cmp.hh>
# include <mlc/typedef.hh>
# include <mlc/value.hh>
+# include <mlc/to_string.hh>
# include <stc/any.hh>
# include <stc/exact.hh>
@@ -95,7 +97,7 @@
// mlc_decl_typedef(fwd_iter_type);
// mlc_decl_typedef(bkd_iter_type);
-// mlc_decl_typedef(piter_type);
+ mlc_decl_typedef(piter_type);
mlc_decl_typedef(fwd_piter_type);
mlc_decl_typedef(bkd_piter_type);
@@ -128,6 +130,7 @@
// mlc_decl_typedef(data_type);
// --------------------------------------------------------------------
mlc_decl_typedef(value_type);
+ mlc_decl_typedef(rvalue_type);
// --------------------------------------------------------------------
// FIXME: To be enabled later.
// --------------------------------------------------------------------
@@ -135,17 +138,19 @@
// mlc_decl_typedef(value_storage_type);
// mlc_decl_typedef(storage_type);
// --------------------------------------------------------------------
+ mlc_decl_typedef(psite_type);
mlc_decl_typedef(point_type);
mlc_decl_typedef(dpoint_type);
// --------------------------------------------------------------------
// FIXME: To be enabled later.
// --------------------------------------------------------------------
// mlc_decl_typedef(image_type);
-// mlc_decl_typedef(concrete_type);
// --------------------------------------------------------------------
+ mlc_decl_typedef(concrete_type);
mlc_decl_typedef(delegated_type);
- mlc_decl_typedef(size_type);
+ mlc_decl_typedef(size_type); // FIXME: To be removed.
+ mlc_decl_typedef(topo_type);
mlc_decl_typedef(bbox_type);
// --------------------------------------------------------------------
// FIXME: To be enabled later.
Index: oln/core/image_entry.hh
===================================================================
--- oln/core/image_entry.hh (revision 0)
+++ oln/core/image_entry.hh (revision 0)
@@ -0,0 +1,97 @@
+// 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 OLENA_CORE_IMAGE_ENTRY_HH
+# define OLENA_CORE_IMAGE_ENTRY_HH
+
+# include <oln/core/abstract/entry.hh>
+# include <oln/core/abstract/image.hh>
+
+
+
+namespace oln
+{
+
+
+ /// Entry class for point sets: image_entry<E> is an alias for
+ /// entry< abstract::image, E>.
+
+ template <typename E>
+ struct image_entry : public entry< abstract::image, E>
+ {
+ protected:
+ image_entry() {}
+ };
+
+
+ /// Virtual types associated to image_entry<E>.
+
+ template <typename E>
+ struct vtypes< image_entry<E> >
+ {
+ typedef mlc::undefined topo_type;
+ typedef mlc::undefined grid_type;
+
+ // psite_type: see below
+ typedef mlc::undefined point_type;
+
+ // piter_type: see below
+ typedef mlc::undefined fwd_piter_type;
+ typedef mlc::undefined bkd_piter_type;
+
+ typedef mlc::undefined value_type;
+ // rvalue_type: see below
+
+ typedef mlc::undefined concrete_type;
+ };
+
+
+ template <typename E>
+ struct single_vtype< image_entry<E>, typedef_::psite_type >
+ {
+ typedef oln_type_of(E, point) ret;
+ };
+
+
+ template <typename E>
+ struct single_vtype< image_entry<E>, typedef_::piter_type >
+ {
+ typedef oln_type_of(E, fwd_piter) ret;
+ };
+
+
+ template <typename E>
+ struct single_vtype< image_entry<E>, typedef_::rvalue_type >
+ {
+ typedef oln_type_of(E, value) ret;
+ };
+
+
+} // end of namespace oln
+
+
+#endif // ! OLENA_CORE_IMAGE_ENTRY_HH
Index: oln/core/abstract/topo.hh
===================================================================
--- oln/core/abstract/topo.hh (revision 526)
+++ oln/core/abstract/topo.hh (working copy)
@@ -54,16 +54,11 @@
decl() {
// constraint:
- mlc::assert_< mlc::implies_< mlc::neq_< bbox, mlc::none >,
- mlc_is_a(bbox, abstract::bbox) > >::check();
+// mlc::assert_< mlc::implies_< mlc::neq_< bbox, mlc::none >,
+// mlc_is_a(bbox, abstract::bbox) > >::check();
}
};
- const oln_type_of(E, bbox)& bbox() const
- {
- return this->exact().impl_bbox();
- }
-
protected:
topo()
Index: oln/core/abstract/image.hh
===================================================================
--- oln/core/abstract/image.hh (revision 526)
+++ oln/core/abstract/image.hh (working copy)
@@ -29,216 +29,11 @@
#ifndef OLENA_CORE_ABSTRACT_IMAGE_HH
# define OLENA_CORE_ABSTRACT_IMAGE_HH
-# include <mlc/assert.hh>
-# include <mlc/cmp.hh>
-# include <mlc/to_string.hh>
-# include <oln/core/abstract/internal/image_impl.hh>
+# include <oln/core/typedefs.hh>
+// # include <oln/core/abstract/internal/image_impl.hh>
-namespace oln {
- // Forward declaration.
- template <typename I>
- class value_box;
-
- // Forward declarations.
- namespace abstract
- {
- template <typename I> class image;
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// template <typename I> class image_without_nbh;
-// template <typename I> class readonly_image;
-// template <typename I> class raw_image;
-// template <typename P> class point;
-// --------------------------------------------------------------------
- }
-
- /// Virtual types associated to oln::abstract::image.
- template <typename I>
- struct vtypes_in_category< category::image, abstract::image<I> >
- {
- typedef I exact_type;
-
- typedef mlc::undefined grid_type;
-
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// typedef mlc::undefined concrete_type;
-// --------------------------------------------------------------------
- typedef mlc::undefined value_type;
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// typedef mlc::undefined point_type;
-// typedef mlc::undefined size_type;
-
-// typedef mlc::undefined piter_type;
-// typedef mlc::undefined fwd_piter_type;
-// typedef mlc::undefined bkd_piter_type;
-
-// typedef mlc::none value_storage_type;
-// typedef mlc::none storage_type;
-// --------------------------------------------------------------------
- typedef mlc::none delegated_type;
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// typedef mlc::none neighb_type;
-
-// typedef is_a<abstract::image_without_nbh> image_neighbness_type;
-// typedef is_a<abstract::readonly_image> image_constness_type;
-// typedef mlc::undefined image_rawness_type;
-// --------------------------------------------------------------------
- };
-
- /// Packing of the virtual types of any image class.
- template <typename I>
- struct packed_vtypes_in_category<category::image, I>
- {
- /// Virtual types defined internally.
- /// \{
- typedef oln_type_of(I, exact) exact_type;
-
- typedef oln_type_of(I, grid) grid_type;
-
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// typedef oln_type_of(I, concrete) concrete_type;
-// --------------------------------------------------------------------
- typedef oln_type_of(I, value) value_type;
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// typedef oln_type_of(I, point) point_type;
-// typedef oln_type_of(I, size) size_type;
-
-// typedef oln_type_of(I, piter) piter_type;
-// typedef oln_type_of(I, fwd_piter) fwd_piter_type;
-// typedef oln_type_of(I, bkd_piter) bkd_piter_type;
-
-// typedef oln_type_of(I, value_storage) value_storage_type;
-// typedef oln_type_of(I, storage) storage_type;
-// --------------------------------------------------------------------
- typedef oln_type_of(I, delegated) delegated_type;
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// typedef oln_type_of(I, neighb) neighb_type;
-
-
-// typedef oln_type_of(I, image_neighbness) image_neighbness_type;
-// typedef oln_type_of(I, image_constness) image_constness_type;
-// typedef oln_type_of(I, image_rawness) image_rawness_type;
-// --------------------------------------------------------------------
- /// \}
-
- /// Virtual types defined as extensions.
- /// \{
- typedef oln_type_of(I, image_dimension) image_dimension_type;
- typedef oln_type_of(I, image_typeness) image_typeness_type;
- /// \}
-
- /// Pretty-printing.
- static void echo(std::ostream& ostr)
- {
- ostr
- << "vtypes_in_category(oln::category::image, "
- << mlc_to_string(I) << ") ="
- << std::endl
- << "{" << std::endl
- << " exact_type = " << mlc_to_string(exact_type) << std::endl
-
- << " grid_type = " << mlc_to_string(grid_type) << std::endl
-
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// << " concrete_type = " << mlc_to_string(concrete_type) << std::endl
-// --------------------------------------------------------------------
- << " value_type = " << mlc_to_string(value_type) << std::endl
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// << " point_type = " << mlc_to_string(point_type) << std::endl
-// << " size_type = " << mlc_to_string(size_type) << std::endl
-
-// << " piter_type = " << mlc_to_string(piter_type) << std::endl
-// << " fwd_piter_type = " << mlc_to_string(fwd_piter_type) << std::endl
-// << " bkd_piter_type = " << mlc_to_string(bkd_piter_type) << std::endl
-
-// << " value_storage_type = " << mlc_to_string(value_storage_type) << std::endl
-// << " storage_type = " << mlc_to_string(storage_type) << std::endl
-// ---------------------------------------------------------------------
- << " delegated_type = " << mlc_to_string(delegated_type) << std::endl
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// << " neighb_type = " << mlc_to_string(neighb_type) << std::endl
-
-// << " image_neighbness_type = " << mlc_to_string(image_neighbness_type) << std::endl
-// << " image_constness_type = " << mlc_to_string(image_constness_type) << std::endl
-// << " image_rawness_type = " << mlc_to_string(image_rawness_type) << std::endl
-// --------------------------------------------------------------------
- << " image_dimension_type = " << mlc_to_string(image_dimension_type)
- << std::endl
- << " image_typeness_type = " << mlc_to_string(image_typeness_type)
- << std::endl
- << "}" << std::endl;
- }
-
- static void ensure()
- {
- mlc::assert_< mlc_is_ok(exact_type) >::check();
-
- mlc::assert_< mlc_is_ok(grid_type) >::check();
-
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// mlc::assert_< mlc_is_ok(concrete_type) >::check();
-// --------------------------------------------------------------------
- mlc::assert_< mlc_is_ok(value_type) >::check();
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// mlc::assert_< mlc_is_ok(point_type) >::check();
-// mlc::assert_< mlc_is_ok(size_type) >::check();
-// mlc::assert_< mlc_is_ok(piter_type) >::check();
-// mlc::assert_< mlc_is_ok(fwd_piter_type) >::check();
-// mlc::assert_< mlc_is_ok(bkd_piter_type) >::check();
-
-// mlc::assert_< mlc_is_ok(value_storage_type) >::check();
-// mlc::assert_< mlc_is_ok(storage_type) >::check();
-// --------------------------------------------------------------------
- mlc::assert_< mlc_is_ok(delegated_type) >::check();
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// mlc::assert_< mlc_is_ok(neighb_type) >::check();
-
-// mlc::assert_< mlc_is_ok(image_neighbness_type) >::check();
-// mlc::assert_< mlc_is_ok(image_constness_type) >::check();
-// mlc::assert_< mlc_is_ok(image_rawness_type) >::check();
-// --------------------------------------------------------------------
- mlc::assert_< mlc_is_ok(image_dimension_type) >::check();
- mlc::assert_< mlc_is_ok(image_typeness_type) >::check();
- }
- };
-
-} // end of namespace oln
-
-
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// # include <oln/core/gen/internal/value_box.hh>
-// --------------------------------------------------------------------
-
-
namespace oln
{
@@ -259,359 +54,106 @@
template <typename E>
- struct image : public internal::get_image_impl < image<E>, E >
+ struct image : public virtual stc::any__simple<E>,
+ public virtual oln::type
+ // , public internal::get_image_impl < image<E>, E >
{
- /// Typedefs.
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// typedef oln_type_of(E, size) size_type;
-// --------------------------------------------------------------------
- typedef oln_type_of(E, value) value_type;
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// typedef oln_type_of(E, point) point_type;
-// --------------------------------------------------------------------
+ public:
- /*------------------*
- ! abstract methods !
- *------------------*/
+ struct decl {
+ stc_virtual_typedef(topo);
+ stc_virtual_typedef(grid);
- /*! \brief Return the size of the current image. Nota bene:
- ** this method is abstract-like.it is a pseudo-abstract method.
- **
- ** \return An object deriving from abstract::size. Ex: if the
- ** image is an image2d<something>, the returned object is a
- ** size2d.
- */
+ stc_virtual_typedef(psite);
+ stc_virtual_typedef(point);
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// const size_type& size() const
-// {
-// return this->exact().impl_size();
-// }
-// --------------------------------------------------------------------
+ stc_virtual_typedef(piter);
+ stc_virtual_typedef(fwd_piter);
+ stc_virtual_typedef(bkd_piter);
+ stc_virtual_typedef(value);
+ stc_virtual_typedef(rvalue);
- /*! \brief Return the number of points of the current image.
- ** Nota bene: this method is abstract-like.
- **
- ** FIXME: this method should be deferred in an abstract subclass
- ** since its complexity can vary from a concrete image to another...
- **
- ** \return A positive value. It can be 0 when the image size is
- ** not yet defined; ex: image2d<int> ima; cout << ima.npoints();
- */
+ stc_virtual_typedef(concrete);
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// unsigned long npoints() const
-// {
-// return this->exact().impl_npoints();
-// }
-// --------------------------------------------------------------------
+ decl() {
+ // FIXME: ...
+ }
+ };
- /*! \brief Test if the point \a p belongs to the current image.
- ** Please note that a point of the outer boundary of an image
- ** does NOT belong to the image. Nota bene: this method is
- ** abstract-like.
- **
- ** \return True if p belongs to the current image, false otherwise.
- **
- ** \see hold_large
- */
+ private:
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// bool hold(const point_type& p) const; // impl is in box.hh
-// --------------------------------------------------------------------
+ /// Typedefs.
+ typedef oln_type_of(E, topo) topo_t;
+ typedef oln_type_of(E, psite) psite_t;
+ typedef oln_type_of(E, rvalue) rvalue_t;
- /*! \brief Test if \a p is a proper point to access a value of
- ** the current image. When an image has an outer boundary, the
- ** points of this boundary have values and these values can be
- ** accessed. Nota bene: this method is polymorphic so it can be
- ** overriden in derived classes; by default, hold_large behaves
- ** like hold.
- **
- ** FIXME: hold_large should come only for images WITH a border!
- **
- ** \return True if (*this)[p] is ok, false otherwise.
- **
- ** \see hold
- */
+ public:
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// bool hold_large(const point_type& p) const
-// {
-// precondition(this->npoints() != 0);
-// return this->exact().impl_hold_large(p);
-// }
-// --------------------------------------------------------------------
-
-
- /*! \brief Default implementation for hold_large. If not
- ** overriden in derived class, it just calls hold(p).
- **
- ** FIXME: hold_large should come only for images WITH a border!
- **
- ** \return True if (*this)[p] is ok, false otherwise.
- **
- ** \see hold_large
- */
-
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// bool impl_hold_large(const point_type& p) const
-// {
-// // it relies on 'impl_hold' to avoid counting one call to
-// // 'hold' when the effective call is 'hold_large'
-// return this->exact().impl_hold(p);
-// }
-// --------------------------------------------------------------------
-
-
-
/*------------------*
- ! concrete methods !
+ ! abstract methods !
*------------------*/
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// template <typename P>
-// void operator()(const oln::abstract::point<P>&) const
-// {
-// // FIXME: provide an explicit err msg, e.g., "(p) should not be used on an ima"
-// }
-// --------------------------------------------------------------------
-
- /*! \brief Give access to the value stored at \a p in the
- ** current image. Precisely it returns a box that encloses this
- ** value. FIXME: say more about that box!
+ /*! \brief Return the topological information about the current
+ ** image. Nota bene: this method is abstract-like.it is a
+ ** pseudo-abstract method.
**
- ** \precondition this->hold_large(p)
- **
- ** \see value_box
+ ** \return An object deriving from abstract::topo. Ex: if the
+ ** image is an image2d<something>, the returned object is a
+ ** topo2d.
*/
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// value_box<const E> operator[](const point_type& p) const
-// {
-// precondition(this->npoints() != 0);
-// precondition(this->hold_large(p));
-// value_box<const E> tmp(this->exact(), p);
-// return tmp;
-// }
-// --------------------------------------------------------------------
+ const topo_t& topo() const
+ {
+ return this->exact().impl_topo();
+ }
/*! \brief Gives access to the value stored at \a p in the
- ** current image. Precisely it returns a box that encloses this
- ** value.
- **
- ** \precondition this->hold_large(p)
- **
- ** \see value_box
+ ** current image.
*/
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// value_box<E> operator[](const point_type& p)
-// {
-// precondition(this->npoints() != 0);
-// precondition(this->hold_large(p));
-// value_box<E> tmp(this->exact(), p);
-// return tmp;
-// }
-// --------------------------------------------------------------------
-
-
- /*! \brief Destructor.
- */
-
- virtual ~image()
+ rvalue_t operator()(const psite_t& p) const
{
- packed_vtypes_in_category<category::image, E>::ensure();
- // FIXME: static check fails because "pointer to member conversion via virtual base"...
-// mlc_check_method_impl(E, const size_type&, size, , const);
-// mlc_check_method_impl(E, unsigned long, npoints, , const);
-// mlc_check_method_impl(E, bool, hold, const point_type&, const);
-// mlc_check_method_impl(E, bool, hold_large, const point_type&, const);
-// mlc_check_method_impl(E, const value_type, get, const point_type&, const);
-// mlc_check_method_impl_2(E, void, resize_border, size_t, bool, const);
+ return this->exact().impl_op_read(p);
}
-
- // explanation:
- // ------------
- // though it works (uncommented) with g++-3.3, it is commented
- // for bwd compatibility purpose because of g++-2.95 that does not accept
- // "partial specialization declared friend"...
- /*
- friend class oln::value_box<E>;
- friend class oln::value_box<const E>;
- private:
- */
-
- /*! \brief Read-only access to the value stored at \a p in the
- ** current image. This method is used in value_box<I>. Client
- ** should not use this method but
- ** abstract::image<I>::operator[](point) instead.
+ /*! \brief Test if the point \a p belongs to the current image.
+ ** Please note that a point of the outer boundary of an image
+ ** does NOT belong to the image.
**
- ** \return The value stored at \a p.
+ ** \return True if p belongs to the current image, false otherwise.
**
- ** \see value_box, abstract::image<I>::operator[](point)
+ ** \see hold_large
*/
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// const value_type get(const point_type& p) const; // impl is in box.hh
-// --------------------------------------------------------------------
+ bool has(const psite_t& p) const
+ {
+ return this->exact().impl_has(p);
+ }
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-
- // FIXME: patch!
-// void resize_border(size_t new_border, bool copy_border = false) const
-// {
-// this->exact().impl_resize_border(new_border, copy_border);
-// }
-// --------------------------------------------------------------------
-
protected:
/*! \brief Constructor (protected, empty).
*/
image() {}
- /*! \brief Cpy constructor (protected, empty).
+ /*! \brief Destructor.
*/
- image(const image&) {}
+ virtual ~image() { decl(); }
- /*! \brief Op= (protected, empty).
- */
- void operator=(const image&) {}
};
-
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// /*! \namespace oln::abstract::internal
-// ** \brief oln::abstract::internal namespace.
-// */
-// namespace internal {
-
-// template <typename E>
-// struct set_image_impl < image<E>, E > : public virtual image_impl<E>
-// {
-
-// /// typedefs
-
-// typedef typename image_impl<E>::D D;
-
-// typedef oln_type_of(D, size) size_type;
-// typedef oln_type_of(D, point) point_type;
-// typedef oln_type_of(D, value) value_type;
-
-// // delegations are "template methods" (Cf. the GOF's book)
-
-// const size_type& impl_size() const
-// {
-// const size_type& s = this->delegate().size();
-// this->exact().impl_size_extra(s);
-// return s;
-// }
-
-// unsigned long impl_npoints() const
-// {
-// unsigned long n = this->delegate().npoints();
-// this->exact().impl_npoints_extra(n);
-// return n;
-// }
-
-// bool impl_hold(const point_type& p) const
-// {
-// this->exact().impl_hold_extra(p);
-// return this->delegate().hold(p);
-// }
-
-// bool impl_hold_large(const point_type& p) const
-// {
-// this->exact().impl_hold_large_extra(p);
-// return this->delegate().hold_large(p);
-// }
-
-// value_box<const D> operator[](const point_type& p) const
-// {
-// precondition(this->hold_large(p));
-// return this->delegate().operator[](p);
-// }
-
-// value_box<D> operator[](const point_type& p)
-// {
-// precondition(this->hold_large(p));
-// return this->delegate().operator[](p);
-// }
-
-// const value_type impl_get(const point_type& p) const
-// {
-// this->exact().impl_get_extra(p);
-// return this->delegate().get(p);
-// }
-
-// // FIXME: patch
-
-// void impl_resize_border(size_t new_border, bool copy_border) const
-// {
-// this->delegate().impl_resize_border(new_border, copy_border);
-// }
-
-// // extra code; default is "do nothing"
-
-// void impl_size_extra(const size_type& s) const {}
-// void impl_npoints_extra(unsigned long n) const {}
-
-// void impl_hold_extra(const point_type& p) const {}
-// void impl_hold_large_extra(const point_type& p) const {}
-
-// void impl_get_extra(const point_type&) const {}
-// };
-
-// } // end of namespace oln::abstract::internal
-// --------------------------------------------------------------------
-
} // end of namespace oln::abstract
} // end of namespace oln
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// # include <oln/core/abstract/piter.hh>
-// --------------------------------------------------------------------
-// this allows for browsing points in file
-// where oln/core/abstract/image.hh is included
-
#endif // ! OLENA_CORE_ABSTRACT_IMAGE_HH
Index: oln/core/abstract/topo_with_bbox.hh
===================================================================
--- oln/core/abstract/topo_with_bbox.hh (revision 526)
+++ oln/core/abstract/topo_with_bbox.hh (working copy)
@@ -48,7 +48,7 @@
// abstract
const bbox_t& bbox() const
{
- return this->exact().impl_box();
+ return this->exact().impl_bbox();
}
// concrete
Index: oln/core/abstract/entry.hh
===================================================================
--- oln/core/abstract/entry.hh (revision 526)
+++ oln/core/abstract/entry.hh (working copy)
@@ -57,7 +57,16 @@
// here: no other hierarchy
};
+
template < template <class> class abstraction,
+ typename E >
+ struct next_entry_node < abstraction, E, 1, mlc::false_ >
+ : public abstraction<E>
+ {
+ };
+
+
+ template < template <class> class abstraction,
typename E,
unsigned num >
struct next_entry_node < abstraction,
Index: oln/core/abstract/topo_ra.hh
===================================================================
--- oln/core/abstract/topo_ra.hh (revision 526)
+++ oln/core/abstract/topo_ra.hh (working copy)
@@ -25,10 +25,10 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef OLENA_CORE_ABSTRACT_PSET_RA_HH
-# define OLENA_CORE_ABSTRACT_PSET_RA_HH
+#ifndef OLENA_CORE_ABSTRACT_TOPO_RA_HH
+# define OLENA_CORE_ABSTRACT_TOPO_RA_HH
-# include <oln/core/abstract/pset.hh>
+# include <oln/core/abstract/topo.hh>
@@ -40,7 +40,7 @@
template <typename E>
- class ra_pset : public virtual pset<E>
+ class ra_topo : public virtual topo<E>
{
typedef oln_type_of(E, point) point_t;
@@ -52,7 +52,7 @@
}
protected:
- ra_pset()
+ ra_topo()
{}
};
@@ -61,14 +61,14 @@
template <typename E>
- struct case_ < pset_ra_hierarchy, E, 1 >
+ struct case_ < topo_ra_hierarchy, E, 1 >
: where_< mlc::eq_< oln_type_of(E, ra), mlc::true_ > >
{
- typedef abstract::ra_pset<E> ret;
+ typedef abstract::ra_topo<E> ret;
};
} // end of namespace oln
-#endif // ! OLENA_CORE_ABSTRACT_PSET_RA_HH
+#endif // ! OLENA_CORE_ABSTRACT_TOPO_RA_HH
Index: oln/core/abstract/pset.hh
===================================================================
--- oln/core/abstract/pset.hh (revision 526)
+++ oln/core/abstract/pset.hh (working copy)
@@ -53,6 +53,8 @@
struct decl
{
stc_virtual_typedef(point);
+
+ stc_virtual_typedef(piter);
stc_virtual_typedef(fwd_piter);
stc_virtual_typedef(bkd_piter);
Index: oln/core/2d/image2d.hh
===================================================================
--- oln/core/2d/image2d.hh (revision 0)
+++ oln/core/2d/image2d.hh (revision 0)
@@ -0,0 +1,107 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 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 OLENA_CORE_2D_IMAGE2D_HH
+# define OLENA_CORE_2D_IMAGE2D_HH
+
+# include <oln/core/image_entry.hh>
+
+
+namespace oln
+{
+
+ // Forward declaration.
+ template <typename T> class image2d;
+
+
+ /// Virtual types associated to oln::image2d<T>.
+ template <typename T>
+ struct vtypes< image2d<T> >
+ {
+ typedef topo2d topo_type;
+ typedef grid2d grid_type;
+
+ typedef point2d point_type;
+
+ typedef fwd_piter2d fwd_piter_type;
+ typedef bkd_piter2d bkd_piter_type;
+
+ typedef T value_type;
+
+ typedef image2d<T> real_type;
+ };
+
+
+ /// Super type declaration.
+ template <typename T>
+ struct set_super_type< image2d<T> >
+ {
+ typedef image2d<T> self_t;
+ typedef image_entry<self_t> ret;
+ };
+
+
+ /// General 2D image class.
+ template <typename T>
+ class image2d : public image_entry< image2d<T> >
+ {
+ typedef image2d<T> self_t;
+
+ public:
+
+ /// Ctor.
+ image2d(unsigned nrows, unsigned ncols)
+ : topo_( bbox2d( point2d(0,0), point2d(nrows-1, ncols-1) ) )
+ {
+ }
+
+ const topo2d& impl_topo() const
+ {
+ return topo_;
+ }
+
+ T impl_op_read(const point2d& p) const
+ {
+ static T val_;
+ return ++val_;
+ }
+
+ bool impl_has(const point2d& p) const
+ {
+ return true;
+ }
+
+ private:
+
+ topo2d topo_;
+ };
+
+
+} // end of namespace oln
+
+
+#endif // ! OLENA_CORE_2D_IMAGE2D_HH
Index: oln/core/gen/fwd_piter.hh
===================================================================
--- oln/core/gen/fwd_piter.hh (revision 526)
+++ oln/core/gen/fwd_piter.hh (working copy)
@@ -80,6 +80,23 @@
++nop_[0];
}
+// template <typename T>
+// fwd_piter_(const abstract::topo<T>& t)
+// {
+// mlc::assert_< mlc_is_a(T, abstract::topo_with_bbox) >::check();
+// bb_ = t.exact().bbox();
+// nop_ = bb_.pmax();
+// ++nop_[0];
+// }
+
+// template <typename Data>
+// fwd_piter_(const Data& data)
+// : bb_(data.bbox())
+// {
+// nop_ = bb_.pmax();
+// ++nop_[0];
+// }
+
const bbox_<point>& bbox() const
{
return bb_;
Index: oln/core/gen/bbox_topo.hh
===================================================================
--- oln/core/gen/bbox_topo.hh (revision 526)
+++ oln/core/gen/bbox_topo.hh (working copy)
@@ -28,8 +28,8 @@
#ifndef OLENA_CORE_GEN_BBOX_TOPO_HH
# define OLENA_CORE_GEN_BBOX_TOPO_HH
+# include <oln/core/gen/bbox.hh>
# include <oln/core/topo_entry.hh>
-# include <oln/core/gen/bbox.hh>
Index: oln/core/pset_entry.hh
===================================================================
--- oln/core/pset_entry.hh (revision 526)
+++ oln/core/pset_entry.hh (working copy)
@@ -54,6 +54,8 @@
struct vtypes< pset_entry<E> >
{
typedef mlc::undefined point_type;
+
+ typedef mlc::undefined piter_type;
typedef mlc::undefined fwd_piter_type;
typedef mlc::undefined bkd_piter_type;
@@ -87,6 +89,13 @@
};
+ template <typename E>
+ struct single_vtype< pset_entry<E>, typedef_::piter_type >
+ {
+ typedef oln_type_of(E, fwd_piter) ret;
+ };
+
+
} // end of namespace oln
Index: oln/basics2d.hh
===================================================================
--- oln/basics2d.hh (revision 526)
+++ oln/basics2d.hh (working copy)
@@ -32,13 +32,25 @@
# include <oln/core/2d/aliases.hh>
# include <oln/core/2d/point2d.hh>
+namespace oln { template class point2d_<int>; }
+
# include <oln/core/2d/dpoint2d.hh>
+namespace oln { template class dpoint2d_<int>; }
# include <oln/core/gen/bbox.hh>
+namespace oln { template class bbox_<point2d>; }
+
# include <oln/core/gen/fwd_piter.hh>
+namespace oln { template class fwd_piter_<point2d>; }
+
# include <oln/core/gen/bkd_piter.hh>
+namespace oln { template class bkd_piter_<point2d>; }
# include <oln/core/gen/bbox_topo.hh>
+namespace oln { template class bbox_topo_<point2d>; }
+# include <oln/core/2d/image2d.hh>
+
+
#endif // ! OLENA_BASICS2D_HH
2
1
526: Start the topology hierarchy and add a new sub-hierarchy to abstract::pset.
by Thierry GERAUD 07 Sep '06
by Thierry GERAUD 07 Sep '06
07 Sep '06
2006-09-07 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Start the topology hierarchy.
* oln/core/topo_entry.hh: New.
* oln/core/abstract/topo.hh: New.
* oln/core/abstract/topo_hierarchies.hh: New.
* oln/core/abstract/topo_with_bbox.hh: New.
* oln/core/abstract/topo_ra.hh: New.
* oln/core/gen/bbox_topo.hh: New.
* oln/core/2d/aliases.hh (topo2d): New.
Add a new sub-hierarchy to abstract::pset.
* oln/core/abstract/pset_cnx.hh: New.
* oln/core/typedefs.hh (cnx_type): New.
* oln/core/abstract/pset_hierarchies.hh (pset_cnx_hierarchy): New.
* oln/core/abstract/bbox.hh (cnx_type): New.
* oln/core/abstract/pset_bboxed.hh (is_valid): Move this method into...
* oln/core/abstract/pset.hh (pset): ...this class.
(dim): New vtype.
* oln/core/pset_entry.hh (single_vtype): Add vtype dim.
* oln/basics2d.hh: Include oln/core/gen/bbox_topo.hh.
Index: oln/core/topo_entry.hh
===================================================================
--- oln/core/topo_entry.hh (revision 0)
+++ oln/core/topo_entry.hh (revision 0)
@@ -0,0 +1,66 @@
+// 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 OLENA_CORE_TOPO_ENTRY_HH
+# define OLENA_CORE_TOPO_ENTRY_HH
+
+# include <oln/core/abstract/entry.hh>
+# include <oln/core/abstract/topo.hh>
+
+
+
+namespace oln
+{
+
+
+ /// Entry class for point sets: topo_entry<E> is an alias for
+ /// entry< abstract::topo, E>.
+
+ template <typename E>
+ struct topo_entry : public entry< abstract::topo, E>
+ {
+ protected:
+ topo_entry() {}
+ };
+
+
+ /// Virtual types associated to topo_entry<E>.
+
+ template <typename E>
+ struct vtypes< topo_entry<E> >
+ {
+ typedef mlc::undefined bbox_type;
+ typedef mlc::undefined ra_type;
+
+ typedef mlc::undefined point_type;
+ };
+
+
+} // end of namespace oln
+
+
+#endif // ! OLENA_CORE_TOPO_ENTRY_HH
Index: oln/core/typedefs.hh
===================================================================
--- oln/core/typedefs.hh (revision 525)
+++ oln/core/typedefs.hh (working copy)
@@ -115,6 +115,7 @@
mlc_decl_typedef(fixed_type);
mlc_decl_typedef(ra_type);
+ mlc_decl_typedef(cnx_type);
/*------------------.
Index: oln/core/abstract/topo.hh
===================================================================
--- oln/core/abstract/topo.hh (revision 0)
+++ oln/core/abstract/topo.hh (revision 0)
@@ -0,0 +1,88 @@
+// 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 OLENA_CORE_ABSTRACT_TOPO_HH
+# define OLENA_CORE_ABSTRACT_TOPO_HH
+
+# include <oln/core/typedefs.hh>
+
+
+namespace oln
+{
+
+ namespace abstract
+ {
+
+
+ /// Abstract point class.
+ template <typename E>
+ class topo : public virtual stc::any__simple<E>,
+ public virtual oln::type
+ {
+ public:
+
+ struct decl
+ {
+ stc_virtual_typedef(bbox); // for being bboxed; provides .bbox()
+ stc_virtual_typedef(ra); // for random access; provides .has(p)
+
+ stc_virtual_typedef(point);
+
+ decl() {
+ // constraint:
+ mlc::assert_< mlc::implies_< mlc::neq_< bbox, mlc::none >,
+ mlc_is_a(bbox, abstract::bbox) > >::check();
+ }
+ };
+
+ const oln_type_of(E, bbox)& bbox() const
+ {
+ return this->exact().impl_bbox();
+ }
+
+ protected:
+
+ topo()
+ {}
+
+ ~topo() { decl(); }
+
+ }; // end of class oln::abstract::topo<E>
+
+
+
+ } // end of namespace oln::abstract
+
+} // end of namespace oln
+
+
+
+# include <oln/core/abstract/topo_hierarchies.hh>
+
+
+
+#endif // ! OLENA_CORE_ABSTRACT_TOPO_HH
Index: oln/core/abstract/pset_hierarchies.hh
===================================================================
--- oln/core/abstract/pset_hierarchies.hh (revision 525)
+++ oln/core/abstract/pset_hierarchies.hh (working copy)
@@ -37,6 +37,7 @@
typedef hierarchy< abstract::pset, 1 > pset_fixed_hierarchy;
typedef hierarchy< abstract::pset, 2 > pset_ra_hierarchy;
typedef hierarchy< abstract::pset, 3 > pset_bboxed_hierarchy;
+ typedef hierarchy< abstract::pset, 4 > pset_cnx_hierarchy;
} // end of namespace oln
@@ -44,6 +45,7 @@
# include <oln/core/abstract/pset_fixed.hh>
# include <oln/core/abstract/pset_ra.hh>
# include <oln/core/abstract/pset_bboxed.hh>
+# include <oln/core/abstract/pset_cnx.hh>
Index: oln/core/abstract/pset_cnx.hh
===================================================================
--- oln/core/abstract/pset_cnx.hh (revision 0)
+++ oln/core/abstract/pset_cnx.hh (revision 0)
@@ -0,0 +1,83 @@
+// 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 OLENA_CORE_ABSTRACT_PSET_CNX_HH
+# define OLENA_CORE_ABSTRACT_PSET_CNX_HH
+
+# include <oln/core/abstract/pset.hh>
+
+
+namespace oln
+{
+
+ namespace abstract
+ {
+
+
+ template <typename E>
+ class cnx2d_pset : public virtual abstract::pset<E>
+ {
+ public:
+
+ unsigned nrows() const
+ {
+ precondition(this->is_valid());
+ return this->exact().len(0);
+ }
+
+ unsigned ncols() const
+ {
+ precondition(this->is_valid());
+ return this->exact().len(1);
+ }
+
+ protected:
+
+ cnx2d_pset()
+ {}
+ };
+
+
+ } // end of namespace oln::abstract
+
+
+
+ template <typename E>
+ struct case_ < pset_cnx_hierarchy, E, 1 >
+ : where_< mlc::and_list_< mlc::neq_< oln_type_of(E, bbox), mlc::none >,
+ mlc::eq_< oln_type_of(E, cnx), mlc::true_ >,
+ mlc::eq_< oln_type_of(E, grid), grid2d > > >
+ {
+ typedef abstract::cnx2d_pset<E> ret;
+ };
+
+
+} // end of namespace oln
+
+
+#endif // ! OLENA_CORE_ABSTRACT_PSET_CNX_HH
+
Index: oln/core/abstract/topo_with_bbox.hh
===================================================================
--- oln/core/abstract/topo_with_bbox.hh (revision 0)
+++ oln/core/abstract/topo_with_bbox.hh (revision 0)
@@ -0,0 +1,81 @@
+// 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 OLENA_CORE_ABSTRACT_TOPO_WITH_BBOX_HH
+# define OLENA_CORE_ABSTRACT_TOPO_WITH_BBOX_HH
+
+# include <oln/core/abstract/topo.hh>
+
+
+namespace oln
+{
+
+ namespace abstract
+ {
+
+
+ template <typename E>
+ class topo_with_bbox : public virtual topo<E>
+ {
+ typedef oln_type_of(E, bbox) bbox_t;
+
+ public:
+
+ // abstract
+ const bbox_t& bbox() const
+ {
+ return this->exact().impl_box();
+ }
+
+ // concrete
+ operator bbox_t() const
+ {
+ return this->bbox();
+ }
+
+ protected:
+
+ topo_with_bbox()
+ {}
+ };
+
+
+ } // end of namespace oln::abstract
+
+
+ template <typename E>
+ struct case_ < topo_with_bbox_hierarchy, E, 1 >
+ : where_< mlc::neq_< oln_type_of(E, bbox), mlc::none > >
+ {
+ typedef abstract::topo_with_bbox<E> ret;
+ };
+
+
+} // end of namespace oln
+
+
+#endif // ! OLENA_CORE_ABSTRACT_TOPO_WITH_BBOX_HH
Index: oln/core/abstract/topo_hierarchies.hh
===================================================================
--- oln/core/abstract/topo_hierarchies.hh (revision 0)
+++ oln/core/abstract/topo_hierarchies.hh (revision 0)
@@ -0,0 +1,49 @@
+// 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 OLENA_CORE_ABSTRACT_TOPO_HIERARCHIES_HH
+# define OLENA_CORE_ABSTRACT_TOPO_HIERARCHIES_HH
+
+# include <oln/core/abstract/topo.hh>
+
+
+namespace oln
+{
+
+ typedef hierarchy< abstract::topo, 1 > topo_ra_hierarchy;
+ typedef hierarchy< abstract::topo, 2 > topo_with_bbox_hierarchy;
+
+} // end of namespace oln
+
+
+# include <oln/core/abstract/topo_ra.hh>
+# include <oln/core/abstract/topo_with_bbox.hh>
+
+
+
+#endif // ! OLENA_CORE_ABSTRACT_TOPO_HIERARCHIES_HH
+
Index: oln/core/abstract/bbox.hh
===================================================================
--- oln/core/abstract/bbox.hh (revision 525)
+++ oln/core/abstract/bbox.hh (working copy)
@@ -53,6 +53,7 @@
{
typedef mlc::true_ ra_type;
typedef mlc::true_ fixed_type;
+ typedef mlc::true_ cnx_type;
typedef E bbox_type;
};
Index: oln/core/abstract/pset_bboxed.hh
===================================================================
--- oln/core/abstract/pset_bboxed.hh (revision 525)
+++ oln/core/abstract/pset_bboxed.hh (working copy)
@@ -55,11 +55,6 @@
return this->exact().impl_box();
}
- bool is_valid() const
- {
- return this->exact().impl_is_valid();
- }
-
const point_t& pmin() const
{
precondition(this->is_valid());
@@ -102,7 +97,6 @@
} // end of namespace oln::abstract
-
template <typename E>
struct case_ < pset_bboxed_hierarchy, E, 1 >
: where_< mlc::neq_< oln_type_of(E, bbox), mlc::none > >
@@ -115,4 +109,3 @@
#endif // ! OLENA_CORE_ABSTRACT_PSET_BBOXED_HH
-
Index: oln/core/abstract/topo_ra.hh
===================================================================
--- oln/core/abstract/topo_ra.hh (revision 0)
+++ oln/core/abstract/topo_ra.hh (revision 0)
@@ -0,0 +1,74 @@
+// 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 OLENA_CORE_ABSTRACT_PSET_RA_HH
+# define OLENA_CORE_ABSTRACT_PSET_RA_HH
+
+# include <oln/core/abstract/pset.hh>
+
+
+
+namespace oln
+{
+
+ namespace abstract
+ {
+
+
+ template <typename E>
+ class ra_pset : public virtual pset<E>
+ {
+ typedef oln_type_of(E, point) point_t;
+
+ public:
+
+ bool has(const point_t& p) const
+ {
+ return this->exact().impl_has(p);
+ }
+
+ protected:
+ ra_pset()
+ {}
+ };
+
+
+ } // end of namespace oln::abstract
+
+
+ template <typename E>
+ struct case_ < pset_ra_hierarchy, E, 1 >
+ : where_< mlc::eq_< oln_type_of(E, ra), mlc::true_ > >
+ {
+ typedef abstract::ra_pset<E> ret;
+ };
+
+
+} // end of namespace oln
+
+
+#endif // ! OLENA_CORE_ABSTRACT_PSET_RA_HH
Index: oln/core/abstract/pset.hh
===================================================================
--- oln/core/abstract/pset.hh (revision 525)
+++ oln/core/abstract/pset.hh (working copy)
@@ -45,7 +45,10 @@
{
public:
- // ...
+ bool is_valid() const
+ {
+ return this->exact().impl_is_valid();
+ }
struct decl
{
@@ -53,13 +56,15 @@
stc_virtual_typedef(fwd_piter);
stc_virtual_typedef(bkd_piter);
- stc_virtual_typedef(bbox);
- stc_virtual_typedef(ra);
- stc_virtual_typedef(fixed);
+ stc_virtual_typedef(bbox); // for being bboxed; provides .bbox()
+ stc_virtual_typedef(ra); // for random access; provides .has(p)
+ stc_virtual_typedef(fixed); // for fixed size; provides .npoints()
+ stc_virtual_typedef(cnx); // for connected; provides, e.g., .nrows()
// derived from point:
stc_virtual_typedef(coord);
stc_virtual_typedef(grid);
+ stc_virtual_typedef(dim);
decl() {
// coherence check:
Index: oln/core/2d/aliases.hh
===================================================================
--- oln/core/2d/aliases.hh (revision 525)
+++ oln/core/2d/aliases.hh (working copy)
@@ -38,6 +38,7 @@
template <typename C> class point2d_;
template <typename C> class dpoint2d_;
template <typename P> class bbox_;
+ template <typename P> class bbox_topo_;
template <typename P> class fwd_piter_;
template <typename P> class bkd_piter_;
class grid2d;
@@ -52,6 +53,7 @@
typedef bbox_<point2d> bbox2d;
typedef fwd_piter_<point2d> fwd_piter2d;
typedef bkd_piter_<point2d> bkd_piter2d;
+ typedef bbox_topo_<point2d> topo2d;
typedef point2d_<float> point2df;
typedef dpoint2d_<float> dpoint2df;
Index: oln/core/gen/bbox_topo.hh
===================================================================
--- oln/core/gen/bbox_topo.hh (revision 0)
+++ oln/core/gen/bbox_topo.hh (revision 0)
@@ -0,0 +1,95 @@
+// 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 OLENA_CORE_GEN_BBOX_TOPO_HH
+# define OLENA_CORE_GEN_BBOX_TOPO_HH
+
+# include <oln/core/topo_entry.hh>
+# include <oln/core/gen/bbox.hh>
+
+
+
+namespace oln
+{
+
+
+ // Forward declarations.
+ template <typename point> class bbox_topo_;
+
+
+ // Super type declaration.
+ template <typename point>
+ struct set_super_type< bbox_topo_<point> >
+ {
+ typedef bbox_topo_<point> self_t;
+ typedef topo_entry<self_t> ret;
+ };
+
+
+ /// Virtual types associated to oln::bbox_<point>.
+ template <typename point>
+ struct vtypes< bbox_topo_<point> >
+ {
+ typedef bbox_<point> bbox_type;
+ typedef point point_type;
+ typedef mlc::true_ ra_type;
+ };
+
+
+ /// Bounding box topology based on a point class.
+ template <typename point>
+ class bbox_topo_ : public topo_entry< bbox_topo_<point> >
+ {
+ typedef bbox_<point> bbox_t;
+
+ public:
+
+ bbox_topo_()
+ {
+ }
+
+ bbox_topo_(const bbox_t& bb)
+ : bb_(bb)
+ {
+ }
+
+ const bbox_t& impl_bbox() const
+ {
+ return bb_;
+ }
+
+ protected:
+
+ bbox_<point> bb_;
+
+ };
+
+
+} // end of namespace oln
+
+
+#endif // ! OLENA_CORE_GEN_BBOX_TOPO_HH
Index: oln/core/pset_entry.hh
===================================================================
--- oln/core/pset_entry.hh (revision 525)
+++ oln/core/pset_entry.hh (working copy)
@@ -79,6 +79,14 @@
};
+ template <typename E>
+ struct single_vtype< pset_entry<E>, typedef_::dim_type >
+ {
+ typedef oln_type_of(E, point) P;
+ typedef oln_type_of(P, dim) ret;
+ };
+
+
} // end of namespace oln
Index: oln/basics2d.hh
===================================================================
--- oln/basics2d.hh (revision 525)
+++ oln/basics2d.hh (working copy)
@@ -38,5 +38,7 @@
# include <oln/core/gen/fwd_piter.hh>
# include <oln/core/gen/bkd_piter.hh>
+# include <oln/core/gen/bbox_topo.hh>
+
#endif // ! OLENA_BASICS2D_HH
1
0
2006-09-07 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
* mlc/cmp.hh (assert_ok_): New shortcut.
Index: mlc/cmp.hh
===================================================================
--- mlc/cmp.hh (revision 524)
+++ mlc/cmp.hh (working copy)
@@ -198,6 +198,11 @@
mlc_is_not_a(T, mlc::not_ok) >::bexpr
{
};
+
+ template <typename T, typename err = no_error_message>
+ struct assert_ok_ : public assert_< is_ok_<T>, err >
+ {
+ };
/// \}
1
0
06 Sep '06
2006-09-06 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Update abstract::pset hierarchy to final SCOOP-2 design.
* oln/core/pset_entry.hh: New.
* oln/core/typedefs.hh: Include oln/core/abstract/entry.hh.
* oln/core/abstract/bbox.hh: Clean includes.
(set_super_type): Change from abstract::pset<E> to pset_entry<E>.
(bbox): Update.
* oln/core/abstract/entry.hh (set_super_type): New specialization.
* oln/core/abstract/pset.hh (Copyright): Fix years.
(vtypes, ext_vtype): Remove.
(fixed_pset, ra_pset, bboxed_pset): Move and dispatch to...
* oln/core/abstract/pset_fixed.hh: ...this new file.
* oln/core/abstract/pset_ra.hh: ...this new file.
* oln/core/abstract/pset_bboxed.hh: ...this new file.
* oln/core/abstract/pset.hh
(pset_fixed_hierarchy, pset_ra_hierarchy, pset_bboxed_hierarchy)
(case_): Move to...
* oln/core/abstract/pset_hierarchies.hh: ...this new file.
Index: oln/core/typedefs.hh
===================================================================
--- oln/core/typedefs.hh (revision 523)
+++ oln/core/typedefs.hh (working copy)
@@ -208,4 +208,7 @@
} // end of namespace oln
+# include <oln/core/abstract/entry.hh>
+
+
#endif // ! OLENA_CORE_TYPEDEFS_HH
Index: oln/core/abstract/pset_hierarchies.hh
===================================================================
--- oln/core/abstract/pset_hierarchies.hh (revision 0)
+++ oln/core/abstract/pset_hierarchies.hh (revision 0)
@@ -0,0 +1,51 @@
+// 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 OLENA_CORE_ABSTRACT_PSET_HIERARCHIES_HH
+# define OLENA_CORE_ABSTRACT_PSET_HIERARCHIES_HH
+
+# include <oln/core/abstract/pset.hh>
+
+
+namespace oln
+{
+
+ typedef hierarchy< abstract::pset, 1 > pset_fixed_hierarchy;
+ typedef hierarchy< abstract::pset, 2 > pset_ra_hierarchy;
+ typedef hierarchy< abstract::pset, 3 > pset_bboxed_hierarchy;
+
+} // end of namespace oln
+
+
+# include <oln/core/abstract/pset_fixed.hh>
+# include <oln/core/abstract/pset_ra.hh>
+# include <oln/core/abstract/pset_bboxed.hh>
+
+
+
+#endif // ! OLENA_CORE_ABSTRACT_PSET_HIERARCHIES_HH
+
Index: oln/core/abstract/bbox.hh
===================================================================
--- oln/core/abstract/bbox.hh (revision 523)
+++ oln/core/abstract/bbox.hh (working copy)
@@ -29,10 +29,7 @@
#ifndef OLENA_CORE_ABSTRACT_BBOX_HH
# define OLENA_CORE_ABSTRACT_BBOX_HH
-# include <mlc/value.hh>
-# include <oln/core/type.hh>
-# include <oln/core/typedefs.hh>
-# include <oln/core/abstract/pset.hh>
+# include <oln/core/pset_entry.hh>
namespace oln
@@ -46,7 +43,7 @@
template <typename E>
struct set_super_type< abstract::bbox<E> >
{
- typedef abstract::pset<E> ret;
+ typedef pset_entry<E> ret;
};
@@ -65,7 +62,7 @@
/// Abstract bbox (bounding box) class.
template <typename E>
- class bbox : public entry< abstract::pset, E> // NEW! former was: abstract::pset<E>
+ class bbox : public pset_entry<E>
{
typedef oln_type_of(E, point) point_t;
Index: oln/core/abstract/pset_fixed.hh
===================================================================
--- oln/core/abstract/pset_fixed.hh (revision 0)
+++ oln/core/abstract/pset_fixed.hh (revision 0)
@@ -0,0 +1,73 @@
+// 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 OLENA_CORE_ABSTRACT_PSET_FIXED_HH
+# define OLENA_CORE_ABSTRACT_PSET_FIXED_HH
+
+# include <oln/core/abstract/pset.hh>
+
+
+
+namespace oln
+{
+
+ namespace abstract
+ {
+
+
+ template <typename E>
+ class fixed_pset : public virtual pset<E>
+ {
+ public:
+
+ unsigned npoints() const
+ {
+ return this->exact().impl_npoints();
+ }
+
+ protected:
+ fixed_pset()
+ {}
+ };
+
+
+ } // end of namespace oln::abstract
+
+
+ template <typename E>
+ struct case_ < pset_fixed_hierarchy, E, 1 >
+ : where_< mlc::eq_< oln_type_of(E, fixed), mlc::true_ > >
+ {
+ typedef abstract::fixed_pset<E> ret;
+ };
+
+
+} // end of namespace oln
+
+
+#endif // ! OLENA_CORE_ABSTRACT_PSET_FIXED_HH
+
Index: oln/core/abstract/pset_ra.hh
===================================================================
--- oln/core/abstract/pset_ra.hh (revision 0)
+++ oln/core/abstract/pset_ra.hh (revision 0)
@@ -0,0 +1,74 @@
+// 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 OLENA_CORE_ABSTRACT_PSET_RA_HH
+# define OLENA_CORE_ABSTRACT_PSET_RA_HH
+
+# include <oln/core/abstract/pset.hh>
+
+
+
+namespace oln
+{
+
+ namespace abstract
+ {
+
+
+ template <typename E>
+ class ra_pset : public virtual pset<E>
+ {
+ typedef oln_type_of(E, point) point_t;
+
+ public:
+
+ bool has(const point_t& p) const
+ {
+ return this->exact().impl_has(p);
+ }
+
+ protected:
+ ra_pset()
+ {}
+ };
+
+
+ } // end of namespace oln::abstract
+
+
+ template <typename E>
+ struct case_ < pset_ra_hierarchy, E, 1 >
+ : where_< mlc::eq_< oln_type_of(E, ra), mlc::true_ > >
+ {
+ typedef abstract::ra_pset<E> ret;
+ };
+
+
+} // end of namespace oln
+
+
+#endif // ! OLENA_CORE_ABSTRACT_PSET_RA_HH
Index: oln/core/abstract/pset_bboxed.hh
===================================================================
--- oln/core/abstract/pset_bboxed.hh (revision 0)
+++ oln/core/abstract/pset_bboxed.hh (revision 0)
@@ -0,0 +1,118 @@
+// 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 OLENA_CORE_ABSTRACT_PSET_BBOXED_HH
+# define OLENA_CORE_ABSTRACT_PSET_BBOXED_HH
+
+# include <oln/core/abstract/pset.hh>
+
+
+namespace oln
+{
+
+ namespace abstract
+ {
+
+
+ template <typename E>
+ class bboxed_pset : public virtual pset<E>
+ {
+ typedef oln_type_of(E, point) point_t;
+ typedef oln_type_of(E, bbox) bbox_t;
+
+ typedef oln_type_of(point_t, coord) coord_t;
+ typedef oln_type_of(point_t, dim) dim_t;
+ enum { n = mlc_value(dim_t) };
+
+ public:
+
+ const bbox_t& bbox() const
+ {
+ return this->exact().impl_box();
+ }
+
+ bool is_valid() const
+ {
+ return this->exact().impl_is_valid();
+ }
+
+ const point_t& pmin() const
+ {
+ precondition(this->is_valid());
+ return pmin_;
+ }
+
+ coord_t pmin(unsigned i) const
+ {
+ precondition(this->is_valid() and i < n);
+ return pmin_[i];
+ }
+
+ const point_t& pmax() const
+ {
+ precondition(this->is_valid());
+ return pmax_;
+ }
+
+ coord_t pmax(unsigned i) const
+ {
+ precondition(this->is_valid() and i < n);
+ return pmax_[i];
+ }
+
+ unsigned len(unsigned i) const
+ {
+ precondition(this->is_valid() and i < n);
+ return pmax_[i] - pmin_[i] + 1;
+ }
+
+ protected:
+
+ bboxed_pset()
+ {}
+
+ point_t pmin_, pmax_;
+ };
+
+
+ } // end of namespace oln::abstract
+
+
+
+ template <typename E>
+ struct case_ < pset_bboxed_hierarchy, E, 1 >
+ : where_< mlc::neq_< oln_type_of(E, bbox), mlc::none > >
+ {
+ typedef abstract::bboxed_pset<E> ret;
+ };
+
+
+} // end of namespace oln
+
+
+#endif // ! OLENA_CORE_ABSTRACT_PSET_BBOXED_HH
+
Index: oln/core/abstract/entry.hh
===================================================================
--- oln/core/abstract/entry.hh (revision 523)
+++ oln/core/abstract/entry.hh (working copy)
@@ -112,6 +112,15 @@
};
+ // Super type declaration.
+ template < template <class> class abstraction,
+ typename E >
+ struct set_super_type< entry<abstraction, E> >
+ {
+ typedef abstraction<E> ret;
+ };
+
+
} // end of namespace oln
Index: oln/core/abstract/pset.hh
===================================================================
--- oln/core/abstract/pset.hh (revision 523)
+++ oln/core/abstract/pset.hh (working copy)
@@ -1,5 +1,4 @@
-// Copyright (C) 2001, 2003, 2004, 2005, 2006 EPITA Research and
-// Development Laboratory
+// 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
@@ -29,53 +28,16 @@
#ifndef OLENA_CORE_ABSTRACT_PSET_HH
# define OLENA_CORE_ABSTRACT_PSET_HH
-# include <stc/any.hh>
-# include <oln/core/type.hh>
# include <oln/core/typedefs.hh>
-# include <oln/core/abstract/entry.hh> // NEW!
-
namespace oln
{
- /// Forward declaration.
- namespace abstract { template <typename E> class pset; }
-
-
-
- /// Virtual types associated to oln::bbox_nd<point>.
- template <typename E>
- struct vtypes< abstract::pset<E> >
- {
- typedef mlc::undefined point_type;
- typedef mlc::undefined fwd_piter_type;
- typedef mlc::undefined bkd_piter_type;
-
- typedef mlc::none bbox_type;
- typedef mlc::undefined ra_type;
- typedef mlc::undefined fixed_type;
- };
-
-
- template <typename E>
- struct ext_vtype< abstract::pset<E>, typedef_::coord_type >
- {
- typedef oln_type_of(E, point) P;
- typedef oln_type_of(P, coord) ret;
- };
-
- template <typename E>
- struct ext_vtype< abstract::pset<E>, typedef_::grid_type >
- {
- typedef oln_type_of(E, point) P;
- typedef oln_type_of(P, grid) ret;
- };
-
-
namespace abstract
{
+
/// Abstract point class.
template <typename E>
class pset : public virtual stc::any__simple<E>,
@@ -85,163 +47,48 @@
// ...
- protected:
-
- pset()
- {}
-
- ~pset()
+ struct decl
{
- mlc::assert_defined_< oln_type_of(E, point) >::check();
- mlc::assert_defined_< oln_type_of(E, fwd_piter) >::check();
- mlc::assert_defined_< oln_type_of(E, bkd_piter) >::check();
+ stc_virtual_typedef(point);
+ stc_virtual_typedef(fwd_piter);
+ stc_virtual_typedef(bkd_piter);
- mlc::assert_defined_< oln_type_of(E, coord) >::check();
- mlc::assert_defined_< oln_type_of(E, grid) >::check();
+ stc_virtual_typedef(bbox);
+ stc_virtual_typedef(ra);
+ stc_virtual_typedef(fixed);
-// mlc::assert_< mlc::eq_< oln_type_of(fwd_piter_t, grid),
-// oln_type_of(point_t, grid) > >::check();
+ // derived from point:
+ stc_virtual_typedef(coord);
+ stc_virtual_typedef(grid);
-// mlc::assert_< mlc::eq_< oln_type_of(bkd_piter_t, grid),
-// oln_type_of(point_t, grid) > >::check();
- }
+ decl() {
+ // coherence check:
+ mlc::assert_equal_< oln_type_of(fwd_piter, grid),
+ oln_type_of(point, grid) >::check();
+ mlc::assert_equal_< oln_type_of(bkd_piter, grid),
+ oln_type_of(point, grid) >::check();
+ }
+ };
- }; // end of class oln::abstract::pset<E>
-
-
-
- template <typename E>
- class fixed_pset : public virtual pset<E>
- {
- public:
-
- unsigned npoints() const
- {
- return this->exact().impl_npoints();
- }
-
protected:
- fixed_pset()
- {}
- };
-
-
- template <typename E>
- class ra_pset : public virtual pset<E>
- {
- typedef oln_type_of(E, point) point_t;
-
- public:
-
- bool has(const point_t& p) const
- {
- return this->exact().impl_has(p);
- }
-
- protected:
- ra_pset()
+ pset()
{}
- };
+ ~pset() { decl(); }
+ }; // end of class oln::abstract::pset<E>
- template <typename E>
- class bboxed_pset : public virtual pset<E>
- {
- typedef oln_type_of(E, point) point_t;
- typedef oln_type_of(E, bbox) bbox_t;
- typedef oln_type_of(point_t, coord) coord_t;
- typedef oln_type_of(point_t, dim) dim_t;
- enum { n = mlc_value(dim_t) };
-
- public:
- const bbox_t& bbox() const
- {
- return this->exact().impl_box();
- }
-
- bool is_valid() const
- {
- return this->exact().impl_is_valid();
- }
-
- const point_t& pmin() const
- {
- precondition(this->is_valid());
- return pmin_;
- }
-
- coord_t pmin(unsigned i) const
- {
- precondition(this->is_valid() and i < n);
- return pmin_[i];
- }
-
- const point_t& pmax() const
- {
- precondition(this->is_valid());
- return pmax_;
- }
-
- coord_t pmax(unsigned i) const
- {
- precondition(this->is_valid() and i < n);
- return pmax_[i];
- }
-
- unsigned len(unsigned i) const
- {
- precondition(this->is_valid() and i < n);
- return pmax_[i] - pmin_[i] + 1;
- }
-
- protected:
-
- bboxed_pset()
- {}
-
- point_t pmin_, pmax_;
- };
-
-
} // end of namespace oln::abstract
+} // end of namespace oln
- typedef hierarchy<abstract::pset, 1> pset_fixed_hierarchy;
- typedef hierarchy<abstract::pset, 2> pset_ra_hierarchy;
- typedef hierarchy<abstract::pset, 3> pset_bboxed_hierarchy;
+# include <oln/core/abstract/pset_hierarchies.hh>
- template <typename E>
- struct case_ < pset_fixed_hierarchy, E, 1 >
- : where_< mlc::eq_< oln_type_of(E, fixed), mlc::true_ > >
- {
- typedef abstract::fixed_pset<E> ret;
- };
- template <typename E>
- struct case_ < pset_ra_hierarchy, E, 1 >
- : where_< mlc::eq_< oln_type_of(E, ra), mlc::true_ > >
- {
- typedef abstract::ra_pset<E> ret;
- };
-
-
- template <typename E>
- struct case_ < pset_bboxed_hierarchy, E, 1 >
- : where_< mlc::neq_< oln_type_of(E, bbox), mlc::none > >
- {
- typedef abstract::bboxed_pset<E> ret;
- };
-
-
-
-} // end of namespace oln
-
-
#endif // ! OLENA_CORE_ABSTRACT_PSET_HH
Index: oln/core/pset_entry.hh
===================================================================
--- oln/core/pset_entry.hh (revision 0)
+++ oln/core/pset_entry.hh (revision 0)
@@ -0,0 +1,85 @@
+// 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 OLENA_CORE_PSET_ENTRY_HH
+# define OLENA_CORE_PSET_ENTRY_HH
+
+# include <oln/core/abstract/entry.hh>
+# include <oln/core/abstract/pset.hh>
+
+
+
+namespace oln
+{
+
+
+ /// Entry class for point sets: pset_entry<E> is an alias for
+ /// entry< abstract::pset, E>.
+
+ template <typename E>
+ struct pset_entry : public entry< abstract::pset, E>
+ {
+ protected:
+ pset_entry() {}
+ };
+
+
+ /// Virtual types associated to pset_entry<E>.
+
+ template <typename E>
+ struct vtypes< pset_entry<E> >
+ {
+ typedef mlc::undefined point_type;
+ typedef mlc::undefined fwd_piter_type;
+ typedef mlc::undefined bkd_piter_type;
+
+ typedef mlc::none bbox_type;
+ typedef mlc::undefined ra_type;
+ typedef mlc::undefined fixed_type;
+ };
+
+
+ template <typename E>
+ struct single_vtype< pset_entry<E>, typedef_::coord_type >
+ {
+ typedef oln_type_of(E, point) P;
+ typedef oln_type_of(P, coord) ret;
+ };
+
+
+ template <typename E>
+ struct single_vtype< pset_entry<E>, typedef_::grid_type >
+ {
+ typedef oln_type_of(E, point) P;
+ typedef oln_type_of(P, grid) ret;
+ };
+
+
+} // end of namespace oln
+
+
+#endif // ! OLENA_CORE_PSET_ENTRY_HH
1
0
06 Sep '06
2006-09-06 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
New macro to declare virtual types in abstract classes.
* stc/vtypes.hh (stc_virtual_typedef): New.
Index: stc/vtypes.hh
===================================================================
--- stc/vtypes.hh (revision 522)
+++ stc/vtypes.hh (working copy)
@@ -889,4 +889,11 @@
Namespace::type_of_<Category, FromType, \
Namespace::typedef_:: Typedef##_type >::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 oln_type_of(E, Typedef) Typedef
+
+
#endif // ! STATIC_VTYPES_HH
1
0