]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/python/test/return_arg.cpp
1 // Copyright David Abrahams and Nikolay Mladenov 2003.
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)
6 #include <boost/python/module.hpp>
7 #include <boost/python/class.hpp>
8 #include <boost/python/def.hpp>
9 #include <boost/python/return_arg.hpp>
17 bool get_sensitive() const
22 void set_sensitive(bool s
)
35 std::string
get_label() const
40 void set_label(const std::string
&l
)
49 void return_arg_f(boost::python::object
) {}
51 using namespace boost::python
;
52 BOOST_PYTHON_MODULE(return_arg_ext
)
54 class_
<Widget
>("Widget")
55 .def("sensitive", &Widget::get_sensitive
)
56 .def("sensitive", &Widget::set_sensitive
, return_self
<>())
59 class_
<Label
, bases
<Widget
> >("Label")
60 .def("label", &Label::get_label
)//,return_arg<0>()) //error(s)
61 .def("label", &Label::set_label
, return_self
<>())
64 def("return_arg", return_arg_f
, return_arg
<1>());
67 #include "module_tail.cpp"