2006-09-04 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Test how to define derived associated types in bbox hierarchy.
* oln/core/abstract/bbox.hh (ext_vtype_): New definitions of
fwd_piter_type and bkd_piter_type.
(~bbox): Comment possible recursive code.
* oln/core/gen/bbox.hh (vtypes_): Comment former definitions of
fwd_piter_type and bkd_piter_type.
* oln/core/abstract/pset.hh (ext_vtype_): New definition for
grid.
(fwd_piter_type, bkd_piter_type): Comment because they are now
externally defined.
Index: oln/core/abstract/bbox.hh
===================================================================
--- oln/core/abstract/bbox.hh (revision 518)
+++ oln/core/abstract/bbox.hh (working copy)
@@ -40,6 +40,8 @@
// Forward declaration.
namespace abstract { template <typename E> class bbox; }
+ template <typename point> class fwd_piter_;
+ template <typename point> class bkd_piter_;
// Super type declaration.
@@ -50,6 +52,26 @@
};
+
+ template <typename E>
+ struct ext_vtype_< abstract::bbox<E>, typedef_::fwd_piter_type >
+ {
+ private:
+ typedef oln_type_of(E, point) P;
+ public:
+ typedef fwd_piter_<P> ret;
+ };
+
+ template <typename E>
+ struct ext_vtype_< abstract::bbox<E>, typedef_::bkd_piter_type >
+ {
+ private:
+ typedef oln_type_of(E, point) P;
+ public:
+ typedef bkd_piter_<P> ret;
+ };
+
+
namespace abstract
{
@@ -234,17 +256,17 @@
mlc::assert_defined_< point_t >::check();
- typedef oln_type_of(E, fwd_piter) fwd_piter_t;
- typedef oln_type_of(E, bkd_piter) bkd_piter_t;
+// typedef oln_type_of(E, fwd_piter) fwd_piter_t;
+// typedef oln_type_of(E, bkd_piter) bkd_piter_t;
- mlc::assert_defined_< fwd_piter_t >::check();
- mlc::assert_defined_< bkd_piter_t >::check();
+// mlc::assert_defined_< fwd_piter_t >::check();
+// mlc::assert_defined_< bkd_piter_t >::check();
- mlc::assert_< mlc::eq_< oln_type_of(fwd_piter_t, grid),
- oln_type_of(point_t, grid) > >::check();
+// mlc::assert_< mlc::eq_< oln_type_of(fwd_piter_t, grid),
+// oln_type_of(point_t, grid) > >::check();
- mlc::assert_< mlc::eq_< oln_type_of(bkd_piter_t, grid),
- oln_type_of(point_t, grid) > >::check();
+// mlc::assert_< mlc::eq_< oln_type_of(bkd_piter_t, grid),
+// oln_type_of(point_t, grid) > >::check();
}
Index: oln/core/abstract/pset.hh
===================================================================
--- oln/core/abstract/pset.hh (revision 518)
+++ oln/core/abstract/pset.hh (working copy)
@@ -47,13 +47,35 @@
struct vtypes_< abstract::pset<E> >
{
typedef mlc::undefined point_type;
- typedef mlc::undefined fwd_piter_type;
- typedef mlc::undefined bkd_piter_type;
- typedef mlc::undefined coord_type;
- // FIXME: Add grid.
+// typedef mlc::undefined fwd_piter_type;
+// typedef mlc::undefined bkd_piter_type;
};
+// template <typename E>
+// struct vtype_< abstract::pset<E>, typedef_::coord_type >
+// : type_of_< oln_type_of(E, point), typedef_::coord_type >
+// {};
+
+
+// template <typename E>
+// struct extension_vtype_< abstract::pset<E>, typedef_::coord_type >
+// {
+// private:
+// typedef oln_type_of(E, point) P;
+// public:
+// 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
{
@@ -71,8 +93,9 @@
~pset()
{
mlc::assert_defined_< oln_type_of(E, point) >::check();
+ mlc::assert_defined_< oln_type_of(E, coord) >::check();
- // FIXME: Trouble with circular dependencies.
+ // FIXME: BUG! Trouble with circular dependencies.
// mlc::assert_defined_< fwd_piter_t >::check();
// mlc::assert_defined_< bkd_piter_t >::check();
Index: oln/core/gen/bbox.hh
===================================================================
--- oln/core/gen/bbox.hh (revision 518)
+++ oln/core/gen/bbox.hh (working copy)
@@ -56,11 +56,11 @@
struct vtypes_< bbox_<point> >
{
typedef point point_type;
- typedef fwd_piter_<point> fwd_piter_type;
- typedef bkd_piter_<point> bkd_piter_type;
+// typedef fwd_piter_<point> fwd_piter_type;
+// typedef bkd_piter_<point> bkd_piter_type;
typedef typename point::coord_t coord_type;
- // BUG! typedef oln_type_of(point, grid) grid_type;
- // BUG! typedef typename point::grid_t grid_type;
+ // FIXME: BUG! typedef oln_type_of(point, grid) grid_type;
+ // FIXME: BUG! typedef typename point::grid_t grid_type;
};