Loading...
Searching...
No Matches
blockinterleaver_xx.h
Go to the documentation of this file.
/* -*- c++ -*- */
/*
* Copyright 2022 Johannes Demel.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#ifndef INCLUDE_BLOCKINTERLEAVER_H
#define INCLUDE_BLOCKINTERLEAVER_H
#include <gnuradio/blocks/api.h>
#include <gnuradio/sync_block.h>
#include <cstdint>
namespace gr {
namespace blocks {
/*!
* \brief Fully parameterizable block interleaver
* \ingroup blocks
*
* \details
* This block accepts item multiples of size \p interleaver_indices.size() and interleaves
* or deinterleaves them on the output.
*
* \param interleaver_indices indices of items in output vector.
* \param interleave_mode Switch between interleaver [true] and deinterleaver mode
* [false].
* \param is_packed Assume packed bytes. For uint8_t I/O only.
*/
template <class T>
class BLOCKS_API blockinterleaver_xx : virtual public sync_block
{
public:
typedef std::shared_ptr<blockinterleaver_xx<T>> sptr;
/*!
* \brief Build a blockinterleaver block
*
* \param interleaver_indices indices of items in output vector.
* \param interleave_mode Switch between interleaver [true] and deinterleaver mode
* [false].
* \param is_packed Assume packed bytes.
*/
static sptr make(std::vector<size_t> interleaver_indices,
bool interleave_mode,
bool is_packed = false);
/*!
* \brief Return interleaver indices
*/
virtual std::vector<size_t> interleaver_indices() const = 0;
/*!
* \brief Return derived de-interleaver indices
*/
virtual std::vector<size_t> deinterleaver_indices() const = 0;
/*!
* \brief Return true if packed bytes are expected
*/
virtual bool is_packed() const = 0;
/*!
* \brief Return true if in interleaver mode, otherwise false
*/
virtual bool interleaver_mode() const = 0;
};
typedef blockinterleaver_xx<uint8_t> blockinterleaver_bb;
typedef blockinterleaver_xx<gr_complex> blockinterleaver_cc;
typedef blockinterleaver_xx<float> blockinterleaver_ff;
typedef blockinterleaver_xx<int32_t> blockinterleaver_ii;
typedef blockinterleaver_xx<int16_t> blockinterleaver_ss;
} /* namespace blocks */
} /* namespace gr */
#endif /* INCLUDE_BLOCKINTERLEAVER_H */
gr::blocks::blockinterleaver_xx
Fully parameterizable block interleaver.
Definition blockinterleaver_xx.h:36
gr::blocks::blockinterleaver_xx< uint8_t >::interleaver_indices
virtual std::vector< size_t > interleaver_indices() const=0
gr::blocks::blockinterleaver_xx::deinterleaver_indices
virtual std::vector< size_t > deinterleaver_indices() const =0
Return derived de-interleaver indices.
gr::blocks::blockinterleaver_xx::make
static sptr make(std::vector< size_t > interleaver_indices, bool interleave_mode, bool is_packed=false)
Build a blockinterleaver block.
gr::blocks::blockinterleaver_xx< uint8_t >::is_packed
virtual bool is_packed() const=0
gr::blocks::blockinterleaver_xx::interleaver_mode
virtual bool interleaver_mode() const =0
Return true if in interleaver mode, otherwise false.
gr::blocks::blockinterleaver_xx::sptr
std::shared_ptr< blockinterleaver_xx< T > > sptr
Definition blockinterleaver_xx.h:38
gr::sync_block::sync_block
sync_block(void)
Definition sync_block.h:28
api.h
BLOCKS_API
#define BLOCKS_API
Definition gr-blocks/include/gnuradio/blocks/api.h:18
gr::blocks
Definition abs_blk.h:20
gr::blocks::blockinterleaver_bb
blockinterleaver_xx< uint8_t > blockinterleaver_bb
Definition blockinterleaver_xx.h:73
gr::blocks::blockinterleaver_cc
blockinterleaver_xx< gr_complex > blockinterleaver_cc
Definition blockinterleaver_xx.h:74
gr::blocks::blockinterleaver_ii
blockinterleaver_xx< int32_t > blockinterleaver_ii
Definition blockinterleaver_xx.h:76
gr::blocks::blockinterleaver_ss
blockinterleaver_xx< int16_t > blockinterleaver_ss
Definition blockinterleaver_xx.h:77
gr::blocks::blockinterleaver_ff
blockinterleaver_xx< float > blockinterleaver_ff
Definition blockinterleaver_xx.h:75
gr
GNU Radio logging wrapper.
Definition basic_block.h:29
sync_block.h