|
9 | 9 | # include <boost/python/class_fwd.hpp> |
10 | 10 | # include <boost/python/bases.hpp> |
11 | 11 | # include <boost/python/args.hpp> |
12 | | -# include <boost/python/reference.hpp> |
| 12 | +# include <boost/python/handle.hpp> |
13 | 13 | # include <boost/python/object/class.hpp> |
14 | 14 | # include <boost/python/type_id.hpp> |
15 | 15 | # include <boost/python/detail/wrap_function.hpp> |
@@ -46,14 +46,14 @@ namespace detail |
46 | 46 | // to the type of holder that must be created. The 3rd argument is a |
47 | 47 | // reference to the Python type object to be created. |
48 | 48 | template <class T, class Holder> |
49 | | - static inline void register_copy_constructor(mpl::bool_t<true> const&, Holder*, ref const& obj, T* = 0) |
| 49 | + static inline void register_copy_constructor(mpl::bool_t<true> const&, Holder*, handle<> const& obj, T* = 0) |
50 | 50 | { |
51 | 51 | objects::class_wrapper<T,Holder> x(obj); |
52 | 52 | } |
53 | 53 |
|
54 | 54 | // Tag dispatched to have no effect. |
55 | 55 | template <class T, class Holder> |
56 | | - static inline void register_copy_constructor(mpl::bool_t<false> const&, Holder*, ref const&, T* = 0) |
| 56 | + static inline void register_copy_constructor(mpl::bool_t<false> const&, Holder*, handle<> const&, T* = 0) |
57 | 57 | { |
58 | 58 | } |
59 | 59 | } |
@@ -104,7 +104,7 @@ class class_ : public objects::class_base |
104 | 104 | // appropriate. |
105 | 105 | objects::function::add_to_namespace( |
106 | 106 | this->object(), name, |
107 | | - ref(detail::wrap_function( |
| 107 | + handle<>(detail::wrap_function( |
108 | 108 | // This bit of nastiness casts F to a member function of T if possible. |
109 | 109 | detail::member_function_cast<T,F>::stage1(f).stage2((T*)0).stage3(f) |
110 | 110 | ))); |
@@ -132,7 +132,7 @@ class class_ : public objects::class_base |
132 | 132 | // appropriate. |
133 | 133 | objects::function::add_to_namespace( |
134 | 134 | this->object(), op.name(), |
135 | | - ref(detail::wrap_function(&op_t::template apply<T>::execute))); |
| 135 | + handle<>(detail::wrap_function(&op_t::template apply<T>::execute))); |
136 | 136 | return *this; |
137 | 137 | } |
138 | 138 |
|
@@ -176,24 +176,24 @@ class class_ : public objects::class_base |
176 | 176 | template <class D> |
177 | 177 | self& def_readonly(char const* name, D T::*pm) |
178 | 178 | { |
179 | | - ref fget(make_getter(pm)); |
| 179 | + handle<> fget(make_getter(pm)); |
180 | 180 | this->add_property(name, fget); |
181 | 181 | return *this; |
182 | 182 | } |
183 | 183 |
|
184 | 184 | template <class D> |
185 | 185 | self& def_readwrite(char const* name, D T::*pm) |
186 | 186 | { |
187 | | - ref fget(make_getter(pm)); |
188 | | - ref fset(make_setter(pm)); |
| 187 | + handle<> fget(make_getter(pm)); |
| 188 | + handle<> fset(make_setter(pm)); |
189 | 189 | return this->add_property(name, fget, fset); |
190 | 190 | } |
191 | 191 |
|
192 | 192 | // Property creation |
193 | | - self& add_property(char const* name, ref const& fget); |
194 | | - self& add_property(char const* name, ref const& fget, ref const& fset); |
| 193 | + self& add_property(char const* name, handle<> const& fget); |
| 194 | + self& add_property(char const* name, handle<> const& fget, handle<> const& fset); |
195 | 195 |
|
196 | | - self& setattr(char const* name, ref const&); |
| 196 | + self& setattr(char const* name, handle<> const&); |
197 | 197 |
|
198 | 198 | private: // types |
199 | 199 | typedef objects::class_id class_id; |
@@ -258,21 +258,21 @@ inline class_<T,X1,X2,X3>::class_(char const* name) |
258 | 258 |
|
259 | 259 |
|
260 | 260 | template <class T, class X1, class X2, class X3> |
261 | | -inline class_<T,X1,X2,X3>& class_<T,X1,X2,X3>::add_property(char const* name, ref const& fget) |
| 261 | +inline class_<T,X1,X2,X3>& class_<T,X1,X2,X3>::add_property(char const* name, handle<> const& fget) |
262 | 262 | { |
263 | 263 | base::add_property(name, fget); |
264 | 264 | return *this; |
265 | 265 | } |
266 | 266 |
|
267 | 267 | template <class T, class X1, class X2, class X3> |
268 | | -inline class_<T,X1,X2,X3>& class_<T,X1,X2,X3>::add_property(char const* name, ref const& fget, ref const& fset) |
| 268 | +inline class_<T,X1,X2,X3>& class_<T,X1,X2,X3>::add_property(char const* name, handle<> const& fget, handle<> const& fset) |
269 | 269 | { |
270 | 270 | base::add_property(name, fget, fset); |
271 | 271 | return *this; |
272 | 272 | } |
273 | 273 |
|
274 | 274 | template <class T, class X1, class X2, class X3> |
275 | | -inline class_<T,X1,X2,X3>& class_<T,X1,X2,X3>::setattr(char const* name, ref const& x) |
| 275 | +inline class_<T,X1,X2,X3>& class_<T,X1,X2,X3>::setattr(char const* name, handle<> const& x) |
276 | 276 | { |
277 | 277 | base::setattr(name, x); |
278 | 278 | return *this; |
|
0 commit comments