diff options
| author | neksard <[email protected]> | 2022-02-10 16:45:33 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:45:33 +0300 |
| commit | 1d9c550e7c38e051d7961f576013a482003a70d9 (patch) | |
| tree | b2cc84ee7850122e7ccf51d0ea21e4fa7e7a5685 /contrib/restricted/boost/libs/python/src/wrapper.cpp | |
| parent | 8f7cf138264e0caa318144bf8a2c950e0b0a8593 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'contrib/restricted/boost/libs/python/src/wrapper.cpp')
| -rw-r--r-- | contrib/restricted/boost/libs/python/src/wrapper.cpp | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/contrib/restricted/boost/libs/python/src/wrapper.cpp b/contrib/restricted/boost/libs/python/src/wrapper.cpp index 8923d8128a4..f8feaef9478 100644 --- a/contrib/restricted/boost/libs/python/src/wrapper.cpp +++ b/contrib/restricted/boost/libs/python/src/wrapper.cpp @@ -1,66 +1,66 @@ -// Copyright David Abrahams 2004. 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) - -#include <boost/python/wrapper.hpp> - -namespace boost { namespace python { - -namespace detail -{ - override wrapper_base::get_override( - char const* name - , PyTypeObject* class_object - ) const - { - if (this->m_self) - { - if (handle<> m = handle<>( - python::allow_null( - ::PyObject_GetAttrString( - this->m_self, const_cast<char*>(name)))) - ) - { - PyObject* borrowed_f = 0; - - if ( - PyMethod_Check(m.get()) - && ((PyMethodObject*)m.get())->im_self == this->m_self - && class_object->tp_dict != 0 - ) - { - borrowed_f = ::PyDict_GetItemString( - class_object->tp_dict, const_cast<char*>(name)); - - - } - if (borrowed_f != ((PyMethodObject*)m.get())->im_func) - return override(m); - } - } - return override(handle<>(detail::none())); - } -} - -#if 0 -namespace converter -{ - PyObject* BOOST_PYTHON_DECL do_polymorphic_ref_to_python( - python::detail::wrapper_base const volatile* x, type_info src - ) - { - if (x == 0) - { - ::PyErr_Format( - PyExc_TypeError - , "Attempting to returning pointer or reference to instance of %s\n" - "for which no corresponding Python object exists. Wrap this function" - "with a return return value policy" - ) - } - } - -} -#endif - -}} // namespace boost::python::detail +// Copyright David Abrahams 2004. 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) + +#include <boost/python/wrapper.hpp> + +namespace boost { namespace python { + +namespace detail +{ + override wrapper_base::get_override( + char const* name + , PyTypeObject* class_object + ) const + { + if (this->m_self) + { + if (handle<> m = handle<>( + python::allow_null( + ::PyObject_GetAttrString( + this->m_self, const_cast<char*>(name)))) + ) + { + PyObject* borrowed_f = 0; + + if ( + PyMethod_Check(m.get()) + && ((PyMethodObject*)m.get())->im_self == this->m_self + && class_object->tp_dict != 0 + ) + { + borrowed_f = ::PyDict_GetItemString( + class_object->tp_dict, const_cast<char*>(name)); + + + } + if (borrowed_f != ((PyMethodObject*)m.get())->im_func) + return override(m); + } + } + return override(handle<>(detail::none())); + } +} + +#if 0 +namespace converter +{ + PyObject* BOOST_PYTHON_DECL do_polymorphic_ref_to_python( + python::detail::wrapper_base const volatile* x, type_info src + ) + { + if (x == 0) + { + ::PyErr_Format( + PyExc_TypeError + , "Attempting to returning pointer or reference to instance of %s\n" + "for which no corresponding Python object exists. Wrap this function" + "with a return return value policy" + ) + } + } + +} +#endif + +}} // namespace boost::python::detail |
