Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52860 - in sandbox/mirror: boost/mirror libs/mirror/example/factories
From: chochlik_at_[hidden]
Date: 2009-05-09 06:34:17


Author: matus.chochlik
Date: 2009-05-09 06:34:16 EDT (Sat, 09 May 2009)
New Revision: 52860
URL: http://svn.boost.org/trac/boost/changeset/52860

Log:
[mirror 0.4.x]
- meta-constructors and meta-member-functions are now parts of
  meta_class
- minor update of the function-caller template

Text files modified:
   sandbox/mirror/boost/mirror/functor_call.hpp | 33 +++++++++++++++++++++++++++++++++
   sandbox/mirror/boost/mirror/meta_class.hpp | 8 ++++++++
   sandbox/mirror/boost/mirror/meta_constructors.hpp | 2 +-
   sandbox/mirror/boost/mirror/meta_data_fwd.hpp | 11 +++++++++--
   sandbox/mirror/boost/mirror/meta_mem_functions.hpp | 2 +-
   sandbox/mirror/libs/mirror/example/factories/inserter.cpp | 4 +---
   6 files changed, 53 insertions(+), 7 deletions(-)

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-09 06:34:16 EDT (Sat, 09 May 2009)
@@ -141,6 +141,11 @@
          : base_class(param)
         { }
 
+ inline result operator()(void)
+ {
+ return base_class::call(meta_function::wrap());
+ }
+
         template <class Class>
         inline result operator()(Class& instance)
         {
@@ -148,6 +153,34 @@
         }
 };
 
+template <
+ template <class> class Manufacturer,
+ class Class,
+ int FuncIndex
+> struct member_function_caller : public functor_caller<
+ Manufacturer,
+ meta_member_functions<Class>,
+ mpl::int_<FuncIndex>
+>
+{
+private:
+ typedef functor_caller<
+ Manufacturer,
+ meta_member_functions<Class>,
+ mpl::int_<FuncIndex>
+ > base_class;
+public:
+ member_function_caller()
+ : base_class(0)
+ { }
+
+ template <class Param>
+ member_function_caller(Param param)
+ : base_class(param)
+ { }
+
+};
+
 } // namespace mirror
 } // namespace boost
 

Modified: sandbox/mirror/boost/mirror/meta_class.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_class.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_class.hpp 2009-05-09 06:34:16 EDT (Sat, 09 May 2009)
@@ -35,6 +35,8 @@
 // reflection of class member attributes
 #include <boost/mirror/meta_attributes.hpp>
 //
+#include <boost/mirror/meta_constructors.hpp>
+#include <boost/mirror/meta_mem_functions.hpp>
 // reflection of destructors
 #include <boost/mirror/meta_destructor.hpp>
 
@@ -79,6 +81,12 @@
         typedef meta_class_all_attributes<Class, VariantTag >
                 all_attributes;
 
+ typedef meta_constructors<Class, VariantTag>
+ constructors;
+
+ typedef meta_member_functions<Class, VariantTag>
+ member_functions;
+
         /** Meta data concerning the destructor of the reflected class
          * EXPERIMENTAL
          */

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-09 06:34:16 EDT (Sat, 09 May 2009)
@@ -203,7 +203,7 @@
 /** Template providing meta-data about the constructors
  * of the Class.
  */
-template <class Class /*, class VariantTag*/ >
+template < class Class, class VariantTag>
 struct meta_constructors : public meta_constructors_base<Class>
 {
         template <class ConstructorIndex>

Modified: sandbox/mirror/boost/mirror/meta_data_fwd.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_data_fwd.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_data_fwd.hpp 2009-05-09 06:34:16 EDT (Sat, 09 May 2009)
@@ -150,8 +150,15 @@
 
 /** This is a forward declaration of the meta_constructors template
  */
-template <class Class /*, class VariantTag*/ >
-struct meta_constructors;
+template <
+ class Class,
+ class VariantTag = detail::default_meta_class_variant
+> struct meta_constructors;
+
+template <
+ class Class ,
+ class VariantTag = detail::default_meta_class_variant
+> struct meta_member_functions;
 
 #define BOOST_MIRRORED_CONSTRUCTORS(TYPE)\
         meta_constructors< TYPE >

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-09 06:34:16 EDT (Sat, 09 May 2009)
@@ -261,7 +261,7 @@
 /** Template providing meta-data about the member functions
  * (methods) of the Class.
  */
-template <class Class /*, class VariantTag*/ >
+template < class Class, class VariantTag>
 struct meta_member_functions : public meta_mem_functions_base<Class>
 {
 private:

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-09 06:34:16 EDT (Sat, 09 May 2009)
@@ -77,8 +77,6 @@
         // a list of persons
         ::std::list< person > persons;
         //
- typedef meta_member_functions<person> mem_fns;
- //
         const cts::bchar yes = BOOST_CTS_LIT('y');
         const cts::bchar no = BOOST_CTS_LIT('n');
         cts::bchar insert_more = yes;
@@ -98,7 +96,7 @@
                 } while(change_address != yes && change_address != no);
                 if(change_address == yes)
                 {
- functor_caller<input_ui, mem_fns, mpl::int_<0> > func(0);
+ member_function_caller<input_ui, person, 0> func;
                         func(persons.back());
                 }
                 // check whether to insert more persons


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