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
tagged_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_TAGGED_ENCODER_H
24 #define INCLUDED_FEC_TAGGED_ENCODER_H
25 
26 #include <gnuradio/fec/api.h>
29 #include <boost/shared_ptr.hpp>
30 
31 namespace gr {
32  namespace fec {
33 
34  /*!
35  * \brief Creates the encoder block for use in GNU Radio
36  * flowgraphs from a given FECAPI object derived from the
37  * generic_encoder class.
38  * \ingroup error_coding_blk
39  *
40  * \details
41  *
42  * Generally, we would use the fec.extended_encoder Python
43  * implementation to instantiate this. The extended_encoder wraps
44  * up a few more details, like taking care of puncturing as well
45  * as the encoder itself.
46  */
48  {
49  public:
50  typedef boost::shared_ptr<tagged_encoder> sptr;
51 
52  /*!
53  * Build the FEC encoder block from an FECAPI encoder object.
54  *
55  * \param my_encoder An FECAPI encoder object child of the generic_encoder class.
56  * \param input_item_size size of a block of data for the encoder.
57  * \param output_item_size size of a block of data the encoder will produce.
58  * \param lengthtagname Key name of the tagged stream frame size.
59  * \param mtu The Maxium Transmission Unit (MTU) of the input
60  * frame that the block will be able to
61  * process. Specified in bytes and defaults to 1500.
62  */
63  static sptr make(generic_encoder::sptr my_encoder,
64  size_t input_item_size,
65  size_t output_item_size,
66  const std::string& lengthtagname="packet_len",
67  int mtu=1500);
68 
69  virtual int work(int noutput_items,
70  gr_vector_int& ninput_items,
71  gr_vector_const_void_star &input_items,
72  gr_vector_void_star &output_items) = 0;
73  virtual int calculate_output_stream_length(const gr_vector_int &ninput_items) = 0;
74  };
75 
76  } /* namespace fec */
77 } /* namespace gr */
78 
79 #endif /* INCLUDED_FEC_TAGGED_ENCODER_H */
Block that operates on PDUs in form of tagged streamsOverride work to provide the signal processing i...
Definition: tagged_stream_block.h:37
Creates the encoder block for use in GNU Radio flowgraphs from a given FECAPI object derived from the...
Definition: tagged_encoder.h:47
boost::shared_ptr< tagged_encoder > sptr
Definition: tagged_encoder.h:50
std::vector< const void * > gr_vector_const_void_star
Definition: gnuradio-runtime/include/gnuradio/types.h:38
std::vector< void * > gr_vector_void_star
Definition: gnuradio-runtime/include/gnuradio/types.h:37
std::vector< int > gr_vector_int
Definition: gnuradio-runtime/include/gnuradio/types.h:33
Include this header to use the message passing features.
Definition: logger.h:131
boost::shared_ptr< generic_encoder > sptr
Definition: generic_encoder.h:49
#define FEC_API
Definition: gr-fec/include/gnuradio/fec/api.h:30