GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
dummy_encoder.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2014 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 #ifndef INCLUDED_FEC_DUMMY_ENCODER_H
12 #define INCLUDED_FEC_DUMMY_ENCODER_H
13 
14 #include <gnuradio/fec/api.h>
15 #include <gnuradio/fec/encoder.h>
16 #include <map>
17 #include <string>
18 
19 namespace gr {
20 namespace fec {
21 namespace code {
22 
23 /*!
24  * \brief Dummy Encoding class.
25  * \ingroup error_coding_blk
26  *
27  * \details
28  * A dummy encoder class that simply passes the input to the
29  * output. It is meant to allow us to easily use the FEC API
30  * encoder and decoder blocks in an application with no coding.
31  */
32 class FEC_API dummy_encoder : virtual public generic_encoder
33 {
34 public:
35  /*!
36  * Build a dummy encoding FEC API object.
37  *
38  * \param frame_size Number of bits per frame. If using in the
39  * tagged stream style, this is the maximum allowable
40  * number of bits per frame.
41  * \param pack Determines how to handle the input data stream
42  * as packed or unpacked bits. If set to True, the
43  * encoder's get_input_conversion will be set to
44  * 'pack', meaning that the data must be packed before
45  * being sent to this encoder. Generally handled
46  * through an extended encoder interface.
47  * \param packed_bits Determines how the output data stream is
48  * handled. If set to True, the encoder's
49  * get_output_conversion returns 'packed_bits', meaning
50  * that the output data of the encoder is packed and
51  * should be unpacked. Generally handled through an
52  * extended encoder interface.
53  */
55  make(int frame_size, bool pack = false, bool packed_bits = false);
56 
57  /*!
58  * Sets the uncoded frame size to \p frame_size. If \p
59  * frame_size is greater than the value given to the
60  * constructor, the frame size will be capped by that initial
61  * value and this function will return false. Otherwise, it
62  * returns true.
63  */
64  bool set_frame_size(unsigned int frame_size) override = 0;
65 
66  /*!
67  * Returns the coding rate of this encoder (it will always be 1).
68  */
69  double rate() override = 0;
70 };
71 
72 } /* namespace code */
73 } /* namespace fec */
74 } /* namespace gr */
75 
76 #endif /* INCLUDED_FEC_DUMMY_ENCODER_H */
Dummy Encoding class.
Definition: dummy_encoder.h:33
double rate() override=0
bool set_frame_size(unsigned int frame_size) override=0
static generic_encoder::sptr make(int frame_size, bool pack=false, bool packed_bits=false)
Definition: generic_encoder.h:23
std::shared_ptr< generic_encoder > sptr
Definition: generic_encoder.h:37
#define FEC_API
Definition: gr-fec/include/gnuradio/fec/api.h:18
GNU Radio logging wrapper.
Definition: basic_block.h:29