572: Rename stc/vtypes.hh as stc/scoop.hh.

https://svn.lrde.epita.fr/svn/oln/trunk/static Index: ChangeLog from Roland Levillain <roland@lrde.epita.fr> Rename stc/vtypes.hh as stc/scoop.hh. * stc/vtypes.hh: Rename as... * stc/scoop.hh: ..this. Adjust headers guards. (stc_equip_namespace_with_vtypes): Pass the enclosing namespace as an argument of this macro. Rename as... (stc_scoop_equipment_for_namespace): ...this. Adjust. (stc::abstraction_as_type): Remove. * tests/super.cc, tests/multiple-supers.cc, * tests/vtypes.cc, tests/vtypes-and-exact.cc, * tests/vtypes-multiple-supers.cc: Adjust. stc/Makefile.am | 2 - stc/scoop.hh | 46 ++++++++++++++-------------------------- tests/multiple-supers.cc | 12 ++++------ tests/super.cc | 12 ++++------ tests/vtypes-and-exact.cc | 24 ++++++++++---------- tests/vtypes-multiple-supers.cc | 21 ++++++++---------- tests/vtypes.cc | 20 ++++++++--------- 7 files changed, 60 insertions(+), 77 deletions(-) Index: tests/vtypes-and-exact.cc --- tests/vtypes-and-exact.cc (revision 571) +++ tests/vtypes-and-exact.cc (working copy) @@ -25,15 +25,17 @@ // reasons why the executable file might be covered by the GNU General // Public License. -#include <stc/any.hh> -#include <stc/vtypes.hh> +/// Check the virtual types system on a SCOOP hierarchy propagating the +/// exact (static) type throughout the inheritance tree (using +/// stc::any). + #include <mlc/cmp.hh> #include <mlc/assert.hh> #include <mlc/int.hh> -// Check the virtual types system on a SCOOP hierarchy propagating the -// exact (static) type throughout the inheritance tree (using -// stc::any). +#include <stc/any.hh> +#include <stc/scoop.hh> + // Helper macros. #define my_type_of(FromType, Typedef) \ @@ -42,6 +44,11 @@ #define my_type_of_(FromType, Typedef) \ stc_type_of_(my, my::category::my_cat, FromType, Typedef) + +// Namespace equipment. +stc_scoop_equipment_for_namespace(my); + + namespace my { /*-----------. @@ -56,13 +63,6 @@ mlc_decl_typedef(zorg_type); - /*----------------------. - | Namespace equipment. | - `----------------------*/ - - stc_equip_namespace_with_vtypes(); - - /*-----------. | Category. | `-----------*/ Index: tests/super.cc --- tests/super.cc (revision 571) +++ tests/super.cc (working copy) @@ -27,20 +27,18 @@ // Check Static's super relationship. -#include <stc/vtypes.hh> #include <mlc/is_a.hh> #include <mlc/assert.hh> +#include <stc/scoop.hh> -namespace my -{ - /*----------------------. - | Namespace equipment. | - `----------------------*/ +// Namespace equipment. +stc_scoop_equipment_for_namespace(my); - stc_equip_namespace_with_vtypes(); +namespace my +{ /*----. | A. | Index: tests/vtypes-multiple-supers.cc --- tests/vtypes-multiple-supers.cc (revision 571) +++ tests/vtypes-multiple-supers.cc (working copy) @@ -25,15 +25,17 @@ // reasons why the executable file might be covered by the GNU General // Public License. -#include <stc/vtypes.hh> +/// This test focuses on the support of virtual types in hierachies +/// with multiple inheritance. + +// FIXME: To do: Check extended vtypes, too. + #include <mlc/cmp.hh> #include <mlc/assert.hh> #include <mlc/int.hh> -// This test focuses on the support of virtual types in hierachies -// with multiple inheritance. +#include <stc/scoop.hh> -// FIXME: To do: Check extended vtypes, too. /// Helper macros. /// \{ @@ -45,6 +47,10 @@ /// \} +// Namespace equipment. +stc_scoop_equipment_for_namespace(my); + + namespace my { /*-----------. @@ -56,13 +62,6 @@ mlc_decl_typedef(baz_type); - /*----------------------. - | Namespace equipment. | - `----------------------*/ - - stc_equip_namespace_with_vtypes(); - - /*----------------. | Various types. | `----------------*/ Index: tests/vtypes.cc --- tests/vtypes.cc (revision 571) +++ tests/vtypes.cc (working copy) @@ -25,13 +25,15 @@ // reasons why the executable file might be covered by the GNU General // Public License. -#include <stc/vtypes.hh> +/// This test focuses on the virtual types system, so the exact type of +/// classes is not propagated here (stc::any is not used). + #include <mlc/cmp.hh> #include <mlc/assert.hh> #include <mlc/int.hh> -// This test focuses on the virtual types system, so the exact type of -// classes is not propagated here (stc::any is not used). +#include <stc/scoop.hh> + // Helper macros. #define my_type_of(FromType, Typedef) \ @@ -40,6 +42,11 @@ #define my_type_of_(FromType, Typedef) \ stc_type_of_(my, my::category::my_cat, FromType, Typedef) + +// Namespace equipment. +stc_scoop_equipment_for_namespace(my); + + namespace my { /*-----------. @@ -54,13 +61,6 @@ mlc_decl_typedef(zorg_type); - /*----------------------. - | Namespace equipment. | - `----------------------*/ - - stc_equip_namespace_with_vtypes(); - - /*-----------. | Category. | `-----------*/ Index: tests/multiple-supers.cc --- tests/multiple-supers.cc (revision 571) +++ tests/multiple-supers.cc (working copy) @@ -27,20 +27,18 @@ // Check Static's multiple super relationship. -#include <stc/vtypes.hh> #include <mlc/is_a.hh> #include <mlc/assert.hh> +#include <stc/scoop.hh> -namespace my -{ - /*----------------------. - | Namespace equipment. | - `----------------------*/ +// Namespace equipment. +stc_scoop_equipment_for_namespace(my); - stc_equip_namespace_with_vtypes(); +namespace my +{ /*--. | A | Index: stc/scoop.hh --- stc/scoop.hh (revision 567) +++ stc/scoop.hh (working copy) @@ -26,12 +26,14 @@ // Public License. /* \file stc/vtypes.hh - \brief Virtual types (also known as ``properties'') mechanism. + + \brief Equipment for SCOOP: notably, Virtual types (also known as + ``properties'') mechanism. Based on Theo's presentation from January 2006 (olena-06-jan.pdf). */ -#ifndef STATIC_VTYPES_HH -# define STATIC_VTYPES_HH +#ifndef STATIC_SCOOP_HH +# define STATIC_SCOOP_HH # include <mlc/flags.hh> # include <mlc/typedef.hh> @@ -121,7 +123,10 @@ // FIXME: Could we extract some classes from this gigantic macro? -# define stc_equip_namespace_with_vtypes() \ +# define stc_scoop_equipment_for_namespace(SCOOPED_NAMESPACE) \ + \ +namespace SCOOPED_NAMESPACE \ +{ \ \ /* ----------------------- */ \ /* Typedefs declarations. */ \ @@ -158,7 +163,7 @@ mlc_ret(mlc_comma_1(set_super_type< type, N >)) >::ret \ ret; \ }; \ - } /* end of namespace internal */ \ + } /* end of namespace SCOOPED_NAMESPACE ::internal */ \ \ template <typename type> \ struct get_supers_list \ @@ -216,7 +221,7 @@ { \ }; \ \ - } /* end of namespace internal */ \ + } /* end of namespace SCOOPED_NAMESPACE ::internal */ \ \ \ template<typename type> \ @@ -250,7 +255,7 @@ { \ }; \ \ - } /* end of namespace automatic */ \ + } /* end of namespace SCOOPED_NAMESPACE ::automatic */ \ \ \ /* --------------- */ \ @@ -426,7 +431,7 @@ /** Tag for retrieval within extended vtypes. */ \ struct extended : public method {}; \ \ - } /** end of stc::internal::tag */ \ + } /* end of namespace SCOOPED_NAMESPACE ::internal::tag */ \ \ /** Try to get \a typedef_type from \a from_type. In case this */ \ /** typedef is mlc::not_found, don't perform a recursive */ \ @@ -779,7 +784,7 @@ }; \ /** \} */ \ \ - } /** End of namespace internal. */ \ + } /* End of namespace SCOOPED_NAMESPACE ::internal */ \ \ \ /* Entry points. */ \ @@ -869,28 +874,11 @@ >::ret ret; \ }; \ \ +} /* end of namespace SCOOPED_NAMESPACE */ \ + \ struct e_n_d__w_i_t_h___s_e_m_i_c_o_l_o_n -/*---------------------. -| Abstraction helper. | -`---------------------*/ - -namespace stc -{ - /// Allow the manipulation of an abstraction (i.e., a template type) - /// as a plain type. - template <template <typename> class abstraction> - struct abstraction_as_type - { - template <typename E> - struct instantiated_with - { - typedef abstraction<E> ret; - }; - }; -} // end of namespace stc - /*---------. | Macros. | @@ -1057,4 +1045,4 @@ typedef oln_type_of(E, Typedef) Typedef -#endif // ! STATIC_VTYPES_HH +#endif // ! STATIC_SCOOP_HH Index: stc/Makefile.am --- stc/Makefile.am (revision 571) +++ stc/Makefile.am (working copy) @@ -6,7 +6,7 @@ entry.hh \ exact.hh \ find_exact.hh \ + scoop.hh \ valist_aggregator.hh \ - vtypes.hh \ \ internal/extract_vtype_from_list.hh
participants (1)
-
Roland Levillain