1 // Copyright David Abrahams 2002.
2 // Distributed under the Boost Software License, Version 1.0. (See
3 // accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
5 #ifndef BACK_REFERENCE_DWA2002510_HPP
6 # define BACK_REFERENCE_DWA2002510_HPP
8 # include <boost/python/detail/prefix.hpp>
10 # include <boost/python/object_fwd.hpp>
11 # include <boost/python/detail/dependent.hpp>
12 # include <boost/python/detail/raw_pyobject.hpp>
14 namespace boost { namespace python {
20 typedef typename detail::dependent<object,T>::type source_t;
24 back_reference(PyObject*, T);
25 source_t const& source() const;
33 class is_back_reference
36 BOOST_STATIC_CONSTANT(bool, value = false);
40 class is_back_reference<back_reference<T> >
43 BOOST_STATIC_CONSTANT(bool, value = true);
51 back_reference<T>::back_reference(PyObject* p, T x)
52 : m_source(detail::borrowed_reference(p))
58 typename back_reference<T>::source_t const& back_reference<T>::source() const
64 T back_reference<T>::get() const
69 }} // namespace boost::python
71 #endif // BACK_REFERENCE_DWA2002510_HPP