GNU Radio Manual and C++ API Reference  3.7.9.2
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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  * 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 #ifndef INCLUDED_FEC_DUMMY_ENCODER_H
24 #define INCLUDED_FEC_DUMMY_ENCODER_H
25 
26 #include <gnuradio/fec/api.h>
27 #include <gnuradio/fec/encoder.h>
28 #include <map>
29 #include <string>
30 
31 namespace gr {
32  namespace fec {
33  namespace code {
34 
35  /*!
36  * \brief Dummy Encoding class.
37  * \ingroup error_coding_blk
38  *
39  * \details
40  * A dummy encoder class that simply passes the input to the
41  * output. It is meant to allow us to easily use the FEC API
42  * encoder and decoder blocks in an application with no coding.
43  */
44  class FEC_API dummy_encoder : virtual public generic_encoder
45  {
46  public:
47 
48  /*!
49  * Build a dummy encoding FEC API object.
50  *
51  * \param frame_size Number of bits per frame. If using in the
52  * tagged stream style, this is the maximum allowable
53  * number of bits per frame.
54  * \param pack Determines how to handle the input data stream
55  * as packed or unpacked bits. If set to True, the
56  * encoder's get_input_conversion will be set to
57  * 'pack', meaning that the data must be packed before
58  * being sent to this encoder. Generally handled
59  * through an extended encoder interface.
60  * \param packed_bits Determines how the output data stream is
61  * handled. If set to True, the encoder's
62  * get_output_conversion returns 'packed_bits', meaning
63  * that the output data of the encoder is packed and
64  * should be unpacked. Generally handled throug an
65  * extended encoder interface.
66  */
67  static generic_encoder::sptr make(int frame_size, bool pack = false,
68  bool packed_bits = false);
69 
70  /*!
71  * Sets the uncoded frame size to \p frame_size. If \p
72  * frame_size is greater than the value given to the
73  * constructor, the frame size will be capped by that initial
74  * value and this function will return false. Otherwise, it
75  * returns true.
76  */
77  virtual bool set_frame_size(unsigned int frame_size) = 0;
78 
79  /*!
80  * Returns the coding rate of this encoder (it will always be 1).
81  */
82  virtual double rate() = 0;
83  };
84 
85  } /* namespace code */
86  } /* namespace fec */
87 } /* namespace gr */
88 
89 #endif /* INCLUDED_FEC_DUMMY_ENCODER_H */
Dummy Encoding class.
Definition: dummy_encoder.h:44
Include this header to use the message passing features.
Definition: logger.h:131
Definition: generic_encoder.h:34
boost::shared_ptr< generic_encoder > sptr
Definition: generic_encoder.h:49
#define FEC_API
Definition: gr-fec/include/gnuradio/fec/api.h:30