Warning, file /include/boost/python/back_reference.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005 #ifndef BACK_REFERENCE_DWA2002510_HPP
0006 # define BACK_REFERENCE_DWA2002510_HPP
0007
0008 # include <boost/python/detail/prefix.hpp>
0009
0010 # include <boost/python/object_fwd.hpp>
0011 # include <boost/python/detail/dependent.hpp>
0012 # include <boost/python/detail/raw_pyobject.hpp>
0013
0014 namespace boost { namespace python {
0015
0016 template <class T>
0017 struct back_reference
0018 {
0019 private:
0020 typedef typename detail::dependent<object,T>::type source_t;
0021 public:
0022 typedef T type;
0023
0024 back_reference(PyObject*, T);
0025 source_t const& source() const;
0026 T get() const;
0027 private:
0028 source_t m_source;
0029 T m_value;
0030 };
0031
0032 template<typename T>
0033 class is_back_reference
0034 {
0035 public:
0036 BOOST_STATIC_CONSTANT(bool, value = false);
0037 };
0038
0039 template<typename T>
0040 class is_back_reference<back_reference<T> >
0041 {
0042 public:
0043 BOOST_STATIC_CONSTANT(bool, value = true);
0044 };
0045
0046
0047
0048
0049
0050 template <class T>
0051 back_reference<T>::back_reference(PyObject* p, T x)
0052 : m_source(detail::borrowed_reference(p))
0053 , m_value(x)
0054 {
0055 }
0056
0057 template <class T>
0058 typename back_reference<T>::source_t const& back_reference<T>::source() const
0059 {
0060 return m_source;
0061 }
0062
0063 template <class T>
0064 T back_reference<T>::get() const
0065 {
0066 return m_value;
0067 }
0068
0069 }}
0070
0071 #endif