summaryrefslogtreecommitdiff
path: root/src/py_utils.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-02 21:39:54 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-02 21:55:53 -0500
commit690e46117e1da8da1dd1bd2b9a0151c2b792104e (patch)
tree68aadb45413dfe4319d0b4d0a79985900fbc7c01 /src/py_utils.cc
parent4befcfa27d1e4b162512f6161f9f897862ccdf57 (diff)
downloadfork-ledger-690e46117e1da8da1dd1bd2b9a0151c2b792104e.tar.gz
fork-ledger-690e46117e1da8da1dd1bd2b9a0151c2b792104e.tar.bz2
fork-ledger-690e46117e1da8da1dd1bd2b9a0151c2b792104e.zip
Added Python interface for commodity_t
Diffstat (limited to 'src/py_utils.cc')
-rw-r--r--src/py_utils.cc44
1 files changed, 44 insertions, 0 deletions
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<std::ostream, ostream_to_python, ostream_from
void export_utils()
{
+ class_< supports_flags<uint_least8_t> > ("SupportFlags8")
+ .def(init<supports_flags<uint_least8_t> >())
+ .def(init<uint_least8_t>())
+
+ .def("flags", &supports_flags<uint_least8_t>::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)
+ ;
+
+ class_< supports_flags<uint_least16_t> > ("SupportFlags16")
+ .def(init<supports_flags<uint_least16_t> >())
+ .def(init<uint_least16_t>())
+
+ .def("flags", &supports_flags<uint_least16_t>::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)
+ ;
+
+#if 0
+ class_< basic_flags_t<uint_least8_t>,
+ bases<supports_flags<uint_least8_t> > > ("BasicFlags8")
+ .def(init<uint_least8_t>())
+
+ .def("plus_flags", &basic_flags_t<uint_least8_t>::plus_flags)
+ .def("minus_flags", &basic_flags_t<uint_least8_t>::minus_flags)
+ ;
+#endif
+
+ class_< delegates_flags<uint_least16_t>,
+ boost::noncopyable > ("DelegatesFlags16", no_init)
+ .def("flags", &delegates_flags<uint_least16_t>::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)
+ ;
+
bool_python_conversion();
string_python_conversion();
istream_python_conversion();