Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52706 - in sandbox/mirror: boost/char_type_switch boost/mirror boost/mirror/concept boost/mirror/detail boost/mirror/meta_types boost/mirror/meta_types/boost boost/mirror/meta_types/boost/fusion boost/mirror/meta_types/boost/mpl boost/mirror/meta_types/boost/tuples boost/mirror/meta_types/std boost/mirror/visitors libs/mirror/example/factories
From: chochlik_at_[hidden]
Date: 2009-05-01 14:23:16


Author: matus.chochlik
Date: 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
New Revision: 52706
URL: http://svn.boost.org/trac/boost/changeset/52706

Log:
[mirror 0.4.x]
- major rewrite of the char_type_switch facility
- update of mirror to use the new features of CTS
- initial, not fully functional version of meta-member-functions

Added:
   sandbox/mirror/boost/char_type_switch/char_types.hpp (contents, props changed)
   sandbox/mirror/boost/mirror/meta_mem_functions.hpp (contents, props changed)
   sandbox/mirror/libs/mirror/example/factories/person.hpp (contents, props changed)
Text files modified:
   sandbox/mirror/boost/char_type_switch/char.hpp | 48 +++++++++------------
   sandbox/mirror/boost/mirror/concept/MetaNamedObject.hpp | 13 ++++-
   sandbox/mirror/boost/mirror/detail/decorated_type_name.hpp | 69 ++++++++++++------------------
   sandbox/mirror/boost/mirror/detail/full_name_builder.hpp | 71 +++++++++++++------------------
   sandbox/mirror/boost/mirror/detail/meta_attribs_base.hpp | 27 +++++++----
   sandbox/mirror/boost/mirror/detail/meta_type_registering.hpp | 37 +++++++--------
   sandbox/mirror/boost/mirror/detail/static_int_to_str.hpp | 29 ++++++++----
   sandbox/mirror/boost/mirror/detail/unnamed_attribs.hpp | 25 +++++++----
   sandbox/mirror/boost/mirror/meta_attributes.hpp | 21 +++++----
   sandbox/mirror/boost/mirror/meta_constructors.hpp | 41 ++++++++++++------
   sandbox/mirror/boost/mirror/meta_namespace.hpp | 50 ++++++++++-----------
   sandbox/mirror/boost/mirror/meta_types/_free_fn.hpp | 59 +++++++++++++++-----------
   sandbox/mirror/boost/mirror/meta_types/boost/fusion/vector.hpp | 2
   sandbox/mirror/boost/mirror/meta_types/boost/mpl/int.hpp | 2
   sandbox/mirror/boost/mirror/meta_types/boost/optional.hpp | 2
   sandbox/mirror/boost/mirror/meta_types/boost/tuples/tuple.hpp | 2
   sandbox/mirror/boost/mirror/meta_types/boost/variant.hpp | 2
   sandbox/mirror/boost/mirror/meta_types/std/less.hpp | 2
   sandbox/mirror/boost/mirror/meta_types/std/list.hpp | 2
   sandbox/mirror/boost/mirror/meta_types/std/map.hpp | 2
   sandbox/mirror/boost/mirror/meta_types/std/pair.hpp | 2
   sandbox/mirror/boost/mirror/meta_types/std/set.hpp | 2
   sandbox/mirror/boost/mirror/meta_types/std/slist.hpp | 2
   sandbox/mirror/boost/mirror/meta_types/std/vector.hpp | 2
   sandbox/mirror/boost/mirror/visitors/json.hpp | 40 ++++++++--------
   sandbox/mirror/libs/mirror/example/factories/inserter.cpp | 90 +++++++--------------------------------
   26 files changed, 301 insertions(+), 343 deletions(-)

Modified: sandbox/mirror/boost/char_type_switch/char.hpp
==============================================================================
--- sandbox/mirror/boost/char_type_switch/char.hpp (original)
+++ sandbox/mirror/boost/char_type_switch/char.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -11,43 +11,37 @@
 #define BOOST_CHAR_TYPE_SWITCH_CHAR_HPP
 
 
-#include <boost/char_type_switch/choice.hpp>
 #include <boost/config.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/char_type_switch/char_types.hpp>
 
 namespace boost {
 namespace cts {
 
 
-#ifdef BOOST_CTS_USE_WIDE_CHARS
-
-#include <boost/preprocessor/wstringize.hpp>
-
- // If wide characters were picked
- //
- // define character type
- typedef wchar_t bchar;
- // define macro for string literal type selection
-# define BOOST_CTS_LIT(STR) L##STR
- // stringization
-# define BOOST_CTS_STRINGIZE(TO_TEXT) BOOST_PP_WSTRINGIZE(TO_TEXT)
-#else // NOT BOOST_CTS_USE_WIDE_CHARS
-
-#include <boost/preprocessor/stringize.hpp>
-
- // if narrow characters were chosen
- //
- // define character type
- typedef char bchar;
- // define macro for string literal type selection
-# define BOOST_CTS_LIT(STR) STR
- // stringization
-# define BOOST_CTS_STRINGIZE(TO_TEXT) BOOST_PP_STRINGIZE(TO_TEXT)
-#endif // NOT BOOST_CTS_USE_WIDE_CHARS
+// define the bchar type
+typedef BOOST_CTS_BCHAR() bchar;
 
 // define macro expanding into a compile time const length
 // of the given string literal
-#define BOOST_CTS_LIT_LENGTH(STR) ((sizeof(BOOST_CTS_LIT(STR))/sizeof(::boost::cts::bchar))-1)
+#define BOOST_CTS_LIT_LENGTH(STR) \
+ ((sizeof(BOOST_CTS_LIT(STR))/sizeof(::boost::cts::bchar))-1)
 
+#define BOOST_CTS_LIT_CHAR_T(CHAR_T, STR) \
+ BOOST_PP_CAT(BOOST_CTS_PREFIX_CHAR_T(CHAR_T), STR)
+// define macro for string literal type selection
+#define BOOST_CTS_LIT(STR) BOOST_CTS_LIT_CHAR_T(BOOST_CTS_BCHAR(), STR)
+//
+
+#define BOOST_CTS_STRINGIZE_CHAR_T(CHAR_T, PARAM) \
+ BOOST_CTS_DO_STRINGIZE_CHAR_T(CHAR_T, PARAM)
+#define BOOST_CTS_DO_STRINGIZE_CHAR_T(CHAR_T, PARAM) \
+ BOOST_CTS_LIT_CHAR_T(CHAR_T, #PARAM)
+
+
+// stringization macro for bchar based literals
+#define BOOST_CTS_STRINGIZE(PARAM) \
+ BOOST_CTS_STRINGIZE_CHAR_T(BOOST_CTS_BCHAR(), PARAM)
 
 } // namespace cts
 } // namespace boost

Added: sandbox/mirror/boost/char_type_switch/char_types.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/char_type_switch/char_types.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -0,0 +1,60 @@
+/**
+ * \file boost/char_type_switch/char_types.hpp
+ * Supported character types and char-type-prefixes
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under the Boost
+ * Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ */
+
+#ifndef BOOST_CHAR_TYPE_SWITCH_CHAR_TYPES_HPP
+#define BOOST_CHAR_TYPE_SWITCH_CHAR_TYPES_HPP
+
+
+#include <boost/char_type_switch/choice.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/seq/for_each_i.hpp>
+#include <boost/preprocessor/list/for_each_i.hpp>
+
+
+// the prefixes for various char type literals
+#define BOOST_CTS_PREFIX_char() BOOST_PP_EMPTY()
+#define BOOST_CTS_PREFIX_wchar_t() L
+#define BOOST_CTS_PREFIX_char16_t() u
+#define BOOST_CTS_PREFIX_char32_t() U
+
+#define BOOST_CTS_PREFIX_CHAR_T(CHAR_T) \
+ BOOST_PP_CAT(BOOST_CTS_PREFIX_, CHAR_T)()
+
+// here the switching is done
+#if defined BOOST_CTS_USE_WIDE_CHARS
+#define BOOST_CTS_BCHAR() wchar_t
+#else
+#define BOOST_CTS_BCHAR() char
+#endif
+
+// if we want to use just the bchars
+#ifdef BOOST_CTS_USE_BCHARS_ONLY
+#define BOOST_CTS_CHAR_TYPE_SEQ() (BOOST_CTS_BCHAR())
+#define BOOST_CTS_CHAR_TYPE_LIST() (BOOST_CTS_BCHAR(), BOOST_PP_NIL)
+#else
+// a PP sequence of supported character types
+#define BOOST_CTS_CHAR_TYPE_SEQ() (char)(wchar_t)
+#define BOOST_CTS_CHAR_TYPE_LIST() (char, (wchar_t, BOOST_PP_NIL))
+#endif
+
+// returns the prefix for bchar literals
+#define BOOST_CTS_BCHAR_PREFIX() \
+ BOOST_PP_CAT(BOOST_CTS_PREFIX_,BOOST_CTS_BCHAR())()
+
+
+#define BOOST_CTS_FOR_EACH_CHAR_T(MACRO, DATA) \
+ BOOST_PP_SEQ_FOR_EACH_I(MACRO, DATA, BOOST_CTS_CHAR_TYPE_SEQ())
+
+#define BOOST_CTS_FOR_EACH_CHAR_T_2(MACRO, DATA) \
+ BOOST_PP_LIST_FOR_EACH_I(MACRO, DATA, BOOST_CTS_CHAR_TYPE_LIST())
+
+
+#endif //include guard
+
+

Modified: sandbox/mirror/boost/mirror/concept/MetaNamedObject.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/concept/MetaNamedObject.hpp (original)
+++ sandbox/mirror/boost/mirror/concept/MetaNamedObject.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -13,10 +13,16 @@
 #define BOOST_MIRROR_CONCEPT_META_NAMED_OBJECT_HPP
 
 #include <boost/mirror/concept/MetaObject.hpp>
+#include <boost/char_type_switch/string.hpp>
+#include <boost/preprocessor/cat.hpp>
 
 namespace boost {
 namespace mirror {
 
+#define BOOST_MIRROR_MNO_CONCEPT_TEST_HELPER(Z, X, I, CHAR_T) \
+ , const ::std::basic_string< CHAR_T >* BOOST_PP_CAT(_z, I) = \
+ &X::get_name( mpl::false_(), ::std::char_traits< CHAR_T >())
+
 template <typename T>
 struct is_MetaNamedObject
 {
@@ -26,10 +32,9 @@
         static match test(
                 X*,
                 // check for base_name member function
- const ::boost::cts::bstring* _y1 = &X::base_name(),
+ const ::boost::cts::bstring* _y1 = &X::base_name()
                 // check for get_name member function
- const ::std::string* _y2 = &X::get_name(mpl::false_(), ::std::char_traits<char>()),
- const ::std::wstring* _y3 = &X::get_name(mpl::false_(), ::std::char_traits<wchar_t>())
+ BOOST_CTS_FOR_EACH_CHAR_T(BOOST_MIRROR_MNO_CONCEPT_TEST_HELPER,X)
         );
 
         typedef is_MetaObject<T> other_constraints;
@@ -38,7 +43,7 @@
 
 };
 
-
+#undef BOOST_MIRROR_MNO_CONCEPT_TEST_HELPER
 
 } // namespace mirror
 } // namespace boost

Modified: sandbox/mirror/boost/mirror/detail/decorated_type_name.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/decorated_type_name.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/decorated_type_name.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -153,49 +153,34 @@
 template <typename CharT>
 struct type_name_decorator_literals;
 
-// specialization for chars
-template <>
-struct type_name_decorator_literals<char>
-: type_name_decorator_literal_selectors
-{
- typedef type_name_decorator_literal_selectors bc;
- inline static const char* get(bc::space_){return " ";}
- inline static const char* get(bc::asterisk_post_){return " *";}
- inline static const char* get(bc::ampersand_post_){return " &";}
- inline static const char* get(bc::const_post_){return " const";}
- inline static const char* get(bc::volatile_post_){return " volatile";}
- inline static const char* get(bc::cv_post_){return " const volatile";}
- inline static const char* get(bc::lbracket_){return "[";}
- inline static const char* get(bc::rbracket_){return "]";}
- inline static const char* get(bc::brackets_){return "[]";}
- inline static const char* get(bc::lpar_){return "(";}
- inline static const char* get(bc::rpar_){return ")";}
- inline static const char* get(bc::comma_){return ", ";}
- inline static const char* get(bc::langle_){return "< ";}
- inline static const char* get(bc::rangle_){return " >";}
-};
+#define BOOST_MIRROR_DEFINE_TYPE_NAME_DECORATOR_LITERALS(R, DATA, I, CHAR_T) \
+template <> \
+struct type_name_decorator_literals<CHAR_T> \
+: type_name_decorator_literal_selectors \
+{ \
+ typedef type_name_decorator_literal_selectors bc; \
+ inline static const CHAR_T* get(bc::space_){return BOOST_CTS_LIT_CHAR_T(CHAR_T, " ");} \
+ inline static const CHAR_T* get(bc::asterisk_post_){return BOOST_CTS_LIT_CHAR_T(CHAR_T, " *");} \
+ inline static const CHAR_T* get(bc::ampersand_post_){return BOOST_CTS_LIT_CHAR_T(CHAR_T, " &");} \
+ inline static const CHAR_T* get(bc::const_post_){return BOOST_CTS_LIT_CHAR_T(CHAR_T, " const");} \
+ inline static const CHAR_T* get(bc::volatile_post_){return BOOST_CTS_LIT_CHAR_T(CHAR_T, " volatile");} \
+ inline static const CHAR_T* get(bc::cv_post_){return BOOST_CTS_LIT_CHAR_T(CHAR_T, " const volatile");} \
+ inline static const CHAR_T* get(bc::lbracket_){return BOOST_CTS_LIT_CHAR_T(CHAR_T, "[");} \
+ inline static const CHAR_T* get(bc::rbracket_){return BOOST_CTS_LIT_CHAR_T(CHAR_T, "]");} \
+ inline static const CHAR_T* get(bc::brackets_){return BOOST_CTS_LIT_CHAR_T(CHAR_T, "[]");} \
+ inline static const CHAR_T* get(bc::lpar_){return BOOST_CTS_LIT_CHAR_T(CHAR_T, "(");} \
+ inline static const CHAR_T* get(bc::rpar_){return BOOST_CTS_LIT_CHAR_T(CHAR_T, ")");} \
+ inline static const CHAR_T* get(bc::comma_){return BOOST_CTS_LIT_CHAR_T(CHAR_T, ", ");} \
+ inline static const CHAR_T* get(bc::langle_){return BOOST_CTS_LIT_CHAR_T(CHAR_T, "< ");} \
+ inline static const CHAR_T* get(bc::rangle_){return BOOST_CTS_LIT_CHAR_T(CHAR_T, " >");} \
+};
+
+BOOST_CTS_FOR_EACH_CHAR_T(
+ BOOST_MIRROR_DEFINE_TYPE_NAME_DECORATOR_LITERALS,
+ _
+)
 
-// specialization for chars
-template <>
-struct type_name_decorator_literals<wchar_t>
-: type_name_decorator_literal_selectors
-{
- typedef type_name_decorator_literal_selectors bc;
- inline static const wchar_t* get(bc::space_){return L" ";}
- inline static const wchar_t* get(bc::asterisk_post_){return L" *";}
- inline static const wchar_t* get(bc::ampersand_post_){return L" &";}
- inline static const wchar_t* get(bc::const_post_){return L" const";}
- inline static const wchar_t* get(bc::volatile_post_){return L" volatile";}
- inline static const wchar_t* get(bc::cv_post_){return L" const volatile";}
- inline static const wchar_t* get(bc::lbracket_){return L"[";}
- inline static const wchar_t* get(bc::rbracket_){return L"]";}
- inline static const wchar_t* get(bc::brackets_){return L"[]";}
- inline static const wchar_t* get(bc::lpar_){return L"(";}
- inline static const wchar_t* get(bc::rpar_){return L")";}
- inline static const wchar_t* get(bc::comma_){return L", ";}
- inline static const wchar_t* get(bc::langle_){return L"< ";}
- inline static const wchar_t* get(bc::rangle_){return L" >";}
-};
+#undef BOOST_MIRROR_DEFINE_TYPE_NAME_DECORATOR_LITERALS
 
 // no-op decorator
 template <typename T>

Modified: sandbox/mirror/boost/mirror/detail/full_name_builder.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/full_name_builder.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/full_name_builder.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -30,6 +30,28 @@
 
 namespace detail {
         
+
+#define BOOST_MIRROR_IMPLEMENT_FULL_NAME_BUILDER_APPEND_SEP(Z,D,I,CHAR_T)\
+ template <typename Type> \
+ inline static void append_separator( \
+ ::std::basic_string< CHAR_T >& _str, \
+ mpl::identity<meta_namespace<namespace_::_> >, \
+ mpl::identity<detail::registered_type_info<Type> > \
+ ) { } \
+ template <typename AnyScope, class AnyMO> \
+ inline static void append_separator( \
+ ::std::basic_string< CHAR_T >& _str, \
+ mpl::identity<AnyScope>, \
+ mpl::identity<AnyMO> \
+ ) \
+ { \
+ static const ::std::basic_string<CHAR_T> separator( \
+ BOOST_CTS_LIT_CHAR_T(CHAR_T, "::") \
+ ); \
+ _str.append(separator); \
+ }
+
+
         /** Helper template that builds the fully qualified names
          * from base names
          */
@@ -38,48 +60,14 @@
         {
         private:
 
- // don't prepend '::' to types on global scope
- template <typename Type>
- inline static void append_separator(
- ::std::basic_string<char>& _str,
- mpl::identity<meta_namespace<namespace_::_> >,
- mpl::identity<detail::registered_type_info<Type> >
- )
- { }
- // don't prepend '::' to types on global scope
- template <typename Type>
- inline static void append_separator(
- ::std::basic_string<wchar_t>& _str,
- mpl::identity<meta_namespace<namespace_::_> >,
- mpl::identity<detail::registered_type_info<Type> >
- )
- { }
-
- // append separator to anything else
- template <typename AnyScope, class AnyMO>
- inline static void append_separator(
- ::std::string& _str,
- mpl::identity<AnyScope>,
- mpl::identity<AnyMO>
- )
- {
- static const ::std::string separator("::");
- _str.append(separator);
- }
-
- // append separator to anything else
- template <typename AnyScope, class AnyMO>
- inline static void append_separator(
- ::std::wstring& _str,
- mpl::identity<AnyScope>,
- mpl::identity<AnyMO>
+ // implement the append_separator functions for all
+ // supported character types
+ // do not prepend :: for types declared on the global scope
+ BOOST_CTS_FOR_EACH_CHAR_T(
+ BOOST_MIRROR_IMPLEMENT_FULL_NAME_BUILDER_APPEND_SEP,
+ _
                 )
- {
- static const ::std::wstring separator(L"::");
- _str.append(separator);
- }
-
-
+
                 // initializes the full names
                 template <typename CharT>
                 inline static ::std::basic_string<CharT> init_name(
@@ -135,6 +123,7 @@
                 }
         };
         
+#undef BOOST_MIRROR_IMPLEMENT_FULL_NAME_BUILDER_APPEND_SEP
         
 } // namespace detail
 } // namespace mirror

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 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -112,6 +112,19 @@
         BOOST_MIRROR_REG_CLASS_ATTRIBS_END
 
 
+#define BOOST_MIRROR_REG_TEMPL_OR_CLASS_ATTRIB_IMPL_GET_NAME(R,NAME,I, CHAR_T)\
+ inline static const ::std::basic_string< CHAR_T >& get_name( \
+ position_of_##NAME, \
+ ::boost::mpl::false_, \
+ ::std::char_traits< CHAR_T > \
+ ) \
+ { \
+ static ::std::basic_string< CHAR_T > name( \
+ BOOST_CTS_STRINGIZE_CHAR_T(CHAR_T, NAME) \
+ ); \
+ return name; \
+ }
+
 /** Helper macro expanding into a prologue of a meta-attribute
  * declaration
  */
@@ -127,16 +140,10 @@
         typedef TYPENAME_KW ::boost::mirror::typedef_::extract_type< \
                 TYPE_SELECTOR \
>::type type_of_##NAME; \
- inline static const ::std::string& get_name( \
- position_of_##NAME, \
- ::boost::mpl::false_, \
- ::std::char_traits<char> \
- ){static ::std::string name(#NAME); return name;}\
- inline static const ::std::wstring& get_name( \
- position_of_##NAME, \
- ::boost::mpl::false_, \
- ::std::char_traits<wchar_t> \
- ){static ::std::wstring name(L ## #NAME); return name;}\
+ BOOST_CTS_FOR_EACH_CHAR_T( \
+ BOOST_MIRROR_REG_TEMPL_OR_CLASS_ATTRIB_IMPL_GET_NAME, \
+ NAME \
+ ) \
         static meta_class_attribute_traits< \
                 ::boost::mirror::attrib_storage_specifiers:: SPECIFIERS##_, \
                 TYPE_SELECTOR \

Modified: sandbox/mirror/boost/mirror/detail/meta_type_registering.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/meta_type_registering.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/meta_type_registering.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -54,30 +54,27 @@
         typedef typename base_info::reflected_type reflected_type;
 };
 
-#define BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME(TYPE_NAME_STRING) \
- static inline const ::std::string& get_name( \
+#define BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME_HELPER(R, TYPE, I, CHAR_T) \
+ static inline const ::std::basic_string< CHAR_T >& get_name( \
                 mpl::false_, \
- ::std::char_traits<char> \
+ ::std::char_traits< CHAR_T > \
         )\
         { \
- static ::std::string s_name(TYPE_NAME_STRING); \
- return s_name; \
- } \
- static inline const ::std::wstring& get_name( \
- mpl::false_, \
- ::std::char_traits<wchar_t> \
- )\
- { \
- static ::std::wstring s_name(L ## TYPE_NAME_STRING); \
+ static ::std::basic_string< CHAR_T > s_name( \
+ BOOST_CTS_STRINGIZE_CHAR_T(CHAR_T, TYPE) \
+ ); \
                 return s_name; \
         }
 
 
-/** Helper macro used to declare base-name getting functions
+/** macro used to declare base-name getting functions
  * and base-name length static constants
  */
-#define BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME_HELPER(TYPE_NAME) \
- BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME(#TYPE_NAME)
+#define BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME(TYPE) \
+ BOOST_CTS_FOR_EACH_CHAR_T( \
+ BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME_HELPER, \
+ TYPE \
+ )
 
 /** Macro for registering global-scope types
  */
@@ -87,7 +84,7 @@
         { \
                 typedef BOOST_MIRRORED_GLOBAL_SCOPE() scope; \
                 typedef BASE_NAME reflected_type; \
- BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME_HELPER(BASE_NAME) \
+ BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME(BASE_NAME) \
         }; \
         } /* namespace detail */ \
         BOOST_MIRROR_ADD_TO_GLOBAL_LIST( \
@@ -110,7 +107,7 @@
         { \
                 typedef BOOST_MIRRORED_NAMESPACE(NAMESPACE) scope; \
                 typedef NAMESPACE::BASE_NAME reflected_type; \
- BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME_HELPER(BASE_NAME) \
+ BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME(BASE_NAME) \
         }; \
         } /* namespace detail */ \
         BOOST_MIRROR_ADD_TO_GLOBAL_LIST( \
@@ -188,7 +185,7 @@
         { \
                 typedef BOOST_MIRRORED_GLOBAL_SCOPE() scope; \
                 typedef ::TYPEDEFD_NAME reflected_type; \
- BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME_HELPER(TYPEDEFD_NAME) \
+ BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME(TYPEDEFD_NAME) \
         }; \
         } /* namespace detail */ \
         BOOST_MIRROR_ADD_TO_GLOBAL_LIST( \
@@ -221,7 +218,7 @@
         { \
                 typedef BOOST_MIRRORED_NAMESPACE(NAMESPACE) scope; \
                 typedef NAMESPACE::TYPEDEFD_NAME reflected_type; \
- BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME_HELPER(TYPEDEFD_NAME) \
+ BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME(TYPEDEFD_NAME) \
         }; \
         } /* namespace detail */ \
         BOOST_MIRROR_ADD_TO_GLOBAL_LIST( \
@@ -242,7 +239,7 @@
         { \
                 typedef meta_type< WRAPPER > scope; \
                 typedef WRAPPER::BASE_NAME reflected_type; \
- BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME_HELPER(BASE_NAME) \
+ BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME(BASE_NAME) \
         }; \
         } // namespace detail
 

Modified: sandbox/mirror/boost/mirror/detail/static_int_to_str.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/static_int_to_str.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/static_int_to_str.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -29,19 +29,26 @@
 template <typename CharT>
 struct static_int_to_str_constants;
 
-template <>
-struct static_int_to_str_constants<char>
-{
- static inline char null(void){return '\0';}
- static inline char zero(void){return '0';}
+#define BOOST_MIRROR_DEFINE_STATIC_INT_TO_STR_CONSTANTS(R, DATA, I, CHAR_T)\
+template <> \
+struct static_int_to_str_constants< CHAR_T > \
+{ \
+ static inline CHAR_T null(void)\
+ {\
+ return BOOST_CTS_LIT_CHAR_T(CHAR_T,'\0');\
+ }\
+ static inline CHAR_T zero(void)\
+ {\
+ return BOOST_CTS_LIT_CHAR_T(CHAR_T,'0');\
+ } \
 };
 
-template <>
-struct static_int_to_str_constants<wchar_t>
-{
- static inline wchar_t null(void){return L'\0';}
- static inline wchar_t zero(void){return L'0';}
-};
+BOOST_CTS_FOR_EACH_CHAR_T(
+ BOOST_MIRROR_DEFINE_STATIC_INT_TO_STR_CONSTANTS,
+ _
+)
+
+#undef BOOST_MIRROR_DEFINE_STATIC_INT_TO_STR_CONSTANTS
 
 template <typename CharT, int I>
 struct static_int_to_str

Modified: sandbox/mirror/boost/mirror/detail/unnamed_attribs.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/unnamed_attribs.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/unnamed_attribs.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -22,16 +22,23 @@
         template <typename CharT>
         struct meta_class_tuple_attrib_name_prefix;
 
- template <>
- struct meta_class_tuple_attrib_name_prefix<char>
- {
- typedef mpl::vector_c<char, '_' > type;
- };
- template <>
- struct meta_class_tuple_attrib_name_prefix<wchar_t>
- {
- typedef mpl::vector_c<wchar_t, L'_' > type;
+#define BOOST_MIRROR_DEFINE_MC_TUPLE_ATTRIB_NAME_PREFIX(R, DATA, I, CHAR_T)\
+ template <> \
+ struct meta_class_tuple_attrib_name_prefix< CHAR_T > \
+ { \
+ typedef mpl::vector_c< \
+ CHAR_T, \
+ BOOST_CTS_LIT_CHAR_T(CHAR_T, '_') \
+ > type; \
         };
+
+BOOST_CTS_FOR_EACH_CHAR_T(
+ BOOST_MIRROR_DEFINE_MC_TUPLE_ATTRIB_NAME_PREFIX,
+ _
+)
+
+#undef BOOST_MIRROR_DEFINE_MC_TUPLE_ATTRIB_NAME_PREFIX
+
 } // namespace detail
 } // namespace mirror
 } // namespace boost

Modified: sandbox/mirror/boost/mirror/meta_attributes.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_attributes.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_attributes.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -42,6 +42,13 @@
 
 };
 
+#define BOOST_MIRROR_IMPLEMENT_META_CLASS_ATTRIB_GET_DBL_CLN(R,DATA,I, CHAR_T) \
+inline static const CHAR_T* get_double_colon(::std::char_traits< CHAR_T >) \
+{ \
+ return BOOST_CTS_LIT_CHAR_T(CHAR_T, "::"); \
+}
+
+
 /** Instances of this template are used to store information
  * about single class' member attribute and are used mainly
  * in the algorithms.
@@ -71,15 +78,10 @@
         typedef typename scope::reflected_type
                 owner_class;
 
- inline static const char* get_double_colon(::std::char_traits<char>)
- {
- return "::";
- }
-
- inline static const wchar_t* get_double_colon(::std::char_traits<wchar_t>)
- {
- return L"::";
- }
+ BOOST_CTS_FOR_EACH_CHAR_T(
+ BOOST_MIRROR_IMPLEMENT_META_CLASS_ATTRIB_GET_DBL_CLN,
+ _
+ )
 
         template <typename CharT>
         inline static ::std::basic_string<CharT> init_full_name(
@@ -231,6 +233,7 @@
 
 };
 
+#undef BOOST_MIRROR_IMPLEMENT_META_CLASS_ATTRIB_GET_DBL_CLN
 
 } // namespace mirror
 } // namespace boost

Modified: sandbox/mirror/boost/mirror/meta_constructors.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_constructors.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_constructors.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -33,6 +33,7 @@
 #include <boost/preprocessor/logical/and.hpp>
 #include <boost/preprocessor/logical/not.hpp>
 #include <boost/preprocessor/arithmetic/sub.hpp>
+#include <boost/preprocessor/array/elem.hpp>
 
 #include <boost/char_type_switch/string.hpp>
 #include <boost/mirror/meta_data_fwd.hpp>
@@ -67,28 +68,39 @@
 /** Registers the parameter name of the j-th parameter
  * of the i-th constructor
  */
-#define BOOST_MIRROR_REG_CONSTRUCTOR_PARAM_NAME(CONSTRUCTOR, PARAM, NAME) \
-inline static const ::std::string& get_param_name( \
- mpl::false_, \
- const ::std::char_traits<char>&, \
- mpl::int_< CONSTRUCTOR >, \
- mpl::int_< PARAM > \
+#define BOOST_MIRROR_IMPLEMENT_CONSTRUCTOR_GET_PARAM_NAME( \
+ CONSTRUCTOR, \
+ PARAM, \
+ NAME, \
+ CHAR_T \
 ) \
-{ \
- static ::std::string result( BOOST_PP_STRINGIZE( NAME ) ); \
- return result; \
-} \
-inline static const ::std::wstring& get_param_name( \
+inline static const ::std::basic_string< CHAR_T >& get_param_name( \
         mpl::false_, \
- const ::std::char_traits<wchar_t>&, \
+ const ::std::char_traits< CHAR_T >&, \
         mpl::int_< CONSTRUCTOR >, \
         mpl::int_< PARAM > \
 ) \
 { \
- static ::std::wstring result( BOOST_PP_WSTRINGIZE( NAME ) ); \
+ static ::std::basic_string< CHAR_T > result( \
+ BOOST_CTS_STRINGIZE_CHAR_T( CHAR_T, NAME ) \
+ ); \
         return result; \
-}
+}
+
+#define BOOST_MIRROR_IMPLEMENT_CONSTRUCTOR_GET_PARAM_NAME_HELPER(\
+ R, PARAMS, I, CHAR_T \
+) BOOST_MIRROR_IMPLEMENT_CONSTRUCTOR_GET_PARAM_NAME( \
+ BOOST_PP_ARRAY_ELEM(0, PARAMS), \
+ BOOST_PP_ARRAY_ELEM(1, PARAMS), \
+ BOOST_PP_ARRAY_ELEM(2, PARAMS), \
+ CHAR_T \
+)
 
+#define BOOST_MIRROR_REG_CONSTRUCTOR_PARAM_NAME(R,CONSTRUCTOR, PARAM, NAME) \
+ BOOST_CTS_FOR_EACH_CHAR_T_2( \
+ BOOST_MIRROR_IMPLEMENT_CONSTRUCTOR_GET_PARAM_NAME_HELPER, \
+ (3, (CONSTRUCTOR, PARAM, NAME)) \
+ )
 
 /** Ends the registering of (template) class' constructors
  */
@@ -130,6 +142,7 @@
         PARAM_INDEX, \
         TYPE_AND_NAME \
 ) BOOST_MIRROR_REG_CONSTRUCTOR_PARAM_NAME( \
+ R, \
                 CONSTR_INDEX, \
                 PARAM_INDEX, \
                 BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(TYPE_AND_NAME)) \

Added: sandbox/mirror/boost/mirror/meta_mem_functions.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/meta_mem_functions.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -0,0 +1,386 @@
+/**
+ * \file boost/mirror/meta_mem_functions.hpp
+ * Meta data concerning class' member functions
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under the Boost
+ * Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ */
+
+#ifndef BOOST_MIRROR_META_MEM_FUNCTIONS_HPP
+#define BOOST_MIRROR_META_MEM_FUNCTIONS_HPP
+
+#include <boost/mirror/meta_constructors.hpp>
+
+namespace boost {
+namespace mirror {
+
+/** Forward declaration of the meta-constructors base template
+ */
+template <class Class /*, class VariantTag*/ >
+struct meta_mem_functions_base;
+
+#ifdef NOT_DEFINED //TODO:
+
+/** Begins the registering of template class' constructors
+ */
+#define BOOST_MIRROR_REG_TEMPLATE_CONSTRUCTORS_BEGIN(TEMPLATE, TEMPL_ARG_COUNT)\
+template < BOOST_PP_ENUM_PARAMS(TEMPL_ARG_COUNT, typename T) > \
+struct meta_constructors_base< \
+ TEMPLATE < BOOST_PP_ENUM_PARAMS(TEMPL_ARG_COUNT, T) > \
+> \
+{ \
+ typedef mpl::vector0<>
+
+
+/** Begins the registering of class' constructors
+ */
+#define BOOST_MIRROR_REG_CONSTRUCTORS_BEGIN(CLASS) \
+template <> \
+struct meta_constructors_base< CLASS > \
+{ \
+ typedef mpl::vector0<>
+
+/** Registers the parameter name of the j-th parameter
+ * of the i-th constructor
+ */
+#define BOOST_MIRROR_REG_CONSTRUCTOR_PARAM_NAME(CONSTRUCTOR, PARAM, NAME) \
+inline static const ::std::string& get_param_name( \
+ mpl::false_, \
+ const ::std::char_traits<char>&, \
+ mpl::int_< CONSTRUCTOR >, \
+ mpl::int_< PARAM > \
+) \
+{ \
+ static ::std::string result( BOOST_PP_STRINGIZE( NAME ) ); \
+ return result; \
+} \
+inline static const ::std::wstring& get_param_name( \
+ mpl::false_, \
+ const ::std::char_traits<wchar_t>&, \
+ mpl::int_< CONSTRUCTOR >, \
+ mpl::int_< PARAM > \
+) \
+{ \
+ static ::std::wstring result( BOOST_PP_WSTRINGIZE( NAME ) ); \
+ return result; \
+}
+
+
+/** Ends the registering of (template) class' constructors
+ */
+#define BOOST_MIRROR_REG_CONSTRUCTORS_END \
+ param_type_lists; \
+ template <class ConstrIndex, class ParamIndex> \
+ inline static const cts::bstring& base_param_name( \
+ ConstrIndex ci, \
+ ParamIndex pi \
+ ) \
+ { \
+ return get_param_name( \
+ mpl::false_(), \
+ ::std::char_traits< cts::bchar >(), \
+ ci, \
+ pi \
+ ); \
+ } \
+};
+
+
+/** Helper macro which expands into the type of the j-th parameter
+ * preceeded by a comma if it is not the first parameter
+ */
+#define BOOST_MIRROR_REG_CONSTR_EXTRACT_PARAM_TYPE( \
+ R, X, \
+ PARAM_INDEX, \
+ TYPE_AND_NAME \
+) BOOST_PP_COMMA_IF(PARAM_INDEX) BOOST_PP_SEQ_HEAD(TYPE_AND_NAME)
+
+
+
+/** Calls the BOOST_MIRROR_REG_CONSTRUCTOR_PARAM_NAME macro
+ * in repetitions.
+ */
+#define BOOST_MIRROR_REG_CONSTR_REG_CALL_PARAM_NAME(\
+ R, \
+ CONSTR_INDEX, \
+ PARAM_INDEX, \
+ TYPE_AND_NAME \
+) BOOST_MIRROR_REG_CONSTRUCTOR_PARAM_NAME( \
+ CONSTR_INDEX, \
+ PARAM_INDEX, \
+ BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(TYPE_AND_NAME)) \
+ )
+
+
+/** Adds the parameter typelist to the list storing
+ * storing the parameter types for the individual constructors
+ */
+#define BOOST_MIRROR_REG_CONSTRUCTOR_PUSH_BACK_PARAM_TYPES( \
+ CONSTR_INDEX, \
+ TYPENAME_KW\
+) typedef TYPENAME_KW mpl::push_back< \
+ BOOST_PP_CAT(param_type_lists_, CONSTR_INDEX), \
+ BOOST_PP_CAT(BOOST_PP_CAT(constr_, CONSTR_INDEX), _params) \
+ >::type
+
+
+/** Registers a single default constructor
+ */
+#define BOOST_MIRROR_REG_DEFAULT_CONSTRUCTOR(CONSTR_INDEX) \
+ param_type_lists_ ## CONSTR_INDEX ; \
+ typedef mpl::vector0< \
+ > BOOST_PP_CAT(BOOST_PP_CAT(constr_, CONSTR_INDEX), _params) ;\
+ BOOST_MIRROR_REG_CONSTRUCTOR_PUSH_BACK_PARAM_TYPES(\
+ CONSTR_INDEX, \
+ BOOST_PP_EMPTY()\
+ )
+
+/** registers a single non-default constructor
+ */
+#define BOOST_MIRROR_DO_REG_CLASS_OR_TEMPL_CONSTRUCTOR(\
+ CONSTR_INDEX, \
+ PARAM_SEQ, \
+ TYPENAME_KW\
+) \
+ param_type_lists_ ## CONSTR_INDEX ; \
+ typedef BOOST_PP_CAT(mpl::vector, BOOST_PP_SEQ_SIZE(PARAM_SEQ)) < \
+ BOOST_PP_SEQ_FOR_EACH_I( \
+ BOOST_MIRROR_REG_CONSTR_EXTRACT_PARAM_TYPE, \
+ 0, \
+ PARAM_SEQ \
+ ) \
+ > BOOST_PP_CAT(BOOST_PP_CAT(constr_, CONSTR_INDEX), _params) ;\
+ BOOST_PP_SEQ_FOR_EACH_I( \
+ BOOST_MIRROR_REG_CONSTR_REG_CALL_PARAM_NAME, \
+ CONSTR_INDEX, \
+ PARAM_SEQ \
+ ) \
+ BOOST_MIRROR_REG_CONSTRUCTOR_PUSH_BACK_PARAM_TYPES( \
+ CONSTR_INDEX, \
+ TYPENAME_KW \
+ )
+
+
+
+/** Decides whether the PARAM_SEQ is a argument sequence for
+ * a default constructor (having no parameters)
+ */
+#define BOOST_MIRROR_IS_VOID_FN_ARG_LIST(PARAM_SEQ) \
+ BOOST_PP_AND( \
+ BOOST_PP_EQUAL(BOOST_PP_SEQ_SIZE(PARAM_SEQ),1), \
+ BOOST_PP_EQUAL( \
+ BOOST_PP_SEQ_SIZE( \
+ BOOST_PP_SEQ_HEAD(PARAM_SEQ) \
+ ),1 \
+ ) \
+ )
+
+/** expands into the default constructor registering macro
+ */
+#define BOOST_MIRROR_REG_CLASS_OR_TEMPL_CONSTRUCTOR_1( \
+ CONSTR_INDEX, \
+ PARAM_SEQ, \
+ TYPENAME_KW \
+) BOOST_MIRROR_REG_DEFAULT_CONSTRUCTOR(CONSTR_INDEX)
+
+/** expands into the non-default constructor registering macro
+ */
+#define BOOST_MIRROR_REG_CLASS_OR_TEMPL_CONSTRUCTOR_0( \
+ CONSTR_INDEX, \
+ PARAM_SEQ, \
+ TYPENAME_KW \
+) BOOST_MIRROR_DO_REG_CLASS_OR_TEMPL_CONSTRUCTOR( \
+ CONSTR_INDEX, \
+ PARAM_SEQ, \
+ TYPENAME_KW \
+)
+
+/** Registers a single constructor, by disparching between
+ * the BOOST_MIRROR_DO_REG_CLASS_OR_TEMPL_CONSTRUCTOR and
+ * the BOOST_MIRROR_REG_DEFAULT_CONSTRUCTOR macros based on
+ * whether the constructor is default or non-default.
+ * Default constructors are identified as those
+ * having only a single parameter of void type. All other constructors
+ * are considered as non-default.
+ */
+#define BOOST_MIRROR_REG_CLASS_OR_TEMPL_CONSTRUCTOR( \
+ CONSTR_INDEX, \
+ PARAM_SEQ, \
+ TYPENAME_KW \
+) BOOST_PP_CAT( \
+ BOOST_MIRROR_REG_CLASS_OR_TEMPL_CONSTRUCTOR_, \
+ BOOST_MIRROR_IS_VOID_FN_ARG_LIST(PARAM_SEQ) \
+) (CONSTR_INDEX, PARAM_SEQ, TYPENAME_KW)
+
+
+
+/** Registers a constructor of a non-template class
+ */
+#define BOOST_MIRROR_REG_CONSTRUCTOR(CONSTR_INDEX, PARAM_SEQ) \
+ BOOST_MIRROR_REG_CLASS_OR_TEMPL_CONSTRUCTOR( \
+ CONSTR_INDEX, \
+ PARAM_SEQ, \
+ BOOST_PP_EMPTY() \
+ )
+
+/** Registers a constructor of a template class
+ */
+#define BOOST_MIRROR_REG_TEMPLATE_CONSTRUCTOR(CONSTR_INDEX, PARAM_SEQ) \
+ BOOST_MIRROR_REG_CLASS_OR_TEMPL_CONSTRUCTOR( \
+ CONSTR_INDEX, \
+ PARAM_SEQ, \
+ typename \
+ )
+
+/** Helper macro used to call the BOOST_MIRROR_REG_CONSTRUCTOR
+ * for each constructor in the quick registering macro
+ */
+#define BOOST_MIRROR_CALL_REG_CONSTRUCTOR_QREG(R, D, PARAM_SEQ)\
+ BOOST_MIRROR_REG_CONSTRUCTOR(BOOST_PP_SUB(R,2), PARAM_SEQ)
+
+/** Quick and simple constructor registering macro
+ */
+#define BOOST_MIRROR_QREG_CONSTRUCTORS( \
+ CLASS, \
+ CONSTR_PARAM_SEQ_SEQ \
+) \
+BOOST_MIRROR_REG_CONSTRUCTORS_BEGIN( CLASS ) \
+ BOOST_PP_SEQ_FOR_EACH( \
+ BOOST_MIRROR_CALL_REG_CONSTRUCTOR_QREG, \
+ _, \
+ CONSTR_PARAM_SEQ_SEQ \
+ ) \
+BOOST_MIRROR_REG_CONSTRUCTORS_END
+
+
+#endif //NOT_DEFINED TODO
+
+/** Template providing meta-data about the member functions
+ * (methods) of the Class.
+ */
+template <class Class /*, class VariantTag*/ >
+struct meta_member_functions : public meta_mem_functions_base<Class>
+{
+ typedef meta_mem_functions_base<Class> base_class;
+ template <class FunctionIndex>
+ struct member_function
+ {
+ // returns the name of the member function
+ template <bool FullOrBase, class CharT>
+ inline static const ::std::basic_string<CharT>&
+ get_name(
+ mpl::bool_<FullOrBase> full_or_base,
+ const ::std::char_traits<CharT>& traits
+ )
+ {
+ return meta_member_functions::get_name(
+ full_or_base,
+ traits,
+ FunctionIndex()
+ );
+ }
+
+ // returns the base name of the member function
+ inline static const cts::bstring&
+ base_name(void)
+ {
+ return meta_member_functions::get_name(
+ mpl::false_(),
+ cts::bchar_traits(),
+ FunctionIndex()
+ );
+ }
+
+ // meta-data about the parameters of the function
+ struct params
+ {
+ private:
+ typedef typename mpl::at<
+ typename base_class::param_type_lists,
+ FunctionIndex
+ >::type type_list;
+ public:
+ // some meta-data about the i-th param
+ template <class ParamIndex>
+ struct param
+ {
+ private:
+ typedef typename mpl::at<
+ type_list,
+ ParamIndex
+ >::type param_type;
+ public:
+ typedef BOOST_MIRRORED_TYPE(param_type)
+ type;
+ };
+
+ // the count of parameters
+ typedef mpl::int_<
+ mpl::size< type_list>::value
+ > size;
+
+ // gets the i-th param name
+ template <class CharT, class ParamIndex>
+ inline static const ::std::basic_string<CharT>&
+ get_param_name(
+ mpl::false_ full_or_base,
+ const ::std::char_traits<CharT>& traits,
+ ParamIndex
+ )
+ {
+ return meta_member_functions::get_param_name(
+ full_or_base,
+ traits,
+ FunctionIndex(),
+ ParamIndex()
+ );
+ }
+
+ // get the base name of the i-th param
+ template <class ParamIndex>
+ inline static const cts::bstring& base_param_name(
+ ParamIndex
+ )
+ {
+ return meta_member_functions::base_param_name(
+ FunctionIndex(),
+ ParamIndex()
+ );
+ }
+
+
+ // executes the given binary functor on all
+ // parameters of the i-th function
+ template <class Functor>
+ static void for_each(Functor f)
+ {
+ call_for_each(f, mpl::int_<0>());
+ }
+ private:
+ template <class Functor, class ParamIndex>
+ static inline void call_for_each(
+ Functor func,
+ ParamIndex pi
+ )
+ {
+ func((params*)0, pi);
+ call_for_each(
+ func,
+ typename mpl::next<ParamIndex>::type()
+ );
+ }
+
+ template <class Functor>
+ static inline void call_for_each(const Functor&, size)
+ {
+ }
+ };
+ };
+};
+
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+

Modified: sandbox/mirror/boost/mirror/meta_namespace.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_namespace.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_namespace.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -16,8 +16,6 @@
 #include <boost/preprocessor/seq/pop_back.hpp>
 #include <boost/preprocessor/seq/seq.hpp>
 #include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/stringize.hpp>
-#include <boost/preprocessor/wstringize.hpp>
 
 // template meta programming
 #include <boost/mpl/bool.hpp>
@@ -181,6 +179,26 @@
         :: NAMESPACE_NAME
 
 
+// this macro is used to implement the get_name function
+// for various character types
+#define BOOST_MIRROR_REG_NAMESPACE_IMPLEMENT_GET_NAME(R,NAME_SEQUENCE,I,CHAR_T)\
+static inline const ::std::basic_string< CHAR_T >& get_name( \
+ mpl::false_, \
+ ::std::char_traits< CHAR_T > \
+) \
+{ \
+ static ::std::basic_string< CHAR_T> s_name( \
+ BOOST_CTS_STRINGIZE_CHAR_T(\
+ CHAR_T, \
+ BOOST_PP_SEQ_HEAD( \
+ BOOST_PP_SEQ_REVERSE(NAME_SEQUENCE) \
+ ) \
+ ) \
+ ); \
+ return s_name; \
+}
+
+
 /** Macro that does the registering of a namespace.
  * The argument must be a BOOST_PP sequence containing the
  * names of the parent namspaces and the registered namespace.
@@ -229,30 +247,10 @@
                         _, \
                         BOOST_PP_SEQ_POP_BACK(NAME_SEQUENCE) \
                 ) :: _ parent_placeholder; /* -4- */ \
- static inline const ::std::string& get_name( \
- mpl::false_, \
- ::std::char_traits<char> \
- ) \
- { \
- static ::std::string s_name(BOOST_PP_STRINGIZE( \
- BOOST_PP_SEQ_HEAD( \
- BOOST_PP_SEQ_REVERSE(NAME_SEQUENCE) \
- ) \
- )); \
- return s_name; \
- } \
- static inline const ::std::wstring& get_name( \
- mpl::false_, \
- ::std::char_traits<wchar_t> \
- ) \
- { \
- static ::std::wstring s_name(BOOST_PP_WSTRINGIZE( \
- BOOST_PP_SEQ_HEAD( \
- BOOST_PP_SEQ_REVERSE(NAME_SEQUENCE) \
- ) \
- )); \
- return s_name; \
- } /* -5- */ \
+ BOOST_CTS_FOR_EACH_CHAR_T( \
+ BOOST_MIRROR_REG_NAMESPACE_IMPLEMENT_GET_NAME, \
+ NAME_SEQUENCE \
+ ) /* -5- */ \
         }; \
         } \
         BOOST_PP_SEQ_FOR_EACH( \

Modified: sandbox/mirror/boost/mirror/meta_types/_free_fn.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_types/_free_fn.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_types/_free_fn.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -25,44 +25,53 @@
 
 namespace calling_convention {
 
-#define BOOST_MIRROR_DECLARE_CALLING_CONVENTION_HELPER(CC) \
+#define BOOST_MIRROR_IMPLEMENT_CALLING_CONVENTION_NAME(R, CC, I, CHAR_T) \
+ inline static const ::std::basic_string< CHAR_T >& \
+ name(::std::char_traits< CHAR_T >) \
+ { \
+ static ::std::basic_string<CHAR_T> cc_name( \
+ BOOST_CTS_STRINGIZE_CHAR_T(CHAR_T, __##CC) \
+ );\
+ return cc_name; \
+ }
+
+#define BOOST_MIRROR_IMPLEMENT_DEFAULT_CALLING_CONVENTION_NAME(R,CC,I, CHAR_T)\
+ inline static ::std::basic_string< CHAR_T > \
+ name(::std::char_traits< CHAR_T >) \
+ { \
+ return ::std::basic_string< CHAR_T >(); \
+ }
+
+#define BOOST_MIRROR_IMPLEMENT_CALLING_CONVENTION_HELPER(CC) \
         struct __##CC##_ \
         { \
- inline static const ::std::string& name(::std::char_traits<char>) \
- { \
- static ::std::string cc_name(BOOST_PP_STRINGIZE(__##CC));\
- return cc_name; \
- } \
- inline static const ::std::wstring& name(::std::char_traits<wchar_t>) \
- { \
- static ::std::wstring cc_name(BOOST_PP_WSTRINGIZE(__##CC));\
- return cc_name; \
- } \
+ BOOST_CTS_FOR_EACH_CHAR_T( \
+ BOOST_MIRROR_IMPLEMENT_CALLING_CONVENTION_NAME, \
+ CC \
+ ) \
         };
 
- BOOST_MIRROR_DECLARE_CALLING_CONVENTION_HELPER(cdecl)
- BOOST_MIRROR_DECLARE_CALLING_CONVENTION_HELPER(stdcall)
- BOOST_MIRROR_DECLARE_CALLING_CONVENTION_HELPER(pascal)
+ BOOST_MIRROR_IMPLEMENT_CALLING_CONVENTION_HELPER(cdecl)
+ BOOST_MIRROR_IMPLEMENT_CALLING_CONVENTION_HELPER(stdcall)
+ BOOST_MIRROR_IMPLEMENT_CALLING_CONVENTION_HELPER(pascal)
 
         struct __default_
         {
- inline static ::std::string name(::std::char_traits<char>)
- {
- return ::std::string();
- }
- inline static ::std::wstring name(::std::char_traits<wchar_t>)
- {
- return ::std::wstring();
- }
+ BOOST_CTS_FOR_EACH_CHAR_T(
+ BOOST_MIRROR_IMPLEMENT_DEFAULT_CALLING_CONVENTION_NAME,
+ _
+ )
         };
 
 // undefine the helper macros
-#undef BOOST_MIRROR_DECLARE_CALLING_CONVENTION_HELPER
+#undef BOOST_MIRROR_IMPLEMENT_CALLING_CONVENTION_HELPER
+#undef BOOST_MIRROR_IMPLEMENT_DEFAULT_CALLING_CONVENTION_NAME
+#undef BOOST_MIRROR_IMPLEMENT_CALLING_CONVENTION_NAME
 }
 
 /** Meta-type for free function types
  */
-#define BOOST_MIRROR_DECLARE_FREE_FUNCTION_META_TYPE( \
+#define BOOST_MIRROR_IMPLEMENT_FREE_FUNCTION_META_TYPE( \
         X, \
         ARG_COUNT, \
         CALLING_CONVENTION \
@@ -80,7 +89,7 @@
                 (reflected_type)(BOOST_PP_ENUM_PARAMS(ARG_COUNT, T)); \
 };
 
-BOOST_PP_REPEAT(16, BOOST_MIRROR_DECLARE_FREE_FUNCTION_META_TYPE, default)
+BOOST_PP_REPEAT(16, BOOST_MIRROR_IMPLEMENT_FREE_FUNCTION_META_TYPE, default)
 
 
 } // namespace mirror

Modified: sandbox/mirror/boost/mirror/meta_types/boost/fusion/vector.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_types/boost/fusion/vector.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_types/boost/fusion/vector.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -33,7 +33,7 @@
 BOOST_MIRROR_TMP_BOOST_FUSION_VECTOR_TEMPL_DECL()
 struct meta_type_boost_fusion_vector
 {
- BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME("vector")
+ BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME(vector)
 };
 
 

Modified: sandbox/mirror/boost/mirror/meta_types/boost/mpl/int.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_types/boost/mpl/int.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_types/boost/mpl/int.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -23,7 +23,7 @@
 
 struct meta_type_boost_mpl_int_
 {
- BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME("int_")
+ BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME(int_)
 };
 
 } // namespace detail

Modified: sandbox/mirror/boost/mirror/meta_types/boost/optional.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_types/boost/optional.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_types/boost/optional.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -22,7 +22,7 @@
 
 struct meta_type_boost_optional
 {
- BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME("optional")
+ BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME(optional)
 };
 
 } // namespace detail

Modified: sandbox/mirror/boost/mirror/meta_types/boost/tuples/tuple.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_types/boost/tuples/tuple.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_types/boost/tuples/tuple.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -34,7 +34,7 @@
 BOOST_MIRROR_TMP_BOOST_TUPLE_TEMPL_DECL()
 struct meta_type_boost_tuple
 {
- BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME("tuple")
+ BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME(tuple)
 };
 
 

Modified: sandbox/mirror/boost/mirror/meta_types/boost/variant.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_types/boost/variant.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_types/boost/variant.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -31,7 +31,7 @@
 
 struct meta_type_boost_variant
 {
- BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME("variant")
+ BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME(variant)
 };
 
 

Modified: sandbox/mirror/boost/mirror/meta_types/std/less.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_types/std/less.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_types/std/less.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -22,7 +22,7 @@
 
 struct meta_type_std_less
 {
- BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME("less")
+ BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME(less)
 };
 
 } // namespace detail

Modified: sandbox/mirror/boost/mirror/meta_types/std/list.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_types/std/list.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_types/std/list.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -22,7 +22,7 @@
 template <typename T, class Allocator>
 struct meta_type_std_list
 {
- BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME("list")
+ BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME(list)
 };
 
 } // namespace detail

Modified: sandbox/mirror/boost/mirror/meta_types/std/map.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_types/std/map.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_types/std/map.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -23,7 +23,7 @@
 template <typename K, typename T, class Comp, class Allocator>
 struct meta_type_std_map
 {
- BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME("map")
+ BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME(map)
 };
 
 } // namespace detail

Modified: sandbox/mirror/boost/mirror/meta_types/std/pair.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_types/std/pair.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_types/std/pair.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -23,7 +23,7 @@
 template <typename FirstType, typename SecondType>
 struct meta_type_std_pair
 {
- BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME("pair")
+ BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME(pair)
 };
 
 } // namespace detail

Modified: sandbox/mirror/boost/mirror/meta_types/std/set.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_types/std/set.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_types/std/set.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -23,7 +23,7 @@
 template <typename K, class Comp, class Allocator>
 struct meta_type_std_set
 {
- BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME("set")
+ BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME(set)
 };
 
 } // namespace detail

Modified: sandbox/mirror/boost/mirror/meta_types/std/slist.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_types/std/slist.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_types/std/slist.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -22,7 +22,7 @@
 template <typename T, class Allocator>
 struct meta_type_std_slist
 {
- BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME("slist")
+ BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME(slist)
 };
 
 } // namespace detail

Modified: sandbox/mirror/boost/mirror/meta_types/std/vector.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_types/std/vector.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_types/std/vector.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -22,7 +22,7 @@
 template <typename T, class Allocator>
 struct meta_type_std_vector
 {
- BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME("vector")
+ BOOST_MIRROR_REG_TYPE_DECLARE_BASE_NAME(vector)
 };
 
 } // namespace detail

Modified: sandbox/mirror/boost/mirror/visitors/json.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/visitors/json.hpp (original)
+++ sandbox/mirror/boost/mirror/visitors/json.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -26,6 +26,19 @@
 namespace boost {
 namespace mirror {
 
+#define BOOST_MIRROR_JSON_SERIALIZER_STRING_RELATED_HELPER(R,DATA,I,CHAR_T)\
+ static inline mpl::true_ is_base_type(::std::basic_string< CHAR_T >*) \
+ { \
+ return mpl::true_(); \
+ } \
+ inline void do_print_value( \
+ const ::std::basic_string< CHAR_T >& value \
+ ) const \
+ { \
+ do_print_string(value); \
+ }
+
+
 template <class OutputStream, class EncodeMBCs>
 class json_serializer
 {
@@ -82,22 +95,17 @@
                 throw ::std::runtime_error("JSON encoding error");
         }
 
+ BOOST_CTS_FOR_EACH_CHAR_T(
+ BOOST_MIRROR_JSON_SERIALIZER_STRING_RELATED_HELPER,
+ _
+ )
+
         template <typename Type>
         static inline is_fundamental<Type> is_base_type(Type*)
         {
                 return is_fundamental<Type>();
         }
 
- static inline mpl::true_ is_base_type(::std::string*)
- {
- return mpl::true_();
- }
-
- static inline mpl::true_ is_base_type(::std::wstring*)
- {
- return mpl::true_();
- }
-
         template <typename Type>
         static inline mpl::true_ is_base_type(Type**)
         {
@@ -285,16 +293,6 @@
                 out_stream << '"' ;
         }
 
- inline void do_print_value(const ::std::string& value) const
- {
- do_print_string(value);
- }
-
- inline void do_print_value(const ::std::wstring& value) const
- {
- do_print_string(value);
- }
-
         template <typename T>
         inline void do_print_value(T* pointer) const
         {
@@ -313,6 +311,8 @@
         }
 };
 
+#undef BOOST_MIRROR_JSON_SERIALIZER_STRING_RELATED_HELPER
+
 template <class OutputStream, class EncodeMBCs>
 inline json_serializer<OutputStream, EncodeMBCs>
 make_json_serializer(OutputStream& out_stream, EncodeMBCs)

Modified: sandbox/mirror/libs/mirror/example/factories/inserter.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/example/factories/inserter.cpp (original)
+++ sandbox/mirror/libs/mirror/example/factories/inserter.cpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -13,76 +13,14 @@
 #include <algorithm>
 
 #include <boost/char_type_switch/iostream.hpp>
+
 #include <boost/mirror/functor_call.hpp>
+#include <boost/mirror/meta_mem_functions.hpp>
 #include <boost/mirror/meta_class.hpp>
 #include <boost/mirror/algorithm/for_each.hpp>
 
 #include "./input_ui.hpp"
-
-namespace test {
-
-struct person
-{
- ::boost::cts::bstring first_name;
- ::boost::cts::bstring family_name;
- ::boost::cts::bstring street;
- ::boost::cts::bstring number;
- ::boost::cts::bstring city;
- ::boost::cts::bstring postal_code;
-
- person(
- const ::boost::cts::bstring& _first_name,
- const ::boost::cts::bstring& _family_name,
- const ::boost::cts::bstring& _street,
- const ::boost::cts::bstring& _number,
- const ::boost::cts::bstring& _city,
- const ::boost::cts::bstring& _postal_code
- ): first_name(_first_name)
- , family_name(_family_name)
- , street(_street)
- , number(_number)
- , city(_city)
- , postal_code(_postal_code)
- { }
-};
-
-} // namespace test
-
-
-namespace boost {
-namespace mirror {
-
-// register the ::test namespace
-BOOST_MIRROR_REG_NAMESPACE( (test) )
-
-// register the person type
-BOOST_MIRROR_REG_TYPE( ::test, person)
-
-// register the constructors of ::test::person
-BOOST_MIRROR_REG_CONSTRUCTORS_BEGIN( ::test::person )
- BOOST_MIRROR_REG_CONSTRUCTOR(0,
- ((::boost::cts::bstring)(first_name))
- ((::boost::cts::bstring)(family_name))
- ((::boost::cts::bstring)(street))
- ((::boost::cts::bstring)(number))
- ((::boost::cts::bstring)(city))
- ((::boost::cts::bstring)(postal_code))
- )
-BOOST_MIRROR_REG_CONSTRUCTORS_END
-
-// register the attributes of person
-BOOST_MIRROR_REG_CLASS_ATTRIBS_BEGIN(::test::person)
- BOOST_MIRROR_REG_AUTO_CLASS_ATTRIB(_, first_name)
- BOOST_MIRROR_REG_AUTO_CLASS_ATTRIB(_, family_name)
- BOOST_MIRROR_REG_AUTO_CLASS_ATTRIB(_, street)
- BOOST_MIRROR_REG_AUTO_CLASS_ATTRIB(_, number)
- BOOST_MIRROR_REG_AUTO_CLASS_ATTRIB(_, city)
- BOOST_MIRROR_REG_AUTO_CLASS_ATTRIB(_, postal_code)
-BOOST_MIRROR_REG_CLASS_ATTRIBS_END
-
-
-} // namespace mirror
-} // namespace boost
+#include "./person.hpp"
 
 /** Prints the types, names and values of
  * class' attribute
@@ -158,11 +96,13 @@
         using namespace ::test;
         //
         // a list of persons
- ::std::list< ::test::person > persons;
+ ::std::list< person > persons;
         //
         // keep inserting while insert_more == 'y'
- cts::bchar insert_more = BOOST_CTS_LIT('y');
- while(insert_more == BOOST_CTS_LIT('y'))
+ const cts::bchar yes = BOOST_CTS_LIT('y');
+ const cts::bchar no = BOOST_CTS_LIT('n');
+ cts::bchar insert_more = yes;
+ while(insert_more == yes)
         {
                 // the name of the function argument.
                 // there is only one in this case
@@ -178,14 +118,18 @@
                 // check whether to insert more persons
                 do
                 {
- cts::bcout() << BOOST_CTS_LIT("Insert more ? (y/n) ") << ::std::flush;
+ cts::bcout() <<
+ BOOST_CTS_LIT("Insert more ? (y/n) ") <<
+ ::std::flush;
                         cts::bcin() >> insert_more;
- } while(
- insert_more != BOOST_CTS_LIT('y') &&
- insert_more != BOOST_CTS_LIT('n')
- );
+ } while(insert_more != yes && insert_more != no);
         }
         //
+ typedef meta_member_functions<person> mem_fns;
+ cts::bcout() <<
+ mem_fns::member_function<mpl::int_<0> >::base_name() <<
+ ::std::endl;
+ //
         // print out all the persons in the list
         cts::bcout() << "Persons:" << ::std::endl;
         ::std::for_each(

Added: sandbox/mirror/libs/mirror/example/factories/person.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/libs/mirror/example/factories/person.hpp 2009-05-01 14:23:10 EDT (Fri, 01 May 2009)
@@ -0,0 +1,112 @@
+/**
+ * \file examples/factories/person.hpp
+ *
+ * Definition of classes used in some of the examples showing
+ * the use of meta-constructors and factories
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under the Boost
+ * Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ */
+
+#ifndef BOOST_MIRROR_EXAMPLES_FACTORIES_PERSON_HPP
+#define BOOST_MIRROR_EXAMPLES_FACTORIES_PERSON_HPP
+
+#include <boost/mirror/meta_class.hpp>
+
+
+namespace test {
+
+struct person
+{
+ ::boost::cts::bstring first_name;
+ ::boost::cts::bstring family_name;
+ ::boost::cts::bstring street;
+ ::boost::cts::bstring number;
+ ::boost::cts::bstring city;
+ ::boost::cts::bstring postal_code;
+
+ person(
+ const ::boost::cts::bstring& _first_name,
+ const ::boost::cts::bstring& _family_name,
+ const ::boost::cts::bstring& _street,
+ const ::boost::cts::bstring& _number,
+ const ::boost::cts::bstring& _city,
+ const ::boost::cts::bstring& _postal_code
+ ): first_name(_first_name)
+ , family_name(_family_name)
+ , street(_street)
+ , number(_number)
+ , city(_city)
+ , postal_code(_postal_code)
+ { }
+
+ void change_address(
+ const ::boost::cts::bstring& _street,
+ const ::boost::cts::bstring& _number,
+ const ::boost::cts::bstring& _city,
+ const ::boost::cts::bstring& _postal_code
+ )
+ {
+ street.assign(_street);
+ number.assign(_number);
+ city.assign(_city);
+ postal_code.assign(_postal_code);
+ }
+};
+
+} // namespace test
+
+namespace boost {
+namespace mirror {
+
+// register the ::test namespace
+BOOST_MIRROR_REG_NAMESPACE( (test) )
+
+// tegister the class, it's attribs, constructors
+BOOST_MIRROR_QREG_CLASS_NO_BASE(
+ ::test, person,
+ (first_name)(family_name)(street)(number)(city)(postal_code)
+)
+BOOST_MIRROR_QREG_CONSTRUCTORS(
+ ::test::person,
+ (
+ ((::boost::cts::bstring)(first_name))
+ ((::boost::cts::bstring)(family_name))
+ ((::boost::cts::bstring)(street))
+ ((::boost::cts::bstring)(number))
+ ((::boost::cts::bstring)(city))
+ ((::boost::cts::bstring)(postal_code))
+ )
+)
+
+#define BOOST_MIRROR_TMP_IMPLEMENT_MEM_FN_GET_NAME(R, MEM_FN, I, CHAR_T) \
+ inline static const ::std::basic_string< CHAR_T >& \
+ get_name( \
+ mpl::false_, \
+ const ::std::char_traits< CHAR_T >, \
+ mpl::int_<0> \
+ ) \
+ { \
+ static ::std::basic_string< CHAR_T > result( \
+ BOOST_CTS_STRINGIZE_CHAR_T(CHAR_T, MEM_FN) \
+ ); \
+ return result; \
+ }
+
+template <class Class>
+struct meta_mem_functions_base
+{
+ BOOST_CTS_FOR_EACH_CHAR_T(
+ BOOST_MIRROR_TMP_IMPLEMENT_MEM_FN_GET_NAME,
+ change_address
+ )
+};
+
+} // namespace mirror
+} // namespace boost
+
+
+
+#endif
+


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