summaryrefslogtreecommitdiff
path: root/gr-digital/python/digital/bindings/chunks_to_symbols_python.cc
diff options
context:
space:
mode:
authorJosh Morman <mormjb@gmail.com>2020-04-23 08:12:30 -0400
committerJosh Morman <mormjb@gmail.com>2020-06-04 10:05:47 -0400
commit5039f381454bc0afc4f676085afa998c438e02e7 (patch)
tree4cd97bfcd6e4959d255961422e3841dc35f0a892 /gr-digital/python/digital/bindings/chunks_to_symbols_python.cc
parent3e4df0bcccc58a2f283268828f9ad2dc3eadb19d (diff)
digital: add pybind11 bindings
Diffstat (limited to 'gr-digital/python/digital/bindings/chunks_to_symbols_python.cc')
-rw-r--r--gr-digital/python/digital/bindings/chunks_to_symbols_python.cc50
1 files changed, 50 insertions, 0 deletions
diff --git a/gr-digital/python/digital/bindings/chunks_to_symbols_python.cc b/gr-digital/python/digital/bindings/chunks_to_symbols_python.cc
new file mode 100644
index 0000000000..9d01a9dfac
--- /dev/null
+++ b/gr-digital/python/digital/bindings/chunks_to_symbols_python.cc
@@ -0,0 +1,50 @@
+/*
+ * 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/digital/chunks_to_symbols.h>
+
+template <class IN_T, class OUT_T>
+void bind_chunks_to_symbols_template(py::module& m, const char* classname)
+{
+ using chunks_to_symbols = gr::digital::chunks_to_symbols<IN_T, OUT_T>;
+
+ py::class_<chunks_to_symbols,
+ gr::sync_interpolator,
+ gr::sync_block,
+ gr::block,
+ gr::basic_block,
+ std::shared_ptr<chunks_to_symbols>>(m, classname)
+ .def(py::init(&gr::digital::chunks_to_symbols<IN_T, OUT_T>::make),
+ py::arg("symbol_table"),
+ py::arg("D") = 1)
+
+ .def("set_symbol_table",
+ &chunks_to_symbols::set_symbol_table,
+ py::arg("symbol_table"))
+ .def("symbol_table", &chunks_to_symbols::symbol_table)
+ .def("D", &chunks_to_symbols::D);
+}
+
+void bind_chunks_to_symbols(py::module& m)
+{
+ bind_chunks_to_symbols_template<std::uint8_t, float>(m, "chunks_to_symbols_bf");
+ bind_chunks_to_symbols_template<std::uint8_t, gr_complex>(m, "chunks_to_symbols_bc");
+ bind_chunks_to_symbols_template<std::int16_t, float>(m, "chunks_to_symbols_sf");
+ bind_chunks_to_symbols_template<std::int16_t, gr_complex>(m, "chunks_to_symbols_sc");
+ bind_chunks_to_symbols_template<std::int32_t, float>(m, "chunks_to_symbols_if");
+ bind_chunks_to_symbols_template<std::int32_t, gr_complex>(m, "chunks_to_symbols_ic");
+}