1 // Copyright David Abrahams 2004. Distributed under the Boost
2 // Software License, Version 1.0. (See accompanying
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4 #include <boost/python/module.hpp>
5 #include <boost/python/def.hpp>
6 #include <boost/python/class.hpp>
7 #include <boost/python/reference_existing_object.hpp>
8 #include <boost/python/return_value_policy.hpp>
14 virtual ~V() {}; // silence compiler warningsa
17 const A
* inside() {return &a
;}
22 const A
* outside(const V
& v
) {return &v
.a
;}
24 BOOST_PYTHON_MODULE(bienstman1_ext
)
26 using namespace boost::python
;
27 using boost::shared_ptr
;
28 using boost::python::return_value_policy
;
29 using boost::python::reference_existing_object
;
33 class_
<V
, boost::noncopyable
>("V", no_init
)
34 .def("inside", &V::inside
,
35 return_value_policy
<reference_existing_object
>())
36 .def("outside", outside
,
37 return_value_policy
<reference_existing_object
>())