diff options
author | Marcus Müller <mmueller@gnuradio.org> | 2021-07-17 16:22:30 +0200 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2021-07-30 20:41:54 -0400 |
commit | 001a949262436cc42d06976f6ba9b48ec8ad607d (patch) | |
tree | 5d56f9804408a2a141c85489bf95dc6f494246e4 | |
parent | 18488e31d4ad13077990383f7eb0e1ab7655bf23 (diff) |
runtime: remove tag_checker
Deprecated on 3.9:
`tag_checker` used to be meant for cases where you've gotten an unsorted
tag vector (mostly, from `get_tags_in_range`), which you then had to go
through in parallel to your samples, to check which tag applies at what
sample.
For that it sorts the tags; the tags coming from the `get_tags*` functions
are sorted already
The checking pattern (which `chunks_to_symbols` is the last consumer of)
is inefficient: instead of taking the index of the first unprocessed tag
and processing all samples up to that index, a check is performed on
every sample, which includes calls and multiple indirections.
So, since very likely nobody uses this, and because it's a design
anti-pattern, deprecating this on 3.9 and removing it with 3.10.
Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
6 files changed, 0 insertions, 146 deletions
diff --git a/gnuradio-runtime/include/gnuradio/CMakeLists.txt b/gnuradio-runtime/include/gnuradio/CMakeLists.txt index b3b1da9259..9e99f64658 100644 --- a/gnuradio-runtime/include/gnuradio/CMakeLists.txt +++ b/gnuradio-runtime/include/gnuradio/CMakeLists.txt @@ -56,7 +56,6 @@ install(FILES sync_decimator.h sync_interpolator.h sys_paths.h - tag_checker.h types.h rpccallbackregister_base.h rpcmanager_base.h diff --git a/gnuradio-runtime/include/gnuradio/tag_checker.h b/gnuradio-runtime/include/gnuradio/tag_checker.h deleted file mode 100644 index 78358868cb..0000000000 --- a/gnuradio-runtime/include/gnuradio/tag_checker.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2013 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - */ - -#ifndef INCLUDED_GR_RUNTIME_TAG_CHECKER_H -#define INCLUDED_GR_RUNTIME_TAG_CHECKER_H - -#include <gnuradio/tags.h> -#include <algorithm> -#include <vector> - -namespace gr { - -class tag_checker -{ -private: - std::vector<tag_t> d_tags; - tag_t d_next_tag; - bool d_has_next_tag; - unsigned int d_next_tag_index; - -public: - tag_checker(std::vector<tag_t>& tags) : d_has_next_tag(false), d_next_tag_index(0) - { - d_tags = tags; - std::sort(d_tags.begin(), d_tags.end()); - if (!d_tags.empty()) { - d_has_next_tag = true; - d_next_tag = tags[0]; - } - }; - - ~tag_checker(){}; - - void get_tags(std::vector<tag_t>& tag_list, unsigned int offset) - { - while (d_has_next_tag && (offset >= d_next_tag.offset)) { - if (offset == d_next_tag.offset) { - tag_list.push_back(d_next_tag); - } - d_next_tag_index += 1; - if (d_next_tag_index >= d_tags.size()) { - d_has_next_tag = false; - } else { - d_next_tag = d_tags[d_next_tag_index]; - } - } - }; -}; -} // namespace gr - -#endif /* INCLUDED_GR_RUNTIME_TAG_CHECKER_H */ diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/CMakeLists.txt b/gnuradio-runtime/python/gnuradio/gr/bindings/CMakeLists.txt index ef8f1f10dd..14eb501ddb 100644 --- a/gnuradio-runtime/python/gnuradio/gr/bindings/CMakeLists.txt +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/CMakeLists.txt @@ -67,7 +67,6 @@ messages/msg_queue_python.cc sync_decimator_python.cc sync_interpolator_python.cc sys_paths_python.cc - tag_checker_python.cc tagged_stream_block_python.cc tags_python.cc # thread_python.cc diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/tag_checker_pydoc_template.h b/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/tag_checker_pydoc_template.h deleted file mode 100644 index 29d19d8e0f..0000000000 --- a/gnuradio-runtime/python/gnuradio/gr/bindings/docstrings/tag_checker_pydoc_template.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2020 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - */ -#include "pydoc_macros.h" -#define D(...) DOC(gr, __VA_ARGS__) -/* - This file contains placeholders for docstrings for the Python bindings. - Do not edit! These were automatically extracted during the binding process - and will be overwritten during the build process - */ - - -static const char* __doc_gr_tag_checker = R"doc()doc"; - - -static const char* __doc_gr_tag_checker_tag_checker_0 = R"doc()doc"; - - -static const char* __doc_gr_tag_checker_tag_checker_1 = R"doc()doc"; - - -static const char* __doc_gr_tag_checker_get_tags = R"doc()doc"; diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/python_bindings.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/python_bindings.cc index c180116c80..1f39775f81 100644 --- a/gnuradio-runtime/python/gnuradio/gr/bindings/python_bindings.cc +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/python_bindings.cc @@ -77,7 +77,6 @@ void bind_sync_block(py::module&); void bind_sync_decimator(py::module&); void bind_sync_interpolator(py::module&); void bind_sys_paths(py::module&); -void bind_tag_checker(py::module&); void bind_tagged_stream_block(py::module&); void bind_tags(py::module&); // void bind_thread(py::module&); @@ -178,7 +177,6 @@ PYBIND11_MODULE(gr_python, m) bind_sync_decimator(m); bind_sync_interpolator(m); bind_sys_paths(m); - bind_tag_checker(m); bind_tagged_stream_block(m); bind_tags(m); // // bind_thread(m); diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/tag_checker_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/tag_checker_python.cc deleted file mode 100644 index e2043351ef..0000000000 --- a/gnuradio-runtime/python/gnuradio/gr/bindings/tag_checker_python.cc +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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 and can be manually edited */ -/* The following lines can be configured to regenerate this file during cmake */ -/* If manual edits are made, the following tags should be modified accordingly. */ -/* BINDTOOL_GEN_AUTOMATIC(0) */ -/* BINDTOOL_USE_PYGCCXML(0) */ -/* BINDTOOL_HEADER_FILE(tag_checker.h) */ -/* BINDTOOL_HEADER_FILE_HASH(9ffac9df4d29f09b0c8506584e6f1f75) */ -/***********************************************************************************/ - -#include <pybind11/complex.h> -#include <pybind11/pybind11.h> -#include <pybind11/stl.h> - -namespace py = pybind11; - -#include <gnuradio/tag_checker.h> -// pydoc.h is automatically generated in the build directory -#include <tag_checker_pydoc.h> - -void bind_tag_checker(py::module& m) -{ - - using tag_checker = ::gr::tag_checker; - - - py::class_<tag_checker, std::shared_ptr<tag_checker>>( - m, "tag_checker", D(tag_checker)) - - .def(py::init<std::vector<gr::tag_t, std::allocator<gr::tag_t>>&>(), - py::arg("tags"), - D(tag_checker, tag_checker, 0)) - .def(py::init<gr::tag_checker const&>(), - py::arg("arg0"), - D(tag_checker, tag_checker, 1)) - - - .def("get_tags", - &tag_checker::get_tags, - py::arg("tag_list"), - py::arg("offset"), - D(tag_checker, get_tags)) - - ; - - - py::module m_messages = m.def_submodule("messages"); -} |