// 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 PYTYPE_OBJECT_MANAGER_TRAITS_DWA2002716_HPP # define PYTYPE_OBJECT_MANAGER_TRAITS_DWA2002716_HPP # include # include # include # include # include namespace boost { namespace python { namespace converter { // Provide a forward declaration as a convenience for clients, who all // need it. template struct object_manager_traits; // Derive specializations of object_manager_traits from this class // when T is an object manager for a particular Python type hierarchy. // template struct pytype_object_manager_traits : pyobject_type // provides check() { BOOST_STATIC_CONSTANT(bool, is_specialized = true); static inline python::detail::new_reference adopt(PyObject*); }; // // implementations // template inline python::detail::new_reference pytype_object_manager_traits::adopt(PyObject* x) { return python::detail::new_reference(python::pytype_check(pytype, x)); } }}} // namespace boost::python::converter #endif // PYTYPE_OBJECT_MANAGER_TRAITS_DWA2002716_HPP