summaryrefslogtreecommitdiff
path: root/gr-digital/include
diff options
context:
space:
mode:
authorAndrej Rode <mail@andrejro.de>2018-08-21 14:34:46 +0200
committerAndrej Rode <mail@andrejro.de>2018-08-25 20:21:23 +0200
commitc70c0a4cb7f84e7047ffe717b99da6be3c0c72df (patch)
tree8a489125a98a2d2b790acf873cc3781a9db02ed1 /gr-digital/include
parent4d02f8a0bb58e4509ad8f8c2c7ee1616259581a5 (diff)
digital: replace gengen with C++ templates
Diffstat (limited to 'gr-digital/include')
-rw-r--r--gr-digital/include/gnuradio/digital/CMakeLists.txt14
-rw-r--r--gr-digital/include/gnuradio/digital/burst_shaper.h (renamed from gr-digital/include/gnuradio/digital/burst_shaper_XX.h.t)32
-rw-r--r--gr-digital/include/gnuradio/digital/chunks_to_symbols.h (renamed from gr-digital/include/gnuradio/digital/chunks_to_symbols_XX.h.t)35
3 files changed, 38 insertions, 43 deletions
diff --git a/gr-digital/include/gnuradio/digital/CMakeLists.txt b/gr-digital/include/gnuradio/digital/CMakeLists.txt
index cdaf48080b..af7a20eda5 100644
--- a/gr-digital/include/gnuradio/digital/CMakeLists.txt
+++ b/gr-digital/include/gnuradio/digital/CMakeLists.txt
@@ -18,24 +18,14 @@
# Boston, MA 02110-1301, USA.
########################################################################
-# Invoke macro to generate various headers
-#######################################################################
-include(GrMiscUtils)
-GR_EXPAND_X_H(digital chunks_to_symbols_XX bf bc sf sc if ic)
-GR_EXPAND_X_H(digital burst_shaper_XX cc ff)
-
-add_custom_target(digital_generated_includes DEPENDS
- ${generated_includes}
-)
-
-########################################################################
# Install header files
########################################################################
install(FILES
- ${generated_includes}
additive_scrambler_bb.h
api.h
binary_slicer_fb.h
+ burst_shaper.h
+ chunks_to_symbols.h
clock_recovery_mm_cc.h
clock_recovery_mm_ff.h
cma_equalizer_cc.h
diff --git a/gr-digital/include/gnuradio/digital/burst_shaper_XX.h.t b/gr-digital/include/gnuradio/digital/burst_shaper.h
index fd7b69060e..25277595b3 100644
--- a/gr-digital/include/gnuradio/digital/burst_shaper_XX.h.t
+++ b/gr-digital/include/gnuradio/digital/burst_shaper.h
@@ -1,29 +1,27 @@
/* -*- c++ -*- */
-/*
+/*
* Copyright 2015 Free Software Foundation, Inc.
- *
+ *
* This file is part of GNU Radio
- *
+ *
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
- *
+ *
* GNU Radio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Radio; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
-/* @WARNING@ */
-
-#ifndef @GUARD_NAME@
-#define @GUARD_NAME@
+#ifndef BURST_SHAPER_H
+#define BURST_SHAPER_H
#include <gnuradio/digital/api.h>
#include <gnuradio/block.h>
@@ -59,14 +57,14 @@ namespace gr {
* burst's length tags. Tags at other offsets will be placed with
* the samples on which they were found.
*
- * \li input: stream of @I_TYPE@
- * \li output: stream of @O_TYPE@
+ * \li input: stream of T
+ * \li output: stream of T
*/
- class DIGITAL_API @NAME@ : virtual public block
+ template <class T>
+ class DIGITAL_API burst_shaper : virtual public block
{
public:
- // gr::digital::@BASE_NAME@::sptr
- typedef boost::shared_ptr<@BASE_NAME@> sptr;
+ typedef boost::shared_ptr< burst_shaper<T> > sptr;
/*!
* Make a burst shaper block.
@@ -89,7 +87,7 @@ namespace gr {
* \param length_tag_name: the name of the tagged stream length
* tag key.
*/
- static sptr make(const std::vector<@O_TYPE@> &taps,
+ static sptr make(const std::vector<T> &taps,
int pre_padding=0, int post_padding=0,
bool insert_phasing=false,
const std::string &length_tag_name="packet_len");
@@ -117,7 +115,9 @@ namespace gr {
virtual int suffix_length() const = 0;
};
+ typedef burst_shaper<float> burst_shaper_ff;
+ typedef burst_shaper<gr_complex> burst_shaper_cc;
} // namespace digital
} // namespace gr
-#endif /* @GUARD_NAME@ */
+#endif /* BURST_SHAPER_H */
diff --git a/gr-digital/include/gnuradio/digital/chunks_to_symbols_XX.h.t b/gr-digital/include/gnuradio/digital/chunks_to_symbols.h
index 6683ea94fc..f7cdd45352 100644
--- a/gr-digital/include/gnuradio/digital/chunks_to_symbols_XX.h.t
+++ b/gr-digital/include/gnuradio/digital/chunks_to_symbols.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004,2012 Free Software Foundation, Inc.
+ * Copyright 2004,2012,2018 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,25 +20,24 @@
* Boston, MA 02110-1301, USA.
*/
-/* @WARNING@ */
-
-#ifndef @GUARD_NAME@
-#define @GUARD_NAME@
+#ifndef CHUNKS_TO_SYMBOLS_H
+#define CHUNKS_TO_SYMBOLS_H
#include <gnuradio/digital/api.h>
#include <gnuradio/sync_interpolator.h>
+#include <cstdint>
namespace gr {
namespace digital {
-
+
/*!
* \brief Map a stream of unpacked symbol indexes to stream of
* float or complex constellation points in D dimensions (D = 1 by
* default) \ingroup converter_blk
*
* \details
- * \li input: stream of @I_TYPE@
- * \li output: stream of @O_TYPE@
+ * \li input: stream of IN_T
+ * \li output: stream of OUT_T
*
* \li out[n D + k] = symbol_table[in[n] D + k], k=0,1,...,D-1
*
@@ -52,11 +51,11 @@ namespace gr {
* \sa gr::digital::chunks_to_symbols_bf, gr::digital::chunks_to_symbols_bc.
* \sa gr::digital::chunks_to_symbols_sf, gr::digital::chunks_to_symbols_sc.
*/
- class DIGITAL_API @NAME@ : virtual public sync_interpolator
+ template <class IN_T, class OUT_T>
+ class DIGITAL_API chunks_to_symbols : virtual public sync_interpolator
{
public:
- // gr::digital::@BASE_NAME@::sptr
- typedef boost::shared_ptr<@BASE_NAME@> sptr;
+ typedef boost::shared_ptr< chunks_to_symbols<IN_T,OUT_T> > sptr;
/*!
* Make a chunks-to-symbols block.
@@ -64,14 +63,20 @@ namespace gr {
* \param symbol_table: list that maps chunks to symbols.
* \param D: dimension of table.
*/
- static sptr make(const std::vector<@O_TYPE@> &symbol_table, const int D = 1);
+ static sptr make(const std::vector<OUT_T> &symbol_table, const int D = 1);
virtual int D() const = 0;
- virtual std::vector<@O_TYPE@> symbol_table() const = 0;
- virtual void set_symbol_table(const std::vector<@O_TYPE@> &symbol_table) =0;
+ virtual std::vector<OUT_T> symbol_table() const = 0;
+ virtual void set_symbol_table(const std::vector<OUT_T> &symbol_table) =0;
};
+ typedef chunks_to_symbols<std::uint8_t, float> chunks_to_symbols_bf;
+ typedef chunks_to_symbols<std::uint8_t, gr_complex> chunks_to_symbols_bc;
+ typedef chunks_to_symbols<std::int16_t, float> chunks_to_symbols_sf;
+ typedef chunks_to_symbols<std::int16_t, gr_complex> chunks_to_symbols_sc;
+ typedef chunks_to_symbols<std::int32_t, float> chunks_to_symbols_if;
+ typedef chunks_to_symbols<std::int32_t, gr_complex> chunks_to_symbols_ic;
} /* namespace digital */
} /* namespace gr */
-#endif /* @GUARD_NAME@ */
+#endif /* CHUNKS_TO_SYMBOLS_H */