|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r52723 - in sandbox/mirror: boost/mirror boost/mirror/factory/wx_constructor_gui libs/mirror/example/factories
From: chochlik_at_[hidden]
Date: 2009-05-02 06:39:48
Author: matus.chochlik
Date: 2009-05-02 06:39:47 EDT (Sat, 02 May 2009)
New Revision: 52723
URL: http://svn.boost.org/trac/boost/changeset/52723
Log:
[mirror 0.4.x]
- change in the interface of meta-constructors
- update of the examples to use this change
Text files modified:
sandbox/mirror/boost/mirror/factory/wx_constructor_gui/default.hpp | 6 +-
sandbox/mirror/boost/mirror/factory/wx_constructor_gui/manager.hpp | 6 ++-
sandbox/mirror/boost/mirror/factory/wx_constructor_gui/utils.hpp | 6 +-
sandbox/mirror/boost/mirror/meta_constructors.hpp | 66 +++++++++++++++------------------------
sandbox/mirror/boost/mirror/meta_mem_functions.hpp | 6 +-
sandbox/mirror/libs/mirror/example/factories/input_ui.hpp | 24 +++++++-------
sandbox/mirror/libs/mirror/example/factories/inserter.cpp | 7 +++
sandbox/mirror/libs/mirror/example/factories/person.hpp | 2
8 files changed, 57 insertions(+), 66 deletions(-)
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-02 06:39:47 EDT (Sat, 02 May 2009)
@@ -37,9 +37,9 @@
assert(parent_data != 0);
// make a label for the static box sizer
wxString label(
- BOOST_MIRRORED_CONSTRUCTORS(
- Context
- )::base_param_name(ci, pi)
+ BOOST_MIRRORED_CONSTRUCTORS(Context)::
+ template constructor<ConstrIndex>::params::
+ template param<ParamIndex>::base_name()
);
// the panel which will be the parent of
// all child widgets
Modified: sandbox/mirror/boost/mirror/factory/wx_constructor_gui/manager.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/factory/wx_constructor_gui/manager.hpp (original)
+++ sandbox/mirror/boost/mirror/factory/wx_constructor_gui/manager.hpp 2009-05-02 06:39:47 EDT (Sat, 02 May 2009)
@@ -104,12 +104,14 @@
else str_ref.append(wxT(", "));
// append the type name
str_ref.append(
- Parameters::param<ParamIndex>::type::base_name()
+ Parameters::template param<ParamIndex>::
+ type::base_name()
);
// append the space
str_ref.append(wxT(" "));
str_ref.append(
- Parameters::base_param_name(pi)
+ Parameters::template param<ParamIndex>::
+ base_name()
);
}
};
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-02 06:39:47 EDT (Sat, 02 May 2009)
@@ -34,9 +34,9 @@
assert(parent_data != 0);
// make a label for the static box sizer
wxString label(
- BOOST_MIRRORED_CONSTRUCTORS(
- Context
- )::base_param_name(ci, pi)
+ BOOST_MIRRORED_CONSTRUCTORS(Context)::
+ template constructor<ConstrIndex>::params::
+ template param<ParamIndex>::base_name()
);
// the panel which will be the parent of
// the child widgets
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-02 06:39:47 EDT (Sat, 02 May 2009)
@@ -106,19 +106,6 @@
*/
#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 \
- ); \
- } \
};
@@ -350,40 +337,37 @@
public:
typedef BOOST_MIRRORED_TYPE(param_type)
type;
+
+ template <class CharT>
+ inline static const ::std::basic_string<CharT>&
+ get_name(
+ mpl::false_ full_or_base,
+ const ::std::char_traits<CharT>& traits
+ )
+ {
+ return meta_constructors::get_param_name(
+ full_or_base,
+ traits,
+ ConstructorIndex(),
+ ParamIndex()
+ );
+ }
+
+ inline static const cts::bstring& base_name(void)
+ {
+ return meta_constructors::get_param_name(
+ mpl::false_(),
+ cts::bchar_traits(),
+ ConstructorIndex(),
+ ParamIndex()
+ );
+ }
};
typedef mpl::int_<
mpl::size< type_list>::value
> size;
- 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_constructors::get_param_name(
- full_or_base,
- traits,
- ConstructorIndex(),
- ParamIndex()
- );
- }
-
- template <class ParamIndex>
- inline static const cts::bstring& base_param_name(
- ParamIndex
- )
- {
- return meta_constructors::base_param_name(
- ConstructorIndex(),
- ParamIndex()
- );
- }
-
-
template <class Functor>
static void for_each(Functor f)
{
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-02 06:39:47 EDT (Sat, 02 May 2009)
@@ -264,7 +264,7 @@
{
typedef meta_mem_functions_base<Class> base_class;
template <class FunctionIndex>
- struct member_function
+ struct function
{
// returns the name of the member function
template <bool FullOrBase, class CharT>
@@ -274,7 +274,7 @@
const ::std::char_traits<CharT>& traits
)
{
- return meta_member_functions::get_name(
+ return meta_member_functions::get_function_name(
full_or_base,
traits,
FunctionIndex()
@@ -285,7 +285,7 @@
inline static const cts::bstring&
base_name(void)
{
- return meta_member_functions::get_name(
+ return meta_member_functions::get_function_name(
mpl::false_(),
cts::bchar_traits(),
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-02 06:39:47 EDT (Sat, 02 May 2009)
@@ -37,9 +37,9 @@
BOOST_CTS_LIT("Construct ") <<
BOOST_MIRRORED_TYPE(Product)::full_name() <<
BOOST_CTS_LIT(" ") <<
- boost::mirror::meta_constructors<
- Context
- >::base_param_name(ci, pi) <<
+ boost::mirror::meta_constructors<Context>::
+ template constructor<ConstrIndex>::params::
+ template param<ParamIndex>::base_name() <<
::std::endl;
}
} b;
@@ -74,7 +74,9 @@
{
if(ParamIndex::value > 0)
boost::cts::bcout() << BOOST_CTS_LIT(", ");
- ::boost::cts::bcout() << MetaParams::base_param_name(pi);
+ ::boost::cts::bcout() <<
+ MetaParams::
+ template param<ParamIndex>::base_name();
}
};
@@ -86,18 +88,16 @@
BOOST_CTS_LIT("Enter ") <<
BOOST_MIRRORED_TYPE(Product)::full_name() <<
BOOST_CTS_LIT(" ") <<
- boost::mirror::meta_constructors<
- Context
- >::base_param_name(ci, pi) <<
+ boost::mirror::meta_constructors<Context>::
+ template constructor<ConstrIndex>::params::
+ template param<ParamIndex>::base_name() <<
BOOST_CTS_LIT(" for ") <<
BOOST_MIRRORED_TYPE(Context)::full_name() <<
BOOST_CTS_LIT("(");
//
- boost::mirror::meta_constructors<
- Context
- >::template constructor<
- ConstrIndex
- >::params::for_each(constr_param_name_printer());
+ boost::mirror::meta_constructors<Context>::
+ template constructor<ConstrIndex>::params::
+ for_each(constr_param_name_printer());
//
::boost::cts::bcout() <<
BOOST_CTS_LIT(") = ") <<
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-02 06:39:47 EDT (Sat, 02 May 2009)
@@ -125,11 +125,16 @@
} while(insert_more != yes && insert_more != no);
}
//
+ // TODO: remove this
+ //
typedef meta_member_functions<person> mem_fns;
cts::bcout() <<
- mem_fns::member_function<mpl::int_<0> >::base_name() <<
+ mem_fns::function<mpl::int_<0> >::base_name() <<
::std::endl;
//
+ // TODO:
+ //
+ //
// print out all the persons in the list
cts::bcout() << "Persons:" << ::std::endl;
::std::for_each(
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-02 06:39:47 EDT (Sat, 02 May 2009)
@@ -82,7 +82,7 @@
#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( \
+ get_function_name( \
mpl::false_, \
const ::std::char_traits< CHAR_T >, \
mpl::int_<0> \
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