$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r52805 - in sandbox/mirror: boost/mirror boost/mirror/detail boost/mirror/factory/wx_constructor_gui libs/mirror/example/factories
From: chochlik_at_[hidden]
Date: 2009-05-06 15:26:26
Author: matus.chochlik
Date: 2009-05-06 15:26:24 EDT (Wed, 06 May 2009)
New Revision: 52805
URL: http://svn.boost.org/trac/boost/changeset/52805
Log:
[mirror 0.4.x]
- rewrite of the meta-function/factory facilities
Text files modified: 
   sandbox/mirror/boost/mirror/detail/function_meta_data.hpp          |    40 ++++++++++++++-----------               
   sandbox/mirror/boost/mirror/factory.hpp                            |    61 ++++++++++++++++++++++++++++++++------- 
   sandbox/mirror/boost/mirror/factory/wx_constructor_gui/basic.hpp   |    18 +++++-----                              
   sandbox/mirror/boost/mirror/factory/wx_constructor_gui/boolean.hpp |     8 ++--                                    
   sandbox/mirror/boost/mirror/factory/wx_constructor_gui/default.hpp |    18 +++++-----                              
   sandbox/mirror/boost/mirror/factory/wx_constructor_gui/utils.hpp   |    15 ++++++---                               
   sandbox/mirror/boost/mirror/functor_call.hpp                       |     6 +++                                     
   sandbox/mirror/boost/mirror/meta_constructors.hpp                  |     6 +++                                     
   sandbox/mirror/boost/mirror/meta_mem_functions.hpp                 |    53 ++++++++++++++++++++++++++++++++--      
   sandbox/mirror/libs/mirror/example/factories/input_ui.hpp          |    47 +++++++++++++++++-------------          
   sandbox/mirror/libs/mirror/example/factories/inserter.cpp          |     5 +++                                     
   sandbox/mirror/libs/mirror/example/factories/person.hpp            |    20 ++++++------                            
   12 files changed, 206 insertions(+), 91 deletions(-)
Modified: sandbox/mirror/boost/mirror/detail/function_meta_data.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/function_meta_data.hpp	(original)
+++ sandbox/mirror/boost/mirror/detail/function_meta_data.hpp	2009-05-06 15:26:24 EDT (Wed, 06 May 2009)
@@ -265,6 +265,14 @@
                 ) \
         )
 
+#define BOOST_MIRROR_REG_META_FUNCTIONS_IMPLEMENT_GET_SCOPE() \
+        template <class FunctionIndex> \
+        struct get_scope \
+        { \
+                typedef BOOST_MIRRORED_CLASS(_detail_class) type; \
+        }; 
+ 
+
 /** Begins the registering of template class' members
  */
 #define BOOST_MIRROR_REG_TEMPLATE_META_FUNCTIONS_BEGIN( \
@@ -277,14 +285,10 @@
         TEMPLATE < BOOST_PP_ENUM_PARAMS(TEMPL_ARG_COUNT, T) > \
 > \
 { \
-        template <class FunctionIndex> \
-        struct get_scope \
-        { \
-                typedef TEMPLATE < BOOST_PP_ENUM_PARAMS(TEMPL_ARG_COUNT, T) >\
-                        _templ; \
-                typedef BOOST_MIRRORED_CLASS(_templ) type; \
-        }; \
-        typedef mpl::vector0<>
+	typedef TEMPLATE < BOOST_PP_ENUM_PARAMS(TEMPL_ARG_COUNT, T) > \
+		_detail_class; \
+	BOOST_MIRROR_REG_META_FUNCTIONS_IMPLEMENT_GET_SCOPE() \
+	typedef mpl::vector0<>
 
 
 /** Begins the registering of class' constructors
@@ -293,23 +297,23 @@
 template <> \
 struct META_FUNCTIONS_BASE < CLASS > \
 { \
-        template <class FunctionIndex> \
-        struct get_scope \
-        { \
-                typedef BOOST_MIRRORED_CLASS(CLASS) type; \
-        }; \
+	typedef CLASS _detail_class; \
+	BOOST_MIRROR_REG_META_FUNCTIONS_IMPLEMENT_GET_SCOPE() \
         typedef mpl::vector0<>
 
+#define BOOST_MIRROR_REG_META_FUNCTION_ENUM_PARAM_TYPES(PARAM_SEQ) \
+	BOOST_PP_SEQ_FOR_EACH_I( \
+        	BOOST_MIRROR_REG_META_FUNCTION_EXTRACT_PARAM_TYPE, \
+		0, \
+		PARAM_SEQ \
+	) 
+
 #define BOOST_MIRROR_REG_META_FUNCTION_DEFINE_PARAM_TYPELIST( \
         FUNC_INDEX, \
         PARAM_SEQ \
 ) \
 typedef BOOST_PP_CAT(mpl::vector, BOOST_PP_SEQ_SIZE(PARAM_SEQ)) < \
-	BOOST_PP_SEQ_FOR_EACH_I( \
-        	BOOST_MIRROR_REG_META_FUNCTION_EXTRACT_PARAM_TYPE, \
-		0, \
-		PARAM_SEQ \
-	) \
+BOOST_MIRROR_REG_META_FUNCTION_ENUM_PARAM_TYPES(PARAM_SEQ) \
 > BOOST_PP_CAT(BOOST_PP_CAT(function_, FUNC_INDEX), _params) ;
 
 #define BOOST_MIRROR_REG_META_FUNCTION_DEFINE_EMPTY_PARAM_TYPELIST(FUNC_INDEX) \
Modified: sandbox/mirror/boost/mirror/factory.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/factory.hpp	(original)
+++ sandbox/mirror/boost/mirror/factory.hpp	2009-05-06 15:26:24 EDT (Wed, 06 May 2009)
@@ -14,13 +14,31 @@
 #include <boost/mirror/meta_constructors.hpp>
 #include <boost/mpl/accumulate.hpp>
 #include <boost/mpl/push_back.hpp>
+#include  <boost/type_traits/remove_cv.hpp>
+#include  <boost/type_traits/remove_reference.hpp>
+
 #include <boost/mirror/detail/argument_type_list.hpp>
 
+#define BOOST_MIRROR_MAX_FUNC_PARAMS() 12
+
 
 namespace boost {
 namespace mirror {
 namespace detail {
 
+struct constructor_utils
+{
+	template <typename T>
+	struct adjust_product
+	{
+		typedef typename ::boost::remove_cv<
+			typename ::boost::remove_reference<
+				T
+			>::type
+		>::type type;
+	};
+};
+
 /** Forward declaration of the constructor template
  *  class.
  */
@@ -45,7 +63,7 @@
         TypeList,
         mpl::int_<0>,
         Index
->
+> : constructor_utils
 {
         template <typename Param>
         constructor(Param param)
@@ -59,13 +77,17 @@
 
 
 #define BOOST_MIRROR_DECLARE_CONSTRUCTOR_PARAM_MANUFACTURER(Z, INDEX, TYPELIST)\
-Manufacturer<typename mpl::at<TYPELIST, mpl::int_<INDEX> >::type > _##INDEX;
+Manufacturer< \
+typename constructor_utils::template adjust_product< \
+                typename mpl::at<TYPELIST, mpl::int_<INDEX> >::type \
+        >::type \
+> _##INDEX;
 
 #define BOOST_MIRROR_INITIALIZE_CONSTRUCTOR_MANUFACTURER(Z, INDEX, PARAM)\
-        _##INDEX (PARAM, (Product*)0, ConstructorIndex(), mpl::int_<INDEX>())
+_##INDEX (PARAM, _meta_constructors, ConstructorIndex(), mpl::int_<INDEX>())
 
 #define BOOST_MIRROR_CALL_CONSTRUCTOR_MANUFACTURER(Z, INDEX, X)\
-        _##INDEX ()
+_##INDEX ()
 
 
 /** Constructor with arguments
@@ -82,8 +104,12 @@
         TypeList,  \
         mpl::int_< PARAM_COUNT >,  \
         ConstructorIndex \
-> \
+> : constructor_utils \
 { \
+	typedef typename constructor_utils::template adjust_product< \
+                Product \
+        >::type product; \
+	::boost::mirror::meta_constructors<product> _meta_constructors; \
         BOOST_PP_REPEAT( \
                 PARAM_COUNT,  \
                 BOOST_MIRROR_DECLARE_CONSTRUCTOR_PARAM_MANUFACTURER,  \
@@ -125,7 +151,12 @@
 #define BOOST_MIRROR_DO_IMPLEMENT_CONSTRUCTOR(Z, PARAM_COUNT, X) \
         BOOST_MIRROR_IMPLEMENT_CONSTRUCTOR(PARAM_COUNT)
 
-BOOST_PP_REPEAT_FROM_TO(1, 12, BOOST_MIRROR_DO_IMPLEMENT_CONSTRUCTOR, 0)
+BOOST_PP_REPEAT_FROM_TO(
+	1, 
+	BOOST_MIRROR_MAX_FUNC_PARAMS(), 
+	BOOST_MIRROR_DO_IMPLEMENT_CONSTRUCTOR, 
+	0
+)
 
 
 #undef BOOST_MIRROR_DO_IMPLEMENT_CONSTRUCTOR
@@ -147,7 +178,7 @@
 #define BOOST_MIRROR_DECLARE_FACTORY_CONSTRUCTOR(Z, INDEX, CONSTR_LIST) \
 constructor< \
         Manufacturer, \
-        Product, \
+        typename constructor_utils::template adjust_product< Product >::type, \
         typename mpl::at< CONSTR_LIST, mpl::int_<INDEX> >::type, \
         mpl::int_< \
                 mpl::size< \
@@ -231,7 +262,11 @@
 #define BOOST_MIRROR_DO_IMPLEMENT_BASE_FACTORY(Z, PARAM_COUNT, X) \
         BOOST_MIRROR_IMPLEMENT_BASE_FACTORY(PARAM_COUNT)
 
-BOOST_PP_REPEAT(12, BOOST_MIRROR_DO_IMPLEMENT_BASE_FACTORY, 0)
+BOOST_PP_REPEAT(
+	BOOST_MIRROR_MAX_FUNC_PARAMS(), 
+	BOOST_MIRROR_DO_IMPLEMENT_BASE_FACTORY, 
+	0
+)
 
 #undef BOOST_MIRROR_CALL_FACTORY_OP_NEW
 #undef BOOST_MIRROR_DO_IMPLEMENT_BASE_FACTORY
@@ -254,9 +289,13 @@
 template <
         template <class> class Manufacturer,
         class Product
-> struct make_base_factory
+> struct make_base_factory : constructor_utils
 {
-	typedef typename meta_constructors<Product>::param_type_lists
+	typedef typename constructor_utils::template adjust_product<
+		Product
+	>::type product;
+
+	typedef typename meta_constructors<product>::param_type_lists
                 raw_param_type_lists;
 
         typedef typename mpl::accumulate<
@@ -272,7 +311,7 @@
 
         typedef base_factory<
                 Manufacturer,
-	        Product,
+	        product,
                 param_type_lists,
                 mpl::int_< mpl::size< param_type_lists >::value >
 	> type;
Modified: sandbox/mirror/boost/mirror/factory/wx_constructor_gui/basic.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/factory/wx_constructor_gui/basic.hpp	(original)
+++ sandbox/mirror/boost/mirror/factory/wx_constructor_gui/basic.hpp	2009-05-06 15:26:24 EDT (Wed, 06 May 2009)
@@ -61,11 +61,11 @@
                 return text_ctl->GetValue();
         }
 public:
-	template <class Context, class ConstrIndex, class ParamIndex>
+	template <class MetaFunctions, class FuncIndex, class ParamIndex>
         wx_constructor_gui_basic(
                 wx_constructor_gui_data* parent_data, 
-		Context* pc, 
-		ConstrIndex ci, 
+		MetaFunctions mf, 
+		FuncIndex fi, 
                 ParamIndex pi,
                 wxString pattern,
                 wxString message
@@ -74,7 +74,7 @@
                         text_ctl_maker(pattern, message), 
                         parent_data, 
                         pc, 
-			ci, 
+			fi, 
                         pi
                 )
         ){ }
@@ -94,16 +94,16 @@
         typedef wx_constructor_gui_basic< PRODUCT > \
                 base_class; \
 public: \
-	template <class Context, class ConstrIndex, class ParamIndex> \
+	template <class MetaFunctions, class FuncIndex, class ParamIndex> \
         wx_constructor_gui( \
                 wx_constructor_gui_data* parent_data, \
-		Context* pc, \
-		ConstrIndex ci, \
+		MetaFunctions mf, \
+		FuncIndex fi, \
                 ParamIndex pi \
         ): base_class( \
                 parent_data, \
-		pc, \
-		ci, \
+		mf, \
+		fi, \
                 pi, \
                 wxT( PATTERN ), \
                 wxT( MESSAGE ) \
Modified: sandbox/mirror/boost/mirror/factory/wx_constructor_gui/boolean.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/factory/wx_constructor_gui/boolean.hpp	(original)
+++ sandbox/mirror/boost/mirror/factory/wx_constructor_gui/boolean.hpp	2009-05-06 15:26:24 EDT (Wed, 06 May 2009)
@@ -38,13 +38,13 @@
         };
 
 public:
-	template <class Context, class ConstrIndex, class ParamIndex>
+	template <class MetaFunctions, class FuncIndex, class ParamIndex>
         wx_constructor_gui(
                 wx_constructor_gui_data* parent_data, 
-		Context* pc, 
-		ConstrIndex ci, 
+		MetaFunctions mf, 
+		FuncIndex fi, 
                 ParamIndex pi
-	): chb_ctl(make_ctl(chbctl_maker(), parent_data, pc, ci, pi))
+	): chb_ctl(make_ctl(chbctl_maker(), parent_data, mf, fi, pi))
         { }
 
         inline bool operator()(void) const 
Modified: sandbox/mirror/boost/mirror/factory/wx_constructor_gui/default.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/factory/wx_constructor_gui/default.hpp	(original)
+++ sandbox/mirror/boost/mirror/factory/wx_constructor_gui/default.hpp	2009-05-06 15:26:24 EDT (Wed, 06 May 2009)
@@ -25,11 +25,11 @@
         wx_constructor_gui_data data;
         //
         // makes the data
-	template <class Context, class ConstrIndex, class ParamIndex>
+	template <class MetaFunctions, class FuncIndex, class ParamIndex>
         static inline wx_constructor_gui_data make_data(
                 wx_constructor_gui_data* parent_data, 
-		Context* pc, 
-		ConstrIndex ci, 
+		MetaFunctions mf, 
+		FuncIndex fi, 
                 ParamIndex pi
         )
         {
@@ -37,8 +37,8 @@
                 assert(parent_data != 0);
                 // make a label for the static box sizer
                 wxString label(
-			BOOST_MIRRORED_CONSTRUCTORS(Context)::
-			template constructor<ConstrIndex>::params::
+			MetaFunctions::
+			template constructor<FuncIndex>::params::
                         template param<ParamIndex>::base_name()
                 );
                 // the panel which will be the parent of
@@ -78,13 +78,13 @@
                 Product 
 	>::type fact;
 public:
-	template <class Context, class ConstrIndex, class ParamIndex>
+	template <class MetaFunctions, class FuncIndex, class ParamIndex>
         wx_constructor_gui(
                 wx_constructor_gui_data* parent_data, 
-		Context* pc, 
-		ConstrIndex ci, 
+		MetaFunctions mf, 
+		FuncIndex fi, 
                 ParamIndex pi
-	): data(make_data(parent_data, pc, ci, pi))
+	): data(make_data(parent_data, mf, fi, pi))
          , fact(&data)
         { }
 
Modified: sandbox/mirror/boost/mirror/factory/wx_constructor_gui/utils.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/factory/wx_constructor_gui/utils.hpp	(original)
+++ sandbox/mirror/boost/mirror/factory/wx_constructor_gui/utils.hpp	2009-05-06 15:26:24 EDT (Wed, 06 May 2009)
@@ -21,12 +21,17 @@
 {
 protected:
         // makes the data
-	template <class CtrlMaker, class Context, class ConstrIndex, class ParamIndex>
+	template <
+		class CtrlMaker, 
+		class MetaFunctions, 
+		class FuncIndex, 
+		class ParamIndex
+	>
         static inline typename CtrlMaker::result_type* make_ctl(
                 CtrlMaker make_ctl,
                 wx_constructor_gui_data* parent_data, 
-		Context* pc, 
-		ConstrIndex ci, 
+		MetaFunctions mf, 
+		FuncIndex fi, 
                 ParamIndex pi
         )
         {
@@ -34,8 +39,8 @@
                 assert(parent_data != 0);
                 // make a label for the static box sizer
                 wxString label(
-			BOOST_MIRRORED_CONSTRUCTORS(Context)::
-			template constructor<ConstrIndex>::params::
+			MetaFunctions::
+			template function<FuncIndex>::params::
                         template param<ParamIndex>::base_name()
                 );
                 // the panel which will be the parent of
Modified: sandbox/mirror/boost/mirror/functor_call.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/functor_call.hpp	(original)
+++ sandbox/mirror/boost/mirror/functor_call.hpp	2009-05-06 15:26:24 EDT (Wed, 06 May 2009)
@@ -84,7 +84,11 @@
 #define BOOST_MIRROR_DO_IMPLEMENT_BASE_FUNCTION_CALLER(Z, PARAM_COUNT, X) \
         BOOST_MIRROR_IMPLEMENT_BASE_FUNCTION_CALLER(PARAM_COUNT)
 
-BOOST_PP_REPEAT(12, BOOST_MIRROR_DO_IMPLEMENT_BASE_FUNCTION_CALLER, 0)
+BOOST_PP_REPEAT(
+	BOOST_MIRROR_MAX_FUNC_PARAMS(), 
+	BOOST_MIRROR_DO_IMPLEMENT_BASE_FUNCTION_CALLER, 
+	0
+)
 
 #undef BOOST_MIRROR_DO_IMPLEMENT_BASE_FUNCTION_CALLER
 #undef BOOST_MIRROR_IMPLEMENT_BASE_FUNCTION_CALLER
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-06 15:26:24 EDT (Wed, 06 May 2009)
@@ -209,6 +209,12 @@
         template <class ConstructorIndex>
         struct constructor
          : detail::meta_function<meta_constructors, ConstructorIndex>
+	{
+		typedef BOOST_MIRRORED_CLASS(Class) result_type;
+	};
+
+	template <class FunctionIndex>
+	struct function : constructor<FunctionIndex>
         { };
 };
 
Modified: sandbox/mirror/boost/mirror/meta_mem_functions.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_mem_functions.hpp	(original)
+++ sandbox/mirror/boost/mirror/meta_mem_functions.hpp	2009-05-06 15:26:24 EDT (Wed, 06 May 2009)
@@ -48,10 +48,13 @@
 #define BOOST_MIRROR_REG_PARAMLESS_MEM_FUNCTION( \
         FUNC_INDEX, \
         RET_VAL, \
-	FUNC_NAME \
+	FUNC_NAME, \
+	CONST_KW \
 ) \
         param_type_lists_ ## FUNC_INDEX ; \
         static RET_VAL get_result_of(mpl::int_< FUNC_INDEX >); \
+	static inline RET_VAL (_detail_class::*)(void) CONST_KW \
+	get_address_of(mpl::int_< FUNC_INDEX >) {return &_detail_class::FUNC_NAME;}\
         BOOST_MIRROR_REG_META_FUNCTION_DEFINE_EMPTY_PARAM_TYPELIST(FUNC_INDEX)\
         BOOST_MIRROR_REG_META_FUNCTION_PUSH_BACK_PARAM_TYPES(\
                 FUNC_INDEX, \
@@ -98,10 +101,17 @@
         RET_VAL, \
         FUNC_NAME, \
         PARAM_SEQ, \
+	CONST_KW, \
         TYPENAME_KW\
 ) \
         param_type_lists_ ## FUNC_INDEX ; \
         static RET_VAL get_result_of(mpl::int_< FUNC_INDEX >); \
+	typedef RET_VAL (_detail_class::* BOOST_PP_CAT(pointer_to_, FUNC_INDEX))(\
+		BOOST_MIRROR_REG_META_FUNCTION_ENUM_PARAM_TYPES(PARAM_SEQ) \
+	) CONST_KW; \
+	static inline BOOST_PP_CAT(pointer_to_, FUNC_INDEX) \
+	get_address_of(mpl::int_< FUNC_INDEX >) \
+	{return &_detail_class::FUNC_NAME;}\
         BOOST_MIRROR_REG_META_FUNCTION_DEFINE_PARAM_TYPELIST( \
                 FUNC_INDEX, \
                 PARAM_SEQ \
@@ -124,9 +134,14 @@
         RET_VAL, \
         FUNC_NAME, \
         PARAM_SEQ, \
+	CONST_KW, \
         TYPENAME_KW \
-) BOOST_MIRROR_REG_PARAMLESS_MEM_FUNCTION(FUNC_INDEX, RET_VAL, FUNC_NAME)
-
+) BOOST_MIRROR_REG_PARAMLESS_MEM_FUNCTION( \
+	FUNC_INDEX, \
+	RET_VAL, \
+	FUNC_NAME, \
+	CONST_KW \
+)
 /** expands into the member function registering macro
  */
 #define BOOST_MIRROR_REG_CLASS_OR_TEMPL_MEM_FUNCTION_0( \
@@ -134,12 +149,14 @@
         RET_VAL, \
         FUNC_NAME, \
         PARAM_SEQ, \
+	CONST_KW, \
         TYPENAME_KW \
 ) BOOST_MIRROR_DO_REG_CLASS_OR_TEMPL_MEM_FUNCTION( \
         FUNC_INDEX, \
         RET_VAL, \
         FUNC_NAME, \
         PARAM_SEQ, \
+	CONST_KW, \
         TYPENAME_KW \
 )
 
@@ -148,11 +165,12 @@
         RET_VAL, \
         FUNC_NAME, \
         PARAM_SEQ, \
+	CONST_KW, \
         TYPENAME_KW \
 ) BOOST_PP_CAT( \
         BOOST_MIRROR_REG_CLASS_OR_TEMPL_MEM_FUNCTION_, \
         BOOST_MIRROR_IS_VOID_FN_ARG_LIST(PARAM_SEQ) \
-) (FUNC_INDEX, RET_VAL, FUNC_NAME, PARAM_SEQ, TYPENAME_KW)
+) (FUNC_INDEX, RET_VAL, FUNC_NAME, PARAM_SEQ, CONST_KW, TYPENAME_KW)
 
 
 /** Registers a member function of a non-template class
@@ -167,6 +185,23 @@
         RET_VAL, \
         FUNC_NAME, \
         PARAM_SEQ, \
+	BOOST_PP_EMPTY(), \
+	BOOST_PP_EMPTY() \
+)
+
+/** Registers a const member function of a non-template class
+ */
+#define BOOST_MIRROR_REG_CONST_MEM_FUNCTION( \
+	FUNC_INDEX, \
+	RET_VAL, \
+	FUNC_NAME, \
+	PARAM_SEQ \
+) BOOST_MIRROR_REG_CLASS_OR_TEMPL_MEM_FUNCTION( \
+	FUNC_INDEX, \
+	RET_VAL, \
+	FUNC_NAME, \
+	PARAM_SEQ, \
+	const, \
         BOOST_PP_EMPTY() \
 )
 
@@ -182,6 +217,7 @@
         RET_VAL, \
         FUNC_NAME, \
         PARAM_SEQ, \
+	BOOST_PP_EMPTY(), \
         typename \
 )
 
@@ -233,6 +269,15 @@
                         reflected_result<FunctionIndex>, 
                         reflected_type<void>
 		>::type result_type;
+
+		typedef BOOST_TYPEOF_TPL(
+			base_meta_data::get_address_of(FunctionIndex())
+		) pointer;
+
+		static inline pointer address(void)
+		{
+			return base_meta_data::get_address_of(FunctionIndex());
+		}
         };
 };
 
Modified: sandbox/mirror/libs/mirror/example/factories/input_ui.hpp
==============================================================================
--- sandbox/mirror/libs/mirror/example/factories/input_ui.hpp	(original)
+++ sandbox/mirror/libs/mirror/example/factories/input_ui.hpp	2009-05-06 15:26:24 EDT (Wed, 06 May 2009)
@@ -29,16 +29,16 @@
 {
         struct banner
         {
-		template <class Context, class ConstrIndex, class ParamIndex>
-		banner(int tabs, Context* pc, ConstrIndex ci, ParamIndex pi)
+		template <class MetaFunctions, class FuncIndex, class ParamIndex>
+		banner(int tabs, MetaFunctions mf, FuncIndex fi, ParamIndex pi)
                 {
                         ::boost::cts::bcout() << 
                                 ::boost::cts::bstring(tabs, BOOST_CTS_LIT('\t')) << 
-				BOOST_CTS_LIT("Construct ") << 
+				BOOST_CTS_LIT("Get ") << 
                                 BOOST_MIRRORED_TYPE(Product)::full_name() << 
                                 BOOST_CTS_LIT(" ") << 
-				boost::mirror::meta_constructors<Context>::
-				template constructor<ConstrIndex>::params::
+				MetaFunctions::
+				template function<FuncIndex>::params::
                                 template param<ParamIndex>::base_name() <<
                                 ::std::endl;
                 }
@@ -46,9 +46,9 @@
 
         typename ::boost::mirror::make_factory< input_ui, Product >::type f;
 
-	template <class Context, class ConstrIndex, class ParamIndex>
-	input_ui(int tabs, Context* pc, ConstrIndex ci, ParamIndex pi)
-	 : b(tabs, pc, ci, pi)
+	template <class MetaFunctions, class FuncIndex, class ParamIndex>
+	input_ui(int tabs, MetaFunctions mf, FuncIndex fi, ParamIndex pi)
+	 : b(tabs, mf, fi, pi)
          , f(tabs)
         { }
 
@@ -80,23 +80,30 @@
                 }
         };
         
-	template <class Context, class ConstrIndex, class ParamIndex>
-	console_input_ui(int tabs, Context* pc, ConstrIndex ci, ParamIndex pi)
+	template <class MetaFunctions, class FuncIndex, class ParamIndex>
+	console_input_ui(
+		int tabs, 
+		MetaFunctions mf, 
+		FuncIndex fi, 
+		ParamIndex pi
+	)
         {
                         ::boost::cts::bcout() <<
                         ::boost::cts::bstring(tabs, BOOST_CTS_LIT('\t')) << 
                         BOOST_CTS_LIT("Enter ") << 
                         BOOST_MIRRORED_TYPE(Product)::full_name() << 
                         BOOST_CTS_LIT(" ") << 
-			boost::mirror::meta_constructors<Context>::
-			template constructor<ConstrIndex>::params::
+			MetaFunctions::
+			template function<FuncIndex>::params::
                         template param<ParamIndex>::base_name() <<
                         BOOST_CTS_LIT(" for ") <<
-			BOOST_MIRRORED_TYPE(Context)::full_name() <<
+			MetaFunctions::
+			template function<FuncIndex>::result_type::
+			full_name() <<
                         BOOST_CTS_LIT("(");
                         //
-			boost::mirror::meta_constructors<Context>::
-			template constructor<ConstrIndex>::params::
+			MetaFunctions::
+			template function<FuncIndex>::params::
                         for_each(constr_param_name_printer());
                         //
                         ::boost::cts::bcout() <<
@@ -115,9 +122,9 @@
 template <>  \
 struct input_ui< TYPE > : console_input_ui< TYPE > \
 { \
-	template <class Context, class ConstrIndex, class ParamIndex> \
-	input_ui(int tabs, Context* pc, ConstrIndex ci, ParamIndex pi) \
-	 : console_input_ui< TYPE >(tabs, pc, ci, pi) \
+	template <class MetaFunctions, class FuncIndex, class ParamIndex> \
+	input_ui(int tabs, MetaFunctions mf, FuncIndex fi, ParamIndex pi) \
+	 : console_input_ui< TYPE >(tabs, mf, fi, pi) \
         { } \
 }; 
 
@@ -146,8 +153,8 @@
                         names[factory_index]  << ::std::endl;
         }
 
-	template <class Product, class ConstructorIndex>
-	inline int param(Product* pp, ConstructorIndex ci) const 
+	template <class Product, class FunctionIndex>
+	inline int param(Product* pp, FunctionIndex fi) const 
         {
                 return tabs+1;
         }
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-06 15:26:24 EDT (Wed, 06 May 2009)
@@ -138,6 +138,11 @@
                 fn_0::params::param<mpl::int_<3> >::type::base_name() << ")"  <<
                 ::std::endl;
         //
+	if(!persons.empty())
+	{
+		(persons.front().*fn_0::address())("a","b","c","d");
+	}
+	//
         // TODO: 
         //
         //
Modified: sandbox/mirror/libs/mirror/example/factories/person.hpp
==============================================================================
--- sandbox/mirror/libs/mirror/example/factories/person.hpp	(original)
+++ sandbox/mirror/libs/mirror/example/factories/person.hpp	2009-05-06 15:26:24 EDT (Wed, 06 May 2009)
@@ -70,22 +70,22 @@
 )
 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))
+		((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))
         )
 )
 
 BOOST_MIRROR_REG_MEM_FUNCTIONS_BEGIN(::test::person)
 BOOST_MIRROR_REG_MEM_FUNCTION(
         0, void, change_address, 
-	((::boost::cts::bstring)(street))
-	((::boost::cts::bstring)(number))
-	((::boost::cts::bstring)(city))
-	((::boost::cts::bstring)(postal_code))
+	((const ::boost::cts::bstring&)(street))
+	((const ::boost::cts::bstring&)(number))
+	((const ::boost::cts::bstring&)(city))
+	((const ::boost::cts::bstring&)(postal_code))
 )
 BOOST_MIRROR_REG_MEM_FUNCTIONS_END