GNU Radio Manual and C++ API Reference 3.10.5.1
The Free & Open Software Radio Ecosystem
blockinterleaver_xx.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2022 Johannes Demel.
4 *
5 * This file is part of GNU Radio
6 *
7 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11#ifndef INCLUDE_BLOCKINTERLEAVER_H
12#define INCLUDE_BLOCKINTERLEAVER_H
13
14#include <gnuradio/blocks/api.h>
15#include <gnuradio/sync_block.h>
16#include <cstdint>
17
18namespace gr {
19namespace blocks {
20
21/*!
22 * \brief Fully parameterizable block interleaver
23 * \ingroup blocks
24 *
25 * \details
26 * This block accepts item multiples of size \p interleaver_indices.size() and interleaves
27 * or deinterleaves them on the output.
28 *
29 * \param interleaver_indices indices of items in output vector.
30 * \param interleave_mode Switch between interleaver [true] and deinterleaver mode
31 * [false].
32 * \param is_packed Assume packed bytes. For uint8_t I/O only.
33 */
34template <class T>
36{
37public:
38 typedef std::shared_ptr<blockinterleaver_xx<T>> sptr;
39
40 /*!
41 * \brief Build a blockinterleaver block
42 *
43 * \param interleaver_indices indices of items in output vector.
44 * \param interleave_mode Switch between interleaver [true] and deinterleaver mode
45 * [false].
46 * \param is_packed Assume packed bytes.
47 */
48 static sptr make(std::vector<size_t> interleaver_indices,
49 bool interleave_mode,
50 bool is_packed = false);
51
52 /*!
53 * \brief Return interleaver indices
54 */
55 virtual std::vector<size_t> interleaver_indices() const = 0;
56
57 /*!
58 * \brief Return derived de-interleaver indices
59 */
60 virtual std::vector<size_t> deinterleaver_indices() const = 0;
61
62 /*!
63 * \brief Return true if packed bytes are expected
64 */
65 virtual bool is_packed() const = 0;
66
67 /*!
68 * \brief Return true if in interleaver mode, otherwise false
69 */
70 virtual bool interleaver_mode() const = 0;
71};
72
78} /* namespace blocks */
79} /* namespace gr */
80
81#endif /* INCLUDE_BLOCKINTERLEAVER_H */
Fully parameterizable block interleaver.
Definition: blockinterleaver_xx.h:36
virtual std::vector< size_t > interleaver_indices() const =0
Return interleaver indices.
virtual std::vector< size_t > deinterleaver_indices() const =0
Return derived de-interleaver indices.
static sptr make(std::vector< size_t > interleaver_indices, bool interleave_mode, bool is_packed=false)
Build a blockinterleaver block.
virtual bool is_packed() const =0
Return true if packed bytes are expected.
virtual bool interleaver_mode() const =0
Return true if in interleaver mode, otherwise false.
std::shared_ptr< blockinterleaver_xx< T > > sptr
Definition: blockinterleaver_xx.h:38
synchronous 1:1 input to output with history
Definition: sync_block.h:26
#define BLOCKS_API
Definition: gr-blocks/include/gnuradio/blocks/api.h:18
blockinterleaver_xx< uint8_t > blockinterleaver_bb
Definition: blockinterleaver_xx.h:73
blockinterleaver_xx< gr_complex > blockinterleaver_cc
Definition: blockinterleaver_xx.h:74
blockinterleaver_xx< int32_t > blockinterleaver_ii
Definition: blockinterleaver_xx.h:76
blockinterleaver_xx< int16_t > blockinterleaver_ss
Definition: blockinterleaver_xx.h:77
blockinterleaver_xx< float > blockinterleaver_ff
Definition: blockinterleaver_xx.h:75
GNU Radio logging wrapper.
Definition: basic_block.h:29