424: New subproject: Static (`stc' for short).

https://svn.lrde.epita.fr/svn/oln/trunk Index: ChangeLog from Roland Levillain <roland@lrde.epita.fr> New subproject: Static (`stc' for short). Move the SCOOP machinery (virtual types/properties) from Metalic to Static. * configure.ac (static/Makefile, static/stc/Makefile) (static/tests/Makefile): Configure these files. * metalic/stc/properties.hh: Move... * static/stc/properties.hh: ...here. (mlc_internal_get_typedef, mlc_equip_namespace_with_properties) (mlc_set_super, mlc_super, mlc_super_, mlc_typeof, mlc_typeof_): Rename as... (stc_internal_get_typedef, stc_equip_namespace_with_properties) (stc_set_super, stc_super, stc_super_, stc_typeof, stc_typeof_): ...this. Adjust. * metalic/tests/properties.cc: Move... * static/tests/properties.cc: ...here. Adjust. * Makefile.am (SUBDIRS): Add static. * static/Makefile.am, static/stc/Makefile.am, * static/tests/Makefile.am: New. * metalic/mlc/Makefile.am (nobase_mlc_HEADERS): Remove properties.hh. * metalic/tests/Makefile.am (check_PROGRAMS): Remove properties. (properties_SOURCES): Remove. * extended/tests/Makefile.am (AM_CPPFLAGS): Add -I$(top_srcdir)/metalic. Makefile.am | 2 +- configure.ac | 10 ++++++++-- extended/tests/Makefile.am | 2 +- metalic/mlc/Makefile.am | 1 - metalic/tests/Makefile.am | 2 -- static/Makefile.am | 3 +++ static/stc/Makefile.am | 5 +++++ static/stc/properties.hh | 36 ++++++++++++++++++------------------ static/tests/Makefile.am | 15 +++++++++++++++ static/tests/properties.cc | 12 ++++++------ 10 files changed, 57 insertions(+), 31 deletions(-) Index: extended/tests/Makefile.am --- extended/tests/Makefile.am (revision 423) +++ extended/tests/Makefile.am (working copy) @@ -1,6 +1,6 @@ ## Process this file through Automake to create Makefile.in -*- Makefile -*- -AM_CPPFLAGS = -I$(top_srcdir)/extended +AM_CPPFLAGS = -I$(top_srcdir)/extended -I$(top_srcdir)/metalic # FIXME: Add # # AM_CXXFLAGS = $(CXXFLAGS_STRICT) $(CXXFLAGS_OPTIMIZE) -ggdb Index: configure.ac --- configure.ac (revision 423) +++ configure.ac (working copy) @@ -20,7 +20,7 @@ ## --------------------- ## -## C++ Compiler Set up. ## +## C++ compiler set up. ## ## --------------------- ## # Look for a C++ compiler. @@ -39,7 +39,11 @@ # Students should create their test suite in tests/. Add the needed # configure options here. -AC_CONFIG_FILES([metalic/tests/Makefile extended/tests/Makefile]) +AC_CONFIG_FILES([ + metalic/tests/Makefile + extended/tests/Makefile + static/tests/Makefile +]) ## --------------- ## @@ -56,6 +60,8 @@ metalic/mlc/Makefile extended/Makefile extended/xtd/Makefile + static/Makefile + static/stc/Makefile ]) # Checks for library functions. Index: static/tests/properties.cc --- static/tests/properties.cc (revision 0) +++ static/tests/properties.cc (working copy) @@ -1,16 +1,16 @@ -#include <mlc/properties.hh> +#include <stc/properties.hh> #include <mlc/cmp.hh> // FIXME: Split this test into several smaller tests? For instance, // we have to test inheritance, properties/associated types, // ``external properties'', etc. The best approach is probably to -// browse mlc/properties.hh so as to make a list of the features to be +// browse stc/properties.hh so as to make a list of the features to be // checked. // Helper macro. #define my_type_of_(FromType, Typedef) \ - mlc_typeof_(my::category::my_cat, FromType, Typedef) + stc_typeof_(my::category::my_cat, FromType, Typedef) namespace my { @@ -30,7 +30,7 @@ | Namespace equipment. | `----------------------*/ - mlc_equip_namespace_with_properties(); + stc_equip_namespace_with_properties(); /*-----------. @@ -77,7 +77,7 @@ struct B; // Warning, this sugar might me remove from properties.hh. - mlc_set_super(B, A); + stc_set_super(B, A); /// Types associated to my::B. template<> @@ -100,7 +100,7 @@ typedef unsigned long ret; }; - struct B : public mlc_super_(B) + struct B : public stc_super_(B) { // Aliases. typedef my_type_of_(B, foo) foo_type; Index: static/tests/Makefile.am --- static/tests/Makefile.am (revision 0) +++ static/tests/Makefile.am (revision 0) @@ -0,0 +1,15 @@ +## Process this file through Automake to create Makefile.in -*- Makefile -*- + +AM_CPPFLAGS = -I$(top_srcdir)/static -I$(top_srcdir)/metalic +# FIXME: Add +# +# AM_CXXFLAGS = $(CXXFLAGS_STRICT) $(CXXFLAGS_OPTIMIZE) -ggdb +# +# when oln.m4 is available in the distribution. + +check_PROGRAMS = \ + properties + +properties_SOURCES = properties.cc + +TESTS = $(check_PROGRAMS) Index: static/stc/Makefile.am --- static/stc/Makefile.am (revision 0) +++ static/stc/Makefile.am (revision 0) @@ -0,0 +1,5 @@ +## Process this file through Automake to create Makefile.in -*- Makefile -*- + +stcdir = $(includedir)/stc +nobase_stc_HEADERS = \ + properties.hh Index: static/stc/properties.hh --- static/stc/properties.hh (revision 0) +++ static/stc/properties.hh (working copy) @@ -25,13 +25,13 @@ // reasons why the executable file might be covered by the GNU General // Public License. -// \file mlc/properties.hh +// \file stc/properties.hh // \brief Property mechanism. // // From Theo's presentation (olena-06-jan.pdf). -#ifndef METALIC_PROPERTIES_HH -# define METALIC_PROPERTIES_HH +#ifndef STATIC_PROPERTIES_HH +# define STATIC_PROPERTIES_HH # include <mlc/flags.hh> # include <mlc/typedef.hh> @@ -47,11 +47,11 @@ `------------*/ // Note: TypedefName *must* be of the form `typedef_::foo'. -# define mlc_internal_get_typedef(Type, TypedefName) \ +# define stc_internal_get_typedef(Type, TypedefName) \ typename TypedefName::template from_< Type >::ret // FIXME: Add support for hierarchies with several super classes. -# define mlc_equip_namespace_with_properties() \ +# define stc_equip_namespace_with_properties() \ \ /* ----------------------- */ \ /* Typedefs declarations. */ \ @@ -132,12 +132,12 @@ /** Set of vtypes associated with FROM_TYPE. */ \ typedef vtypes<category, from_type> types; \ /** Typedef in the current vtypes (may be mlc::not_found). */ \ - typedef mlc_internal_get_typedef(types, typedef_type) type; \ + typedef stc_internal_get_typedef(types, typedef_type) type; \ \ /** Implicit parent (i.e. super), if any. */ \ - typedef mlc_super(from_type) super; \ + typedef stc_super(from_type) super; \ /** Pseudosuper class, if any. */ \ - typedef mlc_internal_get_typedef(types, typedef_::pseudosuper_type) \ + typedef stc_internal_get_typedef(types, typedef_::pseudosuper_type) \ pseudosuper; \ \ typedef typename \ @@ -204,12 +204,12 @@ typedef mlc_ret(ext_type) type; \ \ /** Implicit parent (i.e. super), if any. */ \ - typedef mlc_super(from_type) super; \ + typedef stc_super(from_type) super; \ /** Pseudosuper class, if any. */ \ /* FIXME: Looking for this information is not elegant. Have a */ \ - /* look at metalic/tests/properties.cc for a better suggestion. */ \ + /* look at static/tests/properties.cc for a better suggestion. */ \ typedef vtypes<category, from_type> types; \ - typedef mlc_internal_get_typedef(types, typedef_::pseudosuper_type) \ + typedef stc_internal_get_typedef(types, typedef_::pseudosuper_type) \ pseudosuper; \ \ typedef typename \ @@ -345,8 +345,8 @@ /* FIXME: I don't know this macro will be really usable; what if T is a template class? */ -// mlc_set_super_type(T, S) to declare the immediate base class S of T -# define mlc_set_super(Type, Super) \ +/// \def Declare the immediate base class \a Super of \a Type. +# define stc_set_super(Type, Super) \ template <> \ struct set_super_type<Type> \ { \ @@ -354,20 +354,20 @@ } /// \def Get the immediate base class of T (version with typename). -# define mlc_super(T) \ +# define stc_super(T) \ typename set_super_type<T>::ret /// \def Get the immediate base class of T (version without typename). -# define mlc_super_(T) \ +# define stc_super_(T) \ set_super_type<T>::ret /// Get the property \a Typedef from \a FromType (version with typename). -#define mlc_typeof(Category, FromType, Typedef) \ +#define stc_typeof(Category, FromType, Typedef) \ typename typeof_<Category, FromType, typedef_:: Typedef##_type >::ret /// Get the property \a Typedef from \a FromType (version without typename). -#define mlc_typeof_(Category, FromType, Typedef) \ +#define stc_typeof_(Category, FromType, Typedef) \ typeof_<Category, FromType, typedef_:: Typedef##_type >::ret -#endif // ! METALIC_PROPERTIES_HH +#endif // ! STATIC_PROPERTIES_HH Index: static/Makefile.am --- static/Makefile.am (revision 0) +++ static/Makefile.am (revision 0) @@ -0,0 +1,3 @@ +## Process this file through Automake to create Makefile.in -*- Makefile -*- + +SUBDIRS = stc tests Index: Makefile.am --- Makefile.am (revision 423) +++ Makefile.am (working copy) @@ -1,3 +1,3 @@ ## Process this file through Automake to produce Makefile.in -*- Makefile -*- -SUBDIRS = build-aux metalic extended +SUBDIRS = build-aux metalic extended static Index: metalic/tests/Makefile.am --- metalic/tests/Makefile.am (revision 423) +++ metalic/tests/Makefile.am (working copy) @@ -11,7 +11,6 @@ case \ if \ is_a \ - properties \ ret \ switch \ typedef @@ -19,7 +18,6 @@ case_SOURCES = case.cc if_SOURCES = if.cc is_a_SOURCES = is_a.cc -properties_SOURCES = properties.cc ret_SOURCES = ret.cc switch_SOURCES = switch.cc typedef_SOURCES = typedef.cc Index: metalic/mlc/Makefile.am --- metalic/mlc/Makefile.am (revision 423) +++ metalic/mlc/Makefile.am (working copy) @@ -13,7 +13,6 @@ is_a.hh \ logic.hh \ pair.hh \ - properties.hh \ ret.hh \ to_string.hh \ type.hh \
participants (1)
-
Roland Levillain