![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /proc/thread-self/root/usr/include/boost/python/ |
Upload File : |
// Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef DEFAULT_CALL_POLICIES_DWA2002131_HPP # define DEFAULT_CALL_POLICIES_DWA2002131_HPP # include <boost/python/detail/prefix.hpp> # include <boost/mpl/if.hpp> # include <boost/python/to_python_value.hpp> # include <boost/python/detail/type_traits.hpp> # include <boost/python/detail/value_arg.hpp> # include <boost/mpl/or.hpp> # include <boost/mpl/front.hpp> namespace boost { namespace python { template <class T> struct to_python_value; namespace detail { // for "readable" error messages template <class T> struct specify_a_return_value_policy_to_wrap_functions_returning # if defined(__GNUC__) || defined(__EDG__) {} # endif ; } struct default_result_converter; struct default_call_policies { // Ownership of this argument tuple will ultimately be adopted by // the caller. template <class ArgumentPackage> static bool precall(ArgumentPackage const&) { return true; } // Pass the result through template <class ArgumentPackage> static PyObject* postcall(ArgumentPackage const&, PyObject* result) { return result; } typedef default_result_converter result_converter; typedef PyObject* argument_package; template <class Sig> struct extract_return_type : mpl::front<Sig> { }; }; struct default_result_converter { template <class R> struct apply { typedef typename mpl::if_< mpl::or_<detail::is_pointer<R>, detail::is_reference<R> > , detail::specify_a_return_value_policy_to_wrap_functions_returning<R> , boost::python::to_python_value< typename detail::value_arg<R>::type > >::type type; }; }; // Exceptions for c strings an PyObject*s template <> struct default_result_converter::apply<char const*> { typedef boost::python::to_python_value<char const*const&> type; }; template <> struct default_result_converter::apply<PyObject*> { typedef boost::python::to_python_value<PyObject*const&> type; }; }} // namespace boost::python #endif // DEFAULT_CALL_POLICIES_DWA2002131_HPP