diff options
author | Martin Braun <martin.braun@ettus.com> | 2019-02-04 16:00:16 +0100 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-02-22 16:56:52 -0800 |
commit | 692ddc71b17196487dcad982836e074cab9a0f25 (patch) | |
tree | cf76abf577dde6128e03561c52d9c31dca302026 /host/lib/usrp/subdev_spec_python.hpp | |
parent | 51bbf548c9b442d0b53b6c8de5f89403de274424 (diff) | |
download | uhd-692ddc71b17196487dcad982836e074cab9a0f25.tar.gz uhd-692ddc71b17196487dcad982836e074cab9a0f25.tar.bz2 uhd-692ddc71b17196487dcad982836e074cab9a0f25.zip |
python: Replace Boost.Python with PyBind11
This does not change the Python API itself, but it is still
a significant change. Most importantly, it removes the dependency on
Boost.Python.
Diffstat (limited to 'host/lib/usrp/subdev_spec_python.hpp')
-rw-r--r-- | host/lib/usrp/subdev_spec_python.hpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/host/lib/usrp/subdev_spec_python.hpp b/host/lib/usrp/subdev_spec_python.hpp index ed91099f9..61a517a6f 100644 --- a/host/lib/usrp/subdev_spec_python.hpp +++ b/host/lib/usrp/subdev_spec_python.hpp @@ -1,5 +1,6 @@ // // Copyright 2017-2018 Ettus Research, a National Instruments Company +// Copyright 2019 Ettus Research, a National Instruments Brand // // SPDX-License-Identifier: GPL-3.0-or-later // @@ -9,24 +10,20 @@ #include <uhd/usrp/subdev_spec.hpp> -void export_subdev_spec() +void export_subdev_spec(py::module& m) { using subdev_spec_pair_t = uhd::usrp::subdev_spec_pair_t; using subdev_spec_t = uhd::usrp::subdev_spec_t; - bp::class_<subdev_spec_pair_t> - ("subdev_spec_pair", bp::init<const std::string&, const std::string &>()) - + py::class_<subdev_spec_pair_t> (m, "subdev_spec_pair") + .def(py::init<const std::string&, const std::string &>()) // Properties - .add_property("db_name", &subdev_spec_pair_t::db_name) - .add_property("sd_name", &subdev_spec_pair_t::sd_name) + .def_readwrite("db_name", &subdev_spec_pair_t::db_name) + .def_readwrite("sd_name", &subdev_spec_pair_t::sd_name) ; - bp::class_<std::vector<subdev_spec_pair_t> >("subdev_spec_vector") - .def(bp::vector_indexing_suite<std::vector<subdev_spec_pair_t> >()); - - bp::class_<subdev_spec_t, bp::bases<std::vector<subdev_spec_pair_t> > > - ("subdev_spec", bp::init<const std::string &>()) + py::class_<subdev_spec_t>(m, "subdev_spec") + .def(py::init<const std::string &>()) // Methods .def("__str__", &subdev_spec_t::to_pp_string) |