Chris@16: // Copyright David Abrahams 2002. Chris@16: // Distributed under the Boost Software License, Version 1.0. (See Chris@16: // accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: #ifndef FUNCTION_HANDLE_DWA2002725_HPP Chris@16: # define FUNCTION_HANDLE_DWA2002725_HPP Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: Chris@16: namespace boost { namespace python { namespace objects { Chris@16: Chris@16: BOOST_PYTHON_DECL handle<> function_handle_impl(py_function const& f); Chris@16: Chris@16: // Just like function_object, but returns a handle<> instead. Using Chris@16: // this for arg_to_python<> allows us to break a circular dependency Chris@16: // between object and arg_to_python. Chris@16: template Chris@16: inline handle<> function_handle(F const& f, Signature) Chris@16: { Chris@16: enum { n_arguments = mpl::size::value - 1 }; Chris@16: Chris@16: return objects::function_handle_impl( Chris@16: python::detail::caller< Chris@16: F,default_call_policies,Signature Chris@16: >( Chris@16: f, default_call_policies() Chris@16: ) Chris@16: ); Chris@16: } Chris@16: Chris@16: // Just like make_function, but returns a handle<> intead. Same Chris@16: // reasoning as above. Chris@16: template Chris@16: handle<> make_function_handle(F f) Chris@16: { Chris@16: return objects::function_handle(f, python::detail::get_signature(f)); Chris@16: } Chris@16: Chris@16: }}} // namespace boost::python::objects Chris@16: Chris@16: #endif // FUNCTION_HANDLE_DWA2002725_HPP