Warning, file /include/boost/python/call_method.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 # ifndef CALL_METHOD_DWA2002411_HPP
0008 # define CALL_METHOD_DWA2002411_HPP
0009
0010 # include <boost/python/detail/prefix.hpp>
0011
0012 # include <boost/type.hpp>
0013
0014 # include <boost/python/converter/arg_to_python.hpp>
0015 # include <boost/python/converter/return_from_python.hpp>
0016 # include <boost/python/detail/preprocessor.hpp>
0017 # include <boost/python/detail/void_return.hpp>
0018
0019 # include <boost/preprocessor/comma_if.hpp>
0020 # include <boost/preprocessor/iterate.hpp>
0021 # include <boost/preprocessor/repeat.hpp>
0022 # include <boost/preprocessor/debug/line.hpp>
0023 # include <boost/preprocessor/repetition/enum_trailing_params.hpp>
0024 # include <boost/preprocessor/repetition/enum_binary_params.hpp>
0025
0026 namespace boost { namespace python {
0027
0028 # define BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET(z, n, _) \
0029 , converter::arg_to_python<A##n>(a##n).get()
0030
0031 # define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PYTHON_MAX_ARITY, <boost/python/call_method.hpp>))
0032 # include BOOST_PP_ITERATE()
0033
0034 # undef BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET
0035
0036 }}
0037
0038 # endif
0039
0040
0041
0042 #else
0043 #if BOOST_PP_ITERATION_DEPTH() == 1
0044 # if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \
0045 && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201)))
0046 # line BOOST_PP_LINE(__LINE__, call_method.hpp)
0047 # endif
0048
0049 # define N BOOST_PP_ITERATION()
0050
0051 template <
0052 class R
0053 BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class A)
0054 >
0055 typename detail::returnable<R>::type
0056 call_method(PyObject* self, char const* name
0057 BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, A, const& a)
0058 , boost::type<R>* = 0
0059 )
0060 {
0061 PyObject* const result =
0062 PyObject_CallMethod(
0063 self
0064 , const_cast<char*>(name)
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