/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/obj_mgr_arg_from_python.hpp (3732B)
// 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 OBJ_MGR_ARG_FROM_PYTHON_DWA2002628_HPP # define OBJ_MGR_ARG_FROM_PYTHON_DWA2002628_HPP # include # include # include # include # include # include # include // // arg_from_python converters for Python type wrappers, to be used as // base classes for specializations. // namespace boost { namespace python { namespace converter { template struct object_manager_value_arg_from_python { typedef T result_type; object_manager_value_arg_from_python(PyObject*); bool convertible() const; T operator()() const; private: PyObject* m_source; }; // Used for converting reference-to-object-manager arguments from // python. The process used here is a little bit odd. Upon // construction, we build the object manager object in the m_result // object, *forcing* it to accept the source Python object by casting // its pointer to detail::borrowed_reference. This is supposed to // bypass any type checking of the source object. The convertible // check then extracts the owned object and checks it. If the check // fails, nothing else in the program ever gets to touch this strange // "forced" object. template struct object_manager_ref_arg_from_python { typedef Ref result_type; object_manager_ref_arg_from_python(PyObject*); bool convertible() const; Ref operator()() const; ~object_manager_ref_arg_from_python(); private: typename python::detail::referent_storage::type m_result; }; // // implementations // template inline object_manager_value_arg_from_python::object_manager_value_arg_from_python(PyObject* x) : m_source(x) { } template inline bool object_manager_value_arg_from_python::convertible() const { return object_manager_traits::check(m_source); } template inline T object_manager_value_arg_from_python::operator()() const { return T(python::detail::borrowed_reference(m_source)); } template inline object_manager_ref_arg_from_python::object_manager_ref_arg_from_python(PyObject* x) { # if defined(__EDG_VERSION__) && __EDG_VERSION__ <= 243 // needed for warning suppression python::detail::borrowed_reference x_ = python::detail::borrowed_reference(x); python::detail::construct_referent(&m_result.bytes, x_); # else python::detail::construct_referent(&m_result.bytes, (python::detail::borrowed_reference)x); # endif } template inline object_manager_ref_arg_from_python::~object_manager_ref_arg_from_python() { python::detail::destroy_referent(this->m_result.bytes); } namespace detail { template inline bool object_manager_ref_check(T const& x) { return object_manager_traits::check(get_managed_object(x, tag)); } } template inline bool object_manager_ref_arg_from_python::convertible() const { return detail::object_manager_ref_check( python::detail::void_ptr_to_reference(this->m_result.bytes, (Ref(*)())0)); } template inline Ref object_manager_ref_arg_from_python::operator()() const { return python::detail::void_ptr_to_reference( this->m_result.bytes, (Ref(*)())0); } }}} // namespace boost::python::converter #endif // OBJ_MGR_ARG_FROM_PYTHON_DWA2002628_HPP