https://svn.lrde.epita.fr/svn/oln/trunk/static
The corresponding patch for the Olena subproject follows.
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Rename virtual types classes.
* stc/vtypes.hh (vtypes, single_vtype, ext_vtype): Rename as...
(vtypes_in_category, single_vtype_in_category, ext_vtype_in_category):
...this.
(vtypes_, single_vtype_, ext_vtype_): Rename as...
(vtypes, single_vtype, ext_vtype): ...this.
(packed_vtypes): Rename as...
(packed_vtypes_in_category): ...this.
(packed_vtypes_): Rename as...
(packed_vtypes): ...this
* tests/vtypes.cc, tests/vtypes-and-exact.cc,
* tests/vtypes-multiple-supers.cc: Adjust.
stc/vtypes.hh | 45 ++++++++++++++++++++--------------------
tests/vtypes-and-exact.cc | 18 ++++++++--------
tests/vtypes-multiple-supers.cc | 14 ++++++------
tests/vtypes.cc | 20 ++++++++---------
4 files changed, 49 insertions(+), 48 deletions(-)
Index: tests/vtypes-and-exact.cc
--- tests/vtypes-and-exact.cc (revision 519)
+++ tests/vtypes-and-exact.cc (working copy)
@@ -75,7 +75,7 @@
/// Packing of virtual types of any class belonging to the category my::cat.
template <typename T>
- struct packed_vtypes <category::my_cat, T>
+ struct packed_vtypes_in_category<category::my_cat, T>
{
typedef my_type_of(T, foo) foo_type;
typedef my_type_of(T, bar) bar_type;
@@ -100,7 +100,7 @@
/// Types associated to my::A.
template <typename Exact>
- struct vtypes< category::my_cat, A<Exact> >
+ struct vtypes_in_category< category::my_cat, A<Exact> >
{
// A native type.
typedef int foo_type;
@@ -121,8 +121,8 @@
~A()
{
- // packed_vtypes< category::my, A<Exact> > is not checked here,
- // since A's baz_type virtual type is undefined.
+ // packed_vtypes_in_category< category::my, A<Exact> > is not checked
+ // here, since A's baz_type virtual type is undefined.
}
};
@@ -144,7 +144,7 @@
/// Types associated to my::B.
template <typename Exact>
- struct vtypes< category::my_cat, B<Exact> >
+ struct vtypes_in_category< category::my_cat, B<Exact> >
{
// (foo is left untouched.)
@@ -158,7 +158,7 @@
/// An extended type associated to my::B.
template <typename Exact>
- struct ext_vtype<category::my_cat, B<Exact>, typedef_::yin_type>
+ struct ext_vtype_in_category<category::my_cat, B<Exact>,
typedef_::yin_type>
{
typedef unsigned long ret;
};
@@ -176,7 +176,7 @@
// Check B's vtypes.
~B()
{
- packed_vtypes< category::my_cat, B<Exact> >::ensure();
+ packed_vtypes_in_category< category::my_cat, B<Exact> >::ensure();
}
};
@@ -193,7 +193,7 @@
/// Types associated to my::C.
template <>
- struct vtypes<category::my_cat, C>
+ struct vtypes_in_category<category::my_cat, C>
{
// A type defined only here (and not in the super class).
typedef double zorg_type;
@@ -209,7 +209,7 @@
// Check C's vtypes.
~C()
{
- packed_vtypes<category::my_cat, C>::ensure();
+ packed_vtypes_in_category<category::my_cat, C>::ensure();
}
};
Index: tests/vtypes-multiple-supers.cc
--- tests/vtypes-multiple-supers.cc (revision 519)
+++ tests/vtypes-multiple-supers.cc (working copy)
@@ -83,7 +83,7 @@
/// Packing of virtual types of any class belonging to the category my::cat.
template <typename T>
- struct packed_vtypes <category::my_cat, T>
+ struct packed_vtypes_in_category<category::my_cat, T>
{
typedef my_type_of(T, foo) foo_type;
@@ -103,7 +103,7 @@
/// Types associated to my::A.
template <>
- struct vtypes<category::my_cat, my::A>
+ struct vtypes_in_category<category::my_cat, my::A>
{
typedef int foo_type;
typedef alpha bar_type;
@@ -118,7 +118,7 @@
// Check A's vtypes.
~A()
{
- packed_vtypes<category::my_cat, A>::ensure();
+ packed_vtypes_in_category<category::my_cat, A>::ensure();
}
};
@@ -132,7 +132,7 @@
/// Types associated to my::B.
template <>
- struct vtypes<category::my_cat, B>
+ struct vtypes_in_category<category::my_cat, B>
{
typedef float foo_type;
typedef beta baz_type;
@@ -147,7 +147,7 @@
// Check B's vtypes.
~B()
{
- packed_vtypes<category::my_cat, B>::ensure();
+ packed_vtypes_in_category<category::my_cat, B>::ensure();
}
};
@@ -168,7 +168,7 @@
/// Types associated to my::C.
template <>
- struct vtypes<category::my_cat, C>
+ struct vtypes_in_category<category::my_cat, C>
{
// This typedef remove the ambiguity on the `foo' vtype: this vtype
// is provided by both A and B. Here, let `foo' take the value from
@@ -186,7 +186,7 @@
// Check C's vtypes.
~C()
{
- packed_vtypes<category::my_cat, C>::ensure();
+ packed_vtypes_in_category<category::my_cat, C>::ensure();
}
};
Index: tests/vtypes.cc
--- tests/vtypes.cc (revision 519)
+++ tests/vtypes.cc (working copy)
@@ -73,7 +73,7 @@
/// Packing of virtual types of any class belonging to the category my::cat.
template <typename T>
- struct packed_vtypes <category::my_cat, T>
+ struct packed_vtypes_in_category<category::my_cat, T>
{
typedef my_type_of(T, foo) foo_type;
typedef my_type_of(T, bar) bar_type;
@@ -97,7 +97,7 @@
/// Types associated to my::A.
template <>
- struct vtypes<category::my_cat, my::A>
+ struct vtypes_in_category<category::my_cat, my::A>
{
// A native type.
typedef int foo_type;
@@ -118,8 +118,8 @@
~A()
{
- // packed_vtypes<category::my, A> is not checked here, since A's
- // baz_type virtual type is undefined.
+ // packed_vtypes_in_category<category::my, A> is not checked here,
+ // since A's baz_type virtual type is undefined.
}
};
@@ -136,7 +136,7 @@
/// Types associated to my::B.
template <>
- struct vtypes<category::my_cat, B>
+ struct vtypes_in_category<category::my_cat, B>
{
// (foo is left untouched.)
@@ -150,7 +150,7 @@
/// An extended type associated to my::B.
template <>
- struct ext_vtype<category::my_cat, B, typedef_::yin_type>
+ struct ext_vtype_in_category<category::my_cat, B, typedef_::yin_type>
{
typedef unsigned long ret;
};
@@ -164,10 +164,10 @@
typedef my_type_of_(B, quux) quux_type;
typedef my_type_of_(B, yin) yin_type;
- // Check B's vtypes.
+ // Check B's vtype.
~B()
{
- packed_vtypes<category::my_cat, B>::ensure();
+ packed_vtypes_in_category<category::my_cat, B>::ensure();
}
};
@@ -189,7 +189,7 @@
/// Types associated to my::Z.
template <>
- struct vtypes<category::my_cat, Z>
+ struct vtypes_in_category<category::my_cat, Z>
{
// A type defined only here (and not in the super class).
typedef double zorg_type;
@@ -208,7 +208,7 @@
// Check C's vtypes.
~Z()
{
- packed_vtypes<category::my_cat, Z>::ensure();
+ packed_vtypes_in_category<category::my_cat, Z>::ensure();
}
};
Index: stc/vtypes.hh
--- stc/vtypes.hh (revision 519)
+++ stc/vtypes.hh (working copy)
@@ -265,7 +265,7 @@
/** */ \
/** Specialize this class for the desired \a from_type. */ \
template <typename category, typename from_type> \
- struct vtypes \
+ struct vtypes_in_category \
{ \
}; \
\
@@ -274,19 +274,19 @@
/** */ \
/** Specialize this class for the desired \a from_type. */ \
template <typename from_type> \
- struct vtypes_ \
+ struct vtypes \
{ \
}; \
\
/** Specialization of vtypes for types without category. */ \
template <typename from_type> \
- struct vtypes<void, from_type> : public vtypes_<from_type> \
+ struct vtypes_in_category<void, from_type> : public vtypes<from_type>
\
{ \
}; \
\
/** End of the recursive construction of any vtypes hierarchy. */ \
template <typename category> \
- struct vtypes<category, mlc::none> \
+ struct vtypes_in_category<category, mlc::none> \
{ \
}; \
\
@@ -300,7 +300,7 @@
/** */ \
/** Specialize this class for the desired \a from_type. */ \
template <typename category, typename from_type, typename typedef_type> \
- struct ext_vtype \
+ struct ext_vtype_in_category \
{ \
}; \
\
@@ -309,21 +309,21 @@
/** */ \
/** Specialize this class for the desired \a from_type. */ \
template <typename from_type, typename typedef_type> \
- struct ext_vtype_ \
+ struct ext_vtype \
{ \
}; \
\
/** Specialization of ext_vtype for types without category. */ \
template <typename from_type, typename typedef_type> \
- struct ext_vtype<void, from_type, typedef_type> \
- : public ext_vtype_<from_type, typedef_type> \
+ struct ext_vtype_in_category<void, from_type, typedef_type> \
+ : public ext_vtype<from_type, typedef_type> \
{ \
}; \
\
/** End of the recursive construction of any ext_vtype<> */ \
/** hierarchy. */ \
template <typename category, typename typedef_type> \
- struct ext_vtype<category, mlc::none, typedef_type> \
+ struct ext_vtype_in_category<category, mlc::none, typedef_type> \
{ \
}; \
\
@@ -337,7 +337,7 @@
/** */ \
/** Specialize this class for the desired \a from_type. */ \
template <typename category, typename from_type, typename typedef_type> \
- struct single_vtype \
+ struct single_vtype_in_category \
{ \
}; \
\
@@ -346,21 +346,21 @@
/** */ \
/** Specialize this class for the desired \a from_type. */ \
template <typename from_type, typename typedef_type> \
- struct single_vtype_ \
+ struct single_vtype \
{ \
}; \
\
/** Specialization of single_vtype for types without category. */ \
template <typename from_type, typename typedef_type> \
- struct single_vtype<void, from_type, typedef_type> \
- : public single_vtype_<from_type, typedef_type> \
+ struct single_vtype_in_category<void, from_type, typedef_type> \
+ : public single_vtype<from_type, typedef_type> \
{ \
}; \
\
/** End of the recursive construction of any single_vtype<> */ \
/** hierarchy. */ \
template <typename category, typename typedef_type> \
- struct single_vtype<category, mlc::none, typedef_type> \
+ struct single_vtype_in_category<category, mlc::none, typedef_type> \
{ \
}; \
\
@@ -374,20 +374,21 @@
/** Optional packing structure, to be specialized by the user. */ \
/** See tests/vtypes.cc for an example of use. */ \
template <typename category, typename from_type> \
- struct packed_vtypes \
+ struct packed_vtypes_in_category \
{ \
}; \
\
/** Optional packing structure, to be specialized by the user. */ \
/** Version for types without category. */ \
template <typename from_type> \
- struct packed_vtypes_ \
+ struct packed_vtypes \
{ \
}; \
\
/** Specialization of packed_vtypes for types without category. */ \
template <typename from_type> \
- struct packed_vtypes<void, from_type> : public packed_vtypes_<from_type>
\
+ struct packed_vtypes_in_category<void, from_type> : \
+ public packed_vtypes<from_type> \
{ \
}; \
\
@@ -439,7 +440,7 @@
from_type, typedef_type> \
{ \
/** Set of vtypes associated with FROM_TYPE. */ \
- typedef vtypes<category, from_type> types; \
+ typedef vtypes_in_category<category, from_type> types; \
/** Typedef in the current vtypes (may be mlc::not_found). */ \
typedef stc_internal_get_typedef(types, typedef_type) ret; \
}; \
@@ -452,7 +453,8 @@
from_type, typedef_type> \
{ \
/** Set of vtypes associated with FROM_TYPE. */ \
- typedef single_vtype<category, from_type, typedef_type> single_type; \
+ typedef single_vtype_in_category<category, from_type, typedef_type> \
+ single_type; \
/** Typedef in the current single_vtype (may be mlc::not_found). */ \
typedef mlc_ret(single_type) ret; \
}; \
@@ -465,7 +467,8 @@
from_type, typedef_type> \
{ \
/** Set of vtypes associated with FROM_TYPE. */ \
- typedef ext_vtype<category, from_type, typedef_type> ext_type; \
+ typedef ext_vtype_in_category<category, from_type, typedef_type> \
+ ext_type; \
/** Typedef in the current ext_vtype (may be mlc::not_found). */ \
typedef mlc_ret(ext_type) ret; \
}; \
@@ -473,8 +476,6 @@
\
/* FIXME: Do a basic scheme of the algorithm in pseudo-code. */ \
\
- /* FIXME: Check for mlc::undefined? */ \
- \
/* Forward declaration. */ \
template <typename method, typename category, \
typename from_list, typename typedef_type> \