Commit 1eadf52f authored by Roland Levillain's avatar Roland Levillain
Browse files

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.


git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@424 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 8b4beec4
2006-03-14 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.
2006-03-14 Roland Levillain <roland@lrde.epita.fr>
Catch up with recent changes and fix some tests of Metalic.
......
## Process this file through Automake to produce Makefile.in -*- Makefile -*-
SUBDIRS = build-aux metalic extended
SUBDIRS = build-aux metalic extended static
......@@ -20,7 +20,7 @@ AM_INIT_AUTOMAKE([1.9.4 foreign check-news dist-bzip2 -Wall])
## --------------------- ##
## C++ Compiler Set up. ##
## C++ compiler set up. ##
## --------------------- ##
# Look for a C++ compiler.
......@@ -39,7 +39,11 @@ fi
# 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 @@ AC_CONFIG_FILES([
metalic/mlc/Makefile
extended/Makefile
extended/xtd/Makefile
static/Makefile
static/stc/Makefile
])
# Checks for library functions.
......
## 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
......
......@@ -13,7 +13,6 @@ nobase_mlc_HEADERS = \
is_a.hh \
logic.hh \
pair.hh \
properties.hh \
ret.hh \
to_string.hh \
type.hh \
......
......@@ -11,7 +11,6 @@ check_PROGRAMS = \
case \
if \
is_a \
properties \
ret \
switch \
typedef
......@@ -19,7 +18,6 @@ check_PROGRAMS = \
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
......
## Process this file through Automake to create Makefile.in -*- Makefile -*-
SUBDIRS = stc tests
## Process this file through Automake to create Makefile.in -*- Makefile -*-
stcdir = $(includedir)/stc
nobase_stc_HEADERS = \
properties.hh
......@@ -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
## 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)
#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 my
| Namespace equipment. |
`----------------------*/
mlc_equip_namespace_with_properties();
stc_equip_namespace_with_properties();
/*-----------.
......@@ -77,7 +77,7 @@ namespace my
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 @@ namespace my
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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment