1 // Copyright Daniel Wallin 2005. Use, modification and distribution is
2 // subject to the Boost Software License, Version 1.0. (See accompanying
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 #ifndef BOOST_PARAMETER_INVOKER_051210_HPP
6 # define BOOST_PARAMETER_INVOKER_051210_HPP
8 # include <boost/mpl/begin.hpp>
9 # include <boost/mpl/next.hpp>
10 # include <boost/mpl/deref.hpp>
11 # include <boost/mpl/size.hpp>
12 # include <boost/parameter/keyword.hpp>
13 # include <boost/preprocessor/iteration/iterate.hpp>
15 namespace boost { namespace parameter { namespace python { namespace aux {
17 template <long Arity, class M, class R, class Args>
20 template <class M, class R>
27 mpl::size<Args>::value, M, R, Args
32 template <long Arity, class M, class R, class T, class Args>
33 struct member_invoker;
35 template <class M, class R, class T>
36 struct make_member_invoker
41 typedef member_invoker<
42 mpl::size<Args>::value, M, R, T, Args
47 template <long Arity, class T, class R, class Args>
50 template <class T, class R>
51 struct make_call_invoker
57 mpl::size<Args>::value, T, R, Args
62 template <long Arity, class T, class Args>
66 struct make_init_invoker
72 mpl::size<Args>::value, T, Args
77 template <class M, class R, class Args>
78 struct invoker<0, M, R, Args>
82 return M()(boost::type<R>());
86 template <class M, class R, class T, class Args>
87 struct member_invoker<0, M, R, T, Args>
89 static R execute(T& self)
91 return M()(boost::type<R>(), self);
95 template <class T, class R, class Args>
96 struct call_invoker<0, T, R, Args>
98 static R execute(T& self)
104 template <class T, class Args>
105 struct init_invoker<0, T, Args>
107 static T* execute(T& self)
113 # define BOOST_PP_ITERATION_PARAMS_1 (4, \
114 (1, BOOST_PARAMETER_MAX_ARITY, <boost/parameter/aux_/python/invoker_iterate.hpp>, 1))
115 # include BOOST_PP_ITERATE()
117 # define BOOST_PP_ITERATION_PARAMS_1 (4, \
118 (1, BOOST_PARAMETER_MAX_ARITY, <boost/parameter/aux_/python/invoker_iterate.hpp>, 2))
119 # include BOOST_PP_ITERATE()
121 # define BOOST_PP_ITERATION_PARAMS_1 (4, \
122 (1, BOOST_PARAMETER_MAX_ARITY, <boost/parameter/aux_/python/invoker_iterate.hpp>, 3))
123 # include BOOST_PP_ITERATE()
125 # define BOOST_PP_ITERATION_PARAMS_1 (4, \
126 (1, BOOST_PARAMETER_MAX_ARITY, <boost/parameter/aux_/python/invoker_iterate.hpp>, 4))
127 # include BOOST_PP_ITERATE()
129 }}}} // namespace boost::parameter::python::aux
131 #endif // BOOST_PARAMETER_INVOKER_051210_HPP