diff --git a/include/boost/python/class.hpp b/include/boost/python/class.hpp index 31805a34..ba475595 100644 --- a/include/boost/python/class.hpp +++ b/include/boost/python/class.hpp @@ -27,6 +27,9 @@ # include # include +# include + + # include # include # include @@ -638,6 +641,7 @@ inline void class_::register_() const mpl::bool_() , select_holder() ); + converter::python_class::register_(); } template diff --git a/include/boost/python/detail/signature.hpp b/include/boost/python/detail/signature.hpp index 581ed767..c0a92253 100644 --- a/include/boost/python/detail/signature.hpp +++ b/include/boost/python/detail/signature.hpp @@ -24,8 +24,14 @@ namespace boost { namespace python { namespace detail { struct signature_element { - char const* basename; + char const* basename() const{return tid.name();} + type_info tid; bool lvalue; + signature_element( type_info t, bool l) + : tid(t) + , lvalue(l) + { + } }; template struct signature_arity; @@ -70,14 +76,14 @@ struct signature_arity static signature_element const result[N+2] = { # define BOOST_PP_LOCAL_MACRO(i) \ - { \ - type_id::type>().name() \ + signature_element( \ + type_id::type>() \ , is_reference_to_non_const::type>::value \ - }, + ), # define BOOST_PP_LOCAL_LIMITS (0, N) # include BOOST_PP_LOCAL_ITERATE() - {0,0} + signature_element(type_info(), 0) }; return result; } diff --git a/include/boost/python/object/function.hpp b/include/boost/python/object/function.hpp index 9a3e0818..0d24cdd7 100644 --- a/include/boost/python/object/function.hpp +++ b/include/boost/python/object/function.hpp @@ -39,10 +39,12 @@ struct BOOST_PYTHON_DECL function : PyObject void doc(object const& x); object const& name() const; + object pretty_signature(bool cpp_types = false, size_t n_optional_trailing_args=0)const; private: // helper functions void argument_error(PyObject* args, PyObject* keywords) const; void add_overload(handle const&); + function const * overloads() const ; private: // data members py_function m_fn; @@ -52,6 +54,7 @@ struct BOOST_PYTHON_DECL function : PyObject object m_doc; object m_arg_names; unsigned m_nkeyword_values; + friend class function_signature_generator; }; // @@ -71,7 +74,7 @@ inline object const& function::name() const { return this->m_name; } - + }}} // namespace boost::python::objects #endif // FUNCTION_DWA20011214_HPP diff --git a/include/boost/python/object/make_holder.hpp b/include/boost/python/object/make_holder.hpp index 87feb927..85d54262 100644 --- a/include/boost/python/object/make_holder.hpp +++ b/include/boost/python/object/make_holder.hpp @@ -13,6 +13,9 @@ # include +# include +# include + # include # include @@ -75,7 +78,7 @@ struct make_holder # endif static void execute( - PyObject* p + converter::python_class *p BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(1, N, t, a)) { typedef instance instance_t; diff --git a/include/boost/python/object/select_holder.hpp b/include/boost/python/object/select_holder.hpp index 11a8c09a..42f4e95b 100644 --- a/include/boost/python/object/select_holder.hpp +++ b/include/boost/python/object/select_holder.hpp @@ -16,6 +16,8 @@ # include # include +# include + # include # include @@ -111,7 +113,10 @@ namespace detail typedef Held held_type; - static inline void register_() {} + static inline void register_() + { + converter::detail::strip_type_info::insert(python::type_id(), python::type_id()); + } static type* get() { return 0; } }; @@ -143,6 +148,7 @@ namespace detail static inline void register_() { select_pointer_holder::register_(use_back_ref()); + converter::detail::strip_type_info::insert(python::type_id(), python::type_id()); } static type* get() { return 0; } diff --git a/include/boost/python/register_ptr_to_python.hpp b/include/boost/python/register_ptr_to_python.hpp index cbd42cc1..4d70f619 100644 --- a/include/boost/python/register_ptr_to_python.hpp +++ b/include/boost/python/register_ptr_to_python.hpp @@ -9,6 +9,7 @@ #include #include #include +#include namespace boost { namespace python { @@ -23,6 +24,7 @@ void register_ptr_to_python(BOOST_EXPLICIT_TEMPLATE_TYPE(P)) , objects::pointer_holder > >(); + converter::detail::strip_type_info::insert(type_id(), type_id

()); } }} // namespace boost::python