diff options
Diffstat (limited to 'gnuradio-runtime/python/gnuradio/gr/bindings/thread')
3 files changed, 110 insertions, 0 deletions
diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/thread/thread_body_wrapper_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/thread/thread_body_wrapper_python.cc new file mode 100644 index 0000000000..b062a0d303 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/thread/thread_body_wrapper_python.cc @@ -0,0 +1,20 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/thread_body_wrapper.h> + +void bind_thread_body_wrapper(py::module& m) { m.def("mask_signals", &gr::mask_signals); } diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/thread/thread_group_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/thread/thread_group_python.cc new file mode 100644 index 0000000000..66666898a3 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/thread/thread_group_python.cc @@ -0,0 +1,37 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/thread_group.h> + +void bind_thread_group(py::module& m) +{ + using thread_group = gr::thread_group; + + + py::class_<thread_group, + boost::noncopyable_::noncopyable, + std::shared_ptr<thread_group>>(m, "thread_group") + + .def(py::init<>()) + + .def("create_thread", &thread_group::create_thread, py::arg("threadfunc")) + .def("add_thread", &thread_group::add_thread, py::arg("thrd")) + .def("remove_thread", &thread_group::remove_thread, py::arg("thrd")) + .def("join_all", &thread_group::join_all) + .def("interrupt_all", &thread_group::interrupt_all) + .def("size", &thread_group::size); +} diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/thread/thread_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/thread/thread_python.cc new file mode 100644 index 0000000000..87e769ef88 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/thread/thread_python.cc @@ -0,0 +1,53 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/thread.h> + +void bind_thread(py::module& m) +{ + + + m.def("get_current_thread_id", &gr::get_current_thread_id); + m.def("thread_bind_to_processor", + (void (*)(std::vector<int, std::allocator<int>> const&)) & + gr::thread_bind_to_processor, + py::arg("mask")); + m.def("thread_bind_to_processor", + (void (*)(int)) & gr::thread_bind_to_processor, + py::arg("n")); + m.def("thread_bind_to_processor", + (void (*)(gr::thread::gr_thread_t, + std::vector<int, std::allocator<int>> const&)) & + gr::thread_bind_to_processor, + py::arg("thread"), + py::arg("mask")); + m.def("thread_bind_to_processor", + (void (*)(gr::thread::gr_thread_t, unsigned int)) & + gr::thread_bind_to_processor, + py::arg("thread"), + py::arg("n")); + m.def("thread_unbind", (void (*)()) & gr::thread_unbind); + m.def("thread_unbind", + (void (*)(gr::thread::gr_thread_t)) & gr::thread_unbind, + py::arg("thread")); + m.def("thread_priority", &gr::thread_priority, py::arg("thread")); + m.def("set_thread_priority", + &gr::set_thread_priority, + py::arg("thread"), + py::arg("priority")); + m.def("set_thread_name", &gr::set_thread_name, py::arg("thread"), py::arg("name")); +} |