summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Habets <thomas@habets.se>2019-12-21 16:29:50 +0000
committerMartin Braun <martin.braun@ettus.com>2020-01-06 15:38:02 -0800
commitbf59d95c1a6920af76309ec23f6b10a903b7689e (patch)
tree01720b11ba33497cdf94adaa1862a9f0a5ddeafc
parentff650cb6f996795af747fc8a0a3fe894fe14f94f (diff)
gr-digital/chunks_to_symbols: Simplify helper functions
-rw-r--r--gr-digital/lib/chunks_to_symbols_impl.cc36
-rw-r--r--gr-digital/lib/chunks_to_symbols_impl.h5
2 files changed, 17 insertions, 24 deletions
diff --git a/gr-digital/lib/chunks_to_symbols_impl.cc b/gr-digital/lib/chunks_to_symbols_impl.cc
index 26d590a66e..b4302b12de 100644
--- a/gr-digital/lib/chunks_to_symbols_impl.cc
+++ b/gr-digital/lib/chunks_to_symbols_impl.cc
@@ -32,6 +32,23 @@
namespace gr {
namespace digital {
+
+void set_vector_from_pmt(
+ std::vector<gr_complex>& symbol_table, pmt::pmt_t& symbol_table_pmt)
+{
+ size_t length;
+ const gr_complex* elements = pmt::c32vector_elements(symbol_table_pmt, length);
+ symbol_table.assign(elements, elements + length);
+}
+
+void set_vector_from_pmt(
+ std::vector<float>& symbol_table, pmt::pmt_t& symbol_table_pmt)
+{
+ size_t length;
+ const float* elements = pmt::f32vector_elements(symbol_table_pmt, length);
+ symbol_table.assign(elements, elements + length);
+}
+
template <class IN_T, class OUT_T>
typename chunks_to_symbols<IN_T, OUT_T>::sptr
chunks_to_symbols<IN_T, OUT_T>::make(const std::vector<OUT_T>& symbol_table, const int D)
@@ -62,25 +79,6 @@ chunks_to_symbols_impl<IN_T, OUT_T>::~chunks_to_symbols_impl()
{
}
-
-template <class IN_T, class OUT_T>
-void chunks_to_symbols_impl<IN_T, OUT_T>::set_vector_from_pmt(
- std::vector<gr_complex>& symbol_table, pmt::pmt_t& symbol_table_pmt)
-{
- size_t length;
- const gr_complex* elements = pmt::c32vector_elements(symbol_table_pmt, length);
- symbol_table.assign(elements, elements + length);
-}
-
-template <class IN_T, class OUT_T>
-void chunks_to_symbols_impl<IN_T, OUT_T>::set_vector_from_pmt(
- std::vector<float>& symbol_table, pmt::pmt_t& symbol_table_pmt)
-{
- size_t length;
- const float* elements = pmt::f32vector_elements(symbol_table_pmt, length);
- symbol_table.assign(elements, elements + length);
-}
-
template <class IN_T, class OUT_T>
void chunks_to_symbols_impl<IN_T, OUT_T>::handle_set_symbol_table(
pmt::pmt_t symbol_table_pmt)
diff --git a/gr-digital/lib/chunks_to_symbols_impl.h b/gr-digital/lib/chunks_to_symbols_impl.h
index c250baa0ba..8cbcdb350e 100644
--- a/gr-digital/lib/chunks_to_symbols_impl.h
+++ b/gr-digital/lib/chunks_to_symbols_impl.h
@@ -40,11 +40,6 @@ public:
~chunks_to_symbols_impl();
- void set_vector_from_pmt(std::vector<float>& symbol_table,
- pmt::pmt_t& symbol_table_pmt);
- void set_vector_from_pmt(std::vector<gr_complex>& symbol_table,
- pmt::pmt_t& symbol_table_pmt);
-
void handle_set_symbol_table(pmt::pmt_t symbol_table_pmt);
void set_symbol_table(const std::vector<OUT_T>& symbol_table);