1
#if !defined(BOOST_PP_IS_ITERATING)
3
// Copyright David Abrahams 2002.
4
// Distributed under the Boost Software License, Version 1.0. (See
5
// accompanying file LICENSE_1_0.txt or copy at
6
// http://www.boost.org/LICENSE_1_0.txt)
8
# ifndef SIGNATURE_DWA20021121_HPP
9
# define SIGNATURE_DWA20021121_HPP
11
# include <boost/python/type_id.hpp>
13
# include <boost/python/detail/preprocessor.hpp>
14
# include <boost/python/detail/indirect_traits.hpp>
15
# include <boost/python/converter/pytype_function.hpp>
17
# include <boost/preprocessor/iterate.hpp>
18
# include <boost/preprocessor/iteration/local.hpp>
20
# include <boost/mpl/at.hpp>
21
# include <boost/mpl/size.hpp>
23
namespace boost { namespace python { namespace detail {
25
struct signature_element
28
converter::pytype_function pytype_f;
32
struct py_func_sig_info
34
signature_element const *signature;
35
signature_element const *ret;
38
template <unsigned> struct signature_arity;
40
# define BOOST_PP_ITERATION_PARAMS_1 \
41
(3, (0, BOOST_PYTHON_MAX_ARITY + 1, <boost/python/detail/signature.hpp>))
42
# include BOOST_PP_ITERATE()
44
// A metafunction returning the base class used for
46
// signature<class F, class CallPolicies, class Sig>.
49
struct signature_base_select
51
enum { arity = mpl::size<Sig>::value - 1 };
52
typedef typename signature_arity<arity>::template impl<Sig> type;
57
: signature_base_select<Sig>::type
61
}}} // namespace boost::python::detail
63
# endif // SIGNATURE_DWA20021121_HPP
67
# define N BOOST_PP_ITERATION()
70
struct signature_arity<N>
75
static signature_element const* elements()
77
static signature_element const result[N+2] = {
79
#ifndef BOOST_PYTHON_NO_PY_SIGNATURES
80
# define BOOST_PP_LOCAL_MACRO(i) \
82
type_id<BOOST_DEDUCED_TYPENAME mpl::at_c<Sig,i>::type>().name() \
83
, &converter::expected_pytype_for_arg<BOOST_DEDUCED_TYPENAME mpl::at_c<Sig,i>::type>::get_pytype \
84
, indirect_traits::is_reference_to_non_const<BOOST_DEDUCED_TYPENAME mpl::at_c<Sig,i>::type>::value \
87
# define BOOST_PP_LOCAL_MACRO(i) \
89
type_id<BOOST_DEDUCED_TYPENAME mpl::at_c<Sig,i>::type>().name() \
91
, indirect_traits::is_reference_to_non_const<BOOST_DEDUCED_TYPENAME mpl::at_c<Sig,i>::type>::value \
95
# define BOOST_PP_LOCAL_LIMITS (0, N)
96
# include BOOST_PP_LOCAL_ITERATE()
104
#endif // BOOST_PP_IS_ITERATING