GNU Radio Manual and C++ API Reference 3.8.5.0
The Free & Open Software Radio Ecosystem
 
Loading...
Searching...
No Matches
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
31namespace gr {
32namespace 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{
49public:
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 Maximum 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 */
boost::shared_ptr< generic_encoder > sptr
Definition generic_encoder.h:49
Creates the encoder block for use in GNU Radio flowgraphs from a given FECAPI object derived from the...
Definition tagged_encoder.h:48
virtual int work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)=0
Just like gr::block::general_work, but makes sure the input is valid.
virtual int calculate_output_stream_length(const gr_vector_int &ninput_items)=0
Calculate the number of output items.
boost::shared_ptr< tagged_encoder > sptr
Definition tagged_encoder.h:50
static sptr make(generic_encoder::sptr my_encoder, size_t input_item_size, size_t output_item_size, const std::string &lengthtagname="packet_len", int mtu=1500)
Block that operates on PDUs in form of tagged streams.
Definition tagged_stream_block.h:38
#define FEC_API
Definition gr-fec/include/gnuradio/fec/api.h:30
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition basic_block.h:46
std::vector< const void * > gr_vector_const_void_star
Definition types.h:40
std::vector< void * > gr_vector_void_star
Definition types.h:39
std::vector< int > gr_vector_int
Definition types.h:35