Warning, file /include/boost/python/call.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 #if !defined(BOOST_PP_IS_ITERATING)
0002
0003
0004
0005
0006
0007
0008 # ifndef CALL_DWA2002411_HPP
0009 # define CALL_DWA2002411_HPP
0010
0011 # include <boost/python/detail/prefix.hpp>
0012
0013 # include <boost/type.hpp>
0014
0015 # include <boost/python/converter/arg_to_python.hpp>
0016 # include <boost/python/converter/return_from_python.hpp>
0017 # include <boost/python/detail/preprocessor.hpp>
0018 # include <boost/python/detail/void_return.hpp>
0019
0020 # include <boost/preprocessor/comma_if.hpp>
0021 # include <boost/preprocessor/iterate.hpp>
0022 # include <boost/preprocessor/repeat.hpp>
0023 # include <boost/preprocessor/debug/line.hpp>
0024 # include <boost/preprocessor/repetition/enum_trailing_params.hpp>
0025 # include <boost/preprocessor/repetition/enum_binary_params.hpp>
0026
0027 namespace boost { namespace python {
0028
0029 # define BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET(z, n, _) \
0030 , converter::arg_to_python<A##n>(a##n).get()
0031
0032 # define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PYTHON_MAX_ARITY, <boost/python/call.hpp>))
0033 # include BOOST_PP_ITERATE()
0034
0035 # undef BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET
0036
0037 }}
0038
0039 # endif
0040
0041
0042
0043 #else
0044 #if BOOST_PP_ITERATION_DEPTH() == 1
0045 # if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \
0046 && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201)))
0047 # line BOOST_PP_LINE(__LINE__, call.hpp)
0048 # endif
0049
0050 # define N BOOST_PP_ITERATION()
0051
0052 template <
0053 class R
0054 BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class A)
0055 >
0056 typename detail::returnable<R>::type
0057 call(PyObject* callable
0058 BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, A, const& a)
0059 , boost::type<R>* = 0
0060 )
0061 {
0062 PyObject* const result =
0063 PyObject_CallFunction(
0064 callable
0065 , const_cast<char*>("(" BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_FIXED, "O") ")")
0066 BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET, nil)
0067 );
0068
0069
0070
0071
0072
0073
0074
0075
0076 converter::return_from_python<R> converter;
0077 return converter(result);
0078 }
0079
0080 # undef N
0081
0082 #endif
0083 #endif