Boost logo

Boost-Commit :

From: chochlik_at_[hidden]
Date: 2008-06-19 03:44:44


Author: matus.chochlik
Date: 2008-06-19 03:44:43 EDT (Thu, 19 Jun 2008)
New Revision: 46499
URL: http://svn.boost.org/trac/boost/changeset/46499

Log:
- done some cleanup in the sources
- added additional traits for meta-attributes namely is_static (some more are probably to follow)
Text files modified:
   sandbox/mirror/boost/mirror/detail/meta_attribs_base.hpp | 75 ++++++++-----
   sandbox/mirror/boost/mirror/detail/meta_attribs_getset.hpp | 48 ++++----
   sandbox/mirror/boost/mirror/meta_attributes.hpp | 216 ++++++++++++++++++++++++++++-----------
   sandbox/mirror/boost/mirror/meta_classes/boost_tuple.hpp | 7 +
   sandbox/mirror/libs/mirror/doc/xml/mirror/_library.xml | 5
   5 files changed, 238 insertions(+), 113 deletions(-)

Modified: sandbox/mirror/boost/mirror/detail/meta_attribs_base.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/meta_attribs_base.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/meta_attribs_base.hpp 2008-06-19 03:44:43 EDT (Thu, 19 Jun 2008)
@@ -38,6 +38,23 @@
         typedef mpl::vector<> type_list;
 };
 
+/** Additional attribute traits
+ */
+template <bool IsStatic>
+struct meta_class_attribute_traits
+{
+ typedef mpl::bool_<IsStatic> is_static;
+};
+
+/** This macro declares the meta-attribute traits getter
+ * function.
+ * There is a special implementation of this in meta-class
+ * for boost::tuple
+ */
+#define BOOST_MIRROR_REG_CLASS_ATTRIB_TRAITS_GETTER(NUMBER, IS_STATIC) \
+ static meta_class_attribute_traits<IS_STATIC> \
+ get_traits(mpl::int_<NUMBER>); \
+
 /** This macro starts the declaration of member attributes
  * of the given class
  */
@@ -78,15 +95,16 @@
  * It declares all common things that need to be declared
  * after the specific stuff.
  */
-#define BOOST_MIRROR_REG_CLASS_OR_TEMPL_ATTRIB_EPILOGUE(NUMBER, TYPE, NAME, TYPENAME_KW) \
+#define BOOST_MIRROR_REG_CLASS_OR_TEMPL_ATTRIB_EPILOGUE(NUMBER, TYPE, NAME, IS_STATIC, TYPENAME_KW) \
+ BOOST_MIRROR_REG_CLASS_ATTRIB_TRAITS_GETTER(NUMBER, IS_STATIC) \
         typedef TYPENAME_KW mpl::push_back<_partial_list_##NUMBER, TYPE>::type
 
 
-#define BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE(NUMBER, TYPE, NAME) \
- BOOST_MIRROR_REG_CLASS_OR_TEMPL_ATTRIB_EPILOGUE(NUMBER, TYPE, NAME, BOOST_PP_EMPTY())
+#define BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE(NUMBER, TYPE, NAME, IS_STATIC) \
+ BOOST_MIRROR_REG_CLASS_OR_TEMPL_ATTRIB_EPILOGUE(NUMBER, TYPE, NAME, IS_STATIC, BOOST_PP_EMPTY())
 
-#define BOOST_MIRROR_REG_TEMPLATE_ATTRIB_EPILOGUE(NUMBER, TYPE, NAME) \
- BOOST_MIRROR_REG_CLASS_OR_TEMPL_ATTRIB_EPILOGUE(NUMBER, TYPE, NAME, typename)
+#define BOOST_MIRROR_REG_TEMPLATE_ATTRIB_EPILOGUE(NUMBER, TYPE, NAME, IS_STATIC) \
+ BOOST_MIRROR_REG_CLASS_OR_TEMPL_ATTRIB_EPILOGUE(NUMBER, TYPE, NAME, IS_STATIC, typename)
 
 
 /** This is a helper for the BOOST_MIRROR_CLASS_ATTRIB*_TD
@@ -94,30 +112,31 @@
  * It declares all common things that need to be declared
  * after the specific stuff.
  */
-#define BOOST_MIRROR_REG_CLASS_OR_TEMPL_ATTRIB_EPILOGUE_TD(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, NAME, TYPENAME_KW) \
+#define BOOST_MIRROR_REG_CLASS_OR_TEMPL_ATTRIB_EPILOGUE_TD(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, NAME, IS_STATIC, TYPENAME_KW) \
+ BOOST_MIRROR_REG_CLASS_ATTRIB_TRAITS_GETTER(NUMBER, IS_STATIC) \
         typedef TYPENAME_KW mpl::push_back<\
                 _partial_list_##NUMBER, \
                 BOOST_MIRROR_TYPEDEFD_SELECTOR(TYPE_NS_ALIAS##_##TYPE, TYPE_NAMESPACE::TYPE)\
>::type
 
-#define BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE_TD(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, NAME) \
- BOOST_MIRROR_REG_CLASS_OR_TEMPL_ATTRIB_EPILOGUE_TD(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, NAME, BOOST_PP_EMPTY())
+#define BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE_TD(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, NAME, IS_STATIC) \
+ BOOST_MIRROR_REG_CLASS_OR_TEMPL_ATTRIB_EPILOGUE_TD(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, NAME, IS_STATIC, BOOST_PP_EMPTY())
 
-#define BOOST_MIRROR_REG_TEMPLATE_ATTRIB_EPILOGUE_TD(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, NAME) \
- BOOST_MIRROR_REG_CLASS_OR_TEMPL_ATTRIB_EPILOGUE_TD(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, NAME, typename)
+#define BOOST_MIRROR_REG_TEMPLATE_ATTRIB_EPILOGUE_TD(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, NAME, IS_STATIC) \
+ BOOST_MIRROR_REG_CLASS_OR_TEMPL_ATTRIB_EPILOGUE_TD(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, NAME, IS_STATIC, typename)
 
-/** Helper macro for implementing simple attrib value getting
+/** Helper macro for implementing simple attrib value getting and
  * querying scheme
  */
 #define BOOST_MIRROR_REG_CLASS_OR_TEMPL_ATTRIB_DECL_SIMPLE_GET(NUMBER, TYPE, NAME, TYPENAME_KW) \
- static TYPENAME_KW call_traits<TYPE>::param_type get(const Class& context, mpl::int_<NUMBER>)\
+ static TYPENAME_KW call_traits<TYPE>::param_type get(const Class& instance, mpl::int_<NUMBER>)\
         {\
- return context.NAME;\
+ return instance.NAME;\
         }\
         template <typename DestType>\
- static DestType& query(const Class& context, mpl::int_<NUMBER>, DestType& dest)\
+ static DestType& query(const Class& instance, mpl::int_<NUMBER>, DestType& dest)\
         {\
- dest = DestType(context.NAME);\
+ dest = DestType(instance.NAME);\
                 return dest;\
         }
 
@@ -131,9 +150,9 @@
 /** Helper macro for implementing no-op query meta-class function
  */
 #define BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_NO_GETTER(NUMBER, TYPE) \
- static void get(const Class& context, mpl::int_<NUMBER>){ }\
+ static void get(const Class& instance, mpl::int_<NUMBER>){ }\
         template <typename DestType>\
- static void query(const Class& context, mpl::int_<NUMBER>, DestType& dest){ }
+ static void query(const Class& instance, mpl::int_<NUMBER>, DestType& dest){ }
 
 #define BOOST_MIRROR_REG_TEMPLATE_ATTRIB_DECL_NO_GETTER(NUMBER, TYPE) \
 
@@ -141,11 +160,11 @@
 /** Helper macros
  */
 #define BOOST_MIRROR_REG_CLASS_OR_TEMPL_ATTRIB_DECL_SIMPLE_SET(NUMBER, TYPE, NAME, TYPENAME_KW) \
- static void set(Class& context, mpl::int_<NUMBER>, TYPENAME_KW call_traits<TYPE>::param_type val)\
+ static void set(Class& instance, mpl::int_<NUMBER>, TYPENAME_KW call_traits<TYPE>::param_type val)\
         {\
- context.NAME = val;\
+ instance.NAME = val;\
         } \
- static void set(const Class& context, mpl::int_<NUMBER>, TYPENAME_KW call_traits<TYPE>::param_type val)\
+ static void set(const Class& instance, mpl::int_<NUMBER>, TYPENAME_KW call_traits<TYPE>::param_type val)\
         {\
         }
 
@@ -159,8 +178,8 @@
 /** Helper macro for implementing no-op set meta-class function
  */
 #define BOOST_MIRROR_REG_CLASS_OR_TEMPL_ATTRIB_DECL_NO_SETTER(NUMBER, TYPE, TYPENAME_KW) \
- static void set(Class& context, mpl::int_<NUMBER>, call_traits<TYPE>::param_type val){ }\
- static void set(const Class& context, mpl::int_<NUMBER>, call_traits<TYPE>::param_type val){ }
+ static void set(Class& instance, mpl::int_<NUMBER>, call_traits<TYPE>::param_type val){ }\
+ static void set(const Class& instance, mpl::int_<NUMBER>, call_traits<TYPE>::param_type val){ }
 
 #define BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_NO_SETTER(NUMBER, TYPE) \
         BOOST_MIRROR_REG_CLASS_OR_TEMPL_ATTRIB_DECL_NO_SETTER(NUMBER, TYPE, BOOST_PP_EMPTY())
@@ -174,7 +193,7 @@
         BOOST_MIRROR_REG_CLASS_ATTRIB_PROLOGUE(NUMBER, TYPE, NAME) \
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_SIMPLE_GET(NUMBER, TYPE, NAME) \
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_SIMPLE_SET(NUMBER, TYPE, NAME) \
- BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE(NUMBER, TYPE, NAME)
+ BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE(NUMBER, TYPE, NAME, false)
 
 /** This macro declares the meta-data for a single templates attribute
  */
@@ -182,7 +201,7 @@
         BOOST_MIRROR_REG_CLASS_ATTRIB_PROLOGUE(NUMBER, TYPE, NAME) \
         BOOST_MIRROR_REG_TEMPLATE_ATTRIB_DECL_SIMPLE_GET(NUMBER, TYPE, NAME) \
         BOOST_MIRROR_REG_TEMPLATE_ATTRIB_DECL_SIMPLE_SET(NUMBER, TYPE, NAME) \
- BOOST_MIRROR_REG_TEMPLATE_ATTRIB_EPILOGUE(NUMBER, TYPE, NAME)
+ BOOST_MIRROR_REG_TEMPLATE_ATTRIB_EPILOGUE(NUMBER, TYPE, NAME, false)
 
 /** This macro declares the meta-data for a single class' attribute outline
  */
@@ -191,7 +210,7 @@
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_SIMPLE_GET(NUMBER, TYPE, NAME) \
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_SIMPLE_SET(NUMBER, TYPE, NAME) \
         BOOST_MIRROR_DECLARE_ATTRIB_OUTLINE(NUMBER, TYPE, NAME) \
- BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE(NUMBER, TYPE, NAME)
+ BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE(NUMBER, TYPE, NAME, false)
 
 /** This macro declares the meta-data for a single templates attribute
  */
@@ -200,7 +219,7 @@
         BOOST_MIRROR_REG_TEMPLATE_ATTRIB_DECL_SIMPLE_GET(NUMBER, TYPE, NAME) \
         BOOST_MIRROR_REG_TEMPLATE_ATTRIB_DECL_SIMPLE_SET(NUMBER, TYPE, NAME) \
         BOOST_MIRROR_DECLARE_ATTRIB_OUTLINE(NUMBER, TYPE, NAME) \
- BOOST_MIRROR_REG_TEMPLATE_ATTRIB_EPILOGUE(NUMBER, TYPE, NAME)
+ BOOST_MIRROR_REG_TEMPLATE_ATTRIB_EPILOGUE(NUMBER, TYPE, NAME, false)
 
 /** This macro declares the meta-data for a single class' typedefd attribute
  */
@@ -208,7 +227,7 @@
         BOOST_MIRROR_REG_CLASS_ATTRIB_PROLOGUE(NUMBER, TYPE_NAMESPACE::TYPE, NAME) \
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_SIMPLE_GET(NUMBER, TYPE_NAMESPACE::TYPE, NAME) \
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_SIMPLE_SET(NUMBER, TYPE_NAMESPACE::TYPE, NAME) \
- BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE_TD(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, NAME)
+ BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE_TD(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, NAME, false)
 
 /** This macro declares the meta-data for a single templates typedefd attribute
  */
@@ -216,7 +235,7 @@
         BOOST_MIRROR_REG_CLASS_ATTRIB_PROLOGUE(NUMBER, TYPE_NAMESPACE::TYPE, NAME) \
         BOOST_MIRROR_REG_TEMPLATE_ATTRIB_DECL_SIMPLE_GET(NUMBER, TYPE_NAMESPACE::TYPE, NAME) \
         BOOST_MIRROR_REG_TEMPLATE_ATTRIB_DECL_SIMPLE_SET(NUMBER, TYPE_NAMESPACE::TYPE, NAME) \
- BOOST_MIRROR_REG_TEMPLATE_ATTRIB_EPILOGUE_TD(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, NAME)
+ BOOST_MIRROR_REG_TEMPLATE_ATTRIB_EPILOGUE_TD(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, NAME, false)
 
 /** This macro finishes the declaration of attributes
  * of the given class

Modified: sandbox/mirror/boost/mirror/detail/meta_attribs_getset.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/meta_attribs_getset.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/meta_attribs_getset.hpp 2008-06-19 03:44:43 EDT (Thu, 19 Jun 2008)
@@ -42,34 +42,34 @@
  * gets never used it is (hopefully) culled out of the final binary.
  */
 #define BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_GETTER_ARGS(NUMBER, TYPE, GETTER_NAME, GETTER_ARGS_TUPLE, ARG_COUNT) \
- static call_traits<TYPE>::param_type do_get(Class& context, mpl::int_<NUMBER>, mpl::bool_<true>)\
+ static call_traits<TYPE>::param_type do_get(Class& instance, mpl::int_<NUMBER>, mpl::bool_<true>)\
         {\
- return context.GETTER_NAME(BOOST_PP_LIST_ENUM(BOOST_PP_TUPLE_TO_LIST(ARG_COUNT, GETTER_ARGS_TUPLE)));\
+ return instance.GETTER_NAME(BOOST_PP_LIST_ENUM(BOOST_PP_TUPLE_TO_LIST(ARG_COUNT, GETTER_ARGS_TUPLE)));\
         } \
- static call_traits<TYPE>::param_type do_get(const Class& context, mpl::int_<NUMBER>, mpl::bool_<function_types::is_member_function_pointer<BOOST_TYPEOF(&Class::GETTER_NAME), function_types::const_qualified>::value>)\
+ static call_traits<TYPE>::param_type do_get(const Class& instance, mpl::int_<NUMBER>, mpl::bool_<function_types::is_member_function_pointer<BOOST_TYPEOF(&Class::GETTER_NAME), function_types::const_qualified>::value>)\
         {\
- return const_cast<Class&>(context).GETTER_NAME(BOOST_PP_LIST_ENUM(BOOST_PP_TUPLE_TO_LIST(ARG_COUNT, GETTER_ARGS_TUPLE)));\
+ return const_cast<Class&>(instance).GETTER_NAME(BOOST_PP_LIST_ENUM(BOOST_PP_TUPLE_TO_LIST(ARG_COUNT, GETTER_ARGS_TUPLE)));\
         } \
         template <typename DestType>\
- static DestType& do_query(Class& context, mpl::int_<NUMBER>, DestType& dest, mpl::bool_<true>)\
+ static DestType& do_query(Class& instance, mpl::int_<NUMBER>, DestType& dest, mpl::bool_<true>)\
         {\
- dest = DestType(context.GETTER_NAME(BOOST_PP_LIST_ENUM(BOOST_PP_TUPLE_TO_LIST(ARG_COUNT, GETTER_ARGS_TUPLE))));\
+ dest = DestType(instance.GETTER_NAME(BOOST_PP_LIST_ENUM(BOOST_PP_TUPLE_TO_LIST(ARG_COUNT, GETTER_ARGS_TUPLE))));\
                 return dest;\
         } \
         template <typename DestType>\
- static DestType& do_query(const Class& context, mpl::int_<NUMBER>, DestType& dest, mpl::bool_<function_types::is_member_function_pointer<BOOST_TYPEOF(&Class::GETTER_NAME), function_types::const_qualified>::value>)\
+ static DestType& do_query(const Class& instance, mpl::int_<NUMBER>, DestType& dest, mpl::bool_<function_types::is_member_function_pointer<BOOST_TYPEOF(&Class::GETTER_NAME), function_types::const_qualified>::value>)\
         {\
- dest = DestType(const_cast<Class&>(context).GETTER_NAME(BOOST_PP_LIST_ENUM(BOOST_PP_TUPLE_TO_LIST(ARG_COUNT, GETTER_ARGS_TUPLE))));\
+ dest = DestType(const_cast<Class&>(instance).GETTER_NAME(BOOST_PP_LIST_ENUM(BOOST_PP_TUPLE_TO_LIST(ARG_COUNT, GETTER_ARGS_TUPLE))));\
                 return dest;\
         } \
- template <class SomeClass> static call_traits<TYPE>::param_type get(SomeClass& context, mpl::int_<NUMBER>)\
+ template <class SomeClass> static call_traits<TYPE>::param_type get(SomeClass& instance, mpl::int_<NUMBER>)\
         {\
- return do_get(context, mpl::int_<NUMBER>(), mpl::bool_<true>());\
+ return do_get(instance, mpl::int_<NUMBER>(), mpl::bool_<true>());\
         }\
         template <class SomeClass, typename DestType> \
- static DestType& query(SomeClass& context, mpl::int_<NUMBER>, DestType& dest)\
+ static DestType& query(SomeClass& instance, mpl::int_<NUMBER>, DestType& dest)\
         {\
- return do_query(context, mpl::int_<NUMBER>(), dest, mpl::bool_<true>());\
+ return do_query(instance, mpl::int_<NUMBER>(), dest, mpl::bool_<true>());\
         }
 
 
@@ -78,9 +78,9 @@
 /** Helper macro for implementing setter based set meta-class function
  */
 #define BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_SETTER_ARGS(NUMBER, TYPE, SETTER_NAME, SETTER_ARGS_TUPLE, ARG_COUNT) \
- static void set(Class& context, mpl::int_<NUMBER>, call_traits<TYPE>::param_type val)\
+ static void set(Class& instance, mpl::int_<NUMBER>, call_traits<TYPE>::param_type val)\
         {\
- context.SETTER_NAME(BOOST_PP_LIST_ENUM(BOOST_PP_TUPLE_TO_LIST(ARG_COUNT, SETTER_ARGS_TUPLE)));\
+ instance.SETTER_NAME(BOOST_PP_LIST_ENUM(BOOST_PP_TUPLE_TO_LIST(ARG_COUNT, SETTER_ARGS_TUPLE)));\
         }
 
 
@@ -91,7 +91,7 @@
         BOOST_MIRROR_REG_CLASS_ATTRIB_PROLOGUE(NUMBER, TYPE, ATTRIB_NAME) \
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_GETTER_ARGS(NUMBER, TYPE, GETTER_NAME, GETTER_ARGS_TUPLE, ARG_COUNT)\
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_NO_SETTER(NUMBER, TYPE)\
- BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE(NUMBER, TYPE, ATTRIB_NAME)
+ BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE(NUMBER, TYPE, ATTRIB_NAME, false)
 
 /** Simpler version of the BOOST_MIRROR_REG_CLASS_ATTRIB_GETTER_W_ARGS
  * for getter functions with no bound arguments
@@ -107,7 +107,7 @@
         BOOST_MIRROR_REG_CLASS_ATTRIB_PROLOGUE(NUMBER, TYPE_NAMESPACE::TYPE, ATTRIB_NAME) \
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_GETTER_ARGS(NUMBER, TYPE_NAMESPACE::TYPE, GETTER_NAME, GETTER_ARGS_TUPLE, ARG_COUNT)\
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_NO_SETTER(NUMBER, TYPE_NAMESPACE::TYPE)\
- BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE_TD(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, ATTRIB_NAME)
+ BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE_TD(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, ATTRIB_NAME, false)
 
 /** Simpler version of the BOOST_MIRROR_REG_CLASS_ATTRIB_GETTER_W_ARGS
  * for getter functions with no bound arguments
@@ -125,7 +125,7 @@
         BOOST_MIRROR_REG_CLASS_ATTRIB_PROLOGUE(NUMBER, TYPE, ATTRIB_NAME) \
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_GETTER_ARGS(NUMBER, TYPE, GETTER_NAME, GETTER_ARGS_TUPLE, ARG_COUNT)\
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_SIMPLE_SET(NUMBER, TYPE, ATTRIB_NAME)\
- BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE(NUMBER, TYPE, ATTRIB_NAME)
+ BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE(NUMBER, TYPE, ATTRIB_NAME, false)
 
 /** Simpler version of the BOOST_MIRROR_REG_CLASS_ATTRIB_GETTER_W_ARGS
  * for getter functions with no bound arguments
@@ -141,7 +141,7 @@
         BOOST_MIRROR_REG_CLASS_ATTRIB_PROLOGUE(NUMBER, TYPE_NAMESPACE::TYPE, ATTRIB_NAME) \
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_GETTER_ARGS(NUMBER, TYPE_NAMESPACE::TYPE, GETTER_NAME, GETTER_ARGS_TUPLE, ARG_COUNT)\
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_SIMPLE_SET(NUMBER, TYPE_NAMESPACE::TYPE, ATTRIB_NAME)\
- BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE_TD(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, ATTRIB_NAME)
+ BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE_TD(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, ATTRIB_NAME, false)
 
 /** Simpler version of the BOOST_MIRROR_REG_CLASS_ATTRIB_GETTER_W_ARGS
  * for getter functions with no bound arguments.
@@ -157,7 +157,7 @@
         BOOST_MIRROR_REG_CLASS_ATTRIB_PROLOGUE(NUMBER, TYPE, ATTRIB_NAME) \
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_NO_GETTER(NUMBER, TYPE)\
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_SETTER_ARGS(NUMBER, TYPE, SETTER_NAME, SETTER_ARGS_TUPLE, ARG_COUNT)\
- BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE(NUMBER, TYPE, ATTRIB_NAME)
+ BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE(NUMBER, TYPE, ATTRIB_NAME, false)
 
 /** Simpler version of the BOOST_MIRROR_REG_CLASS_ATTRIB_SETTER_W_ARGS
  * for getter functions with no bound arguments
@@ -173,7 +173,7 @@
         BOOST_MIRROR_REG_CLASS_ATTRIB_PROLOGUE(NUMBER, TYPE_NAMESPACE::TYPE, ATTRIB_NAME) \
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_NO_GETTER(NUMBER, TYPE_NAMESPACE::TYPE)\
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_SETTER_ARGS(NUMBER, TYPE_NAMESPACE::TYPE, SETTER_NAME, SETTER_ARGS_TUPLE, ARG_COUNT)\
- BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE_TD(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, ATTRIB_NAME)
+ BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE_TD(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, ATTRIB_NAME, false)
 
 /** Simpler version of the BOOST_MIRROR_REG_CLASS_ATTRIB_SETTER_W_ARGS
  * for getter functions with no bound arguments.
@@ -190,7 +190,7 @@
         BOOST_MIRROR_REG_CLASS_ATTRIB_PROLOGUE(NUMBER, TYPE, ATTRIB_NAME) \
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_SIMPLE_GET(NUMBER, TYPE, ATTRIB_NAME)\
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_SETTER_ARGS(NUMBER, TYPE, SETTER_NAME, SETTER_ARGS_TUPLE, ARG_COUNT)\
- BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE(NUMBER, TYPE, ATTRIB_NAME)
+ BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE(NUMBER, TYPE, ATTRIB_NAME, false)
 
 /** Simpler version of the BOOST_MIRROR_REG_CLASS_ATTRIB_SETTER_W_ARGS
  * for setter functions with no bound arguments besides the value to be set
@@ -206,7 +206,7 @@
         BOOST_MIRROR_REG_CLASS_ATTRIB_PROLOGUE(NUMBER, TYPE_NAMESPACE::TYPE, ATTRIB_NAME) \
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_SIMPLE_GET(NUMBER, TYPE_NAMESPACE::TYPE, ATTRIB_NAME)\
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_SETTER_ARGS(NUMBER, TYPE_NAMESPACE::TYPE, SETTER_NAME, SETTER_ARGS_TUPLE, ARG_COUNT)\
- BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE_TD(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, ATTRIB_NAME)
+ BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE_TD(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, ATTRIB_NAME, false)
 
 /** Simpler version of the BOOST_MIRROR_REG_CLASS_ATTRIB_SETTER_W_ARGS
  * for setter functions with no bound arguments besides the value to be set.
@@ -233,7 +233,7 @@
         BOOST_MIRROR_REG_CLASS_ATTRIB_PROLOGUE(NUMBER, TYPE, ATTRIB_NAME) \
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_GETTER_ARGS(NUMBER, TYPE, GETTER_NAME, GETTER_ARGS_TUPLE, GETTER_ARG_COUNT)\
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_SETTER_ARGS(NUMBER, TYPE, SETTER_NAME, SETTER_ARGS_TUPLE, SETTER_ARG_COUNT)\
- BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE(NUMBER, TYPE, ATTRIB_NAME)
+ BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE(NUMBER, TYPE, ATTRIB_NAME, false)
 
 /** Simpler version of the BOOST_MIRROR_REG_CLASS_ATTRIB_GETTER_SETTER_W_ARGS
  * for getter and setter functions with no bound arguments
@@ -262,7 +262,7 @@
         BOOST_MIRROR_REG_CLASS_ATTRIB_PROLOGUE(NUMBER, TYPE_NAMESPACE::TYPE, ATTRIB_NAME) \
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_GETTER_ARGS(NUMBER, TYPE_NAMESPACE::TYPE, GETTER_NAME, GETTER_ARGS_TUPLE, GETTER_ARG_COUNT)\
         BOOST_MIRROR_REG_CLASS_ATTRIB_DECL_SETTER_ARGS(NUMBER, TYPE_NAMESPACE::TYPE, SETTER_NAME, SETTER_ARGS_TUPLE, SETTER_ARG_COUNT)\
- BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, ATTRIB_NAME)
+ BOOST_MIRROR_REG_CLASS_ATTRIB_EPILOGUE(NUMBER, TYPE_NS_ALIAS, TYPE_NAMESPACE, TYPE, ATTRIB_NAME, false)
 
 /** Simpler version of the BOOST_MIRROR_REG_CLASS_ATTRIB_GETTER_SETTER_W_ARGS_TD
  * for getter and setter functions with no bound arguments

Modified: sandbox/mirror/boost/mirror/meta_attributes.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_attributes.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_attributes.hpp 2008-06-19 03:44:43 EDT (Thu, 19 Jun 2008)
@@ -14,6 +14,9 @@
 #include <boost/mirror/detail/meta_attribs_base.hpp>
 // macros for declaration of meta attributes accessed through getters/setters
 #include <boost/mirror/detail/meta_attribs_getset.hpp>
+//
+#include <boost/typeof/typeof.hpp>
+#include <boost/mpl/eval_if.hpp>
 
 namespace boost {
 namespace mirror {
@@ -316,9 +319,9 @@
                                 typedef typename inherited_attrib_meta_class_and_pos<I>
                                         ::meta_class meta_class;
                                 typedef typename inherited_attrib_meta_class_and_pos<I>
- ::position new_pos_type;
+ ::position new_position;
 
- return meta_class::attributes::base_name(new_pos_type());
+ return meta_class::attributes::base_name(new_position());
                         }
 
                         template <int I>
@@ -326,9 +329,9 @@
                         base_name(mpl::int_<I> pos, mpl::bool_<false>)
                         {
                                 typedef typename own_attrib_meta_class_and_pos<I>
- ::position new_pos_type;
+ ::position new_position;
 
- return meta_class::attributes::base_name(new_pos_type());
+ return meta_class::attributes::base_name(new_position());
                         }
 
                 
@@ -337,23 +340,23 @@
                           */
                         template <class Class, int I>
                         static typename result_of_get<I>::type
- get(Class context, mpl::int_<I> pos, mpl::bool_<true>)
+ get(Class instance, mpl::int_<I> pos, mpl::bool_<true>)
                         {
                                 typedef typename inherited_attrib_meta_class_and_pos<I>
                                         ::meta_class meta_class;
                                 typedef typename inherited_attrib_meta_class_and_pos<I>
- ::position new_pos_type;
+ ::position new_position;
 
- return meta_class::attributes::get(context, new_pos_type());
+ return meta_class::attributes::get(instance, new_position());
 
                         }
                         template <class Class, int I>
                         static typename result_of_get<I>::type
- get(Class context, mpl::int_<I> pos, mpl::bool_<false>)
+ get(Class instance, mpl::int_<I> pos, mpl::bool_<false>)
                         {
                                 typedef typename own_attrib_meta_class_and_pos<I>
- ::position new_pos_type;
- return meta_class::attributes::get(context, new_pos_type());
+ ::position new_position;
+ return meta_class::attributes::get(instance, new_position());
                         }
 
                 
@@ -362,24 +365,24 @@
                           */
                         template <class Class, int I, typename DestType>
                         static DestType&
- query(Class context, mpl::int_<I> pos, DestType& dest, mpl::bool_<true>)
+ query(Class instance, mpl::int_<I> pos, DestType& dest, mpl::bool_<true>)
                         {
                                 typedef typename inherited_attrib_meta_class_and_pos<I>
                                         ::meta_class meta_class;
                                 typedef typename inherited_attrib_meta_class_and_pos<I>
- ::position new_pos_type;
+ ::position new_position;
 
- return meta_class::attributes::query(context, new_pos_type(), dest);
+ return meta_class::attributes::query(instance, new_position(), dest);
 
                         }
 
                         template <class Class, int I, typename DestType>
                         static DestType&
- query(Class context, mpl::int_<I> pos, DestType& dest, mpl::bool_<false>)
+ query(Class instance, mpl::int_<I> pos, DestType& dest, mpl::bool_<false>)
                         {
                                 typedef typename own_attrib_meta_class_and_pos<I>
- ::position new_pos_type;
- return meta_class::attributes::query(context, new_pos_type(), dest);
+ ::position new_position;
+ return meta_class::attributes::query(instance, new_position(), dest);
                         }
 
                 
@@ -388,30 +391,86 @@
                           */
                         template <class Class, int I, typename ValueType>
                         static void
- set(Class& context, mpl::int_<I> pos, ValueType value, mpl::bool_<true>)
+ set(Class& instance, mpl::int_<I> pos, ValueType value, mpl::bool_<true>)
                         {
                                 typedef typename inherited_attrib_meta_class_and_pos<I>
                                         ::meta_class meta_class;
                                 typedef typename inherited_attrib_meta_class_and_pos<I>
- ::position new_pos_type;
+ ::position new_position;
 
- meta_class::attributes::set(context, new_pos_type(), value);
+ meta_class::attributes::set(instance, new_position(), value);
                         }
 
                         template <class Class, int I, typename ValueType>
                         static void
- set(Class& context, mpl::int_<I> pos, ValueType value, mpl::bool_<false>)
+ set(Class& instance, mpl::int_<I> pos, ValueType value, mpl::bool_<false>)
                         {
                                 typedef typename own_attrib_meta_class_and_pos<I>
- ::position new_pos_type;
- meta_class::attributes::set(context, new_pos_type(), value);
+ ::position new_position;
+ meta_class::attributes::set(instance, new_position(), value);
                         }
 
+ template <int I>
+ struct inherited_attrib_meta_class
+ {
+ typedef typename inherited_attrib_meta_class_and_pos<I>
+ ::meta_class type;
+ };
+
+ struct own_attrib_meta_class
+ {
+ typedef meta_class type;
+ };
+
+ template <int I>
+ struct inherited_attrib_position
+ {
+ typedef typename inherited_attrib_meta_class_and_pos<I>
+ ::position type;
+ };
+
+ template <int I>
+ struct own_attrib_position
+ {
+ typedef typename own_attrib_meta_class_and_pos<I>
+ ::position type;
+ };
+
+ template <int I, class Inherited>
+ struct result_of_get_traits
+ {
+ // get the right meta-class
+ typedef typename mpl::eval_if<
+ Inherited,
+ inherited_attrib_meta_class<I>,
+ own_attrib_meta_class
+ >::type meta_class;
+
+ // get the position inside of the meta-class' attributes
+ typedef typename mpl::eval_if<
+ Inherited,
+ inherited_attrib_position<I>,
+ own_attrib_position<I>
+ >::type position;
+
+
+ // get the return value type of the get_traits function
+ BOOST_TYPEOF_NESTED_TYPEDEF_TPL(
+ detail,
+ meta_class::attributes::get_traits(position())
+ )
+
+ // the traits of the i-th attribute
+ typedef typename detail::type type;
+
+ }; // struct result_of_get_traits
+
                 }; // struct detail
                 
                 /** The list of inherited attribute types
                  */
- typedef typename detail::inherited_member_attrib_type_list inherited_type_list;
+ typedef typename detail::inherited_member_attrib_type_list
+ inherited_type_list;
 
                 /** The size of the type_list, i.e. the count of inherited attributes
                  */
@@ -425,7 +484,26 @@
                 /** The size of the type_list, i.e. the count of all attributes
                  */
                 struct size : public mpl::size<type_list> { };
-
+
+ template <int I>
+ struct result_of_is_inherited
+ {
+ typedef typename mpl::less<
+ mpl::int_<I>,
+ inherited_size
+ >::type type;
+ };
+
+ /** Returns mpl::bool_<true> if the i-th attrib is inherited
+ * returns mpl::bool_<false> otherwise
+ */
+ template <int I>
+ static typename result_of_is_inherited<I>::type
+ is_inherited(mpl::int_<I>)
+ {
+ return typename result_of_is_inherited<I>::type();
+ }
+
                 /** Gets the name of the I-th member (including
                  * the inherited ones)
                  */
@@ -433,12 +511,10 @@
                 static const bchar*
                 base_name(mpl::int_<I> pos)
                 {
- typedef typename mpl::less<
- mpl::int_<I>,
- inherited_size
- >::type is_inherited;
-
- return detail::base_name(pos, is_inherited());
+ return detail::base_name(
+ pos,
+ is_inherited(pos)
+ );
                 }
 
                 /** Gets the value of the I-th member (including
@@ -446,14 +522,13 @@
                  */
                 template <class Class, int I>
                 static typename detail::template result_of_get<I>::type
- get(Class context, mpl::int_<I> pos)
+ get(Class instance, mpl::int_<I> pos)
                 {
- typedef typename mpl::less<
- mpl::int_<I>,
- inherited_size
- >::type is_inherited;
-
- return detail::get(context, pos, is_inherited());
+ return detail::get(
+ instance,
+ pos,
+ is_inherited(pos)
+ );
                 }
 
                 /** Queries the value of the I-th member (including
@@ -461,14 +536,14 @@
                  */
                 template <class Class, int I, typename DestType>
                 static DestType&
- query(Class context, mpl::int_<I> pos, DestType& dest)
+ query(Class instance, mpl::int_<I> pos, DestType& dest)
                 {
- typedef typename mpl::less<
- mpl::int_<I>,
- inherited_size
- >::type is_inherited;
-
- return detail::query(context, pos, dest, is_inherited());
+ return detail::query(
+ instance,
+ pos,
+ dest,
+ is_inherited(pos)
+ );
                 }
 
                 /** Sets the value of the I-th member (including
@@ -476,15 +551,24 @@
                  */
                 template <class Class, int I, typename ValueType>
                 static void
- set(Class& context, mpl::int_<I> pos, ValueType value)
+ set(Class& instance, mpl::int_<I> pos, ValueType value)
                 {
- typedef typename mpl::less<
- mpl::int_<I>,
- inherited_size
- >::type is_inherited;
-
- detail::set(context, pos, value, is_inherited());
+ detail::set(
+ instance,
+ pos,
+ value,
+ is_inherited(pos)
+ );
                 }
+
+ /** The attribute traits getter
+ */
+ template <int I>
+ static typename detail::result_of_get_traits<
+ I,
+ typename result_of_is_inherited<I>::type
+ >::type get_traits(mpl::int_<I>);
+
         }; // all_attributes
 
         /** Instances of this template are used to store information
@@ -518,10 +602,10 @@
 
                 // the meta-attributes list (own/all)
                 // into which the attribute belongs
- // in this context
+ // in this instance
                 typedef MetaAttributes meta_attributes;
 
- // the position of the meta-attribute in the context
+ // the position of the meta-attribute in the instance
                 typedef AttribPos position;
 
                 // the type of the attribute
@@ -530,6 +614,7 @@
                         position
>::type type;
 
+
                 // base name getter
                 inline static const bchar* base_name(void)
                 {
@@ -546,31 +631,40 @@
 
                 // value getter
                 inline static typename detail::result_of_get::type
- get(const reflected_class& context)
+ get(const reflected_class& instance)
                 {
- return meta_attributes::get(context, position());
+ return meta_attributes::get(instance, position());
                 }
 
                 // value query
                 template <typename DestType>
                 inline static DestType&
- query(const reflected_class& context, DestType& dest)
+ query(const reflected_class& instance, DestType& dest)
                 {
- return meta_attributes::query(context, position(), dest);
+ return meta_attributes::query(instance, position(), dest);
                 }
 
                 // value setter
                 inline static void
- set(reflected_class& context, typename call_traits<type>::param_type val)
+ set(reflected_class& instance, typename call_traits<type>::param_type val)
                 {
- meta_attributes::set(context, position(), val);
+ meta_attributes::set(instance, position(), val);
                 }
+
                 // value setter
                 inline static void
- set(const reflected_class& context, typename call_traits<type>::param_type val)
+ set(const reflected_class& instance, typename call_traits<type>::param_type val)
                 {
- meta_attributes::set(context, position(), val);
+ meta_attributes::set(instance, position(), val);
                 }
+
+ // attribute traits
+ BOOST_TYPEOF_NESTED_TYPEDEF_TPL(
+ detail_traits,
+ meta_attributes::get_traits(position())
+ )
+ typedef typename detail_traits::type traits;
+
         };
 } // namespace detail
 } // namespace mirror

Modified: sandbox/mirror/boost/mirror/meta_classes/boost_tuple.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_classes/boost_tuple.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_classes/boost_tuple.hpp 2008-06-19 03:44:43 EDT (Thu, 19 Jun 2008)
@@ -77,6 +77,13 @@
         {
         }
         //
+
+ // traits getter
+ template <int I>
+ static meta_class_attribute_traits<false>
+ get_traits(mpl::int_<I>);
+
+ //
         typedef template_params
 BOOST_MIRROR_REG_TEMPLATE_ATTRIBS_END
 

Modified: sandbox/mirror/libs/mirror/doc/xml/mirror/_library.xml
==============================================================================
--- sandbox/mirror/libs/mirror/doc/xml/mirror/_library.xml (original)
+++ sandbox/mirror/libs/mirror/doc/xml/mirror/_library.xml 2008-06-19 03:44:43 EDT (Thu, 19 Jun 2008)
@@ -184,5 +184,10 @@
                         - Tested with gcc 4.3.0 on SuSE
                         - Tested with intel 10.1 on SuSE
                 </revision>
+ <revision id="20080618" major="0" minor="1" micro="29" author="m_ch">
+ - Added meta-attribute traits (currently containing only is_static 'flag')
+ - Done some cleanup in the sources
+ - Tested with MSVC++ 2008 EE On Vista
+ </revision>
         </revisions>
 </library>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk