GNU Radio 3.6.5 C++ API

ofdm_serializer_vcc_impl.h

Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /* Copyright 2012 Free Software Foundation, Inc.
00003  * 
00004  * This file is part of GNU Radio
00005  * 
00006  * GNU Radio is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 3, or (at your option)
00009  * any later version.
00010  * 
00011  * GNU Radio is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  * 
00016  * You should have received a copy of the GNU General Public License
00017  * along with GNU Radio; see the file COPYING.  If not, write to
00018  * the Free Software Foundation, Inc., 51 Franklin Street,
00019  * Boston, MA 02110-1301, USA.
00020  */
00021 
00022 #ifndef INCLUDED_DIGITAL_OFDM_SERIALIZER_VCC_IMPL_H
00023 #define INCLUDED_DIGITAL_OFDM_SERIALIZER_VCC_IMPL_H
00024 
00025 #include <digital/ofdm_serializer_vcc.h>
00026 
00027 namespace gr {
00028   namespace digital {
00029 
00030     class ofdm_serializer_vcc_impl : public ofdm_serializer_vcc
00031     {
00032      private:
00033       int d_fft_len; //!< FFT length
00034       std::vector<std::vector<int> > d_occupied_carriers; //!< Which carriers/symbols carry data
00035       pmt::pmt_t d_packet_len_tag_key; //!< Key of the length tag
00036       pmt::pmt_t d_out_len_tag_key; //!< Key of the length tag
00037       const int d_symbols_skipped; //!< Start position in d_occupied_carriers
00038       pmt::pmt_t d_carr_offset_key; //!< Key of the carrier offset tag
00039       int d_curr_set; //!< Current position in d_occupied_carriers
00040       int d_symbols_per_set;
00041 
00042      protected:
00043       /*!
00044        * Calculate the number of scalar complex symbols given a number of
00045        * OFDM symbols.
00046        */
00047       int calculate_output_stream_length(const gr_vector_int &ninput_items);
00048       void update_length_tags(int n_produced, int n_ports);
00049 
00050      public:
00051       ofdm_serializer_vcc_impl(
00052           int fft_len,
00053           const std::vector<std::vector<int> > &occupied_carriers,
00054           const std::string &len_tag_key,
00055           const std::string &packet_len_tag_key,
00056           int symbols_skipped,
00057           const std::string &carr_offset_key,
00058           bool input_is_shifted
00059       );
00060       ~ofdm_serializer_vcc_impl();
00061 
00062       int work(int noutput_items,
00063                        gr_vector_int &ninput_items,
00064                        gr_vector_const_void_star &input_items,
00065                        gr_vector_void_star &output_items);
00066     };
00067 
00068   } // namespace digital
00069 } // namespace gr
00070 
00071 #endif /* INCLUDED_DIGITAL_OFDM_SERIALIZER_VCC_IMPL_H */
00072