/usr/include/boost/python/converter
NameSizeModeActions
arg_from_python.hpp92030644editdlrm
arg_to_python.hpp73970644editdlrm
arg_to_python_base.hpp6480644editdlrm
as_to_python_function.hpp21670644editdlrm
builtin_converters.hpp88010644editdlrm
constructor_function.hpp6590644editdlrm
context_result_converter.hpp6230644editdlrm
convertible_function.hpp4820644editdlrm
from_python.hpp15050644editdlrm
implicit.hpp15260644editdlrm
object_manager.hpp43490644editdlrm
obj_mgr_arg_from_python.hpp37320644editdlrm
pointer_type_id.hpp16670644editdlrm
pyobject_traits.hpp14330644editdlrm
pyobject_type.hpp11580644editdlrm
pytype_function.hpp32490644editdlrm
pytype_object_mgr_traits.hpp14420644editdlrm
registered.hpp29640644editdlrm
registered_pointee.hpp9380644editdlrm
registrations.hpp30140644editdlrm
registry.hpp20150644editdlrm
return_from_python.hpp42700644editdlrm
rvalue_from_python_data.hpp59430644editdlrm
shared_ptr_deleter.hpp6050644editdlrm
shared_ptr_from_python.hpp19350644editdlrm
shared_ptr_to_python.hpp13530644editdlrm
to_python_function_type.hpp7640644editdlrm
Edit: /usr/include/boost/python/converter/arg_to_python.hpp (7397B)
// 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 ARG_TO_PYTHON_DWA200265_HPP # define ARG_TO_PYTHON_DWA200265_HPP # include # include # include # include # include # include # include // Bring in specializations # include # include # include # include # include # include # include # include # include namespace boost { namespace python { namespace converter { template struct is_object_manager; namespace detail { template struct function_arg_to_python : handle<> { function_arg_to_python(T const& x); }; template struct reference_arg_to_python : handle<> { reference_arg_to_python(T& x); private: static PyObject* get_object(T& x); }; template struct shared_ptr_arg_to_python : handle<> { shared_ptr_arg_to_python(T const& x); private: static PyObject* get_object(T& x); }; template struct value_arg_to_python : arg_to_python_base { // Throw an exception if the conversion can't succeed value_arg_to_python(T const&); }; template struct pointer_deep_arg_to_python : arg_to_python_base { // Throw an exception if the conversion can't succeed pointer_deep_arg_to_python(Ptr); }; template struct pointer_shallow_arg_to_python : handle<> { // Throw an exception if the conversion can't succeed pointer_shallow_arg_to_python(Ptr); private: static PyObject* get_object(Ptr p); }; // Convert types that manage a Python object to_python template struct object_manager_arg_to_python { object_manager_arg_to_python(T const& x) : m_src(x) {} PyObject* get() const { return python::upcast(get_managed_object(m_src, tag)); } private: T const& m_src; }; template struct select_arg_to_python { typedef typename unwrap_reference::type unwrapped_referent; typedef typename unwrap_pointer::type unwrapped_ptr; typedef typename mpl::if_< // Special handling for char const[N]; interpret them as char // const* for the sake of conversion python::detail::is_string_literal , arg_to_python , typename mpl::if_< python::detail::value_is_shared_ptr , shared_ptr_arg_to_python , typename mpl::if_< mpl::or_< boost::python::detail::is_function , indirect_traits::is_pointer_to_function , boost::python::detail::is_member_function_pointer > , function_arg_to_python , typename mpl::if_< is_object_manager , object_manager_arg_to_python , typename mpl::if_< boost::python::detail::is_pointer , pointer_deep_arg_to_python , typename mpl::if_< is_pointer_wrapper , pointer_shallow_arg_to_python , typename mpl::if_< is_reference_wrapper , reference_arg_to_python , value_arg_to_python >::type >::type >::type >::type >::type >::type >::type type; }; } template struct arg_to_python : detail::select_arg_to_python::type { typedef typename detail::select_arg_to_python::type base; public: // member functions // Throw an exception if the conversion can't succeed arg_to_python(T const& x); }; // // implementations // namespace detail { // reject_raw_object_ptr -- cause a compile-time error if the user // should pass a raw Python object pointer using python::detail::yes_convertible; using python::detail::no_convertible; using python::detail::unspecialized; template struct cannot_convert_raw_PyObject; template struct reject_raw_object_helper { static void error(Convertibility) { cannot_convert_raw_PyObject::to_python_use_handle_instead(); } static void error(...) {} }; template inline void reject_raw_object_ptr(T*) { reject_raw_object_helper::error( python::detail::convertible::check((T*)0)); typedef typename remove_cv::type value_type; reject_raw_object_helper::error( python::detail::convertible::check( (base_type_traits*)0 )); } // --------- template inline function_arg_to_python::function_arg_to_python(T const& x) : handle<>(python::objects::make_function_handle(x)) { } template inline value_arg_to_python::value_arg_to_python(T const& x) : arg_to_python_base(&x, registered::converters) { } template inline pointer_deep_arg_to_python::pointer_deep_arg_to_python(Ptr x) : arg_to_python_base(x, registered_pointee::converters) { detail::reject_raw_object_ptr((Ptr)0); } template inline PyObject* reference_arg_to_python::get_object(T& x) { to_python_indirect convert; return convert(x); } template inline reference_arg_to_python::reference_arg_to_python(T& x) : handle<>(reference_arg_to_python::get_object(x)) { } template inline shared_ptr_arg_to_python::shared_ptr_arg_to_python(T const& x) : handle<>(shared_ptr_to_python(x)) { } template inline pointer_shallow_arg_to_python::pointer_shallow_arg_to_python(Ptr x) : handle<>(pointer_shallow_arg_to_python::get_object(x)) { detail::reject_raw_object_ptr((Ptr)0); } template inline PyObject* pointer_shallow_arg_to_python::get_object(Ptr x) { to_python_indirect convert; return convert(x); } } template inline arg_to_python::arg_to_python(T const& x) : base(x) {} }}} // namespace boost::python::converter #endif // ARG_TO_PYTHON_DWA200265_HPP