GNU Radio Manual and C++ API Reference 3.8.5.0
The Free & Open Software Radio Ecosystem
 
Loading...
Searching...
No Matches
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 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
10 * any later version.
11 *
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Radio; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street,
20 * Boston, MA 02110-1301, USA.
21 */
22
23
24#ifndef PACKED_TO_UNPACKED_H
25#define PACKED_TO_UNPACKED_H
26
27#include <gnuradio/block.h>
28#include <gnuradio/blocks/api.h>
29#include <gnuradio/endianness.h>
30#include <cstdint>
31
32namespace gr {
33namespace blocks {
34
35/*!
36 * \brief Convert a stream of packed bytes or shorts to stream of unpacked bytes or
37 * shorts. \ingroup byte_operators_blk
38 *
39 * \details
40 * input: stream of T; output: stream of T
41 *
42 * This is the inverse of gr::blocks::unpacked_to_packed_XX.
43 *
44 * The bits in the bytes or shorts input stream are grouped into
45 * chunks of \p bits_per_chunk bits and each resulting chunk is
46 * written right- justified to the output stream of bytes or
47 * shorts. All b or 16 bits of the each input bytes or short are
48 * processed. The right thing is done if bits_per_chunk is not a
49 * power of two.
50 *
51 * The combination of gr::blocks::packed_to_unpacked_XX_ followed by
52 * gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the
53 * general case of mapping from a stream of bytes or shorts into
54 * arbitrary float or complex symbols.
55 *
56 * \sa gr::blocks::packed_to_unpacked_bb, gr::blocks::unpacked_to_packed_bb,
57 * \sa gr::blocks::packed_to_unpacked_ss, gr::blocks::unpacked_to_packed_ss,
58 * \sa gr::blocks::chunks_to_symbols_bf, gr::blocks::chunks_to_symbols_bc.
59 * \sa gr::blocks::chunks_to_symbols_sf, gr::blocks::chunks_to_symbols_sc.
60 */
61template <class T>
62class BLOCKS_API packed_to_unpacked : virtual public block
63{
64public:
65 // gr::blocks::packed_to_unpacked::sptr
66 typedef boost::shared_ptr<packed_to_unpacked<T>> sptr;
67
68 static sptr make(unsigned int bits_per_chunk, endianness_t endianness);
69};
70
74} /* namespace blocks */
75} /* namespace gr */
76
77#endif /* PACKED_TO_UNPACKED_H */
The abstract base class for all 'terminal' processing blocks.
Definition block.h:72
Convert a stream of packed bytes or shorts to stream of unpacked bytes or shorts.
Definition packed_to_unpacked.h:63
boost::shared_ptr< packed_to_unpacked< T > > sptr
Definition packed_to_unpacked.h:66
static sptr make(unsigned int bits_per_chunk, endianness_t endianness)
#define BLOCKS_API
Definition gr-blocks/include/gnuradio/blocks/api.h:30
packed_to_unpacked< std::int16_t > packed_to_unpacked_ss
Definition packed_to_unpacked.h:72
packed_to_unpacked< std::int32_t > packed_to_unpacked_ii
Definition packed_to_unpacked.h:73
packed_to_unpacked< std::uint8_t > packed_to_unpacked_bb
Definition packed_to_unpacked.h:71
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition basic_block.h:46
endianness_t
Definition endianness.h:28