function_object.hpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright David Abrahams 2002.
  2. // Distributed under the Boost Software License, Version 1.0. (See
  3. // accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef FUNCTION_OBJECT_DWA2002725_HPP
  6. # define FUNCTION_OBJECT_DWA2002725_HPP
  7. # include <boost/python/detail/prefix.hpp>
  8. # include <boost/function/function2.hpp>
  9. # include <boost/python/object_core.hpp>
  10. # include <boost/python/args_fwd.hpp>
  11. # include <boost/python/object/py_function.hpp>
  12. namespace boost { namespace python {
  13. namespace objects
  14. {
  15. BOOST_PYTHON_DECL api::object function_object(
  16. py_function const& f
  17. , python::detail::keyword_range const&);
  18. BOOST_PYTHON_DECL api::object function_object(
  19. py_function const& f
  20. , python::detail::keyword_range const&);
  21. BOOST_PYTHON_DECL api::object function_object(py_function const& f);
  22. // Add an attribute to the name_space with the given name. If it is
  23. // a Boost.Python function object
  24. // (boost/python/object/function.hpp), and an existing function is
  25. // already there, add it as an overload.
  26. BOOST_PYTHON_DECL void add_to_namespace(
  27. object const& name_space, char const* name, object const& attribute);
  28. BOOST_PYTHON_DECL void add_to_namespace(
  29. object const& name_space, char const* name, object const& attribute, char const* doc);
  30. }
  31. }} // namespace boost::python::objects
  32. #endif // FUNCTION_OBJECT_DWA2002725_HPP