diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-05 02:27:29 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-05 02:27:42 -0500 |
commit | 060fc0e00bacb96d1d16163779d98c45c3999014 (patch) | |
tree | 1e6c661379f02fdc52ef107fd500438ab69f3e60 /src/py_utils.cc | |
parent | 8bd16b2e8e61f914767e3d0973e83f7326f11cbc (diff) | |
download | fork-ledger-060fc0e00bacb96d1d16163779d98c45c3999014.tar.gz fork-ledger-060fc0e00bacb96d1d16163779d98c45c3999014.tar.bz2 fork-ledger-060fc0e00bacb96d1d16163779d98c45c3999014.zip |
Made many object methods in Python properties
Diffstat (limited to 'src/py_utils.cc')
-rw-r--r-- | src/py_utils.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/py_utils.cc b/src/py_utils.cc index c2177c20..b2b9d0f8 100644 --- a/src/py_utils.cc +++ b/src/py_utils.cc @@ -172,9 +172,10 @@ void export_utils() .def(init<supports_flags<uint_least8_t> >()) .def(init<uint_least8_t>()) - .def("flags", &supports_flags<uint_least8_t>::flags) + .add_property("flags", + &supports_flags<uint_least8_t>::flags, + &supports_flags<uint_least8_t>::set_flags) .def("has_flags", &supports_flags<uint_least8_t>::has_flags) - .def("set_flags", &supports_flags<uint_least8_t>::set_flags) .def("clear_flags", &supports_flags<uint_least8_t>::clear_flags) .def("add_flags", &supports_flags<uint_least8_t>::add_flags) .def("drop_flags", &supports_flags<uint_least8_t>::drop_flags) @@ -184,9 +185,10 @@ void export_utils() .def(init<supports_flags<uint_least16_t> >()) .def(init<uint_least16_t>()) - .def("flags", &supports_flags<uint_least16_t>::flags) + .add_property("flags", + &supports_flags<uint_least16_t>::flags, + &supports_flags<uint_least16_t>::set_flags) .def("has_flags", &supports_flags<uint_least16_t>::has_flags) - .def("set_flags", &supports_flags<uint_least16_t>::set_flags) .def("clear_flags", &supports_flags<uint_least16_t>::clear_flags) .def("add_flags", &supports_flags<uint_least16_t>::add_flags) .def("drop_flags", &supports_flags<uint_least16_t>::drop_flags) @@ -204,9 +206,10 @@ void export_utils() class_< delegates_flags<uint_least16_t>, boost::noncopyable > ("DelegatesFlags16", no_init) - .def("flags", &delegates_flags<uint_least16_t>::flags) + .add_property("flags", + &delegates_flags<uint_least16_t>::flags, + &delegates_flags<uint_least16_t>::set_flags) .def("has_flags", &delegates_flags<uint_least16_t>::has_flags) - .def("set_flags", &delegates_flags<uint_least16_t>::set_flags) .def("clear_flags", &delegates_flags<uint_least16_t>::clear_flags) .def("add_flags", &delegates_flags<uint_least16_t>::add_flags) .def("drop_flags", &delegates_flags<uint_least16_t>::drop_flags) |