https://svn.lrde.epita.fr/svn/oln/trunk/olena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Re-enable exact_type vtype.
* oln/core/typedefs.hh (oln_super_of_, oln_super2_of_)
(oln_super3_of_, oln_super_of): Remove macros.
(exact_type): Enable this typedef.
* oln/core/abstract/image.hh (packed_vtypes::exact_type): New
typedef.
(packed_vtypes::echo): Print exact_type.
(packed_vtypes::ensure): Check exact_type.
abstract/image.hh | 8 ++++++
typedefs.hh | 64 +++++++++++++++++++++++++++---------------------------
2 files changed, 40 insertions(+), 32 deletions(-)
Index: oln/core/typedefs.hh
--- oln/core/typedefs.hh (revision 475)
+++ oln/core/typedefs.hh (working copy)
@@ -37,42 +37,34 @@
# include <stc/vtypes.hh>
-# define oln_super_of_(Type) \
-oln::internal::get_super_type<Type>::ret
-
-# define oln_super2_of_(Type,_2) \
-oln::internal::get_super_type<Type,_2>::ret
-
-# define oln_super3_of_(Type,_2,_3) \
-oln::internal::get_super_type<Type,_2,_3>::ret
-
-
-# define oln_super_of(Type) \
-typename oln_super_of_(Type)
-
-
-
namespace oln
{
- // Namespace equipment. The virtual types facility is inserted here
- // because it also triggers Metalic's typedef introspection
- // equipment.
+ /*----------------------.
+ | Namespace equipment. |
+ `----------------------*/
+
+ // The virtual types facility is inserted here because it also
+ // triggers Metalic's typedef introspection equipment.
stc_equip_namespace_with_vtypes();
- // Misc.
+ /*-------.
+ | Misc. |
+ `-------*/
-// --------------------------------------------------------------------
-// FIXME: To be enabled later.
-// --------------------------------------------------------------------
-// mlc_decl_typedef(exact_type);
-// --------------------------------------------------------------------
+ mlc_decl_typedef(exact_type);
- // General.
+
+ /*----------.
+ | General. |
+ `----------*/
mlc_decl_typedef(grid_type);
- // Iterators.
+
+ /*------------.
+ | Iterators. |
+ `------------*/
// --------------------------------------------------------------------
// FIXME: To be enabled later.
@@ -94,7 +86,10 @@
// mlc_decl_typedef(bkd_niter_type);
// --------------------------------------------------------------------
- // category::image.
+
+ /*------------------.
+ | category::image. |
+ `------------------*/
// --------------------------------------------------------------------
// FIXME: To be enabled later.
@@ -133,7 +128,10 @@
// mlc_decl_typedef(image_rawness_type);
// --------------------------------------------------------------------
- // Extension in image_operators.
+ // ------------------------------ //
+ // Extension in image_operators. //
+ // ------------------------------ //
+
// --------------------------------------------------------------------
// FIXME: To be enabled later.
// --------------------------------------------------------------------
@@ -144,14 +142,17 @@
// --------------------------------------------------------------------
-
- // category::grid.
+ /*-----------------.
+ | category::grid. |
+ `-----------------*/
mlc_decl_typedef(dimvalue_type);
mlc_decl_typedef(coord_type);
- // category::fun1 and category::fun2.
+ /*------------------------------------.
+ | category::fun1 and category::fun2. |
+ `------------------------------------*/
// --------------------------------------------------------------------
// FIXME: To be enabled later.
@@ -162,7 +163,6 @@
// mlc_decl_typedef(right_type);
// --------------------------------------------------------------------
-
} // end of namespace oln
Index: oln/core/abstract/image.hh
--- oln/core/abstract/image.hh (revision 475)
+++ oln/core/abstract/image.hh (working copy)
@@ -62,6 +62,7 @@
typedef I exact_type;
typedef mlc::undefined grid_type;
+
// --------------------------------------------------------------------
// FIXME: To be enabled later.
// --------------------------------------------------------------------
@@ -94,6 +95,8 @@
struct packed_vtypes<category::image, I>
{
// Internally defined virtual types.
+ typedef oln_type_of(I, exact) exact_type;
+
typedef oln_type_of(I, grid) grid_type;
// --------------------------------------------------------------------
@@ -133,6 +136,8 @@
<< "vtypes_of(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
// --------------------------------------------------------------------
@@ -166,7 +171,10 @@
static void ensure()
{
+ mlc::assert_< mlc_is_ok(exact_type) >::check();
+
mlc::assert_< mlc_is_ok(grid_type) >::check();
+
// --------------------------------------------------------------------
// FIXME: To be enabled later.
// --------------------------------------------------------------------