GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
gr-fec/include/gnuradio/fec/encoder.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2013-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_ENCODER_H
12 #define INCLUDED_FEC_ENCODER_H
13 
14 #include <gnuradio/block.h>
15 #include <gnuradio/fec/api.h>
17 #include <memory>
18 
19 namespace gr {
20 namespace fec {
21 
22 /*!
23  * \brief Creates the encoder block for use in GNU Radio
24  * flowgraphs from a given FECAPI object derived from the
25  * generic_encoder class.
26  * \ingroup error_coding_blk
27  *
28  * \details
29  *
30  * Generally, we would use the fec.extended_encoder Python
31  * implementation to instantiate this. The extended_encoder wraps
32  * up a few more details, like taking care of puncturing as well
33  * as the encoder itself.
34  */
35 class FEC_API encoder : virtual public block
36 {
37 public:
38  typedef std::shared_ptr<encoder> sptr;
39 
40  /*!
41  * Build the FEC encoder block from an FECAPI encoder object.
42  *
43  * \param my_encoder An FECAPI encoder object child of the generic_encoder class.
44  * \param input_item_size size of a block of data for the encoder.
45  * \param output_item_size size of a block of data the encoder will produce.
46  */
47  static sptr make(generic_encoder::sptr my_encoder,
48  size_t input_item_size,
49  size_t output_item_size);
50 
51  int general_work(int noutput_items,
52  gr_vector_int& ninput_items,
53  gr_vector_const_void_star& input_items,
54  gr_vector_void_star& output_items) override = 0;
55  int fixed_rate_ninput_to_noutput(int ninput) override = 0;
56  int fixed_rate_noutput_to_ninput(int noutput) override = 0;
57  void forecast(int noutput_items, gr_vector_int& ninput_items_required) override = 0;
58 };
59 
60 } /* namespace fec */
61 } /* namespace gr */
62 
63 #endif /* INCLUDED_FEC_ENCODER_H */
The abstract base class for all 'terminal' processing blocks.
Definition: gnuradio-runtime/include/gnuradio/block.h:63
Creates the encoder block for use in GNU Radio flowgraphs from a given FECAPI object derived from the...
Definition: gr-fec/include/gnuradio/fec/encoder.h:36
int fixed_rate_ninput_to_noutput(int ninput) override=0
Given ninput samples, return number of output samples that will be produced. N.B. this is only define...
static sptr make(generic_encoder::sptr my_encoder, size_t input_item_size, size_t output_item_size)
void forecast(int noutput_items, gr_vector_int &ninput_items_required) override=0
Estimate input requirements given output request.
std::shared_ptr< encoder > sptr
Definition: gr-fec/include/gnuradio/fec/encoder.h:38
int fixed_rate_noutput_to_ninput(int noutput) override=0
Given noutput samples, return number of input samples required to produce noutput....
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) override=0
compute output items from input items
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
std::vector< const void * > gr_vector_const_void_star
Definition: types.h:28
std::vector< void * > gr_vector_void_star
Definition: types.h:27
std::vector< int > gr_vector_int
Definition: types.h:23