From 690e46117e1da8da1dd1bd2b9a0151c2b792104e Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 2 Nov 2009 21:39:54 -0500 Subject: Added Python interface for commodity_t --- src/py_utils.cc | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'src/py_utils.cc') diff --git a/src/py_utils.cc b/src/py_utils.cc index cf98c5fe..3e788442 100644 --- a/src/py_utils.cc +++ b/src/py_utils.cc @@ -164,6 +164,50 @@ typedef register_python_conversion > ("SupportFlags8") + .def(init >()) + .def(init()) + + .def("flags", &supports_flags::flags) + .def("has_flags", &supports_flags::has_flags) + .def("set_flags", &supports_flags::set_flags) + .def("clear_flags", &supports_flags::clear_flags) + .def("add_flags", &supports_flags::add_flags) + .def("drop_flags", &supports_flags::drop_flags) + ; + + class_< supports_flags > ("SupportFlags16") + .def(init >()) + .def(init()) + + .def("flags", &supports_flags::flags) + .def("has_flags", &supports_flags::has_flags) + .def("set_flags", &supports_flags::set_flags) + .def("clear_flags", &supports_flags::clear_flags) + .def("add_flags", &supports_flags::add_flags) + .def("drop_flags", &supports_flags::drop_flags) + ; + +#if 0 + class_< basic_flags_t, + bases > > ("BasicFlags8") + .def(init()) + + .def("plus_flags", &basic_flags_t::plus_flags) + .def("minus_flags", &basic_flags_t::minus_flags) + ; +#endif + + class_< delegates_flags, + boost::noncopyable > ("DelegatesFlags16", no_init) + .def("flags", &delegates_flags::flags) + .def("has_flags", &delegates_flags::has_flags) + .def("set_flags", &delegates_flags::set_flags) + .def("clear_flags", &delegates_flags::clear_flags) + .def("add_flags", &delegates_flags::add_flags) + .def("drop_flags", &delegates_flags::drop_flags) + ; + bool_python_conversion(); string_python_conversion(); istream_python_conversion(); -- cgit v1.2.3