Warning, file /include/boost/python/converter/object_manager.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 OBJECT_MANAGER_DWA2002614_HPP
0006 # define OBJECT_MANAGER_DWA2002614_HPP
0007
0008 # include <boost/python/handle.hpp>
0009 # include <boost/python/cast.hpp>
0010 # include <boost/python/converter/pyobject_traits.hpp>
0011 # include <boost/python/detail/type_traits.hpp>
0012 # include <boost/mpl/if.hpp>
0013 # include <boost/python/detail/indirect_traits.hpp>
0014 # include <boost/mpl/bool.hpp>
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065 namespace boost { namespace python
0066 {
0067 namespace api
0068 {
0069 class object;
0070 }
0071 }}
0072
0073 namespace boost { namespace python { namespace converter {
0074
0075
0076
0077 template <class T>
0078 struct handle_object_manager_traits
0079 : pyobject_traits<typename T::element_type>
0080 {
0081 private:
0082 typedef pyobject_traits<typename T::element_type> base;
0083
0084 public:
0085 BOOST_STATIC_CONSTANT(bool, is_specialized = true);
0086
0087
0088
0089 static null_ok<typename T::element_type>* adopt(PyObject* p)
0090 {
0091 return python::allow_null(base::checked_downcast(p));
0092 }
0093 };
0094
0095 template <class T>
0096 struct default_object_manager_traits
0097 {
0098 BOOST_STATIC_CONSTANT(
0099 bool, is_specialized = python::detail::is_borrowed_ptr<T>::value
0100 );
0101 };
0102
0103 template <class T>
0104 struct object_manager_traits
0105 : mpl::if_c<
0106 is_handle<T>::value
0107 , handle_object_manager_traits<T>
0108 , default_object_manager_traits<T>
0109 >::type
0110 {
0111 };
0112
0113
0114
0115
0116
0117
0118 template <class T>
0119 struct is_object_manager
0120 : mpl::bool_<object_manager_traits<T>::is_specialized>
0121 {
0122 };
0123
0124 template <class T>
0125 struct is_reference_to_object_manager
0126 : mpl::false_
0127 {
0128 };
0129
0130 template <class T>
0131 struct is_reference_to_object_manager<T&>
0132 : is_object_manager<T>
0133 {
0134 };
0135
0136 template <class T>
0137 struct is_reference_to_object_manager<T const&>
0138 : is_object_manager<T>
0139 {
0140 };
0141
0142 template <class T>
0143 struct is_reference_to_object_manager<T volatile&>
0144 : is_object_manager<T>
0145 {
0146 };
0147
0148 template <class T>
0149 struct is_reference_to_object_manager<T const volatile&>
0150 : is_object_manager<T>
0151 {
0152 };
0153
0154 }}}
0155
0156 #endif