From 5039f381454bc0afc4f676085afa998c438e02e7 Mon Sep 17 00:00:00 2001
From: Josh Morman <mormjb@gmail.com>
Date: Thu, 23 Apr 2020 08:12:30 -0400
Subject: digital: add pybind11 bindings

---
 .../digital/bindings/chunks_to_symbols_python.cc   | 50 ++++++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 gr-digital/python/digital/bindings/chunks_to_symbols_python.cc

(limited to 'gr-digital/python/digital/bindings/chunks_to_symbols_python.cc')

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");
+}
-- 
cgit v1.2.3