Mirror reflection library 0.5.13

mirror/meta_typedef.hpp

Go to the documentation of this file.
00001 
00011 #ifndef MIRROR_META_TYPEDEF_1011291729_HPP
00012 #define MIRROR_META_TYPEDEF_1011291729_HPP
00013 
00014 #include <mirror/meta_type.hpp>
00015 
00016 MIRROR_NAMESPACE_BEGIN
00017 namespace _typedef {
00018 
00019 // This type is used for distinguishing typedefined types from other T<x>
00020 // template types
00021 template <typename BaseTypedef>
00022 struct _selector { };
00023 
00024 } // namespace _typedef
00025 
00026 namespace _type {
00027 
00028 template <typename BaseTypedef>
00029 struct _< mirror::_typedef::_selector<BaseTypedef> >
00030  : BaseTypedef
00031 { };
00032 
00033 } // namespace _type
00034 
00035 template <typename BaseTypedef>
00036 struct meta_type< mirror::_typedef::_selector<BaseTypedef> >
00037  : aux::scoped_named_impl< BaseTypedef >
00038 {
00039     typedef meta_typedef_tag _type_category;
00040     typedef meta_typedef_tag _class_category;
00041 
00042     typedef typename aux::full_meta_object<
00043         typename BaseTypedef::scope
00044     >::type scope;
00045 
00046     typedef typename BaseTypedef::source_type original_type;
00047 
00048     typedef meta_class<original_type> type;
00049 };
00050 
00051 #ifdef MIRROR_DOCUMENTATION_ONLY
00052 
00053 
00060 #define MIRROR_REG_GLOBAL_SCOPE_TYPEDEF(TYPEDEF)
00061 #else
00062 #define MIRROR_REG_GLOBAL_SCOPE_TYPEDEF(TYPEDEF) \
00063 namespace _typedef { \
00064 template <typename Namespace> struct _ ## TYPEDEF ; \
00065 template <> struct _ ## TYPEDEF< mirror::_namespace::_ >\
00066 {  \
00067     typedef TYPEDEF source_type; \
00068     typedef meta_type_tag category; \
00069     typedef mirror::_namespace::_ scope; \
00070     MIRROR_IMPLEMENT_META_OBJECT_NAME_FUNCTIONS(#TYPEDEF) \
00071 }; \
00072 } MIRROR_ADD_TO_GLOBAL_LIST( \
00073     mirror::_namespace::_, \
00074     mirror::meta_type< \
00075     mirror::_typedef::_selector< \
00076     mirror::_typedef::_ ## TYPEDEF< \
00077     mirror::_namespace::_ \
00078     > > > \
00079 )
00080 #endif
00081 
00082 #ifdef MIRROR_DOCUMENTATION_ONLY
00083 
00084 
00093 #define MIRROR_REG_TYPEDEF(NAMESPACE, TYPEDEF)
00094 #else
00095 #define MIRROR_REG_TYPEDEF(NAMESPACE, TYPEDEF) \
00096 namespace _typedef { \
00097 template <typename Namespace> struct _ ## TYPEDEF; \
00098 template <> \
00099 struct _ ## TYPEDEF< mirror::_namespace:: NAMESPACE :: _ > \
00100 {  \
00101     typedef :: NAMESPACE :: TYPEDEF source_type; \
00102     typedef meta_type_tag category; \
00103     typedef mirror::_namespace:: NAMESPACE ::_ scope; \
00104     MIRROR_IMPLEMENT_META_OBJECT_NAME_FUNCTIONS(#TYPEDEF) \
00105 }; \
00106 } MIRROR_ADD_TO_GLOBAL_LIST( \
00107     mirror::_namespace :: NAMESPACE :: _, \
00108     mirror::meta_type< \
00109     mirror::_typedef::_selector< \
00110     mirror::_typedef::_ ## TYPEDEF< \
00111     mirror::_namespace:: NAMESPACE ::_ \
00112     > > > \
00113 )
00114 #endif
00115 
00116 #ifdef MIRROR_DOCUMENTATION_ONLY
00117 
00118 
00135 #define MIRROR_TYPEDEF(NAMESPACE, TYPEDEF)
00136 #else
00137 #define MIRROR_TYPEDEF(NAMESPACE, TYPEDEF) \
00138     mirror::_typedef::_selector < \
00139     mirror::_typedef::_ ## TYPEDEF < \
00140     mirror::_namespace:: NAMESPACE :: _ \
00141     > >
00142 #endif
00143 
00144 #ifdef MIRROR_DOCUMENTATION_ONLY
00145 
00146 
00160 #define MIRROR_GLOBAL_SCOPE_TYPEDEF(TYPEDEF)
00161 #else
00162 #define MIRROR_GLOBAL_SCOPE_TYPEDEF(TYPEDEF) \
00163     mirror::_typedef::_selector < \
00164     mirror::_typedef::_ ## TYPEDEF < \
00165     mirror::_namespace::  _ \
00166     > >
00167 #endif
00168 
00169 #ifdef MIRROR_DOCUMENTATION_ONLY
00170 
00171 
00182 #define MIRRORED_TYPEDEF(NAMESPACE, TYPEDEF) mirror::MetaTypedef
00183 #else
00184 #define MIRRORED_TYPEDEF(NAMESPACE, TYPEDEF) \
00185     mirror::meta_type< \
00186     mirror::_typedef::_selector< \
00187     mirror::_typedef::_ ## TYPEDEF< \
00188     mirror::_namespace::NAMESPACE::_ \
00189     > > >
00190 #endif
00191 
00192 #ifdef MIRROR_DOCUMENTATION_ONLY
00193 
00194 
00205 #define MIRRORED_GLOBAL_SCOPE_TYPEDEF(TYPEDEF) mirror::MetaTypedef
00206 #else
00207 #define MIRRORED_GLOBAL_SCOPE_TYPEDEF(TYPEDEF) \
00208     mirror::meta_type< \
00209     mirror::_typedef::_selector< \
00210     mirror::_typedef::_ ## TYPEDEF< \
00211     mirror::_namespace::_ \
00212     > > >
00213 #endif
00214 
00215 MIRROR_NAMESPACE_END
00216 
00217 #endif //include guard
00218 

Copyright © 2006-2011 Matus Chochlik, University of Zilina, Zilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Fri Dec 16 2011 by Doxygen (version 1.7.3).
Important note: Although the 'boostified' version of Mirror uses the Boost C++ libraries Coding Guidelines and is implemented inside of the boost namespace, it IS NOT an officially reviewed and accepted Boost library. Mirror is being developed with the intention to be submitted for review for inclusion to the Boost C++ libraries.