GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
packed_to_unpacked.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2006,2013,2018 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * SPDX-License-Identifier: GPL-3.0-or-later
8  *
9  */
10 
11 
12 #ifndef PACKED_TO_UNPACKED_H
13 #define PACKED_TO_UNPACKED_H
14 
15 #include <gnuradio/block.h>
16 #include <gnuradio/blocks/api.h>
17 #include <gnuradio/endianness.h>
18 #include <cstdint>
19 
20 namespace gr {
21 namespace blocks {
22 
23 /*!
24  * \brief Convert a stream of packed bytes or shorts to stream of unpacked bytes or
25  * shorts. \ingroup byte_operators_blk
26  *
27  * \details
28  * input: stream of T; output: stream of T
29  *
30  * This is the inverse of gr::blocks::unpacked_to_packed_XX.
31  *
32  * The bits in the bytes or shorts input stream are grouped into
33  * chunks of \p bits_per_chunk bits and each resulting chunk is
34  * written right- justified to the output stream of bytes or
35  * shorts. All b or 16 bits of the each input bytes or short are
36  * processed. The right thing is done if bits_per_chunk is not a
37  * power of two.
38  *
39  * The combination of gr::blocks::packed_to_unpacked_XX_ followed by
40  * gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the
41  * general case of mapping from a stream of bytes or shorts into
42  * arbitrary float or complex symbols.
43  *
44  * \sa gr::blocks::packed_to_unpacked_bb, gr::blocks::unpacked_to_packed_bb,
45  * \sa gr::blocks::packed_to_unpacked_ss, gr::blocks::unpacked_to_packed_ss,
46  * \sa gr::blocks::chunks_to_symbols_bf, gr::blocks::chunks_to_symbols_bc.
47  * \sa gr::blocks::chunks_to_symbols_sf, gr::blocks::chunks_to_symbols_sc.
48  */
49 template <class T>
50 class BLOCKS_API packed_to_unpacked : virtual public block
51 {
52 public:
53  // gr::blocks::packed_to_unpacked::sptr
54  typedef std::shared_ptr<packed_to_unpacked<T>> sptr;
55 
56  static sptr make(unsigned int bits_per_chunk, endianness_t endianness);
57 };
58 
62 } /* namespace blocks */
63 } /* namespace gr */
64 
65 #endif /* PACKED_TO_UNPACKED_H */
The abstract base class for all 'terminal' processing blocks.
Definition: gnuradio-runtime/include/gnuradio/block.h:63
Convert a stream of packed bytes or shorts to stream of unpacked bytes or shorts.
Definition: packed_to_unpacked.h:51
static sptr make(unsigned int bits_per_chunk, endianness_t endianness)
std::shared_ptr< packed_to_unpacked< T > > sptr
Definition: packed_to_unpacked.h:54
#define BLOCKS_API
Definition: gr-blocks/include/gnuradio/blocks/api.h:18
packed_to_unpacked< std::int16_t > packed_to_unpacked_ss
Definition: packed_to_unpacked.h:60
packed_to_unpacked< std::int32_t > packed_to_unpacked_ii
Definition: packed_to_unpacked.h:61
packed_to_unpacked< std::uint8_t > packed_to_unpacked_bb
Definition: packed_to_unpacked.h:59
GNU Radio logging wrapper.
Definition: basic_block.h:29
endianness_t
Definition: endianness.h:16