Commit fd90e21e authored by Roland Levillain's avatar Roland Levillain
Browse files

Add convenience shortcuts for stc_{direct_,}check_type_of{_,}.

	* oln/core/macros.hh (oln_check_type_of, oln_check_type_of_) 
	(oln_check_direct_type_of, oln_check_direct_type_of_): New macros.
	* oln/morpher/internal/image_extension.hh, oln/morpher/identity.hh
	* oln/morpher/add_neighborhood.hh: Remove FIXMEs.


git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@562 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent eb049f34
2006-09-25 Roland Levillain <roland@lrde.epita.fr>
Add convenience shortcuts for stc_{direct_,}check_type_of{_,}.
* oln/core/macros.hh (oln_check_type_of, oln_check_type_of_)
(oln_check_direct_type_of, oln_check_direct_type_of_): New macros.
* oln/morpher/internal/image_extension.hh, oln/morpher/identity.hh
* oln/morpher/add_neighborhood.hh: Remove FIXMEs.
2006-09-25 Roland Levillain <roland@lrde.epita.fr>
Fix the distribution.
......
......@@ -28,6 +28,10 @@
#ifndef OLENA_CORE_MACROS_HH
# define OLENA_CORE_MACROS_HH
// --------------------- //
// Virtual type access. //
// --------------------- //
/// \def oln_type_of(OlnType, Alias)
///
/// Macro to retrieve an associated type \a Alias from the exact type of
......@@ -62,4 +66,54 @@
stc_direct_type_of_(oln, void, OlnType, Alias)
// ------------------------------- //
// Virtual type check and access. //
// ------------------------------- //
/* These macros are the same as the previous ones, but they use
stc_check_type_of{_,} (resp. stc_check_direct_type_of{_,}) instead of
stc_type_of{_,} (resp. stc_direct_type_of{_,}). */
/// \def oln_check_type_of(OlnType, Alias)
///
/// Macro to retrieve an associated type \a Alias from the exact type of
/// an oln type \a OlnType whose category is not specified (version to be
/// used inside a template).
///
/// If the virtual type is not found, raise a static error.
# define oln_check_type_of(OlnType, Alias) \
stc_check_type_of(oln, void, OlnType, Alias)
/// \def oln_check_type_of(OlnType, Alias)
///
/// Macro to retrieve an associated type \a Alias from the exact type of
/// an oln type \a OlnType whose category is not specified (version to be
/// used outside a template).
///
/// If the virtual type is not found, raise a static error.
# define oln_check_type_of_(OlnType, Alias) \
stc_check_type_of_(oln, void, OlnType, Alias)
/// \def oln_check_direct_type_of(OlnType, Alias)
///
/// Macro to retrieve an associated type \a Alias from an oln type \a
/// OlnType directly, and whose category is not specified (version to
/// be used inside a template).
///
/// If the virtual type is not found, raise a static error.
# define oln_check_direct_type_of(OlnType, Alias) \
stc_check_direct_type_of(oln, void, OlnType, Alias)
/// \def oln_check_direct_type_of_(OlnType, Alias)
///
/// Macro to retrieve an associated type \a Alias from an oln type \a
/// OlnType directly, and whose category is not specified (version to
/// be used inside a template).
///
/// If the virtual type is not found, raise a static error.
# define oln_check_direct_type_of_(OlnType, Alias) \
stc_check_direct_type_of_(oln, void, OlnType, Alias)
#endif // ! OLENA_CORE_MACROS_HH
......@@ -74,10 +74,7 @@ namespace oln
private:
typedef add_neighborhood<Image> self_t;
typedef stc_get_nth_super(self_t, 1) super_t;
// FIXME: This should be replaced by a call to a new version of
// `oln_type_of', (named, for instance, `oln_check_type_of' or
// `oln_type_of_defined_'). Do the necessary changes in Static.
typedef oln_type_of(self_t, neighborhood) neighborhood_t;
typedef oln_check_type_of(self_t, neighborhood) neighborhood_t;
public:
// FIXME: Handle the constness.
......
......@@ -66,7 +66,6 @@ namespace oln
{
/// Identity morpher.
template <typename Image>
// FIXME:
class identity : public stc_get_supers(identity<Image>)
{
private:
......
......@@ -47,7 +47,6 @@ namespace oln
} // end of namespace oln::morpher
// FIXME: Use set_super_type instead?
/// Create an ``uplink'' from
/// oln::morpher::internal::image_extension to the morphed \a Image,
/// so as to get all its virtual types.
......
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