Rev | Line | |
---|
[857] | 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 REGISTER_PTR_TO_PYTHON_HPP
|
---|
| 6 | #define REGISTER_PTR_TO_PYTHON_HPP
|
---|
| 7 |
|
---|
| 8 | #include <boost/python/pointee.hpp>
|
---|
| 9 | #include <boost/python/object.hpp>
|
---|
| 10 | #include <boost/python/object/class_wrapper.hpp>
|
---|
| 11 |
|
---|
| 12 | namespace boost { namespace python {
|
---|
| 13 |
|
---|
| 14 | template <class P>
|
---|
| 15 | void register_ptr_to_python(BOOST_EXPLICIT_TEMPLATE_TYPE(P))
|
---|
| 16 | {
|
---|
| 17 | typedef typename boost::python::pointee<P>::type X;
|
---|
| 18 | objects::class_value_wrapper<
|
---|
| 19 | P
|
---|
| 20 | , objects::make_ptr_instance<
|
---|
| 21 | X
|
---|
| 22 | , objects::pointer_holder<P,X>
|
---|
| 23 | >
|
---|
| 24 | >();
|
---|
| 25 | }
|
---|
| 26 |
|
---|
| 27 | }} // namespace boost::python
|
---|
| 28 |
|
---|
| 29 | #endif // REGISTER_PTR_TO_PYTHON_HPP
|
---|
| 30 |
|
---|
| 31 |
|
---|
Note: See
TracBrowser
for help on using the repository browser.