diff options
Diffstat (limited to 'gnuradio-core/src/lib')
187 files changed, 995 insertions, 1231 deletions
diff --git a/gnuradio-core/src/lib/Makefile.am b/gnuradio-core/src/lib/Makefile.am index 477ba6725..f3a3accdb 100644 --- a/gnuradio-core/src/lib/Makefile.am +++ b/gnuradio-core/src/lib/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2001,2004,2009 Free Software Foundation, Inc. +# Copyright 2001,2004,2009,2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -33,10 +33,11 @@ AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_INCLUDES) $(WITH_INCLUDES) # generate libgnuradio-core.la from the convenience libraries in subdirs -lib_LTLIBRARIES = libgnuradio-core.la libgnuradio-core-qa.la +lib_LTLIBRARIES = libgnuradio-core.la +noinst_LTLIBRARIES = libgnuradio-core-qa.la libgnuradio_core_la_SOURCES = bug_work_around_6.cc -libgnuradio_core_la_LDFLAGS = $(NO_UNDEFINED) -version-info 0:0:0 +libgnuradio_core_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS) libgnuradio_core_qa_la_SOURCES = bug_work_around_6.cc libgnuradio_core_qa_la_LDFLAGS = $(NO_UNDEFINED) -version-info 0:0:0 \ @@ -68,4 +69,4 @@ libgnuradio_core_qa_la_LIBADD = \ bin_PROGRAMS = gnuradio-config-info gnuradio_config_info_SOURCES = gnuradio-config-info.cc -gnuradio_config_info_LDADD = libgnuradio-core.la $(BOOST_PROGRAM_OPTIONS_LIB)
\ No newline at end of file +gnuradio_config_info_LDADD = libgnuradio-core.la $(BOOST_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LIB) diff --git a/gnuradio-core/src/lib/filter/gr_cma_equalizer_cc.cc b/gnuradio-core/src/lib/filter/gr_cma_equalizer_cc.cc index 6a6fe1c26..8252509bb 100644 --- a/gnuradio-core/src/lib/filter/gr_cma_equalizer_cc.cc +++ b/gnuradio-core/src/lib/filter/gr_cma_equalizer_cc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -29,7 +29,7 @@ gr_cma_equalizer_cc_sptr gr_make_cma_equalizer_cc(int num_taps, float modulus, float mu) { - return gr_cma_equalizer_cc_sptr(new gr_cma_equalizer_cc(num_taps, modulus, mu)); + return gnuradio::get_initial_sptr(new gr_cma_equalizer_cc(num_taps, modulus, mu)); } gr_cma_equalizer_cc::gr_cma_equalizer_cc(int num_taps, float modulus, float mu) diff --git a/gnuradio-core/src/lib/filter/gr_fft_filter_ccc.cc b/gnuradio-core/src/lib/filter/gr_fft_filter_ccc.cc index 4540c6e4a..02bfaf105 100644 --- a/gnuradio-core/src/lib/filter/gr_fft_filter_ccc.cc +++ b/gnuradio-core/src/lib/filter/gr_fft_filter_ccc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -45,7 +45,7 @@ gr_fft_filter_ccc_sptr gr_make_fft_filter_ccc (int decimation, const std::vector<gr_complex> &taps) { - return gr_fft_filter_ccc_sptr (new gr_fft_filter_ccc (decimation, taps)); + return gnuradio::get_initial_sptr(new gr_fft_filter_ccc (decimation, taps)); } diff --git a/gnuradio-core/src/lib/filter/gr_fft_filter_fff.cc b/gnuradio-core/src/lib/filter/gr_fft_filter_fff.cc index e8857fe8c..e5b218f20 100644 --- a/gnuradio-core/src/lib/filter/gr_fft_filter_fff.cc +++ b/gnuradio-core/src/lib/filter/gr_fft_filter_fff.cc @@ -37,7 +37,7 @@ gr_fft_filter_fff_sptr gr_make_fft_filter_fff (int decimation, const std::vector<float> &taps) { - return gr_fft_filter_fff_sptr (new gr_fft_filter_fff (decimation, taps)); + return gnuradio::get_initial_sptr(new gr_fft_filter_fff (decimation, taps)); } diff --git a/gnuradio-core/src/lib/filter/gr_filter_delay_fc.cc b/gnuradio-core/src/lib/filter/gr_filter_delay_fc.cc index 49a1e0eb3..7974da934 100644 --- a/gnuradio-core/src/lib/filter/gr_filter_delay_fc.cc +++ b/gnuradio-core/src/lib/filter/gr_filter_delay_fc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ gr_filter_delay_fc_sptr gr_make_filter_delay_fc (const std::vector<float> &taps) { - return gr_filter_delay_fc_sptr (new gr_filter_delay_fc (taps)); + return gnuradio::get_initial_sptr(new gr_filter_delay_fc (taps)); } gr_filter_delay_fc::gr_filter_delay_fc (const std::vector<float> &taps) diff --git a/gnuradio-core/src/lib/filter/gr_fir_filter_XXX.cc.t b/gnuradio-core/src/lib/filter/gr_fir_filter_XXX.cc.t index b99de5073..29e351925 100644 --- a/gnuradio-core/src/lib/filter/gr_fir_filter_XXX.cc.t +++ b/gnuradio-core/src/lib/filter/gr_fir_filter_XXX.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -36,7 +36,7 @@ @SPTR_NAME@ gr_make_@BASE_NAME@ (int decimation, const std::vector<@TAP_TYPE@> &taps) { - return @SPTR_NAME@ (new @NAME@ (decimation, taps)); + return gnuradio::get_initial_sptr (new @NAME@ (decimation, taps)); } diff --git a/gnuradio-core/src/lib/filter/gr_fractional_interpolator_cc.cc b/gnuradio-core/src/lib/filter/gr_fractional_interpolator_cc.cc index 56a1a31aa..500958e3d 100644 --- a/gnuradio-core/src/lib/filter/gr_fractional_interpolator_cc.cc +++ b/gnuradio-core/src/lib/filter/gr_fractional_interpolator_cc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2007 Free Software Foundation, Inc. + * Copyright 2004,2007,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ // Public constructor gr_fractional_interpolator_cc_sptr gr_make_fractional_interpolator_cc(float phase_shift, float interp_ratio) { - return gr_fractional_interpolator_cc_sptr(new gr_fractional_interpolator_cc(phase_shift, interp_ratio)); + return gnuradio::get_initial_sptr(new gr_fractional_interpolator_cc(phase_shift, interp_ratio)); } gr_fractional_interpolator_cc::gr_fractional_interpolator_cc(float phase_shift, float interp_ratio) diff --git a/gnuradio-core/src/lib/filter/gr_fractional_interpolator_ff.cc b/gnuradio-core/src/lib/filter/gr_fractional_interpolator_ff.cc index 0e0fdad7f..9cbe31635 100644 --- a/gnuradio-core/src/lib/filter/gr_fractional_interpolator_ff.cc +++ b/gnuradio-core/src/lib/filter/gr_fractional_interpolator_ff.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2007 Free Software Foundation, Inc. + * Copyright 2004,2007,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ // Public constructor gr_fractional_interpolator_ff_sptr gr_make_fractional_interpolator_ff(float phase_shift, float interp_ratio) { - return gr_fractional_interpolator_ff_sptr(new gr_fractional_interpolator_ff(phase_shift, interp_ratio)); + return gnuradio::get_initial_sptr(new gr_fractional_interpolator_ff(phase_shift, interp_ratio)); } gr_fractional_interpolator_ff::gr_fractional_interpolator_ff(float phase_shift, float interp_ratio) diff --git a/gnuradio-core/src/lib/filter/gr_freq_xlating_fir_filter_XXX.cc.t b/gnuradio-core/src/lib/filter/gr_freq_xlating_fir_filter_XXX.cc.t index f51e046af..656b3402a 100644 --- a/gnuradio-core/src/lib/filter/gr_freq_xlating_fir_filter_XXX.cc.t +++ b/gnuradio-core/src/lib/filter/gr_freq_xlating_fir_filter_XXX.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2003 Free Software Foundation, Inc. + * Copyright 2003,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -39,7 +39,7 @@ gr_make_@BASE_NAME@ (int decimation, const std::vector<@TAP_TYPE@> &taps, double center_freq, double sampling_freq) { - return @SPTR_NAME@ (new @NAME@ (decimation, taps, center_freq, sampling_freq)); + return gnuradio::get_initial_sptr (new @NAME@ (decimation, taps, center_freq, sampling_freq)); } diff --git a/gnuradio-core/src/lib/filter/gr_goertzel_fc.cc b/gnuradio-core/src/lib/filter/gr_goertzel_fc.cc index aee8df844..a93751b2f 100644 --- a/gnuradio-core/src/lib/filter/gr_goertzel_fc.cc +++ b/gnuradio-core/src/lib/filter/gr_goertzel_fc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_goertzel_fc_sptr gr_make_goertzel_fc(int rate, int len, float freq) { - return gr_goertzel_fc_sptr (new gr_goertzel_fc(rate, len, freq)); + return gnuradio::get_initial_sptr(new gr_goertzel_fc(rate, len, freq)); } gr_goertzel_fc::gr_goertzel_fc(int rate, int len, float freq) diff --git a/gnuradio-core/src/lib/filter/gr_hilbert_fc.cc b/gnuradio-core/src/lib/filter/gr_hilbert_fc.cc index 65343916c..7445f051e 100644 --- a/gnuradio-core/src/lib/filter/gr_hilbert_fc.cc +++ b/gnuradio-core/src/lib/filter/gr_hilbert_fc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -33,7 +33,7 @@ gr_hilbert_fc_sptr gr_make_hilbert_fc (unsigned int ntaps) { - return gr_hilbert_fc_sptr (new gr_hilbert_fc (ntaps)); + return gnuradio::get_initial_sptr(new gr_hilbert_fc (ntaps)); } gr_hilbert_fc::gr_hilbert_fc (unsigned int ntaps) diff --git a/gnuradio-core/src/lib/filter/gr_iir_filter_ffd.cc b/gnuradio-core/src/lib/filter/gr_iir_filter_ffd.cc index 0c2d38630..a41a4f7db 100644 --- a/gnuradio-core/src/lib/filter/gr_iir_filter_ffd.cc +++ b/gnuradio-core/src/lib/filter/gr_iir_filter_ffd.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -33,7 +33,7 @@ gr_iir_filter_ffd_sptr gr_make_iir_filter_ffd (const std::vector<double> &fftaps, const std::vector<double> &fbtaps) throw (std::invalid_argument) { - return gr_iir_filter_ffd_sptr (new gr_iir_filter_ffd (fftaps, fbtaps)); + return gnuradio::get_initial_sptr(new gr_iir_filter_ffd (fftaps, fbtaps)); } gr_iir_filter_ffd::gr_iir_filter_ffd (const std::vector<double> &fftaps, diff --git a/gnuradio-core/src/lib/filter/gr_interp_fir_filter_XXX.cc.t b/gnuradio-core/src/lib/filter/gr_interp_fir_filter_XXX.cc.t index 274aee727..b90450c65 100644 --- a/gnuradio-core/src/lib/filter/gr_interp_fir_filter_XXX.cc.t +++ b/gnuradio-core/src/lib/filter/gr_interp_fir_filter_XXX.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -38,7 +38,7 @@ @SPTR_NAME@ gr_make_@BASE_NAME@ (unsigned interpolation, const std::vector<@TAP_TYPE@> &taps) { - return @SPTR_NAME@ (new @NAME@ (interpolation, taps)); + return gnuradio::get_initial_sptr (new @NAME@ (interpolation, taps)); } diff --git a/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc b/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc index 5a6e753ab..399632003 100644 --- a/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc +++ b/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc @@ -34,8 +34,8 @@ gr_pfb_arb_resampler_ccf_sptr gr_make_pfb_arb_resampler_ccf (float rate, const std::vector<float> &taps, unsigned int filter_size) { - return gr_pfb_arb_resampler_ccf_sptr (new gr_pfb_arb_resampler_ccf (rate, taps, - filter_size)); + return gnuradio::get_initial_sptr(new gr_pfb_arb_resampler_ccf (rate, taps, + filter_size)); } @@ -81,6 +81,8 @@ gr_pfb_arb_resampler_ccf::gr_pfb_arb_resampler_ccf (float rate, create_diff_taps(taps, dtaps); create_taps(taps, d_taps, d_filters); create_taps(dtaps, d_dtaps, d_diff_filters); + + set_relative_rate(rate); } gr_pfb_arb_resampler_ccf::~gr_pfb_arb_resampler_ccf () diff --git a/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.cc b/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.cc index 5fda47880..cb67b8104 100644 --- a/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.cc +++ b/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.cc @@ -36,7 +36,7 @@ gr_pfb_channelizer_ccf_sptr gr_make_pfb_channelizer_ccf (unsigned int numchans, const std::vector<float> &taps, float oversample_rate) { - return gr_pfb_channelizer_ccf_sptr (new gr_pfb_channelizer_ccf (numchans, taps, + return gnuradio::get_initial_sptr(new gr_pfb_channelizer_ccf (numchans, taps, oversample_rate)); } @@ -60,6 +60,8 @@ gr_pfb_channelizer_ccf::gr_pfb_channelizer_ccf (unsigned int numchans, if(fltp != 0.0) throw std::invalid_argument("gr_pfb_channelizer: oversample rate must be N/i for i in [1, N]"); + set_relative_rate(1.0/intp); + d_filters = std::vector<gr_fir_ccf*>(d_numchans); // Create an FIR filter for each channel and zero out the taps diff --git a/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.cc b/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.cc index ff4fb70a3..937899c0d 100644 --- a/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.cc +++ b/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.cc @@ -39,7 +39,7 @@ gr_pfb_clock_sync_ccf_sptr gr_make_pfb_clock_sync_ccf (double sps, float gain, float init_phase, float max_rate_deviation) { - return gr_pfb_clock_sync_ccf_sptr (new gr_pfb_clock_sync_ccf (sps, gain, taps, + return gnuradio::get_initial_sptr(new gr_pfb_clock_sync_ccf (sps, gain, taps, filter_size, init_phase, max_rate_deviation)); diff --git a/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_fff.cc b/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_fff.cc index 86de3b5a1..5d7f7a0d0 100644 --- a/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_fff.cc +++ b/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_fff.cc @@ -39,7 +39,7 @@ gr_pfb_clock_sync_fff_sptr gr_make_pfb_clock_sync_fff (double sps, float gain, float init_phase, float max_rate_deviation) { - return gr_pfb_clock_sync_fff_sptr (new gr_pfb_clock_sync_fff (sps, gain, taps, + return gnuradio::get_initial_sptr(new gr_pfb_clock_sync_fff (sps, gain, taps, filter_size, init_phase, max_rate_deviation)); diff --git a/gnuradio-core/src/lib/filter/gr_pfb_decimator_ccf.cc b/gnuradio-core/src/lib/filter/gr_pfb_decimator_ccf.cc index e05e18ff2..28c6a611a 100644 --- a/gnuradio-core/src/lib/filter/gr_pfb_decimator_ccf.cc +++ b/gnuradio-core/src/lib/filter/gr_pfb_decimator_ccf.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2009 Free Software Foundation, Inc. + * Copyright 2009,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -36,7 +36,7 @@ gr_pfb_decimator_ccf_sptr gr_make_pfb_decimator_ccf (unsigned int decim, const std::vector<float> &taps, unsigned int channel) { - return gr_pfb_decimator_ccf_sptr (new gr_pfb_decimator_ccf (decim, taps, channel)); + return gnuradio::get_initial_sptr(new gr_pfb_decimator_ccf (decim, taps, channel)); } diff --git a/gnuradio-core/src/lib/filter/gr_pfb_interpolator_ccf.cc b/gnuradio-core/src/lib/filter/gr_pfb_interpolator_ccf.cc index 6a9598f34..8a0ad1c4c 100644 --- a/gnuradio-core/src/lib/filter/gr_pfb_interpolator_ccf.cc +++ b/gnuradio-core/src/lib/filter/gr_pfb_interpolator_ccf.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2009 Free Software Foundation, Inc. + * Copyright 2009,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -33,7 +33,7 @@ gr_pfb_interpolator_ccf_sptr gr_make_pfb_interpolator_ccf (unsigned int interp, const std::vector<float> &taps) { - return gr_pfb_interpolator_ccf_sptr (new gr_pfb_interpolator_ccf (interp, taps)); + return gnuradio::get_initial_sptr(new gr_pfb_interpolator_ccf (interp, taps)); } diff --git a/gnuradio-core/src/lib/filter/gr_rational_resampler_base_XXX.cc.t b/gnuradio-core/src/lib/filter/gr_rational_resampler_base_XXX.cc.t index 69276f58e..3e9a34cdc 100644 --- a/gnuradio-core/src/lib/filter/gr_rational_resampler_base_XXX.cc.t +++ b/gnuradio-core/src/lib/filter/gr_rational_resampler_base_XXX.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -42,7 +42,7 @@ gr_make_@BASE_NAME@ (unsigned interpolation, unsigned decimation, const std::vector<@TAP_TYPE@> &taps) { - return @SPTR_NAME@ (new @NAME@ (interpolation, decimation, taps)); + return gnuradio::get_initial_sptr (new @NAME@ (interpolation, decimation, taps)); } @NAME@::@NAME@ (unsigned interpolation, unsigned decimation, diff --git a/gnuradio-core/src/lib/filter/gr_single_pole_iir_filter_cc.cc b/gnuradio-core/src/lib/filter/gr_single_pole_iir_filter_cc.cc index e4269798b..8f8efb7e6 100644 --- a/gnuradio-core/src/lib/filter/gr_single_pole_iir_filter_cc.cc +++ b/gnuradio-core/src/lib/filter/gr_single_pole_iir_filter_cc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006 Free Software Foundation, Inc. + * Copyright 2004,2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ gr_single_pole_iir_filter_cc_sptr gr_make_single_pole_iir_filter_cc (double alpha, unsigned int vlen) { - return gr_single_pole_iir_filter_cc_sptr(new gr_single_pole_iir_filter_cc(alpha, vlen)); + return gnuradio::get_initial_sptr(new gr_single_pole_iir_filter_cc(alpha, vlen)); } gr_single_pole_iir_filter_cc::gr_single_pole_iir_filter_cc ( diff --git a/gnuradio-core/src/lib/filter/gr_single_pole_iir_filter_ff.cc b/gnuradio-core/src/lib/filter/gr_single_pole_iir_filter_ff.cc index a71861ba8..3282f1fc3 100644 --- a/gnuradio-core/src/lib/filter/gr_single_pole_iir_filter_ff.cc +++ b/gnuradio-core/src/lib/filter/gr_single_pole_iir_filter_ff.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ gr_single_pole_iir_filter_ff_sptr gr_make_single_pole_iir_filter_ff (double alpha, unsigned int vlen) { - return gr_single_pole_iir_filter_ff_sptr(new gr_single_pole_iir_filter_ff(alpha, vlen)); + return gnuradio::get_initial_sptr(new gr_single_pole_iir_filter_ff(alpha, vlen)); } gr_single_pole_iir_filter_ff::gr_single_pole_iir_filter_ff ( diff --git a/gnuradio-core/src/lib/general/Makefile.am b/gnuradio-core/src/lib/general/Makefile.am index b5f5c346b..3d8a42805 100644 --- a/gnuradio-core/src/lib/general/Makefile.am +++ b/gnuradio-core/src/lib/general/Makefile.am @@ -60,7 +60,6 @@ libgeneral_la_SOURCES = \ gr_cpfsk_bc.cc \ gr_crc32.cc \ gr_ctcss_squelch_ff.cc \ - gr_dd_mpsk_sync_cc.cc \ gr_decode_ccsds_27_fb.cc \ gr_deinterleave.cc \ gr_delay.cc \ @@ -215,7 +214,6 @@ grinclude_HEADERS = \ gr_cpfsk_bc.h \ gr_crc32.h \ gr_ctcss_squelch_ff.h \ - gr_dd_mpsk_sync_cc.h \ gr_decode_ccsds_27_fb.h \ gr_diff_decoder_bb.h \ gr_diff_encoder_bb.h \ @@ -386,7 +384,6 @@ swiginclude_HEADERS = \ gr_cpfsk_bc.i \ gr_crc32.i \ gr_ctcss_squelch_ff.i \ - gr_dd_mpsk_sync_cc.i \ gr_decode_ccsds_27_fb.i \ gr_diff_decoder_bb.i \ gr_diff_encoder_bb.i \ diff --git a/gnuradio-core/src/lib/general/general.i b/gnuradio-core/src/lib/general/general.i index 6929f1e6e..68cafce2e 100644 --- a/gnuradio-core/src/lib/general/general.i +++ b/gnuradio-core/src/lib/general/general.i @@ -80,7 +80,6 @@ #include <gr_threshold_ff.h> #include <gr_clock_recovery_mm_ff.h> #include <gr_clock_recovery_mm_cc.h> -#include <gr_dd_mpsk_sync_cc.h> #include <gr_packet_sink.h> #include <gr_lms_dfe_cc.h> #include <gr_lms_dfe_ff.h> @@ -202,7 +201,6 @@ %include "gr_threshold_ff.i" %include "gr_clock_recovery_mm_ff.i" %include "gr_clock_recovery_mm_cc.i" -%include "gr_dd_mpsk_sync_cc.i" %include "gr_packet_sink.i" %include "gr_lms_dfe_cc.i" %include "gr_lms_dfe_ff.i" diff --git a/gnuradio-core/src/lib/general/gr_additive_scrambler_bb.cc b/gnuradio-core/src/lib/general/gr_additive_scrambler_bb.cc index 91e02c2d3..f390df6d5 100644 --- a/gnuradio-core/src/lib/general/gr_additive_scrambler_bb.cc +++ b/gnuradio-core/src/lib/general/gr_additive_scrambler_bb.cc @@ -30,7 +30,7 @@ gr_additive_scrambler_bb_sptr gr_make_additive_scrambler_bb(int mask, int seed, int len, int count) { - return gr_additive_scrambler_bb_sptr(new gr_additive_scrambler_bb(mask, seed, len, count)); + return gnuradio::get_initial_sptr(new gr_additive_scrambler_bb(mask, seed, len, count)); } gr_additive_scrambler_bb::gr_additive_scrambler_bb(int mask, int seed, int len, int count) diff --git a/gnuradio-core/src/lib/general/gr_agc2_cc.cc b/gnuradio-core/src/lib/general/gr_agc2_cc.cc index 175ca4ab2..687f6c857 100644 --- a/gnuradio-core/src/lib/general/gr_agc2_cc.cc +++ b/gnuradio-core/src/lib/general/gr_agc2_cc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ gr_agc2_cc_sptr gr_make_agc2_cc (float attack_rate, float decay_rate, float reference, float gain, float max_gain) { - return gr_agc2_cc_sptr (new gr_agc2_cc (attack_rate, decay_rate, reference, gain, max_gain)); + return gnuradio::get_initial_sptr(new gr_agc2_cc (attack_rate, decay_rate, reference, gain, max_gain)); } gr_agc2_cc::gr_agc2_cc (float attack_rate, float decay_rate, float reference, diff --git a/gnuradio-core/src/lib/general/gr_agc2_ff.cc b/gnuradio-core/src/lib/general/gr_agc2_ff.cc index a9f7fffab..667e9d05d 100644 --- a/gnuradio-core/src/lib/general/gr_agc2_ff.cc +++ b/gnuradio-core/src/lib/general/gr_agc2_ff.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2006 Free Software Foundation, Inc. + * Copyright 2005,2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ gr_agc2_ff_sptr gr_make_agc2_ff (float attack_rate, float decay_rate, float reference, float gain, float max_gain) { - return gr_agc2_ff_sptr (new gr_agc2_ff (attack_rate, decay_rate, reference, + return gnuradio::get_initial_sptr(new gr_agc2_ff (attack_rate, decay_rate, reference, gain, max_gain)); } diff --git a/gnuradio-core/src/lib/general/gr_agc_cc.cc b/gnuradio-core/src/lib/general/gr_agc_cc.cc index 3f48b55fe..92cec0088 100644 --- a/gnuradio-core/src/lib/general/gr_agc_cc.cc +++ b/gnuradio-core/src/lib/general/gr_agc_cc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ gr_agc_cc_sptr gr_make_agc_cc (float rate, float reference, float gain, float max_gain) { - return gr_agc_cc_sptr (new gr_agc_cc (rate, reference, gain, max_gain)); + return gnuradio::get_initial_sptr(new gr_agc_cc (rate, reference, gain, max_gain)); } gr_agc_cc::gr_agc_cc (float rate, float reference, diff --git a/gnuradio-core/src/lib/general/gr_agc_ff.cc b/gnuradio-core/src/lib/general/gr_agc_ff.cc index 9e74fed85..45c86d898 100644 --- a/gnuradio-core/src/lib/general/gr_agc_ff.cc +++ b/gnuradio-core/src/lib/general/gr_agc_ff.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2006 Free Software Foundation, Inc. + * Copyright 2005,2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_agc_ff_sptr gr_make_agc_ff (float rate, float reference, float gain, float max_gain) { - return gr_agc_ff_sptr (new gr_agc_ff (rate, reference, gain, max_gain)); + return gnuradio::get_initial_sptr(new gr_agc_ff (rate, reference, gain, max_gain)); } gr_agc_ff::gr_agc_ff (float rate, float reference, float gain, float max_gain) diff --git a/gnuradio-core/src/lib/general/gr_align_on_samplenumbers_ss.cc b/gnuradio-core/src/lib/general/gr_align_on_samplenumbers_ss.cc index 241a33f5d..e11793fdd 100644 --- a/gnuradio-core/src/lib/general/gr_align_on_samplenumbers_ss.cc +++ b/gnuradio-core/src/lib/general/gr_align_on_samplenumbers_ss.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -48,7 +48,7 @@ gr_align_on_samplenumbers_ss_sptr gr_make_align_on_samplenumbers_ss (int nchan, int align_interval) { - return gr_align_on_samplenumbers_ss_sptr (new gr_align_on_samplenumbers_ss (nchan,align_interval)); + return gnuradio::get_initial_sptr(new gr_align_on_samplenumbers_ss (nchan,align_interval)); } gr_align_on_samplenumbers_ss::gr_align_on_samplenumbers_ss (int nchan,int align_interval) diff --git a/gnuradio-core/src/lib/general/gr_bin_statistics_f.cc b/gnuradio-core/src/lib/general/gr_bin_statistics_f.cc index 61abd72b8..435a660cd 100644 --- a/gnuradio-core/src/lib/general/gr_bin_statistics_f.cc +++ b/gnuradio-core/src/lib/general/gr_bin_statistics_f.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -35,7 +35,7 @@ gr_make_bin_statistics_f(unsigned int vlen, size_t tune_delay, size_t dwell_delay) { - return gr_bin_statistics_f_sptr(new gr_bin_statistics_f(vlen, + return gnuradio::get_initial_sptr(new gr_bin_statistics_f(vlen, msgq, tune, tune_delay, diff --git a/gnuradio-core/src/lib/general/gr_binary_slicer_fb.cc b/gnuradio-core/src/lib/general/gr_binary_slicer_fb.cc index 69e85f0bc..ae8903abb 100644 --- a/gnuradio-core/src/lib/general/gr_binary_slicer_fb.cc +++ b/gnuradio-core/src/lib/general/gr_binary_slicer_fb.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_binary_slicer_fb_sptr gr_make_binary_slicer_fb () { - return gr_binary_slicer_fb_sptr (new gr_binary_slicer_fb ()); + return gnuradio::get_initial_sptr(new gr_binary_slicer_fb ()); } gr_binary_slicer_fb::gr_binary_slicer_fb () diff --git a/gnuradio-core/src/lib/general/gr_bytes_to_syms.cc b/gnuradio-core/src/lib/general/gr_bytes_to_syms.cc index 2babe492f..460444379 100644 --- a/gnuradio-core/src/lib/general/gr_bytes_to_syms.cc +++ b/gnuradio-core/src/lib/general/gr_bytes_to_syms.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -33,7 +33,7 @@ static const int BITS_PER_BYTE = 8; gr_bytes_to_syms_sptr gr_make_bytes_to_syms () { - return gr_bytes_to_syms_sptr (new gr_bytes_to_syms ()); + return gnuradio::get_initial_sptr(new gr_bytes_to_syms ()); } gr_bytes_to_syms::gr_bytes_to_syms () diff --git a/gnuradio-core/src/lib/general/gr_char_to_float.cc b/gnuradio-core/src/lib/general/gr_char_to_float.cc index 2d3854873..e68f8d208 100644 --- a/gnuradio-core/src/lib/general/gr_char_to_float.cc +++ b/gnuradio-core/src/lib/general/gr_char_to_float.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_char_to_float_sptr gr_make_char_to_float () { - return gr_char_to_float_sptr (new gr_char_to_float ()); + return gnuradio::get_initial_sptr(new gr_char_to_float ()); } gr_char_to_float::gr_char_to_float () diff --git a/gnuradio-core/src/lib/general/gr_check_counting_s.cc b/gnuradio-core/src/lib/general/gr_check_counting_s.cc index 15c7b98e1..bce308814 100644 --- a/gnuradio-core/src/lib/general/gr_check_counting_s.cc +++ b/gnuradio-core/src/lib/general/gr_check_counting_s.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ gr_check_counting_s_sptr gr_make_check_counting_s (bool do_32bit) { - return gr_check_counting_s_sptr (new gr_check_counting_s (do_32bit)); + return gnuradio::get_initial_sptr(new gr_check_counting_s (do_32bit)); } gr_check_counting_s::gr_check_counting_s (bool do_32bit) diff --git a/gnuradio-core/src/lib/general/gr_check_lfsr_32k_s.cc b/gnuradio-core/src/lib/general/gr_check_lfsr_32k_s.cc index c5f7bfc47..95c6c7da5 100644 --- a/gnuradio-core/src/lib/general/gr_check_lfsr_32k_s.cc +++ b/gnuradio-core/src/lib/general/gr_check_lfsr_32k_s.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ gr_check_lfsr_32k_s_sptr gr_make_check_lfsr_32k_s () { - return gr_check_lfsr_32k_s_sptr (new gr_check_lfsr_32k_s ()); + return gnuradio::get_initial_sptr(new gr_check_lfsr_32k_s ()); } gr_check_lfsr_32k_s::gr_check_lfsr_32k_s () diff --git a/gnuradio-core/src/lib/general/gr_clock_recovery_mm_cc.cc b/gnuradio-core/src/lib/general/gr_clock_recovery_mm_cc.cc index 60e3dd13d..23bbf821f 100644 --- a/gnuradio-core/src/lib/general/gr_clock_recovery_mm_cc.cc +++ b/gnuradio-core/src/lib/general/gr_clock_recovery_mm_cc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2006 Free Software Foundation, Inc. + * Copyright 2005,2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -39,7 +39,7 @@ gr_clock_recovery_mm_cc_sptr gr_make_clock_recovery_mm_cc(float omega, float gain_omega, float mu, float gain_mu, float omega_relative_limit) { - return gr_clock_recovery_mm_cc_sptr (new gr_clock_recovery_mm_cc (omega, + return gnuradio::get_initial_sptr(new gr_clock_recovery_mm_cc (omega, gain_omega, mu, gain_mu, diff --git a/gnuradio-core/src/lib/general/gr_clock_recovery_mm_ff.cc b/gnuradio-core/src/lib/general/gr_clock_recovery_mm_ff.cc index 2e9eea8e6..bb5a27071 100644 --- a/gnuradio-core/src/lib/general/gr_clock_recovery_mm_ff.cc +++ b/gnuradio-core/src/lib/general/gr_clock_recovery_mm_ff.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -37,7 +37,7 @@ gr_clock_recovery_mm_ff_sptr gr_make_clock_recovery_mm_ff(float omega, float gain_omega, float mu, float gain_mu, float omega_relative_limit) { - return gr_clock_recovery_mm_ff_sptr (new gr_clock_recovery_mm_ff (omega, + return gnuradio::get_initial_sptr(new gr_clock_recovery_mm_ff (omega, gain_omega, mu, gain_mu, diff --git a/gnuradio-core/src/lib/general/gr_complex_to_interleaved_short.cc b/gnuradio-core/src/lib/general/gr_complex_to_interleaved_short.cc index fcecf0c8b..d198da0b0 100644 --- a/gnuradio-core/src/lib/general/gr_complex_to_interleaved_short.cc +++ b/gnuradio-core/src/lib/general/gr_complex_to_interleaved_short.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2005 Free Software Foundation, Inc. + * Copyright 2004,2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_complex_to_interleaved_short_sptr gr_make_complex_to_interleaved_short () { - return gr_complex_to_interleaved_short_sptr (new gr_complex_to_interleaved_short ()); + return gnuradio::get_initial_sptr(new gr_complex_to_interleaved_short ()); } gr_complex_to_interleaved_short::gr_complex_to_interleaved_short () diff --git a/gnuradio-core/src/lib/general/gr_complex_to_xxx.cc b/gnuradio-core/src/lib/general/gr_complex_to_xxx.cc index abffa4da1..a59c127f3 100644 --- a/gnuradio-core/src/lib/general/gr_complex_to_xxx.cc +++ b/gnuradio-core/src/lib/general/gr_complex_to_xxx.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2008 Free Software Foundation, Inc. + * Copyright 2004,2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -33,7 +33,7 @@ gr_complex_to_float_sptr gr_make_complex_to_float (unsigned int vlen) { - return gr_complex_to_float_sptr (new gr_complex_to_float (vlen)); + return gnuradio::get_initial_sptr(new gr_complex_to_float (vlen)); } gr_complex_to_float::gr_complex_to_float (unsigned int vlen) @@ -81,7 +81,7 @@ gr_complex_to_float::work (int noutput_items, gr_complex_to_real_sptr gr_make_complex_to_real (unsigned int vlen) { - return gr_complex_to_real_sptr (new gr_complex_to_real (vlen)); + return gnuradio::get_initial_sptr(new gr_complex_to_real (vlen)); } gr_complex_to_real::gr_complex_to_real (unsigned int vlen) @@ -112,7 +112,7 @@ gr_complex_to_real::work (int noutput_items, gr_complex_to_imag_sptr gr_make_complex_to_imag (unsigned int vlen) { - return gr_complex_to_imag_sptr (new gr_complex_to_imag (vlen)); + return gnuradio::get_initial_sptr(new gr_complex_to_imag (vlen)); } gr_complex_to_imag::gr_complex_to_imag (unsigned int vlen) @@ -143,7 +143,7 @@ gr_complex_to_imag::work (int noutput_items, gr_complex_to_mag_sptr gr_make_complex_to_mag (unsigned int vlen) { - return gr_complex_to_mag_sptr (new gr_complex_to_mag (vlen)); + return gnuradio::get_initial_sptr(new gr_complex_to_mag (vlen)); } gr_complex_to_mag::gr_complex_to_mag (unsigned int vlen) @@ -174,7 +174,7 @@ gr_complex_to_mag::work (int noutput_items, gr_complex_to_mag_squared_sptr gr_make_complex_to_mag_squared (unsigned int vlen) { - return gr_complex_to_mag_squared_sptr (new gr_complex_to_mag_squared (vlen)); + return gnuradio::get_initial_sptr(new gr_complex_to_mag_squared (vlen)); } gr_complex_to_mag_squared::gr_complex_to_mag_squared (unsigned int vlen) @@ -207,7 +207,7 @@ gr_complex_to_mag_squared::work (int noutput_items, gr_complex_to_arg_sptr gr_make_complex_to_arg (unsigned int vlen) { - return gr_complex_to_arg_sptr (new gr_complex_to_arg (vlen)); + return gnuradio::get_initial_sptr(new gr_complex_to_arg (vlen)); } gr_complex_to_arg::gr_complex_to_arg (unsigned int vlen) diff --git a/gnuradio-core/src/lib/general/gr_conjugate_cc.cc b/gnuradio-core/src/lib/general/gr_conjugate_cc.cc index f25ce1a57..59c3bae89 100644 --- a/gnuradio-core/src/lib/general/gr_conjugate_cc.cc +++ b/gnuradio-core/src/lib/general/gr_conjugate_cc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ gr_conjugate_cc_sptr gr_make_conjugate_cc () { - return gr_conjugate_cc_sptr (new gr_conjugate_cc ()); + return gnuradio::get_initial_sptr(new gr_conjugate_cc ()); } gr_conjugate_cc::gr_conjugate_cc () diff --git a/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.cc b/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.cc index 43dae6c1a..15f673411 100644 --- a/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.cc +++ b/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006 Free Software Foundation, Inc. + * Copyright 2004,2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -37,7 +37,7 @@ gr_correlate_access_code_bb_sptr gr_make_correlate_access_code_bb (const std::string &access_code, int threshold) { - return gr_correlate_access_code_bb_sptr (new gr_correlate_access_code_bb (access_code, threshold)); + return gnuradio::get_initial_sptr(new gr_correlate_access_code_bb (access_code, threshold)); } diff --git a/gnuradio-core/src/lib/general/gr_costas_loop_cc.cc b/gnuradio-core/src/lib/general/gr_costas_loop_cc.cc index 4e0f7e067..f3bfd0951 100644 --- a/gnuradio-core/src/lib/general/gr_costas_loop_cc.cc +++ b/gnuradio-core/src/lib/general/gr_costas_loop_cc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -38,7 +38,7 @@ gr_make_costas_loop_cc (float alpha, float beta, int order ) throw (std::invalid_argument) { - return gr_costas_loop_cc_sptr (new gr_costas_loop_cc (alpha, beta, + return gnuradio::get_initial_sptr(new gr_costas_loop_cc (alpha, beta, max_freq, min_freq, order)); } diff --git a/gnuradio-core/src/lib/general/gr_cpfsk_bc.cc b/gnuradio-core/src/lib/general/gr_cpfsk_bc.cc index 95d7c1753..f0b04ef97 100644 --- a/gnuradio-core/src/lib/general/gr_cpfsk_bc.cc +++ b/gnuradio-core/src/lib/general/gr_cpfsk_bc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2008,2010 Free Software Foundation, Inc. * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,7 +31,7 @@ gr_cpfsk_bc_sptr gr_make_cpfsk_bc(float k, float ampl, int samples_per_sym) { - return gr_cpfsk_bc_sptr(new gr_cpfsk_bc(k, ampl, samples_per_sym)); + return gnuradio::get_initial_sptr(new gr_cpfsk_bc(k, ampl, samples_per_sym)); } gr_cpfsk_bc::gr_cpfsk_bc(float k, float ampl, int samples_per_sym) diff --git a/gnuradio-core/src/lib/general/gr_ctcss_squelch_ff.cc b/gnuradio-core/src/lib/general/gr_ctcss_squelch_ff.cc index 59034ddc1..6c1e98d47 100644 --- a/gnuradio-core/src/lib/general/gr_ctcss_squelch_ff.cc +++ b/gnuradio-core/src/lib/general/gr_ctcss_squelch_ff.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006 Free Software Foundation, Inc. + * Copyright 2004,2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -38,7 +38,7 @@ static int max_tone_index = 37; gr_ctcss_squelch_ff_sptr gr_make_ctcss_squelch_ff(int rate, float freq, float level, int len, int ramp, bool gate) { - return gr_ctcss_squelch_ff_sptr(new gr_ctcss_squelch_ff(rate, freq, level, len, ramp, gate)); + return gnuradio::get_initial_sptr(new gr_ctcss_squelch_ff(rate, freq, level, len, ramp, gate)); } int gr_ctcss_squelch_ff::find_tone(float freq) diff --git a/gnuradio-core/src/lib/general/gr_dd_mpsk_sync_cc.cc b/gnuradio-core/src/lib/general/gr_dd_mpsk_sync_cc.cc deleted file mode 100644 index d4141efc7..000000000 --- a/gnuradio-core/src/lib/general/gr_dd_mpsk_sync_cc.cc +++ /dev/null @@ -1,196 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_dd_mpsk_sync_cc.h> -#include <gr_io_signature.h> -#include <gr_sincos.h> -#include <gri_mmse_fir_interpolator_cc.h> -#include <math.h> -#include <stdexcept> -#include <cstdio> - -#include <gr_complex.h> - -#define M_TWOPI (2*M_PI) - -gr_dd_mpsk_sync_cc_sptr -gr_make_dd_mpsk_sync_cc (float alpha, float beta, float max_freq, float min_freq, float ref_phase, - float omega, float gain_omega, float mu, float gain_mu) -{ - return gr_dd_mpsk_sync_cc_sptr (new gr_dd_mpsk_sync_cc (alpha, beta, max_freq, min_freq,ref_phase, - omega,gain_omega,mu,gain_mu)); -} - -gr_dd_mpsk_sync_cc::gr_dd_mpsk_sync_cc (float alpha, float beta, float max_freq, float min_freq, - float ref_phase, - float omega, float gain_omega, float mu, float gain_mu) - : gr_block ("dd_mpsk_sync_cc", - gr_make_io_signature (1, 1, sizeof (gr_complex)), - gr_make_io_signature (1, 1, sizeof (gr_complex))), - d_alpha(alpha), d_beta(beta), - d_max_freq(max_freq), d_min_freq(min_freq), - d_ref_phase(ref_phase),d_omega(omega), d_gain_omega(gain_omega), - d_mu(mu), d_gain_mu(gain_mu), - d_phase(0), d_freq((max_freq+min_freq)/2), d_last_sample(0), - d_interp(new gri_mmse_fir_interpolator_cc()), - d_dl_idx(0) -{ - if (omega <= 0.0) - throw std::out_of_range ("clock rate must be > 0"); - if (gain_mu < 0 || gain_omega < 0) - throw std::out_of_range ("Gains must be non-negative"); - - assert(d_interp->ntaps() <= DLLEN); - - // zero double length delay line. - for (unsigned int i = 0; i < 2 * DLLEN; i++) - d_dl[i] = gr_complex(0.0,0.0); -} - -gr_dd_mpsk_sync_cc::~gr_dd_mpsk_sync_cc() -{ - delete d_interp; -} - -float -gr_dd_mpsk_sync_cc::phase_detector(gr_complex sample,float ref_phase) -{ - return ((sample.real()>0 ? 1.0 : -1.0) * sample.imag() - - (sample.imag()>0 ? 1.0 : -1.0) * sample.real()); -} - -void -gr_dd_mpsk_sync_cc::forecast(int noutput_items, gr_vector_int &ninput_items_required) -{ - unsigned ninputs = ninput_items_required.size(); - for (unsigned i=0; i < ninputs; i++) - ninput_items_required[i] = - (int) ceil((noutput_items * d_omega) + d_interp->ntaps()); -} -gr_complex -gr_dd_mpsk_sync_cc::slicer_45deg (gr_complex sample) -{ - float real,imag; - if(sample.real() > 0) - real=1; - else - real=-1; - if(sample.imag() > 0) - imag = 1; - else - imag = -1; - return gr_complex(real,imag); -} - -gr_complex -gr_dd_mpsk_sync_cc::slicer_0deg (gr_complex sample) -{ - gr_complex out; - if( fabs(sample.real()) > fabs(sample.imag()) ) { - if(sample.real() > 0) - return gr_complex(1.0,0.0); - else - return gr_complex(-1.0,0.0); - } - else { - if(sample.imag() > 0) - return gr_complex(0.0, 1.0); - else - return gr_complex(0.0, -1.0); - } -} - -int -gr_dd_mpsk_sync_cc::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const gr_complex *in = (gr_complex *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - - int ii, oo; - ii = 0; oo = 0; - - float error; - float t_imag, t_real; - gr_complex nco_out; - float mm_val; - - while (oo < noutput_items) { - // - // generate an output sample by interpolating between the carrier - // tracked samples in the delay line. d_mu, the fractional - // interpolation amount (in [0.0, 1.0]) is controlled by the - // symbol timing loop below. - // - out[oo] = d_interp->interpolate (&d_dl[d_dl_idx], d_mu); - - error = phase_detector(out[oo], d_ref_phase); - - d_freq = d_freq + d_beta * error; - d_phase = d_phase + d_alpha * error; - while(d_phase>M_TWOPI) - d_phase -= M_TWOPI; - while(d_phase<-M_TWOPI) - d_phase += M_TWOPI; - - if (d_freq > d_max_freq) - d_freq = d_max_freq; - else if (d_freq < d_min_freq) - d_freq = d_min_freq; - - mm_val = real(d_last_sample * slicer_0deg(out[oo]) - out[oo] * slicer_0deg(d_last_sample)); - d_last_sample = out[oo]; - - d_omega = d_omega + d_gain_omega * mm_val; - d_mu = d_mu + d_omega + d_gain_mu * mm_val; - - while(d_mu >= 1.0) { - // - // Generate more carrier tracked samples for the delay line - // - d_mu -= 1.0; - gr_sincosf(d_phase, &t_imag, &t_real); - nco_out = gr_complex(t_real, -t_imag); - gr_complex new_sample = in[ii] * nco_out; - - d_dl[d_dl_idx] = new_sample; // overwrite oldest sample - d_dl[(d_dl_idx + DLLEN)] = new_sample; // and second copy - d_dl_idx = (d_dl_idx+1) % DLLEN; // point to the new oldest sample - d_phase = d_phase + d_freq; - ii++; - } - oo++; - printf("%f\t%f\t%f\t%f\t%f\n",d_mu,d_omega,mm_val,d_freq,d_phase); - //printf("%f\t%f\t%f\t%f\t%f\t%f\t%f\n",mple).real(),slicer_0deg(d_last_sample).imag(),mm_val,d_omega,d_mu); - } - - assert(ii <= ninput_items[0]); - - consume_each (ii); - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_dd_mpsk_sync_cc.h b/gnuradio-core/src/lib/general/gr_dd_mpsk_sync_cc.h deleted file mode 100644 index 4ffcd3771..000000000 --- a/gnuradio-core/src/lib/general/gr_dd_mpsk_sync_cc.h +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GR_DD_MPSK_SYNC_CC_H -#define INCLUDED_GR_DD_MPSK_SYNC_CC_H - -#include <gr_sync_block.h> - -class gri_mmse_fir_interpolator_cc; - -class gr_dd_mpsk_sync_cc; -typedef boost::shared_ptr<gr_dd_mpsk_sync_cc> gr_dd_mpsk_sync_cc_sptr; - -gr_dd_mpsk_sync_cc_sptr -gr_make_dd_mpsk_sync_cc (float alpha, float beta, - float max_freq, float min_freq, float ref_phase, - float omega, float gain_omega, float mu, float gain_mu); - -/*! - * \brief Decision directed M-PSK synchronous demod - * \ingroup sync_blk - * This block performs joint carrier tracking and symbol timing recovery. - * - * input: complex baseband; output: properly timed complex samples ready for slicing. - * - * N.B, at this point, it handles only QPSK. - */ - -class gr_dd_mpsk_sync_cc : public gr_block -{ - friend gr_dd_mpsk_sync_cc_sptr gr_make_dd_mpsk_sync_cc (float alpha, float beta, - float max_freq, float min_freq, float ref_phase, - float omega, float gain_omega, float mu, float gain_mu); -public: - ~gr_dd_mpsk_sync_cc (); - void forecast(int noutput_items, gr_vector_int &ninput_items_required); - float mu() const { return d_mu;} - float omega() const { return d_omega;} - float gain_mu() const { return d_gain_mu;} - float gain_omega() const { return d_gain_omega;} - - void set_gain_mu (float gain_mu) { d_gain_mu = gain_mu; } - void set_gain_omega (float gain_omega) { d_gain_omega = gain_omega; } - void set_mu (float mu) { d_mu = mu; } - void set_omega (float omega) { d_omega = omega; } - -protected: - gr_dd_mpsk_sync_cc (float alpha, float beta, float max_freq, float min_freq, float ref_phase, - float omega, float gain_omega, float mu, float gain_mu); - - int general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - -private: - static const unsigned int DLLEN = 8; // delay line length. - - float d_alpha,d_beta,d_max_freq,d_min_freq,d_ref_phase; - float d_omega, d_gain_omega, d_mu, d_gain_mu; - float d_phase, d_freq; - gr_complex slicer_45deg (gr_complex sample); - gr_complex slicer_0deg (gr_complex sample); - gr_complex d_last_sample; - gri_mmse_fir_interpolator_cc *d_interp; - - gr_complex d_dl[2 * DLLEN]; // Holds post carrier tracking samples. - // double length delay line to avoid wraps. - unsigned int d_dl_idx; // indexes oldest sample in delay line. - - float phase_detector(gr_complex sample,float ref_phase); -}; - -#endif diff --git a/gnuradio-core/src/lib/general/gr_dd_mpsk_sync_cc.i b/gnuradio-core/src/lib/general/gr_dd_mpsk_sync_cc.i deleted file mode 100644 index 17739248e..000000000 --- a/gnuradio-core/src/lib/general/gr_dd_mpsk_sync_cc.i +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,dd_mpsk_sync_cc) - - gr_dd_mpsk_sync_cc_sptr gr_make_dd_mpsk_sync_cc (float alpha, float beta, - float max_freq, float min_freq, float ref_phase, - float omega, float gain_omega, float mu, float gain_mu); - -class gr_dd_mpsk_sync_cc : public gr_block -{ - private: - gr_dd_mpsk_sync_cc (float alpha, float beta, float max_freq, float min_freq, float ref_phase, - float omega, float gain_omega, float mu, float gain_mu); -}; diff --git a/gnuradio-core/src/lib/general/gr_decode_ccsds_27_fb.cc b/gnuradio-core/src/lib/general/gr_decode_ccsds_27_fb.cc index add036f20..d5425bfc8 100644 --- a/gnuradio-core/src/lib/general/gr_decode_ccsds_27_fb.cc +++ b/gnuradio-core/src/lib/general/gr_decode_ccsds_27_fb.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2008,2010 Free Software Foundation, Inc. * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ gr_decode_ccsds_27_fb_sptr gr_make_decode_ccsds_27_fb() { - return gr_decode_ccsds_27_fb_sptr(new gr_decode_ccsds_27_fb()); + return gnuradio::get_initial_sptr(new gr_decode_ccsds_27_fb()); } gr_decode_ccsds_27_fb::gr_decode_ccsds_27_fb() diff --git a/gnuradio-core/src/lib/general/gr_deinterleave.cc b/gnuradio-core/src/lib/general/gr_deinterleave.cc index 6530b9675..843275366 100644 --- a/gnuradio-core/src/lib/general/gr_deinterleave.cc +++ b/gnuradio-core/src/lib/general/gr_deinterleave.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ gr_deinterleave_sptr gr_make_deinterleave (size_t itemsize) { - return gr_deinterleave_sptr (new gr_deinterleave (itemsize)); + return gnuradio::get_initial_sptr(new gr_deinterleave (itemsize)); } gr_deinterleave::gr_deinterleave (size_t itemsize) diff --git a/gnuradio-core/src/lib/general/gr_delay.cc b/gnuradio-core/src/lib/general/gr_delay.cc index d52faca39..b06346f59 100644 --- a/gnuradio-core/src/lib/general/gr_delay.cc +++ b/gnuradio-core/src/lib/general/gr_delay.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2007 Free Software Foundation, Inc. + * Copyright 2007,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_delay_sptr gr_make_delay (size_t itemsize, int delay) { - return gr_delay_sptr (new gr_delay (itemsize, delay)); + return gnuradio::get_initial_sptr(new gr_delay (itemsize, delay)); } gr_delay::gr_delay (size_t itemsize, int delay) diff --git a/gnuradio-core/src/lib/general/gr_descrambler_bb.cc b/gnuradio-core/src/lib/general/gr_descrambler_bb.cc index e173a8a22..b712e69ed 100644 --- a/gnuradio-core/src/lib/general/gr_descrambler_bb.cc +++ b/gnuradio-core/src/lib/general/gr_descrambler_bb.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,7 +30,7 @@ gr_descrambler_bb_sptr gr_make_descrambler_bb(int mask, int seed, int len) { - return gr_descrambler_bb_sptr(new gr_descrambler_bb(mask, seed, len)); + return gnuradio::get_initial_sptr(new gr_descrambler_bb(mask, seed, len)); } gr_descrambler_bb::gr_descrambler_bb(int mask, int seed, int len) diff --git a/gnuradio-core/src/lib/general/gr_diff_decoder_bb.cc b/gnuradio-core/src/lib/general/gr_diff_decoder_bb.cc index 1802b3b77..1b0bcfb96 100644 --- a/gnuradio-core/src/lib/general/gr_diff_decoder_bb.cc +++ b/gnuradio-core/src/lib/general/gr_diff_decoder_bb.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,7 +30,7 @@ gr_diff_decoder_bb_sptr gr_make_diff_decoder_bb (unsigned int modulus) { - return gr_diff_decoder_bb_sptr (new gr_diff_decoder_bb(modulus)); + return gnuradio::get_initial_sptr(new gr_diff_decoder_bb(modulus)); } gr_diff_decoder_bb::gr_diff_decoder_bb (unsigned int modulus) diff --git a/gnuradio-core/src/lib/general/gr_diff_encoder_bb.cc b/gnuradio-core/src/lib/general/gr_diff_encoder_bb.cc index 3eb8e62cc..7e67a718e 100644 --- a/gnuradio-core/src/lib/general/gr_diff_encoder_bb.cc +++ b/gnuradio-core/src/lib/general/gr_diff_encoder_bb.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,7 +30,7 @@ gr_diff_encoder_bb_sptr gr_make_diff_encoder_bb (unsigned int modulus) { - return gr_diff_encoder_bb_sptr (new gr_diff_encoder_bb(modulus)); + return gnuradio::get_initial_sptr(new gr_diff_encoder_bb(modulus)); } gr_diff_encoder_bb::gr_diff_encoder_bb (unsigned int modulus) diff --git a/gnuradio-core/src/lib/general/gr_diff_phasor_cc.cc b/gnuradio-core/src/lib/general/gr_diff_phasor_cc.cc index 003297ff8..fb6a3a910 100644 --- a/gnuradio-core/src/lib/general/gr_diff_phasor_cc.cc +++ b/gnuradio-core/src/lib/general/gr_diff_phasor_cc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,7 +30,7 @@ gr_diff_phasor_cc_sptr gr_make_diff_phasor_cc () { - return gr_diff_phasor_cc_sptr (new gr_diff_phasor_cc()); + return gnuradio::get_initial_sptr(new gr_diff_phasor_cc()); } gr_diff_phasor_cc::gr_diff_phasor_cc () diff --git a/gnuradio-core/src/lib/general/gr_dpll_bb.cc b/gnuradio-core/src/lib/general/gr_dpll_bb.cc index f24b2a88e..fcaad2174 100644 --- a/gnuradio-core/src/lib/general/gr_dpll_bb.cc +++ b/gnuradio-core/src/lib/general/gr_dpll_bb.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2007,2009 Free Software Foundation, Inc. + * Copyright 2007,2009,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_dpll_bb_sptr gr_make_dpll_bb (float period, float gain) { - return gr_dpll_bb_sptr (new gr_dpll_bb (period, gain)); + return gnuradio::get_initial_sptr(new gr_dpll_bb (period, gain)); } gr_dpll_bb::gr_dpll_bb (float period, float gain) diff --git a/gnuradio-core/src/lib/general/gr_encode_ccsds_27_bb.cc b/gnuradio-core/src/lib/general/gr_encode_ccsds_27_bb.cc index 76b8091f7..092e91d8b 100644 --- a/gnuradio-core/src/lib/general/gr_encode_ccsds_27_bb.cc +++ b/gnuradio-core/src/lib/general/gr_encode_ccsds_27_bb.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2008 Free Software Foundation, Inc. + * Copyright 2004,2008,2010 Free Software Foundation, Inc. * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,7 +32,7 @@ extern "C" { gr_encode_ccsds_27_bb_sptr gr_make_encode_ccsds_27_bb() { - return gr_encode_ccsds_27_bb_sptr(new gr_encode_ccsds_27_bb()); + return gnuradio::get_initial_sptr(new gr_encode_ccsds_27_bb()); } gr_encode_ccsds_27_bb::gr_encode_ccsds_27_bb() diff --git a/gnuradio-core/src/lib/general/gr_fake_channel_coder_pp.cc b/gnuradio-core/src/lib/general/gr_fake_channel_coder_pp.cc index 02385c59e..24945cfd8 100644 --- a/gnuradio-core/src/lib/general/gr_fake_channel_coder_pp.cc +++ b/gnuradio-core/src/lib/general/gr_fake_channel_coder_pp.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -35,7 +35,7 @@ static const int PAD_VAL = 0xAA; gr_fake_channel_encoder_pp_sptr gr_make_fake_channel_encoder_pp(int input_vlen, int output_vlen) { - return gr_fake_channel_encoder_pp_sptr(new gr_fake_channel_encoder_pp(input_vlen, + return gnuradio::get_initial_sptr(new gr_fake_channel_encoder_pp(input_vlen, output_vlen)); } @@ -77,7 +77,7 @@ gr_fake_channel_encoder_pp::work (int noutput_items, gr_fake_channel_decoder_pp_sptr gr_make_fake_channel_decoder_pp(int input_vlen, int output_vlen) { - return gr_fake_channel_decoder_pp_sptr(new gr_fake_channel_decoder_pp(input_vlen, + return gnuradio::get_initial_sptr(new gr_fake_channel_decoder_pp(input_vlen, output_vlen)); } diff --git a/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.cc b/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.cc index 53fb2a819..9046fcaa7 100644 --- a/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.cc +++ b/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_feedforward_agc_cc_sptr gr_make_feedforward_agc_cc(int nsamples, float reference) { - return gr_feedforward_agc_cc_sptr(new gr_feedforward_agc_cc (nsamples, reference)); + return gnuradio::get_initial_sptr(new gr_feedforward_agc_cc (nsamples, reference)); } gr_feedforward_agc_cc::gr_feedforward_agc_cc (int nsamples, float reference) diff --git a/gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc b/gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc index f69d2e84e..3293e3ab8 100644 --- a/gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc +++ b/gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2007,2008 Free Software Foundation, Inc. + * Copyright 2004,2007,2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -33,7 +33,7 @@ gr_fft_vcc_sptr gr_make_fft_vcc_fftw (int fft_size, bool forward, const std::vector<float> &window, bool shift) { - return gr_fft_vcc_sptr (new gr_fft_vcc_fftw (fft_size, forward, window, shift)); + return gnuradio::get_initial_sptr(new gr_fft_vcc_fftw (fft_size, forward, window, shift)); } gr_fft_vcc_fftw::gr_fft_vcc_fftw (int fft_size, bool forward, diff --git a/gnuradio-core/src/lib/general/gr_fft_vfc.cc b/gnuradio-core/src/lib/general/gr_fft_vfc.cc index df68af7e1..608161efe 100644 --- a/gnuradio-core/src/lib/general/gr_fft_vfc.cc +++ b/gnuradio-core/src/lib/general/gr_fft_vfc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -42,7 +42,7 @@ gr_fft_vfc_sptr gr_make_fft_vfc (int fft_size, bool forward, const std::vector<float> window) { - return gr_fft_vfc_sptr (new gr_fft_vfc (fft_size, forward, window)); + return gnuradio::get_initial_sptr(new gr_fft_vfc (fft_size, forward, window)); } gr_fft_vfc::gr_fft_vfc (int fft_size, bool forward, const std::vector<float> window) diff --git a/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.cc b/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.cc index 7f2c468b7..ff997e7a9 100644 --- a/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.cc +++ b/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2009 Free Software Foundation, Inc. + * Copyright 2009,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -48,7 +48,7 @@ float sinc(float x) gr_fll_band_edge_cc_sptr gr_make_fll_band_edge_cc (float samps_per_sym, float rolloff, int filter_size, float gain_alpha, float gain_beta) { - return gr_fll_band_edge_cc_sptr (new gr_fll_band_edge_cc (samps_per_sym, rolloff, + return gnuradio::get_initial_sptr(new gr_fll_band_edge_cc (samps_per_sym, rolloff, filter_size, gain_alpha, gain_beta)); } diff --git a/gnuradio-core/src/lib/general/gr_float_to_char.cc b/gnuradio-core/src/lib/general/gr_float_to_char.cc index ed6c41826..88b9d276e 100644 --- a/gnuradio-core/src/lib/general/gr_float_to_char.cc +++ b/gnuradio-core/src/lib/general/gr_float_to_char.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_float_to_char_sptr gr_make_float_to_char () { - return gr_float_to_char_sptr (new gr_float_to_char ()); + return gnuradio::get_initial_sptr(new gr_float_to_char ()); } gr_float_to_char::gr_float_to_char () diff --git a/gnuradio-core/src/lib/general/gr_float_to_complex.cc b/gnuradio-core/src/lib/general/gr_float_to_complex.cc index af878231a..89ef18869 100644 --- a/gnuradio-core/src/lib/general/gr_float_to_complex.cc +++ b/gnuradio-core/src/lib/general/gr_float_to_complex.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004, 2009 Free Software Foundation, Inc. + * Copyright 2004, 2009,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,7 +30,7 @@ gr_float_to_complex_sptr gr_make_float_to_complex (size_t vlen) { - return gr_float_to_complex_sptr (new gr_float_to_complex (vlen)); + return gnuradio::get_initial_sptr(new gr_float_to_complex (vlen)); } gr_float_to_complex::gr_float_to_complex (size_t vlen) diff --git a/gnuradio-core/src/lib/general/gr_float_to_short.cc b/gnuradio-core/src/lib/general/gr_float_to_short.cc index ecb0fa0fc..084f76f9c 100644 --- a/gnuradio-core/src/lib/general/gr_float_to_short.cc +++ b/gnuradio-core/src/lib/general/gr_float_to_short.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_float_to_short_sptr gr_make_float_to_short () { - return gr_float_to_short_sptr (new gr_float_to_short ()); + return gnuradio::get_initial_sptr(new gr_float_to_short ()); } gr_float_to_short::gr_float_to_short () diff --git a/gnuradio-core/src/lib/general/gr_float_to_uchar.cc b/gnuradio-core/src/lib/general/gr_float_to_uchar.cc index 3776ac897..78369f8be 100644 --- a/gnuradio-core/src/lib/general/gr_float_to_uchar.cc +++ b/gnuradio-core/src/lib/general/gr_float_to_uchar.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_float_to_uchar_sptr gr_make_float_to_uchar () { - return gr_float_to_uchar_sptr (new gr_float_to_uchar ()); + return gnuradio::get_initial_sptr(new gr_float_to_uchar ()); } gr_float_to_uchar::gr_float_to_uchar () diff --git a/gnuradio-core/src/lib/general/gr_fmdet_cf.cc b/gnuradio-core/src/lib/general/gr_fmdet_cf.cc index e2c7e7a7f..3d828124e 100644 --- a/gnuradio-core/src/lib/general/gr_fmdet_cf.cc +++ b/gnuradio-core/src/lib/general/gr_fmdet_cf.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -35,7 +35,7 @@ gr_fmdet_cf_sptr gr_make_fmdet_cf (float samplerate, float freq_low, float freq_high, float scl) { - return gr_fmdet_cf_sptr (new gr_fmdet_cf (samplerate, freq_low, freq_high, scl)); + return gnuradio::get_initial_sptr(new gr_fmdet_cf (samplerate, freq_low, freq_high, scl)); } gr_fmdet_cf::gr_fmdet_cf (float samplerate, float freq_low, float freq_high, float scl) diff --git a/gnuradio-core/src/lib/general/gr_framer_sink_1.cc b/gnuradio-core/src/lib/general/gr_framer_sink_1.cc index 9da271bac..c90b26c35 100644 --- a/gnuradio-core/src/lib/general/gr_framer_sink_1.cc +++ b/gnuradio-core/src/lib/general/gr_framer_sink_1.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006 Free Software Foundation, Inc. + * Copyright 2004,2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -69,7 +69,7 @@ gr_framer_sink_1::enter_have_header(int payload_len, int whitener_offset) gr_framer_sink_1_sptr gr_make_framer_sink_1(gr_msg_queue_sptr target_queue) { - return gr_framer_sink_1_sptr(new gr_framer_sink_1(target_queue)); + return gnuradio::get_initial_sptr(new gr_framer_sink_1(target_queue)); } diff --git a/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc b/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc index 541f841f4..0f6f0d719 100644 --- a/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc +++ b/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ gr_frequency_modulator_fc_sptr gr_make_frequency_modulator_fc (double sensitivity) { - return gr_frequency_modulator_fc_sptr (new gr_frequency_modulator_fc (sensitivity)); + return gnuradio::get_initial_sptr(new gr_frequency_modulator_fc (sensitivity)); } gr_frequency_modulator_fc::gr_frequency_modulator_fc (double sensitivity) diff --git a/gnuradio-core/src/lib/general/gr_glfsr_source_b.cc b/gnuradio-core/src/lib/general/gr_glfsr_source_b.cc index 8fe616044..134f7a21a 100644 --- a/gnuradio-core/src/lib/general/gr_glfsr_source_b.cc +++ b/gnuradio-core/src/lib/general/gr_glfsr_source_b.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2007 Free Software Foundation, Inc. + * Copyright 2007,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -33,7 +33,7 @@ gr_glfsr_source_b_sptr gr_make_glfsr_source_b(int degree, bool repeat, int mask, int seed) { - return gr_glfsr_source_b_sptr(new gr_glfsr_source_b(degree, repeat, mask, seed)); + return gnuradio::get_initial_sptr(new gr_glfsr_source_b(degree, repeat, mask, seed)); } gr_glfsr_source_b::gr_glfsr_source_b(int degree, bool repeat, int mask, int seed) diff --git a/gnuradio-core/src/lib/general/gr_glfsr_source_f.cc b/gnuradio-core/src/lib/general/gr_glfsr_source_f.cc index 8ef3a06cf..7ffcfbd2a 100644 --- a/gnuradio-core/src/lib/general/gr_glfsr_source_f.cc +++ b/gnuradio-core/src/lib/general/gr_glfsr_source_f.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2007 Free Software Foundation, Inc. + * Copyright 2007,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -33,7 +33,7 @@ gr_glfsr_source_f_sptr gr_make_glfsr_source_f(int degree, bool repeat, int mask, int seed) { - return gr_glfsr_source_f_sptr(new gr_glfsr_source_f(degree, repeat, mask, seed)); + return gnuradio::get_initial_sptr(new gr_glfsr_source_f(degree, repeat, mask, seed)); } gr_glfsr_source_f::gr_glfsr_source_f(int degree, bool repeat, int mask, int seed) diff --git a/gnuradio-core/src/lib/general/gr_interleave.cc b/gnuradio-core/src/lib/general/gr_interleave.cc index 3c3ce8cc9..d210cd5ed 100644 --- a/gnuradio-core/src/lib/general/gr_interleave.cc +++ b/gnuradio-core/src/lib/general/gr_interleave.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ gr_interleave_sptr gr_make_interleave (size_t itemsize) { - return gr_interleave_sptr (new gr_interleave (itemsize)); + return gnuradio::get_initial_sptr(new gr_interleave (itemsize)); } gr_interleave::gr_interleave (size_t itemsize) diff --git a/gnuradio-core/src/lib/general/gr_interleaved_short_to_complex.cc b/gnuradio-core/src/lib/general/gr_interleaved_short_to_complex.cc index 74b853207..09aa91f47 100644 --- a/gnuradio-core/src/lib/general/gr_interleaved_short_to_complex.cc +++ b/gnuradio-core/src/lib/general/gr_interleaved_short_to_complex.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_interleaved_short_to_complex_sptr gr_make_interleaved_short_to_complex () { - return gr_interleaved_short_to_complex_sptr (new gr_interleaved_short_to_complex ()); + return gnuradio::get_initial_sptr(new gr_interleaved_short_to_complex ()); } gr_interleaved_short_to_complex::gr_interleaved_short_to_complex () diff --git a/gnuradio-core/src/lib/general/gr_iqcomp_cc.cc b/gnuradio-core/src/lib/general/gr_iqcomp_cc.cc index e0a2c08ae..16a68337f 100644 --- a/gnuradio-core/src/lib/general/gr_iqcomp_cc.cc +++ b/gnuradio-core/src/lib/general/gr_iqcomp_cc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_iqcomp_cc_sptr gr_make_iqcomp_cc (float mu) { - return gr_iqcomp_cc_sptr (new gr_iqcomp_cc (mu)); + return gnuradio::get_initial_sptr(new gr_iqcomp_cc (mu)); } gr_iqcomp_cc::gr_iqcomp_cc (float mu) diff --git a/gnuradio-core/src/lib/general/gr_keep_one_in_n.cc b/gnuradio-core/src/lib/general/gr_keep_one_in_n.cc index e38240a3f..c07e177fe 100644 --- a/gnuradio-core/src/lib/general/gr_keep_one_in_n.cc +++ b/gnuradio-core/src/lib/general/gr_keep_one_in_n.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_keep_one_in_n_sptr gr_make_keep_one_in_n (size_t item_size, int n) { - return gr_keep_one_in_n_sptr (new gr_keep_one_in_n (item_size, n)); + return gnuradio::get_initial_sptr(new gr_keep_one_in_n (item_size, n)); } gr_keep_one_in_n::gr_keep_one_in_n (size_t item_size, int n) diff --git a/gnuradio-core/src/lib/general/gr_lfsr_32k_source_s.cc b/gnuradio-core/src/lib/general/gr_lfsr_32k_source_s.cc index b65e2b78a..e227f8b3e 100644 --- a/gnuradio-core/src/lib/general/gr_lfsr_32k_source_s.cc +++ b/gnuradio-core/src/lib/general/gr_lfsr_32k_source_s.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ gr_lfsr_32k_source_s_sptr gr_make_lfsr_32k_source_s () { - return gr_lfsr_32k_source_s_sptr (new gr_lfsr_32k_source_s ()); + return gnuradio::get_initial_sptr(new gr_lfsr_32k_source_s ()); } diff --git a/gnuradio-core/src/lib/general/gr_lms_dfe_cc.cc b/gnuradio-core/src/lib/general/gr_lms_dfe_cc.cc index f1eff05cc..8659386d5 100644 --- a/gnuradio-core/src/lib/general/gr_lms_dfe_cc.cc +++ b/gnuradio-core/src/lib/general/gr_lms_dfe_cc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -67,7 +67,7 @@ gr_lms_dfe_cc_sptr gr_make_lms_dfe_cc (float lambda_ff, float lambda_fb, unsigned int num_fftaps, unsigned int num_fbtaps) { - return gr_lms_dfe_cc_sptr (new gr_lms_dfe_cc (lambda_ff, lambda_fb, + return gnuradio::get_initial_sptr(new gr_lms_dfe_cc (lambda_ff, lambda_fb, num_fftaps, num_fbtaps)); } diff --git a/gnuradio-core/src/lib/general/gr_lms_dfe_ff.cc b/gnuradio-core/src/lib/general/gr_lms_dfe_ff.cc index 2992dbf88..8a5e22c2f 100644 --- a/gnuradio-core/src/lib/general/gr_lms_dfe_ff.cc +++ b/gnuradio-core/src/lib/general/gr_lms_dfe_ff.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -42,7 +42,7 @@ gr_lms_dfe_ff_sptr gr_make_lms_dfe_ff (float lambda_ff, float lambda_fb, unsigned int num_fftaps, unsigned int num_fbtaps) { - return gr_lms_dfe_ff_sptr (new gr_lms_dfe_ff (lambda_ff,lambda_fb,num_fftaps,num_fbtaps)); + return gnuradio::get_initial_sptr(new gr_lms_dfe_ff (lambda_ff,lambda_fb,num_fftaps,num_fbtaps)); } gr_lms_dfe_ff::gr_lms_dfe_ff (float lambda_ff, float lambda_fb , diff --git a/gnuradio-core/src/lib/general/gr_map_bb.cc b/gnuradio-core/src/lib/general/gr_map_bb.cc index b10dfea36..7762c7e35 100644 --- a/gnuradio-core/src/lib/general/gr_map_bb.cc +++ b/gnuradio-core/src/lib/general/gr_map_bb.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006,2007 Free Software Foundation, Inc. + * Copyright 2006,2007,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,7 +30,7 @@ gr_map_bb_sptr gr_make_map_bb (const std::vector<int> &map) { - return gr_map_bb_sptr (new gr_map_bb (map)); + return gnuradio::get_initial_sptr(new gr_map_bb (map)); } gr_map_bb::gr_map_bb (const std::vector<int> &map) diff --git a/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.cc b/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.cc index 1efa82703..bc51c6769 100644 --- a/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.cc +++ b/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2006,2007 Free Software Foundation, Inc. + * Copyright 2005,2006,2007,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -46,7 +46,7 @@ gr_make_mpsk_receiver_cc(unsigned int M, float theta, float mu, float gain_mu, float omega, float gain_omega, float omega_rel) { - return gr_mpsk_receiver_cc_sptr (new gr_mpsk_receiver_cc (M, theta, + return gnuradio::get_initial_sptr(new gr_mpsk_receiver_cc (M, theta, alpha, beta, fmin, fmax, mu, gain_mu, diff --git a/gnuradio-core/src/lib/general/gr_nlog10_ff.cc b/gnuradio-core/src/lib/general/gr_nlog10_ff.cc index 8175359b5..15d28d484 100644 --- a/gnuradio-core/src/lib/general/gr_nlog10_ff.cc +++ b/gnuradio-core/src/lib/general/gr_nlog10_ff.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_nlog10_ff_sptr gr_make_nlog10_ff (float n, unsigned vlen, float k) { - return gr_nlog10_ff_sptr(new gr_nlog10_ff(n, vlen, k)); + return gnuradio::get_initial_sptr(new gr_nlog10_ff(n, vlen, k)); } gr_nlog10_ff::gr_nlog10_ff(float n, unsigned vlen, float k) diff --git a/gnuradio-core/src/lib/general/gr_nop.cc b/gnuradio-core/src/lib/general/gr_nop.cc index b8d5cb3ac..e69c8b340 100644 --- a/gnuradio-core/src/lib/general/gr_nop.cc +++ b/gnuradio-core/src/lib/general/gr_nop.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -36,7 +36,7 @@ gr_nop::gr_nop (size_t sizeof_stream_item) gr_block_sptr gr_make_nop (size_t sizeof_stream_item) { - return gr_block_sptr (new gr_nop (sizeof_stream_item)); + return gnuradio::get_initial_sptr (new gr_nop (sizeof_stream_item)); } int diff --git a/gnuradio-core/src/lib/general/gr_null_sink.cc b/gnuradio-core/src/lib/general/gr_null_sink.cc index ed9973a3a..0b7f2d9e8 100644 --- a/gnuradio-core/src/lib/general/gr_null_sink.cc +++ b/gnuradio-core/src/lib/general/gr_null_sink.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -37,7 +37,7 @@ gr_null_sink::gr_null_sink (size_t sizeof_stream_item) gr_block_sptr gr_make_null_sink (size_t sizeof_stream_item) { - return gr_block_sptr (new gr_null_sink (sizeof_stream_item)); + return gnuradio::get_initial_sptr (new gr_null_sink (sizeof_stream_item)); } int diff --git a/gnuradio-core/src/lib/general/gr_null_source.cc b/gnuradio-core/src/lib/general/gr_null_source.cc index d11976e1b..b65c39035 100644 --- a/gnuradio-core/src/lib/general/gr_null_source.cc +++ b/gnuradio-core/src/lib/general/gr_null_source.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -38,7 +38,7 @@ gr_null_source::gr_null_source (size_t sizeof_stream_item) gr_block_sptr gr_make_null_source (size_t sizeof_stream_item) { - return gr_block_sptr (new gr_null_source (sizeof_stream_item)); + return gnuradio::get_initial_sptr (new gr_null_source (sizeof_stream_item)); } int diff --git a/gnuradio-core/src/lib/general/gr_ofdm_bpsk_demapper.cc b/gnuradio-core/src/lib/general/gr_ofdm_bpsk_demapper.cc index a01cf358a..bcb469651 100644 --- a/gnuradio-core/src/lib/general/gr_ofdm_bpsk_demapper.cc +++ b/gnuradio-core/src/lib/general/gr_ofdm_bpsk_demapper.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,7 +30,7 @@ gr_ofdm_bpsk_demapper_sptr gr_make_ofdm_bpsk_demapper (unsigned int occupied_carriers) { - return gr_ofdm_bpsk_demapper_sptr (new gr_ofdm_bpsk_demapper (occupied_carriers)); + return gnuradio::get_initial_sptr(new gr_ofdm_bpsk_demapper (occupied_carriers)); } gr_ofdm_bpsk_demapper::gr_ofdm_bpsk_demapper (unsigned occupied_carriers) diff --git a/gnuradio-core/src/lib/general/gr_ofdm_cyclic_prefixer.cc b/gnuradio-core/src/lib/general/gr_ofdm_cyclic_prefixer.cc index 5327c5707..fb40a3035 100644 --- a/gnuradio-core/src/lib/general/gr_ofdm_cyclic_prefixer.cc +++ b/gnuradio-core/src/lib/general/gr_ofdm_cyclic_prefixer.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006 Free Software Foundation, Inc. + * Copyright 2004,2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,7 +30,7 @@ gr_ofdm_cyclic_prefixer_sptr gr_make_ofdm_cyclic_prefixer (size_t input_size, size_t output_size) { - return gr_ofdm_cyclic_prefixer_sptr (new gr_ofdm_cyclic_prefixer (input_size, output_size)); + return gnuradio::get_initial_sptr(new gr_ofdm_cyclic_prefixer (input_size, output_size)); } gr_ofdm_cyclic_prefixer::gr_ofdm_cyclic_prefixer (size_t input_size, size_t output_size) diff --git a/gnuradio-core/src/lib/general/gr_ofdm_frame_acquisition.cc b/gnuradio-core/src/lib/general/gr_ofdm_frame_acquisition.cc index fd27e6d48..201375597 100644 --- a/gnuradio-core/src/lib/general/gr_ofdm_frame_acquisition.cc +++ b/gnuradio-core/src/lib/general/gr_ofdm_frame_acquisition.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006,2007,2008 Free Software Foundation, Inc. + * Copyright 2006,2007,2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -40,7 +40,7 @@ gr_make_ofdm_frame_acquisition (unsigned int occupied_carriers, unsigned int fft const std::vector<gr_complex> &known_symbol, unsigned int max_fft_shift_len) { - return gr_ofdm_frame_acquisition_sptr (new gr_ofdm_frame_acquisition (occupied_carriers, fft_length, cplen, + return gnuradio::get_initial_sptr(new gr_ofdm_frame_acquisition (occupied_carriers, fft_length, cplen, known_symbol, max_fft_shift_len)); } diff --git a/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc b/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc index 26a5cf0fe..3457370eb 100644 --- a/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc +++ b/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2007,2008 Free Software Foundation, Inc. + * Copyright 2007,2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -184,7 +184,7 @@ gr_make_ofdm_frame_sink(const std::vector<gr_complex> &sym_position, gr_msg_queue_sptr target_queue, unsigned int occupied_carriers, float phase_gain, float freq_gain) { - return gr_ofdm_frame_sink_sptr(new gr_ofdm_frame_sink(sym_position, sym_value_out, + return gnuradio::get_initial_sptr(new gr_ofdm_frame_sink(sym_position, sym_value_out, target_queue, occupied_carriers, phase_gain, freq_gain)); } diff --git a/gnuradio-core/src/lib/general/gr_ofdm_insert_preamble.cc b/gnuradio-core/src/lib/general/gr_ofdm_insert_preamble.cc index 3706c3672..ed10c94a8 100644 --- a/gnuradio-core/src/lib/general/gr_ofdm_insert_preamble.cc +++ b/gnuradio-core/src/lib/general/gr_ofdm_insert_preamble.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2007 Free Software Foundation, Inc. + * Copyright 2007,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -33,7 +33,7 @@ gr_ofdm_insert_preamble_sptr gr_make_ofdm_insert_preamble(int fft_length, const std::vector<std::vector<gr_complex> > &preamble) { - return gr_ofdm_insert_preamble_sptr(new gr_ofdm_insert_preamble(fft_length, + return gnuradio::get_initial_sptr(new gr_ofdm_insert_preamble(fft_length, preamble)); } diff --git a/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc b/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc index 02f09f5f2..370b029cd 100644 --- a/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc +++ b/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006,2007,2008 Free Software Foundation, Inc. + * Copyright 2006,2007,2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -34,7 +34,7 @@ gr_ofdm_mapper_bcv_sptr gr_make_ofdm_mapper_bcv (const std::vector<gr_complex> &constellation, unsigned int msgq_limit, unsigned int occupied_carriers, unsigned int fft_length) { - return gr_ofdm_mapper_bcv_sptr (new gr_ofdm_mapper_bcv (constellation, msgq_limit, + return gnuradio::get_initial_sptr(new gr_ofdm_mapper_bcv (constellation, msgq_limit, occupied_carriers, fft_length)); } diff --git a/gnuradio-core/src/lib/general/gr_ofdm_sampler.cc b/gnuradio-core/src/lib/general/gr_ofdm_sampler.cc index 74bd65a50..f9a53c87f 100644 --- a/gnuradio-core/src/lib/general/gr_ofdm_sampler.cc +++ b/gnuradio-core/src/lib/general/gr_ofdm_sampler.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2007,2008 Free Software Foundation, Inc. + * Copyright 2007,2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -34,7 +34,7 @@ gr_make_ofdm_sampler (unsigned int fft_length, unsigned int symbol_length, unsigned int timeout) { - return gr_ofdm_sampler_sptr (new gr_ofdm_sampler (fft_length, symbol_length, timeout)); + return gnuradio::get_initial_sptr(new gr_ofdm_sampler (fft_length, symbol_length, timeout)); } gr_ofdm_sampler::gr_ofdm_sampler (unsigned int fft_length, @@ -45,6 +45,7 @@ gr_ofdm_sampler::gr_ofdm_sampler (unsigned int fft_length, gr_make_io_signature2 (2, 2, sizeof (gr_complex)*fft_length, sizeof(char)*fft_length)), d_state(STATE_NO_SIG), d_timeout_max(timeout), d_fft_length(fft_length), d_symbol_length(symbol_length) { + set_relative_rate(1.0/(double) fft_length); // buffer allocator hint } void diff --git a/gnuradio-core/src/lib/general/gr_pa_2x2_phase_combiner.cc b/gnuradio-core/src/lib/general/gr_pa_2x2_phase_combiner.cc index c4498ed93..a79e34be4 100644 --- a/gnuradio-core/src/lib/general/gr_pa_2x2_phase_combiner.cc +++ b/gnuradio-core/src/lib/general/gr_pa_2x2_phase_combiner.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,7 +30,7 @@ gr_pa_2x2_phase_combiner_sptr gr_make_pa_2x2_phase_combiner() { - return gr_pa_2x2_phase_combiner_sptr(new gr_pa_2x2_phase_combiner()); + return gnuradio::get_initial_sptr(new gr_pa_2x2_phase_combiner()); } gr_pa_2x2_phase_combiner::gr_pa_2x2_phase_combiner () diff --git a/gnuradio-core/src/lib/general/gr_packet_sink.cc b/gnuradio-core/src/lib/general/gr_packet_sink.cc index 0979f76d3..d66d96839 100644 --- a/gnuradio-core/src/lib/general/gr_packet_sink.cc +++ b/gnuradio-core/src/lib/general/gr_packet_sink.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -77,7 +77,7 @@ gr_packet_sink_sptr gr_make_packet_sink (const std::vector<unsigned char>& sync_vector, gr_msg_queue_sptr target_queue, int threshold) { - return gr_packet_sink_sptr (new gr_packet_sink (sync_vector, target_queue, threshold)); + return gnuradio::get_initial_sptr(new gr_packet_sink (sync_vector, target_queue, threshold)); } diff --git a/gnuradio-core/src/lib/general/gr_peak_detector2_fb.cc b/gnuradio-core/src/lib/general/gr_peak_detector2_fb.cc index 4f927bffe..2b1c5da61 100644 --- a/gnuradio-core/src/lib/general/gr_peak_detector2_fb.cc +++ b/gnuradio-core/src/lib/general/gr_peak_detector2_fb.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2007 Free Software Foundation, Inc. + * Copyright 2007,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ gr_peak_detector2_fb_sptr gr_make_peak_detector2_fb (float threshold_factor_rise, int look_ahead, float alpha) { - return gr_peak_detector2_fb_sptr (new gr_peak_detector2_fb (threshold_factor_rise, + return gnuradio::get_initial_sptr(new gr_peak_detector2_fb (threshold_factor_rise, look_ahead, alpha)); } diff --git a/gnuradio-core/src/lib/general/gr_phase_modulator_fc.cc b/gnuradio-core/src/lib/general/gr_phase_modulator_fc.cc index 9ee8d3f4d..c1a2e7da3 100644 --- a/gnuradio-core/src/lib/general/gr_phase_modulator_fc.cc +++ b/gnuradio-core/src/lib/general/gr_phase_modulator_fc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2006 Free Software Foundation, Inc. + * Copyright 2005,2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ gr_phase_modulator_fc_sptr gr_make_phase_modulator_fc (double sensitivity) { - return gr_phase_modulator_fc_sptr (new gr_phase_modulator_fc (sensitivity)); + return gnuradio::get_initial_sptr(new gr_phase_modulator_fc (sensitivity)); } gr_phase_modulator_fc::gr_phase_modulator_fc (double sensitivity) diff --git a/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.cc b/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.cc index 5f0e9a692..19ab316a1 100644 --- a/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.cc +++ b/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -35,7 +35,7 @@ gr_pll_carriertracking_cc_sptr gr_make_pll_carriertracking_cc (float alpha, float beta, float max_freq, float min_freq) { - return gr_pll_carriertracking_cc_sptr (new gr_pll_carriertracking_cc (alpha, beta, max_freq, min_freq)); + return gnuradio::get_initial_sptr(new gr_pll_carriertracking_cc (alpha, beta, max_freq, min_freq)); } gr_pll_carriertracking_cc::gr_pll_carriertracking_cc (float alpha, float beta, float max_freq, float min_freq) diff --git a/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.cc b/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.cc index c9fd9a71e..1f17f2afc 100644 --- a/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.cc +++ b/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -36,7 +36,7 @@ gr_pll_freqdet_cf_sptr gr_make_pll_freqdet_cf (float alpha, float beta, float max_freq, float min_freq) { - return gr_pll_freqdet_cf_sptr (new gr_pll_freqdet_cf (alpha, beta, max_freq, min_freq)); + return gnuradio::get_initial_sptr(new gr_pll_freqdet_cf (alpha, beta, max_freq, min_freq)); } gr_pll_freqdet_cf::gr_pll_freqdet_cf (float alpha, float beta, float max_freq, float min_freq) diff --git a/gnuradio-core/src/lib/general/gr_pll_refout_cc.cc b/gnuradio-core/src/lib/general/gr_pll_refout_cc.cc index 5df822d37..8a7fbf88b 100644 --- a/gnuradio-core/src/lib/general/gr_pll_refout_cc.cc +++ b/gnuradio-core/src/lib/general/gr_pll_refout_cc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -37,7 +37,7 @@ gr_pll_refout_cc_sptr gr_make_pll_refout_cc (float alpha, float beta, float max_freq, float min_freq) { - return gr_pll_refout_cc_sptr (new gr_pll_refout_cc (alpha, beta, max_freq, min_freq)); + return gnuradio::get_initial_sptr(new gr_pll_refout_cc (alpha, beta, max_freq, min_freq)); } gr_pll_refout_cc::gr_pll_refout_cc (float alpha, float beta, float max_freq, float min_freq) diff --git a/gnuradio-core/src/lib/general/gr_pn_correlator_cc.cc b/gnuradio-core/src/lib/general/gr_pn_correlator_cc.cc index 2614c3a2d..37e7b803c 100644 --- a/gnuradio-core/src/lib/general/gr_pn_correlator_cc.cc +++ b/gnuradio-core/src/lib/general/gr_pn_correlator_cc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2007 Free Software Foundation, Inc. + * Copyright 2007,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,7 +30,7 @@ gr_pn_correlator_cc_sptr gr_make_pn_correlator_cc(int degree, int mask, int seed) { - return gr_pn_correlator_cc_sptr (new gr_pn_correlator_cc(degree, mask, seed)); + return gnuradio::get_initial_sptr(new gr_pn_correlator_cc(degree, mask, seed)); } gr_pn_correlator_cc::gr_pn_correlator_cc(int degree, int mask, int seed) diff --git a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_c.cc b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_c.cc index 8af11ad22..c00eb5cdf 100644 --- a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_c.cc +++ b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_c.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,7 +30,7 @@ gr_probe_avg_mag_sqrd_c_sptr gr_make_probe_avg_mag_sqrd_c(double threshold_db, double alpha) { - return gr_probe_avg_mag_sqrd_c_sptr(new gr_probe_avg_mag_sqrd_c(threshold_db, alpha)); + return gnuradio::get_initial_sptr(new gr_probe_avg_mag_sqrd_c(threshold_db, alpha)); } gr_probe_avg_mag_sqrd_c::gr_probe_avg_mag_sqrd_c (double threshold_db, double alpha) diff --git a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_cf.cc b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_cf.cc index 8b1c7cc50..5350028a7 100644 --- a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_cf.cc +++ b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_cf.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2007 Free Software Foundation, Inc. + * Copyright 2005,2007,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,7 +30,7 @@ gr_probe_avg_mag_sqrd_cf_sptr gr_make_probe_avg_mag_sqrd_cf(double threshold_db, double alpha) { - return gr_probe_avg_mag_sqrd_cf_sptr(new gr_probe_avg_mag_sqrd_cf(threshold_db, alpha)); + return gnuradio::get_initial_sptr(new gr_probe_avg_mag_sqrd_cf(threshold_db, alpha)); } gr_probe_avg_mag_sqrd_cf::gr_probe_avg_mag_sqrd_cf (double threshold_db, double alpha) diff --git a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_f.cc b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_f.cc index c39207d2c..d3b0e2d37 100644 --- a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_f.cc +++ b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_f.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,7 +30,7 @@ gr_probe_avg_mag_sqrd_f_sptr gr_make_probe_avg_mag_sqrd_f(double threshold_db, double alpha) { - return gr_probe_avg_mag_sqrd_f_sptr(new gr_probe_avg_mag_sqrd_f(threshold_db, alpha)); + return gnuradio::get_initial_sptr(new gr_probe_avg_mag_sqrd_f(threshold_db, alpha)); } gr_probe_avg_mag_sqrd_f::gr_probe_avg_mag_sqrd_f (double threshold_db, double alpha) diff --git a/gnuradio-core/src/lib/general/gr_probe_density_b.cc b/gnuradio-core/src/lib/general/gr_probe_density_b.cc index dae4eec74..70b03e881 100644 --- a/gnuradio-core/src/lib/general/gr_probe_density_b.cc +++ b/gnuradio-core/src/lib/general/gr_probe_density_b.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2008,2010 Free Software Foundation, Inc. * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ gr_probe_density_b_sptr gr_make_probe_density_b(double alpha) { - return gr_probe_density_b_sptr(new gr_probe_density_b(alpha)); + return gnuradio::get_initial_sptr(new gr_probe_density_b(alpha)); } gr_probe_density_b::gr_probe_density_b(double alpha) diff --git a/gnuradio-core/src/lib/general/gr_probe_mpsk_snr_c.cc b/gnuradio-core/src/lib/general/gr_probe_mpsk_snr_c.cc index a0bb99ce1..fed9ad66e 100644 --- a/gnuradio-core/src/lib/general/gr_probe_mpsk_snr_c.cc +++ b/gnuradio-core/src/lib/general/gr_probe_mpsk_snr_c.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,7 +30,7 @@ gr_probe_mpsk_snr_c_sptr gr_make_probe_mpsk_snr_c(double alpha) { - return gr_probe_mpsk_snr_c_sptr(new gr_probe_mpsk_snr_c(alpha)); + return gnuradio::get_initial_sptr(new gr_probe_mpsk_snr_c(alpha)); } gr_probe_mpsk_snr_c::gr_probe_mpsk_snr_c(double alpha) diff --git a/gnuradio-core/src/lib/general/gr_probe_signal_f.cc b/gnuradio-core/src/lib/general/gr_probe_signal_f.cc index b67836682..ee1a18e89 100644 --- a/gnuradio-core/src/lib/general/gr_probe_signal_f.cc +++ b/gnuradio-core/src/lib/general/gr_probe_signal_f.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -29,7 +29,7 @@ gr_probe_signal_f_sptr gr_make_probe_signal_f() { - return gr_probe_signal_f_sptr(new gr_probe_signal_f()); + return gnuradio::get_initial_sptr(new gr_probe_signal_f()); } gr_probe_signal_f::gr_probe_signal_f () diff --git a/gnuradio-core/src/lib/general/gr_pwr_squelch_cc.cc b/gnuradio-core/src/lib/general/gr_pwr_squelch_cc.cc index 1604972fd..d2fee1a57 100644 --- a/gnuradio-core/src/lib/general/gr_pwr_squelch_cc.cc +++ b/gnuradio-core/src/lib/general/gr_pwr_squelch_cc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006 Free Software Foundation, Inc. + * Copyright 2004,2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -29,7 +29,7 @@ gr_pwr_squelch_cc_sptr gr_make_pwr_squelch_cc(double threshold, double alpha, int ramp, bool gate) { - return gr_pwr_squelch_cc_sptr(new gr_pwr_squelch_cc(threshold, alpha, ramp, gate)); + return gnuradio::get_initial_sptr(new gr_pwr_squelch_cc(threshold, alpha, ramp, gate)); } gr_pwr_squelch_cc::gr_pwr_squelch_cc(double threshold, double alpha, int ramp, bool gate) : diff --git a/gnuradio-core/src/lib/general/gr_pwr_squelch_ff.cc b/gnuradio-core/src/lib/general/gr_pwr_squelch_ff.cc index 976b7a105..a689c407c 100644 --- a/gnuradio-core/src/lib/general/gr_pwr_squelch_ff.cc +++ b/gnuradio-core/src/lib/general/gr_pwr_squelch_ff.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006 Free Software Foundation, Inc. + * Copyright 2004,2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -29,7 +29,7 @@ gr_pwr_squelch_ff_sptr gr_make_pwr_squelch_ff(double threshold, double alpha, int ramp, bool gate) { - return gr_pwr_squelch_ff_sptr(new gr_pwr_squelch_ff(threshold, alpha, ramp, gate)); + return gnuradio::get_initial_sptr(new gr_pwr_squelch_ff(threshold, alpha, ramp, gate)); } gr_pwr_squelch_ff::gr_pwr_squelch_ff(double threshold, double alpha, int ramp, bool gate) : diff --git a/gnuradio-core/src/lib/general/gr_quadrature_demod_cf.cc b/gnuradio-core/src/lib/general/gr_quadrature_demod_cf.cc index bae5a3857..8e59fbd71 100644 --- a/gnuradio-core/src/lib/general/gr_quadrature_demod_cf.cc +++ b/gnuradio-core/src/lib/general/gr_quadrature_demod_cf.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2005 Free Software Foundation, Inc. + * Copyright 2004,2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -40,7 +40,7 @@ gr_quadrature_demod_cf::gr_quadrature_demod_cf (float gain) gr_quadrature_demod_cf_sptr gr_make_quadrature_demod_cf (float gain) { - return gr_quadrature_demod_cf_sptr (new gr_quadrature_demod_cf (gain)); + return gnuradio::get_initial_sptr(new gr_quadrature_demod_cf (gain)); } int diff --git a/gnuradio-core/src/lib/general/gr_rail_ff.cc b/gnuradio-core/src/lib/general/gr_rail_ff.cc index 9fd3af8df..260897199 100644 --- a/gnuradio-core/src/lib/general/gr_rail_ff.cc +++ b/gnuradio-core/src/lib/general/gr_rail_ff.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,7 +30,7 @@ gr_rail_ff_sptr gr_make_rail_ff(float lo, float hi) { - return gr_rail_ff_sptr(new gr_rail_ff(lo, hi)); + return gnuradio::get_initial_sptr(new gr_rail_ff(lo, hi)); } gr_rail_ff::gr_rail_ff(float lo, float hi) diff --git a/gnuradio-core/src/lib/general/gr_regenerate_bb.cc b/gnuradio-core/src/lib/general/gr_regenerate_bb.cc index 183675520..3bb8be105 100644 --- a/gnuradio-core/src/lib/general/gr_regenerate_bb.cc +++ b/gnuradio-core/src/lib/general/gr_regenerate_bb.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2007 Free Software Foundation, Inc. + * Copyright 2007,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,7 +30,7 @@ gr_regenerate_bb_sptr gr_make_regenerate_bb (int period, unsigned int max_regen) { - return gr_regenerate_bb_sptr (new gr_regenerate_bb (period, max_regen)); + return gnuradio::get_initial_sptr(new gr_regenerate_bb (period, max_regen)); } gr_regenerate_bb::gr_regenerate_bb (int period, unsigned int max_regen) diff --git a/gnuradio-core/src/lib/general/gr_repeat.cc b/gnuradio-core/src/lib/general/gr_repeat.cc index 70bb44e5a..43ad50f52 100644 --- a/gnuradio-core/src/lib/general/gr_repeat.cc +++ b/gnuradio-core/src/lib/general/gr_repeat.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_repeat_sptr gr_make_repeat(size_t itemsize, int interp) { - return gr_repeat_sptr(new gr_repeat(itemsize, interp)); + return gnuradio::get_initial_sptr(new gr_repeat(itemsize, interp)); } gr_repeat::gr_repeat(size_t itemsize, int interp) diff --git a/gnuradio-core/src/lib/general/gr_rms_cf.cc b/gnuradio-core/src/lib/general/gr_rms_cf.cc index eab937e97..a7b5d99f1 100644 --- a/gnuradio-core/src/lib/general/gr_rms_cf.cc +++ b/gnuradio-core/src/lib/general/gr_rms_cf.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,7 +30,7 @@ gr_rms_cf_sptr gr_make_rms_cf(double alpha) { - return gr_rms_cf_sptr(new gr_rms_cf(alpha)); + return gnuradio::get_initial_sptr(new gr_rms_cf(alpha)); } gr_rms_cf::gr_rms_cf (double alpha) diff --git a/gnuradio-core/src/lib/general/gr_rms_ff.cc b/gnuradio-core/src/lib/general/gr_rms_ff.cc index 604cb3c9b..1ff4379f6 100644 --- a/gnuradio-core/src/lib/general/gr_rms_ff.cc +++ b/gnuradio-core/src/lib/general/gr_rms_ff.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,7 +30,7 @@ gr_rms_ff_sptr gr_make_rms_ff(double alpha) { - return gr_rms_ff_sptr(new gr_rms_ff(alpha)); + return gnuradio::get_initial_sptr(new gr_rms_ff(alpha)); } gr_rms_ff::gr_rms_ff (double alpha) diff --git a/gnuradio-core/src/lib/general/gr_scrambler_bb.cc b/gnuradio-core/src/lib/general/gr_scrambler_bb.cc index 42f70901b..59bd1ca41 100644 --- a/gnuradio-core/src/lib/general/gr_scrambler_bb.cc +++ b/gnuradio-core/src/lib/general/gr_scrambler_bb.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,7 +30,7 @@ gr_scrambler_bb_sptr gr_make_scrambler_bb(int mask, int seed, int len) { - return gr_scrambler_bb_sptr(new gr_scrambler_bb(mask, seed, len)); + return gnuradio::get_initial_sptr(new gr_scrambler_bb(mask, seed, len)); } gr_scrambler_bb::gr_scrambler_bb(int mask, int seed, int len) diff --git a/gnuradio-core/src/lib/general/gr_short_to_float.cc b/gnuradio-core/src/lib/general/gr_short_to_float.cc index 09dad2ef2..7b80953ac 100644 --- a/gnuradio-core/src/lib/general/gr_short_to_float.cc +++ b/gnuradio-core/src/lib/general/gr_short_to_float.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_short_to_float_sptr gr_make_short_to_float () { - return gr_short_to_float_sptr (new gr_short_to_float ()); + return gnuradio::get_initial_sptr(new gr_short_to_float ()); } gr_short_to_float::gr_short_to_float () diff --git a/gnuradio-core/src/lib/general/gr_simple_correlator.cc b/gnuradio-core/src/lib/general/gr_simple_correlator.cc index ebfbfa72e..01c007122 100644 --- a/gnuradio-core/src/lib/general/gr_simple_correlator.cc +++ b/gnuradio-core/src/lib/general/gr_simple_correlator.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -39,7 +39,7 @@ static const int THRESHOLD = 3; gr_simple_correlator_sptr gr_make_simple_correlator (int payload_bytesize) { - return gr_simple_correlator_sptr (new gr_simple_correlator (payload_bytesize)); + return gnuradio::get_initial_sptr(new gr_simple_correlator (payload_bytesize)); } gr_simple_correlator::gr_simple_correlator (int payload_bytesize) diff --git a/gnuradio-core/src/lib/general/gr_simple_framer.cc b/gnuradio-core/src/lib/general/gr_simple_framer.cc index d2de09546..2a574a74e 100644 --- a/gnuradio-core/src/lib/general/gr_simple_framer.cc +++ b/gnuradio-core/src/lib/general/gr_simple_framer.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -35,7 +35,7 @@ gr_simple_framer_sptr gr_make_simple_framer (int payload_bytesize) { - return gr_simple_framer_sptr (new gr_simple_framer (payload_bytesize)); + return gnuradio::get_initial_sptr(new gr_simple_framer (payload_bytesize)); } gr_simple_framer::gr_simple_framer (int payload_bytesize) diff --git a/gnuradio-core/src/lib/general/gr_simple_squelch_cc.cc b/gnuradio-core/src/lib/general/gr_simple_squelch_cc.cc index 3900671a6..cdea8055b 100644 --- a/gnuradio-core/src/lib/general/gr_simple_squelch_cc.cc +++ b/gnuradio-core/src/lib/general/gr_simple_squelch_cc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,7 +30,7 @@ gr_simple_squelch_cc_sptr gr_make_simple_squelch_cc(double threshold_db, double alpha) { - return gr_simple_squelch_cc_sptr(new gr_simple_squelch_cc(threshold_db, alpha)); + return gnuradio::get_initial_sptr(new gr_simple_squelch_cc(threshold_db, alpha)); } gr_simple_squelch_cc::gr_simple_squelch_cc (double threshold_db, double alpha) diff --git a/gnuradio-core/src/lib/general/gr_skiphead.cc b/gnuradio-core/src/lib/general/gr_skiphead.cc index 45e3d5cb2..ea7e9405f 100644 --- a/gnuradio-core/src/lib/general/gr_skiphead.cc +++ b/gnuradio-core/src/lib/general/gr_skiphead.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2007 Free Software Foundation, Inc. + * Copyright 2005,2007,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -38,7 +38,7 @@ gr_skiphead::gr_skiphead (size_t itemsize, size_t nitems_to_skip) gr_skiphead_sptr gr_make_skiphead (size_t itemsize, size_t nitems_to_skip) { - return gr_skiphead_sptr (new gr_skiphead (itemsize, nitems_to_skip)); + return gnuradio::get_initial_sptr(new gr_skiphead (itemsize, nitems_to_skip)); } int diff --git a/gnuradio-core/src/lib/general/gr_squash_ff.cc b/gnuradio-core/src/lib/general/gr_squash_ff.cc index 05ad4a7eb..479204fdb 100644 --- a/gnuradio-core/src/lib/general/gr_squash_ff.cc +++ b/gnuradio-core/src/lib/general/gr_squash_ff.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -35,7 +35,7 @@ gr_squash_ff_sptr gr_make_squash_ff(const std::vector<float> &igrid, const std::vector<float> &ogrid) { - return gr_squash_ff_sptr(new gr_squash_ff(igrid, ogrid)); + return gnuradio::get_initial_sptr(new gr_squash_ff(igrid, ogrid)); } gr_squash_ff::gr_squash_ff(const std::vector<float> &igrid, diff --git a/gnuradio-core/src/lib/general/gr_stream_mux.cc b/gnuradio-core/src/lib/general/gr_stream_mux.cc index 06556b583..7ef2bb3c7 100644 --- a/gnuradio-core/src/lib/general/gr_stream_mux.cc +++ b/gnuradio-core/src/lib/general/gr_stream_mux.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -34,7 +34,7 @@ gr_stream_mux_sptr gr_make_stream_mux (size_t itemsize, const std::vector<int> &lengths) { - return gr_stream_mux_sptr (new gr_stream_mux (itemsize, lengths)); + return gnuradio::get_initial_sptr(new gr_stream_mux (itemsize, lengths)); } gr_stream_mux::gr_stream_mux (size_t itemsize, const std::vector<int> &lengths) diff --git a/gnuradio-core/src/lib/general/gr_stream_to_streams.cc b/gnuradio-core/src/lib/general/gr_stream_to_streams.cc index b38a8d4d8..3d34dbc43 100644 --- a/gnuradio-core/src/lib/general/gr_stream_to_streams.cc +++ b/gnuradio-core/src/lib/general/gr_stream_to_streams.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_stream_to_streams_sptr gr_make_stream_to_streams (size_t item_size, size_t nstreams) { - return gr_stream_to_streams_sptr (new gr_stream_to_streams (item_size, nstreams)); + return gnuradio::get_initial_sptr(new gr_stream_to_streams (item_size, nstreams)); } gr_stream_to_streams::gr_stream_to_streams (size_t item_size, size_t nstreams) diff --git a/gnuradio-core/src/lib/general/gr_stream_to_vector.cc b/gnuradio-core/src/lib/general/gr_stream_to_vector.cc index fd233adca..f218601d7 100644 --- a/gnuradio-core/src/lib/general/gr_stream_to_vector.cc +++ b/gnuradio-core/src/lib/general/gr_stream_to_vector.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2005 Free Software Foundation, Inc. + * Copyright 2004,2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_stream_to_vector_sptr gr_make_stream_to_vector (size_t item_size, size_t nitems_per_block) { - return gr_stream_to_vector_sptr (new gr_stream_to_vector (item_size, nitems_per_block)); + return gnuradio::get_initial_sptr(new gr_stream_to_vector (item_size, nitems_per_block)); } gr_stream_to_vector::gr_stream_to_vector (size_t item_size, size_t nitems_per_block) diff --git a/gnuradio-core/src/lib/general/gr_streams_to_stream.cc b/gnuradio-core/src/lib/general/gr_streams_to_stream.cc index 6f6b49a82..ce4101089 100644 --- a/gnuradio-core/src/lib/general/gr_streams_to_stream.cc +++ b/gnuradio-core/src/lib/general/gr_streams_to_stream.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_streams_to_stream_sptr gr_make_streams_to_stream (size_t item_size, size_t nstreams) { - return gr_streams_to_stream_sptr (new gr_streams_to_stream (item_size, nstreams)); + return gnuradio::get_initial_sptr(new gr_streams_to_stream (item_size, nstreams)); } gr_streams_to_stream::gr_streams_to_stream (size_t item_size, size_t nstreams) diff --git a/gnuradio-core/src/lib/general/gr_streams_to_vector.cc b/gnuradio-core/src/lib/general/gr_streams_to_vector.cc index f3ee2c49a..e04fa4dcb 100644 --- a/gnuradio-core/src/lib/general/gr_streams_to_vector.cc +++ b/gnuradio-core/src/lib/general/gr_streams_to_vector.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2005 Free Software Foundation, Inc. + * Copyright 2004,2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_streams_to_vector_sptr gr_make_streams_to_vector (size_t item_size, size_t nstreams) { - return gr_streams_to_vector_sptr (new gr_streams_to_vector (item_size, nstreams)); + return gnuradio::get_initial_sptr(new gr_streams_to_vector (item_size, nstreams)); } gr_streams_to_vector::gr_streams_to_vector (size_t item_size, size_t nstreams) diff --git a/gnuradio-core/src/lib/general/gr_stretch_ff.cc b/gnuradio-core/src/lib/general/gr_stretch_ff.cc index f1822dcb8..c6395798a 100644 --- a/gnuradio-core/src/lib/general/gr_stretch_ff.cc +++ b/gnuradio-core/src/lib/general/gr_stretch_ff.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,7 +30,7 @@ gr_stretch_ff_sptr gr_make_stretch_ff(float lo, size_t vlen) { - return gr_stretch_ff_sptr(new gr_stretch_ff(lo, vlen)); + return gnuradio::get_initial_sptr(new gr_stretch_ff(lo, vlen)); } gr_stretch_ff::gr_stretch_ff(float lo, size_t vlen) diff --git a/gnuradio-core/src/lib/general/gr_test.cc b/gnuradio-core/src/lib/general/gr_test.cc index a04554ec4..077b39707 100644 --- a/gnuradio-core/src/lib/general/gr_test.cc +++ b/gnuradio-core/src/lib/general/gr_test.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006,2008 Free Software Foundation, Inc. + * Copyright 2006,2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -36,7 +36,7 @@ gr_test_sptr gr_make_test (const std::string &name, unsigned int history,unsigned int output_multiple,double relative_rate, bool fixed_rate,gr_consume_type_t cons_type, gr_produce_type_t prod_type) { - return gr_test_sptr (new gr_test (name, min_inputs,max_inputs,sizeof_input_item, + return gnuradio::get_initial_sptr(new gr_test (name, min_inputs,max_inputs,sizeof_input_item, min_outputs,max_outputs,sizeof_output_item, history,output_multiple,relative_rate,fixed_rate,cons_type, prod_type)); } diff --git a/gnuradio-core/src/lib/general/gr_threshold_ff.cc b/gnuradio-core/src/lib/general/gr_threshold_ff.cc index 9deb3e461..622fe1b45 100644 --- a/gnuradio-core/src/lib/general/gr_threshold_ff.cc +++ b/gnuradio-core/src/lib/general/gr_threshold_ff.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ gr_threshold_ff_sptr gr_make_threshold_ff (float lo, float hi, float initial_state) { - return gr_threshold_ff_sptr (new gr_threshold_ff (lo, hi, initial_state)); + return gnuradio::get_initial_sptr(new gr_threshold_ff (lo, hi, initial_state)); } gr_threshold_ff::gr_threshold_ff (float lo, float hi, float initial_state) diff --git a/gnuradio-core/src/lib/general/gr_throttle.cc b/gnuradio-core/src/lib/general/gr_throttle.cc index 88219c1c8..3189e01c0 100644 --- a/gnuradio-core/src/lib/general/gr_throttle.cc +++ b/gnuradio-core/src/lib/general/gr_throttle.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -57,7 +57,7 @@ gr_nanosleep(struct timespec *ts) gr_throttle_sptr gr_make_throttle(size_t itemsize, double samples_per_sec) { - return gr_throttle_sptr(new gr_throttle(itemsize, samples_per_sec)); + return gnuradio::get_initial_sptr(new gr_throttle(itemsize, samples_per_sec)); } gr_throttle::gr_throttle(size_t itemsize, double samples_per_sec) diff --git a/gnuradio-core/src/lib/general/gr_uchar_to_float.cc b/gnuradio-core/src/lib/general/gr_uchar_to_float.cc index 305052942..83616b428 100644 --- a/gnuradio-core/src/lib/general/gr_uchar_to_float.cc +++ b/gnuradio-core/src/lib/general/gr_uchar_to_float.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_uchar_to_float_sptr gr_make_uchar_to_float () { - return gr_uchar_to_float_sptr (new gr_uchar_to_float ()); + return gnuradio::get_initial_sptr(new gr_uchar_to_float ()); } gr_uchar_to_float::gr_uchar_to_float () diff --git a/gnuradio-core/src/lib/general/gr_unpack_k_bits_bb.cc b/gnuradio-core/src/lib/general/gr_unpack_k_bits_bb.cc index 7c5fdb1d6..e33c3da9a 100644 --- a/gnuradio-core/src/lib/general/gr_unpack_k_bits_bb.cc +++ b/gnuradio-core/src/lib/general/gr_unpack_k_bits_bb.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_unpack_k_bits_bb_sptr gr_make_unpack_k_bits_bb (unsigned k) { - return gr_unpack_k_bits_bb_sptr (new gr_unpack_k_bits_bb (k)); + return gnuradio::get_initial_sptr(new gr_unpack_k_bits_bb (k)); } diff --git a/gnuradio-core/src/lib/general/gr_vco_f.cc b/gnuradio-core/src/lib/general/gr_vco_f.cc index 342a880e4..43a686327 100644 --- a/gnuradio-core/src/lib/general/gr_vco_f.cc +++ b/gnuradio-core/src/lib/general/gr_vco_f.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_vco_f_sptr gr_make_vco_f(double sampling_rate, double sensitivity, double amplitude) { - return gr_vco_f_sptr(new gr_vco_f(sampling_rate, sensitivity, amplitude)); + return gnuradio::get_initial_sptr(new gr_vco_f(sampling_rate, sensitivity, amplitude)); } diff --git a/gnuradio-core/src/lib/general/gr_vector_to_stream.cc b/gnuradio-core/src/lib/general/gr_vector_to_stream.cc index 149bc0d5b..0a0788de6 100644 --- a/gnuradio-core/src/lib/general/gr_vector_to_stream.cc +++ b/gnuradio-core/src/lib/general/gr_vector_to_stream.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006 Free Software Foundation, Inc. + * Copyright 2004,2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_vector_to_stream_sptr gr_make_vector_to_stream (size_t item_size, size_t nitems_per_block) { - return gr_vector_to_stream_sptr (new gr_vector_to_stream (item_size, nitems_per_block)); + return gnuradio::get_initial_sptr(new gr_vector_to_stream (item_size, nitems_per_block)); } gr_vector_to_stream::gr_vector_to_stream (size_t item_size, size_t nitems_per_block) diff --git a/gnuradio-core/src/lib/general/gr_vector_to_streams.cc b/gnuradio-core/src/lib/general/gr_vector_to_streams.cc index 19f15b170..cc3264152 100644 --- a/gnuradio-core/src/lib/general/gr_vector_to_streams.cc +++ b/gnuradio-core/src/lib/general/gr_vector_to_streams.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2005 Free Software Foundation, Inc. + * Copyright 2004,2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ gr_vector_to_streams_sptr gr_make_vector_to_streams (size_t item_size, size_t nstreams) { - return gr_vector_to_streams_sptr (new gr_vector_to_streams (item_size, nstreams)); + return gnuradio::get_initial_sptr(new gr_vector_to_streams (item_size, nstreams)); } gr_vector_to_streams::gr_vector_to_streams (size_t item_size, size_t nstreams) diff --git a/gnuradio-core/src/lib/general/gr_wavelet_ff.cc b/gnuradio-core/src/lib/general/gr_wavelet_ff.cc index 6cbfa2381..f77c96e99 100644 --- a/gnuradio-core/src/lib/general/gr_wavelet_ff.cc +++ b/gnuradio-core/src/lib/general/gr_wavelet_ff.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -38,7 +38,7 @@ gr_make_wavelet_ff(int size, int order, bool forward) { - return gr_wavelet_ff_sptr(new gr_wavelet_ff(size, + return gnuradio::get_initial_sptr(new gr_wavelet_ff(size, order, forward)); } diff --git a/gnuradio-core/src/lib/general/gr_wvps_ff.cc b/gnuradio-core/src/lib/general/gr_wvps_ff.cc index f814ba8fc..8a8dc56ac 100644 --- a/gnuradio-core/src/lib/general/gr_wvps_ff.cc +++ b/gnuradio-core/src/lib/general/gr_wvps_ff.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -39,7 +39,7 @@ ceil_log2(int k) gr_wvps_ff_sptr gr_make_wvps_ff(int ilen) { - return gr_wvps_ff_sptr(new gr_wvps_ff(ilen)); + return gnuradio::get_initial_sptr(new gr_wvps_ff(ilen)); } gr_wvps_ff::gr_wvps_ff(int ilen) diff --git a/gnuradio-core/src/lib/general/gri_agc2_cc.i b/gnuradio-core/src/lib/general/gri_agc2_cc.i index e7d6da97f..0f97f1d8e 100644 --- a/gnuradio-core/src/lib/general/gri_agc2_cc.i +++ b/gnuradio-core/src/lib/general/gri_agc2_cc.i @@ -39,4 +39,9 @@ class gri_agc2_cc { float reference (); float gain (); float max_gain (); + void set_decay_rate (float rate); + void set_attack_rate (float rate); + void set_reference (float reference); + void set_gain (float gain); + void set_max_gain(float max_gain); }; diff --git a/gnuradio-core/src/lib/general/gri_agc2_ff.i b/gnuradio-core/src/lib/general/gri_agc2_ff.i index 3825ce225..d04b638a6 100644 --- a/gnuradio-core/src/lib/general/gri_agc2_ff.i +++ b/gnuradio-core/src/lib/general/gri_agc2_ff.i @@ -34,4 +34,14 @@ class gri_agc2_ff { public: gri_agc2_ff (float attack_rate = 1e-1, float decay_rate = 1e-2, float reference = 1.0, float gain = 1.0, float max_gain = 0.0); + float attack_rate (); + float decay_rate (); + float reference (); + float gain (); + float max_gain (); + void set_attack_rate (float rate); + void set_decay_rate (float rate); + void set_reference (float reference); + void set_gain (float gain); + void set_max_gain (float max_gain); }; diff --git a/gnuradio-core/src/lib/gengen/gr_add_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_add_XX.cc.t index 2e44c5ea7..58a25325a 100644 --- a/gnuradio-core/src/lib/gengen/gr_add_XX.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_add_XX.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004, 2009 Free Software Foundation, Inc. + * Copyright 2004, 2009,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ @SPTR_NAME@ gr_make_@BASE_NAME@ (size_t vlen) { - return @SPTR_NAME@ (new @NAME@ (vlen)); + return gnuradio::get_initial_sptr (new @NAME@ (vlen)); } @NAME@::@NAME@ (size_t vlen) diff --git a/gnuradio-core/src/lib/gengen/gr_add_const_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_add_const_XX.cc.t index 3df3ea9c6..0d3034be7 100644 --- a/gnuradio-core/src/lib/gengen/gr_add_const_XX.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_add_const_XX.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ @SPTR_NAME@ gr_make_@BASE_NAME@ (@O_TYPE@ k) { - return @SPTR_NAME@ (new @NAME@ (k)); + return gnuradio::get_initial_sptr (new @NAME@ (k)); } @NAME@::@NAME@ (@O_TYPE@ k) diff --git a/gnuradio-core/src/lib/gengen/gr_add_const_vXX.cc.t b/gnuradio-core/src/lib/gengen/gr_add_const_vXX.cc.t index 0e6588dc0..2a0a3ba3f 100755 --- a/gnuradio-core/src/lib/gengen/gr_add_const_vXX.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_add_const_vXX.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006 Free Software Foundation, Inc. + * Copyright 2004,2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ @SPTR_NAME@ gr_make_@BASE_NAME@ (const std::vector<@I_TYPE@> k) { - return @SPTR_NAME@ (new @NAME@ (k)); + return gnuradio::get_initial_sptr (new @NAME@ (k)); } @NAME@::@NAME@ (const std::vector<@I_TYPE@> k) diff --git a/gnuradio-core/src/lib/gengen/gr_and_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_and_XX.cc.t index cef21d333..150ef7f0d 100644 --- a/gnuradio-core/src/lib/gengen/gr_and_XX.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_and_XX.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2008 Free Software Foundation, Inc. + * Copyright 2004,2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ @SPTR_NAME@ gr_make_@BASE_NAME@ () { - return @SPTR_NAME@ (new @NAME@ ()); + return gnuradio::get_initial_sptr (new @NAME@ ()); } @NAME@::@NAME@ () diff --git a/gnuradio-core/src/lib/gengen/gr_and_const_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_and_const_XX.cc.t index ec725b23d..bd48788e6 100644 --- a/gnuradio-core/src/lib/gengen/gr_and_const_XX.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_and_const_XX.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2009 Free Software Foundation, Inc. + * Copyright 2009,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ @SPTR_NAME@ gr_make_@BASE_NAME@ (@I_TYPE@ k) { - return @SPTR_NAME@ (new @NAME@ (k)); + return gnuradio::get_initial_sptr (new @NAME@ (k)); }; @NAME@::@NAME@ (@I_TYPE@ k) diff --git a/gnuradio-core/src/lib/gengen/gr_chunks_to_symbols_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_chunks_to_symbols_XX.cc.t index ab61fb08d..635d991ef 100644 --- a/gnuradio-core/src/lib/gengen/gr_chunks_to_symbols_XX.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_chunks_to_symbols_XX.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -35,7 +35,7 @@ @SPTR_NAME@ gr_make_@BASE_NAME@ (const std::vector<@O_TYPE@> &symbol_table, const int D) { - return @SPTR_NAME@ (new @NAME@ (symbol_table,D)); + return gnuradio::get_initial_sptr (new @NAME@ (symbol_table,D)); } @NAME@::@NAME@ (const std::vector<@O_TYPE@> &symbol_table, const int D) diff --git a/gnuradio-core/src/lib/gengen/gr_divide_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_divide_XX.cc.t index 2db490f13..1200145fa 100644 --- a/gnuradio-core/src/lib/gengen/gr_divide_XX.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_divide_XX.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004, 2009 Free Software Foundation, Inc. + * Copyright 2004, 2009,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ @SPTR_NAME@ gr_make_@BASE_NAME@ (size_t vlen) { - return @SPTR_NAME@ (new @NAME@ (vlen)); + return gnuradio::get_initial_sptr (new @NAME@ (vlen)); } @NAME@::@NAME@ (size_t vlen) diff --git a/gnuradio-core/src/lib/gengen/gr_integrate_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_integrate_XX.cc.t index 0a62554bd..f6e38848c 100644 --- a/gnuradio-core/src/lib/gengen/gr_integrate_XX.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_integrate_XX.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ @SPTR_NAME@ gr_make_@BASE_NAME@ (int decim) { - return @SPTR_NAME@ (new @NAME@ (decim)); + return gnuradio::get_initial_sptr (new @NAME@ (decim)); } @NAME@::@NAME@ (int decim) diff --git a/gnuradio-core/src/lib/gengen/gr_moving_average_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_moving_average_XX.cc.t index 33a0acf9c..8d2370d3b 100644 --- a/gnuradio-core/src/lib/gengen/gr_moving_average_XX.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_moving_average_XX.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ @SPTR_NAME@ gr_make_@BASE_NAME@ (int length, @O_TYPE@ scale, int max_iter) { - return @SPTR_NAME@ (new @NAME@ (length, scale, max_iter)); + return gnuradio::get_initial_sptr (new @NAME@ (length, scale, max_iter)); } @NAME@::@NAME@ (int length, @O_TYPE@ scale, int max_iter) diff --git a/gnuradio-core/src/lib/gengen/gr_multiply_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_multiply_XX.cc.t index 000c5e0bd..13ec0c8b3 100644 --- a/gnuradio-core/src/lib/gengen/gr_multiply_XX.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_multiply_XX.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004, 2009 Free Software Foundation, Inc. + * Copyright 2004, 2009,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ @SPTR_NAME@ gr_make_@BASE_NAME@ (size_t vlen) { - return @SPTR_NAME@ (new @NAME@ (vlen)); + return gnuradio::get_initial_sptr (new @NAME@ (vlen)); } @NAME@::@NAME@ (size_t vlen) diff --git a/gnuradio-core/src/lib/gengen/gr_multiply_const_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_multiply_const_XX.cc.t index 715782dd1..09e658e90 100644 --- a/gnuradio-core/src/lib/gengen/gr_multiply_const_XX.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_multiply_const_XX.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ @SPTR_NAME@ gr_make_@BASE_NAME@ (@O_TYPE@ k) { - return @SPTR_NAME@ (new @NAME@ (k)); + return gnuradio::get_initial_sptr (new @NAME@ (k)); } @NAME@::@NAME@ (@O_TYPE@ k) diff --git a/gnuradio-core/src/lib/gengen/gr_multiply_const_vXX.cc.t b/gnuradio-core/src/lib/gengen/gr_multiply_const_vXX.cc.t index 5b92ea8a1..8286453f1 100755 --- a/gnuradio-core/src/lib/gengen/gr_multiply_const_vXX.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_multiply_const_vXX.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006 Free Software Foundation, Inc. + * Copyright 2004,2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ @SPTR_NAME@ gr_make_@BASE_NAME@ (const std::vector<@I_TYPE@> k) { - return @SPTR_NAME@ (new @NAME@ (k)); + return gnuradio::get_initial_sptr (new @NAME@ (k)); } @NAME@::@NAME@ (const std::vector<@I_TYPE@> k) diff --git a/gnuradio-core/src/lib/gengen/gr_mute_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_mute_XX.cc.t index ee49d97b4..62a8e63da 100644 --- a/gnuradio-core/src/lib/gengen/gr_mute_XX.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_mute_XX.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -34,7 +34,7 @@ @SPTR_NAME@ gr_make_@BASE_NAME@ (bool mute) { - return @SPTR_NAME@ (new @NAME@ (mute)); + return gnuradio::get_initial_sptr (new @NAME@ (mute)); } @NAME@::@NAME@ (bool mute) diff --git a/gnuradio-core/src/lib/gengen/gr_noise_source_X.cc.t b/gnuradio-core/src/lib/gengen/gr_noise_source_X.cc.t index 83be9aa18..35f5fabd9 100644 --- a/gnuradio-core/src/lib/gengen/gr_noise_source_X.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_noise_source_X.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -33,7 +33,7 @@ @NAME@_sptr gr_make_@BASE_NAME@ (gr_noise_type_t type, float ampl, long seed) { - return @NAME@_sptr (new @NAME@ (type, ampl, seed)); + return gnuradio::get_initial_sptr(new @NAME@ (type, ampl, seed)); } diff --git a/gnuradio-core/src/lib/gengen/gr_not_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_not_XX.cc.t index 272987411..432938e67 100644 --- a/gnuradio-core/src/lib/gengen/gr_not_XX.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_not_XX.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2008 Free Software Foundation, Inc. + * Copyright 2004,2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ @SPTR_NAME@ gr_make_@BASE_NAME@ () { - return @SPTR_NAME@ (new @NAME@ ()); + return gnuradio::get_initial_sptr (new @NAME@ ()); } @NAME@::@NAME@ () diff --git a/gnuradio-core/src/lib/gengen/gr_or_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_or_XX.cc.t index e118cdbbb..07c759d73 100644 --- a/gnuradio-core/src/lib/gengen/gr_or_XX.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_or_XX.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2008 Free Software Foundation, Inc. + * Copyright 2004,2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ @SPTR_NAME@ gr_make_@BASE_NAME@ () { - return @SPTR_NAME@ (new @NAME@ ()); + return gnuradio::get_initial_sptr (new @NAME@ ()); } @NAME@::@NAME@ () diff --git a/gnuradio-core/src/lib/gengen/gr_peak_detector_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_peak_detector_XX.cc.t index ce6316920..1a4a2564b 100644 --- a/gnuradio-core/src/lib/gengen/gr_peak_detector_XX.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_peak_detector_XX.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2007 Free Software Foundation, Inc. + * Copyright 2007,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -35,7 +35,7 @@ gr_make_@BASE_NAME@ (float threshold_factor_rise, float threshold_factor_fall, int look_ahead, float alpha) { - return @SPTR_NAME@ (new @NAME@ (threshold_factor_rise, + return gnuradio::get_initial_sptr (new @NAME@ (threshold_factor_rise, threshold_factor_fall, look_ahead, alpha)); } diff --git a/gnuradio-core/src/lib/gengen/gr_sample_and_hold_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_sample_and_hold_XX.cc.t index 52538286e..b78c52857 100644 --- a/gnuradio-core/src/lib/gengen/gr_sample_and_hold_XX.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_sample_and_hold_XX.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2007 Free Software Foundation, Inc. + * Copyright 2007,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ @SPTR_NAME@ gr_make_@BASE_NAME@ () { - return @SPTR_NAME@ (new @NAME@ ()); + return gnuradio::get_initial_sptr (new @NAME@ ()); } @NAME@::@NAME@ () diff --git a/gnuradio-core/src/lib/gengen/gr_sig_source_X.cc.t b/gnuradio-core/src/lib/gengen/gr_sig_source_X.cc.t index 0694df315..9354eb93c 100644 --- a/gnuradio-core/src/lib/gengen/gr_sig_source_X.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_sig_source_X.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -47,7 +47,7 @@ gr_make_@BASE_NAME@ (double sampling_freq, gr_waveform_t waveform, double frequency, double ampl, @TYPE@ offset) { - return @NAME@_sptr (new @NAME@ (sampling_freq, waveform, frequency, ampl, offset)); + return gnuradio::get_initial_sptr(new @NAME@ (sampling_freq, waveform, frequency, ampl, offset)); } int diff --git a/gnuradio-core/src/lib/gengen/gr_sub_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_sub_XX.cc.t index c8bdabf9f..f0ed75217 100644 --- a/gnuradio-core/src/lib/gengen/gr_sub_XX.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_sub_XX.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004, 2009 Free Software Foundation, Inc. + * Copyright 2004, 2009,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ @SPTR_NAME@ gr_make_@BASE_NAME@ (size_t vlen) { - return @SPTR_NAME@ (new @NAME@ (vlen)); + return gnuradio::get_initial_sptr (new @NAME@ (vlen)); } @NAME@::@NAME@ (size_t vlen) diff --git a/gnuradio-core/src/lib/gengen/gr_vector_sink_X.cc.t b/gnuradio-core/src/lib/gengen/gr_vector_sink_X.cc.t index b2a6c4ac4..f3466d46f 100644 --- a/gnuradio-core/src/lib/gengen/gr_vector_sink_X.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_vector_sink_X.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2008 Free Software Foundation, Inc. + * Copyright 2004,2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -54,7 +54,7 @@ int @NAME@_sptr gr_make_@BASE_NAME@ (int vlen) { - return @NAME@_sptr (new @NAME@ (vlen)); + return gnuradio::get_initial_sptr(new @NAME@ (vlen)); } std::vector<@TYPE@> diff --git a/gnuradio-core/src/lib/gengen/gr_vector_source_X.cc.t b/gnuradio-core/src/lib/gengen/gr_vector_source_X.cc.t index 889a6f22c..1fe5df5b5 100644 --- a/gnuradio-core/src/lib/gengen/gr_vector_source_X.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_vector_source_X.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2008 Free Software Foundation, Inc. + * Copyright 2004,2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -84,6 +84,6 @@ int @NAME@_sptr gr_make_@BASE_NAME@ (const std::vector<@TYPE@> &data, bool repeat, int vlen) { - return @NAME@_sptr (new @NAME@ (data, repeat, vlen)); + return gnuradio::get_initial_sptr(new @NAME@ (data, repeat, vlen)); } diff --git a/gnuradio-core/src/lib/gengen/gr_xor_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_xor_XX.cc.t index f64dd1c97..29230f7a6 100644 --- a/gnuradio-core/src/lib/gengen/gr_xor_XX.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_xor_XX.cc.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2008 Free Software Foundation, Inc. + * Copyright 2004,2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ @SPTR_NAME@ gr_make_@BASE_NAME@ () { - return @SPTR_NAME@ (new @NAME@ ()); + return gnuradio::get_initial_sptr (new @NAME@ ()); } @NAME@::@NAME@ () diff --git a/gnuradio-core/src/lib/io/Makefile.am b/gnuradio-core/src/lib/io/Makefile.am index 9eacd137d..c52554645 100644 --- a/gnuradio-core/src/lib/io/Makefile.am +++ b/gnuradio-core/src/lib/io/Makefile.am @@ -39,7 +39,6 @@ libio_la_SOURCES = \ gr_oscope_guts.cc \ gr_oscope_sink_f.cc \ gr_oscope_sink_x.cc \ - gri_logger.cc \ i2c.cc \ i2c_bitbang.cc \ i2c_bbio.cc \ @@ -72,7 +71,6 @@ grinclude_HEADERS = \ gr_oscope_sink_f.h \ gr_oscope_sink_x.h \ gr_trigger_mode.h \ - gri_logger.h \ i2c.h \ i2c_bitbang.h \ i2c_bbio.h \ diff --git a/gnuradio-core/src/lib/io/gr_file_descriptor_sink.cc b/gnuradio-core/src/lib/io/gr_file_descriptor_sink.cc index 2da66b7ae..09fb6c826 100644 --- a/gnuradio-core/src/lib/io/gr_file_descriptor_sink.cc +++ b/gnuradio-core/src/lib/io/gr_file_descriptor_sink.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -46,7 +46,7 @@ gr_file_descriptor_sink::gr_file_descriptor_sink (size_t itemsize, int fd) gr_file_descriptor_sink_sptr gr_make_file_descriptor_sink (size_t itemsize, int fd) { - return gr_file_descriptor_sink_sptr (new gr_file_descriptor_sink (itemsize, fd)); + return gnuradio::get_initial_sptr(new gr_file_descriptor_sink (itemsize, fd)); } gr_file_descriptor_sink::~gr_file_descriptor_sink () diff --git a/gnuradio-core/src/lib/io/gr_file_sink.cc b/gnuradio-core/src/lib/io/gr_file_sink.cc index d40235fab..aab0158e7 100644 --- a/gnuradio-core/src/lib/io/gr_file_sink.cc +++ b/gnuradio-core/src/lib/io/gr_file_sink.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006,2007 Free Software Foundation, Inc. + * Copyright 2004,2006,2007,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ gr_file_sink_sptr gr_make_file_sink (size_t itemsize, const char *filename) { - return gr_file_sink_sptr (new gr_file_sink (itemsize, filename)); + return gnuradio::get_initial_sptr(new gr_file_sink (itemsize, filename)); } gr_file_sink::gr_file_sink(size_t itemsize, const char *filename) @@ -70,5 +70,8 @@ gr_file_sink::work (int noutput_items, nwritten += count; inbuf += count * d_itemsize; } + if (d_unbuffered) + fflush (d_fp); + return nwritten; } diff --git a/gnuradio-core/src/lib/io/gr_file_sink_base.cc b/gnuradio-core/src/lib/io/gr_file_sink_base.cc index 5ddeeb4d5..c43304b0d 100644 --- a/gnuradio-core/src/lib/io/gr_file_sink_base.cc +++ b/gnuradio-core/src/lib/io/gr_file_sink_base.cc @@ -118,3 +118,9 @@ gr_file_sink_base::do_update() d_updated = false; } } + +void +gr_file_sink_base::set_unbuffered(bool unbuffered) +{ + d_unbuffered = unbuffered; +} diff --git a/gnuradio-core/src/lib/io/gr_file_sink_base.h b/gnuradio-core/src/lib/io/gr_file_sink_base.h index 0c028d7fd..7b96cdb7f 100644 --- a/gnuradio-core/src/lib/io/gr_file_sink_base.h +++ b/gnuradio-core/src/lib/io/gr_file_sink_base.h @@ -37,6 +37,7 @@ class gr_file_sink_base bool d_updated; // is there a new FILE pointer? bool d_is_binary; boost::mutex d_mutex; + bool d_unbuffered; protected: gr_file_sink_base(const char *filename, bool is_binary); @@ -61,6 +62,12 @@ class gr_file_sink_base * \brief if we've had an update, do it now. */ void do_update(); + + + /*! + * \brief turn on unbuffered writes for slower outputs + */ + void set_unbuffered(bool unbuffered); }; diff --git a/gnuradio-core/src/lib/io/gr_file_sink_base.i b/gnuradio-core/src/lib/io/gr_file_sink_base.i index 05a3353bb..ed4342482 100644 --- a/gnuradio-core/src/lib/io/gr_file_sink_base.i +++ b/gnuradio-core/src/lib/io/gr_file_sink_base.i @@ -43,4 +43,9 @@ class gr_file_sink_base * \brief if we've had an update, do it now. */ void do_update(); + + /*! + *\brief turn on unbuffered mode for slow outputs + */ + void set_unbuffered(bool unbuffered); }; diff --git a/gnuradio-core/src/lib/io/gr_file_source.cc b/gnuradio-core/src/lib/io/gr_file_source.cc index 5591826d0..d045e26b3 100644 --- a/gnuradio-core/src/lib/io/gr_file_source.cc +++ b/gnuradio-core/src/lib/io/gr_file_source.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -74,7 +74,7 @@ gr_file_source::gr_file_source (size_t itemsize, const char *filename, bool repe gr_file_source_sptr gr_make_file_source (size_t itemsize, const char *filename, bool repeat) { - return gr_file_source_sptr (new gr_file_source (itemsize, filename, repeat)); + return gnuradio::get_initial_sptr(new gr_file_source (itemsize, filename, repeat)); } gr_file_source::~gr_file_source () diff --git a/gnuradio-core/src/lib/io/gr_histo_sink_f.cc b/gnuradio-core/src/lib/io/gr_histo_sink_f.cc index 2885fe428..a37189c24 100644 --- a/gnuradio-core/src/lib/io/gr_histo_sink_f.cc +++ b/gnuradio-core/src/lib/io/gr_histo_sink_f.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2009 Free Software Foundation, Inc. + * Copyright 2009,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -46,7 +46,7 @@ static float get_clean_num(float num){ gr_histo_sink_f_sptr gr_make_histo_sink_f (gr_msg_queue_sptr msgq) { - return gr_histo_sink_f_sptr (new gr_histo_sink_f (msgq)); + return gnuradio::get_initial_sptr(new gr_histo_sink_f (msgq)); } gr_histo_sink_f::gr_histo_sink_f (gr_msg_queue_sptr msgq) diff --git a/gnuradio-core/src/lib/io/gr_message_sink.cc b/gnuradio-core/src/lib/io/gr_message_sink.cc index b9e0cc382..8881e97f4 100644 --- a/gnuradio-core/src/lib/io/gr_message_sink.cc +++ b/gnuradio-core/src/lib/io/gr_message_sink.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -40,7 +40,7 @@ gr_message_sink_sptr gr_make_message_sink (size_t itemsize, gr_msg_queue_sptr msgq, bool dont_block) { - return gr_message_sink_sptr(new gr_message_sink(itemsize, msgq, dont_block)); + return gnuradio::get_initial_sptr(new gr_message_sink(itemsize, msgq, dont_block)); } gr_message_sink::gr_message_sink (size_t itemsize, gr_msg_queue_sptr msgq, bool dont_block) diff --git a/gnuradio-core/src/lib/io/gr_message_source.cc b/gnuradio-core/src/lib/io/gr_message_source.cc index 3efc5b321..0fa24f2f9 100644 --- a/gnuradio-core/src/lib/io/gr_message_source.cc +++ b/gnuradio-core/src/lib/io/gr_message_source.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -40,14 +40,14 @@ gr_message_source_sptr gr_make_message_source(size_t itemsize, int msgq_limit) { - return gr_message_source_sptr(new gr_message_source(itemsize, msgq_limit)); + return gnuradio::get_initial_sptr(new gr_message_source(itemsize, msgq_limit)); } // public constructor that takes existing message queue gr_message_source_sptr gr_make_message_source(size_t itemsize, gr_msg_queue_sptr msgq) { - return gr_message_source_sptr(new gr_message_source(itemsize, msgq)); + return gnuradio::get_initial_sptr(new gr_message_source(itemsize, msgq)); } gr_message_source::gr_message_source (size_t itemsize, int msgq_limit) diff --git a/gnuradio-core/src/lib/io/gr_oscope_guts.cc b/gnuradio-core/src/lib/io/gr_oscope_guts.cc index 80f78240d..ce7feca13 100644 --- a/gnuradio-core/src/lib/io/gr_oscope_guts.cc +++ b/gnuradio-core/src/lib/io/gr_oscope_guts.cc @@ -104,34 +104,49 @@ gr_oscope_guts::process_sample (const float *channel_data) d_decimator_count = d_decimator_count_init; - for (int i = 0; i < d_nchannels; i++) - d_buffer[i][d_obi] = channel_data[i]; // copy data into buffer - - switch (d_state){ - case HOLD_OFF: - d_hold_off_count--; - if (d_hold_off_count <= 0) - enter_look_for_trigger (); - break; - - case LOOK_FOR_TRIGGER: - if (found_trigger ()) - enter_post_trigger (); - break; - - case POST_TRIGGER: - d_post_trigger_count--; - if (d_post_trigger_count <= 0){ - write_output_records (); - enter_hold_off (); - } - break; - - default: - assert (0); + if (d_trigger_mode != gr_TRIG_MODE_STRIPCHART) + { + for (int i = 0; i < d_nchannels; i++) + d_buffer[i][d_obi] = channel_data[i]; // copy data into buffer + + switch (d_state){ + case HOLD_OFF: + d_hold_off_count--; + if (d_hold_off_count <= 0) + enter_look_for_trigger (); + break; + + case LOOK_FOR_TRIGGER: + if (found_trigger ()) + enter_post_trigger (); + break; + + case POST_TRIGGER: + d_post_trigger_count--; + if (d_post_trigger_count <= 0){ + write_output_records (); + enter_hold_off (); + } + break; + + default: + assert (0); + } + + d_obi = incr_bi (d_obi); + } + else + { + for (int i = 0; i < d_nchannels; i++) + { + for (int j = OUTPUT_RECORD_SIZE-1; j >= 0; j--) + { + d_buffer[i][j] = d_buffer[i][j-1]; + } + d_buffer[i][0] = channel_data[i]; + } + write_output_records(); } - - d_obi = incr_bi (d_obi); } /* diff --git a/gnuradio-core/src/lib/io/gr_oscope_sink_f.cc b/gnuradio-core/src/lib/io/gr_oscope_sink_f.cc index cb401699e..eca0f6dc6 100644 --- a/gnuradio-core/src/lib/io/gr_oscope_sink_f.cc +++ b/gnuradio-core/src/lib/io/gr_oscope_sink_f.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2003,2004,2005 Free Software Foundation, Inc. + * Copyright 2003,2004,2005,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,7 @@ gr_oscope_sink_f_sptr gr_make_oscope_sink_f (double sampling_rate, gr_msg_queue_sptr msgq) { - return gr_oscope_sink_f_sptr (new gr_oscope_sink_f (sampling_rate, msgq)); + return gnuradio::get_initial_sptr(new gr_oscope_sink_f (sampling_rate, msgq)); } diff --git a/gnuradio-core/src/lib/io/gr_trigger_mode.h b/gnuradio-core/src/lib/io/gr_trigger_mode.h index 63f6b1c98..8e1222856 100644 --- a/gnuradio-core/src/lib/io/gr_trigger_mode.h +++ b/gnuradio-core/src/lib/io/gr_trigger_mode.h @@ -27,6 +27,7 @@ enum gr_trigger_mode { gr_TRIG_MODE_FREE, gr_TRIG_MODE_AUTO, gr_TRIG_MODE_NORM, + gr_TRIG_MODE_STRIPCHART, }; enum gr_trigger_slope { diff --git a/gnuradio-core/src/lib/io/gr_udp_sink.cc b/gnuradio-core/src/lib/io/gr_udp_sink.cc index d37adfb8a..36b4cbe36 100644 --- a/gnuradio-core/src/lib/io/gr_udp_sink.cc +++ b/gnuradio-core/src/lib/io/gr_udp_sink.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2007,2008,2009 Free Software Foundation, Inc. + * Copyright 2007,2008,2009,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -26,13 +26,24 @@ #include <gr_udp_sink.h> #include <gr_io_signature.h> #include <stdexcept> -#if defined(HAVE_SOCKET) -#include <netdb.h> +#include <errno.h> #include <stdio.h> +#include <string.h> +#if defined(HAVE_NETDB_H) +#include <netdb.h> +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> //usually included by <netdb.h>? +#endif typedef void* optval_t; -#else +#elif defined(HAVE_WINDOWS_H) +// if not posix, assume winsock +#define USING_WINSOCK +#include <winsock2.h> +#include <ws2tcpip.h> #define SHUT_RDWR 2 -#define inet_aton(N,A) ( (A)->s_addr = inet_addr(N), ( (A)->s_addr != INADDR_NONE ) ) typedef char* optval_t; #endif @@ -40,91 +51,67 @@ typedef char* optval_t; #define SNK_VERBOSE 0 -gr_udp_sink::gr_udp_sink (size_t itemsize, - const char *src, unsigned short port_src, - const char *dst, unsigned short port_dst, - int payload_size) - : gr_sync_block ("udp_sink", - gr_make_io_signature (1, 1, itemsize), - gr_make_io_signature (0, 0, 0)), - d_itemsize (itemsize), d_updated(false), d_payload_size(payload_size) +static int is_error( int perr ) { - int ret = 0; - - // Set up the address stucture for the source address and port numbers - // Get the source IP address from the host name - struct hostent *hsrc = gethostbyname(src); - if(hsrc) { // if the source was provided as a host namex - d_ip_src = *(struct in_addr*)hsrc->h_addr_list[0]; + // Compare error to posix error code; return nonzero if match. +#if defined(USING_WINSOCK) +#define ENOPROTOOPT 109 +#define ECONNREFUSED 111 + // All codes to be checked for must be defined below + int werr = WSAGetLastError(); + switch( werr ) { + case WSAETIMEDOUT: + return( perr == EAGAIN ); + case WSAENOPROTOOPT: + return( perr == ENOPROTOOPT ); + case WSAECONNREFUSED: + return( perr == ECONNREFUSED ); + default: + fprintf(stderr,"gr_udp_source/is_error: unknown error %d\n", perr ); + throw std::runtime_error("internal error"); } - else { // assume it was specified as an IP address - if((ret=inet_aton(src, &d_ip_src)) == 0) { // format IP address - perror("Not a valid source IP address or host name"); - throw std::runtime_error("can't initialize source socket"); - } - } - - // Get the destination IP address from the host name - struct hostent *hdst = gethostbyname(dst); - if(hdst) { // if the source was provided as a host namex - d_ip_dst = *(struct in_addr*)hdst->h_addr_list[0]; - } - else { // assume it was specified as an IP address - if((ret=inet_aton(dst, &d_ip_dst)) == 0) { // format IP address - perror("Not a valid destination IP address or host name"); - throw std::runtime_error("can't initialize destination socket"); - } - } - - d_port_src = htons(port_src); // format port number - d_port_dst = htons(port_dst); // format port number - - d_sockaddr_src.sin_family = AF_INET; - d_sockaddr_src.sin_addr = d_ip_src; - d_sockaddr_src.sin_port = d_port_src; - - d_sockaddr_dst.sin_family = AF_INET; - d_sockaddr_dst.sin_addr = d_ip_dst; - d_sockaddr_dst.sin_port = d_port_dst; - - open(); -} - -// public constructor that returns a shared_ptr - -gr_udp_sink_sptr -gr_make_udp_sink (size_t itemsize, - const char *src, unsigned short port_src, - const char *dst, unsigned short port_dst, - int payload_size) -{ - return gr_udp_sink_sptr (new gr_udp_sink (itemsize, - src, port_src, - dst, port_dst, - payload_size)); + return 0; +#else + return( perr == errno ); +#endif } -gr_udp_sink::~gr_udp_sink () +static void report_error( const char *msg1, const char *msg2 ) { - close(); + // Deal with errors, both posix and winsock +#if defined(USING_WINSOCK) + int werr = WSAGetLastError(); + fprintf(stderr, "%s: winsock error %d\n", msg1, werr ); +#else + perror(msg1); +#endif + if( msg2 != NULL ) + throw std::runtime_error(msg2); + return; } -bool -gr_udp_sink::open() +gr_udp_sink::gr_udp_sink (size_t itemsize, + const char *host, unsigned short port, + int payload_size, bool eof) + : gr_sync_block ("udp_sink", + gr_make_io_signature (1, 1, itemsize), + gr_make_io_signature (0, 0, 0)), + d_itemsize (itemsize), d_payload_size(payload_size), d_eof(eof), + d_socket(-1), d_connected(false) { - gruel::scoped_lock guard(d_mutex); // hold mutex for duration of this function - - // create socket - if((d_socket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) { - perror("socket open"); - throw std::runtime_error("can't open socket"); +#if defined(USING_WINSOCK) // for Windows (with MinGW) + // initialize winsock DLL + WSADATA wsaData; + int iResult = WSAStartup( MAKEWORD(2,2), &wsaData ); + if( iResult != NO_ERROR ) { + report_error( "gr_udp_source WSAStartup", "can't open socket" ); } +#endif - // Turn on reuse address - int opt_val = true; - if(setsockopt(d_socket, SOL_SOCKET, SO_REUSEADDR, (optval_t)&opt_val, sizeof(int)) == -1) { - perror("SO_REUSEADDR"); - throw std::runtime_error("can't set socket option SO_REUSEADDR"); + // create socket + d_socket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); + if(d_socket == -1) { + report_error("socket open","can't open socket"); } // Don't wait when shutting down @@ -132,36 +119,46 @@ gr_udp_sink::open() lngr.l_onoff = 1; lngr.l_linger = 0; if(setsockopt(d_socket, SOL_SOCKET, SO_LINGER, (optval_t)&lngr, sizeof(linger)) == -1) { - perror("SO_LINGER"); - throw std::runtime_error("can't set socket option SO_LINGER"); + if( !is_error(ENOPROTOOPT) ) { // no SO_LINGER for SOCK_DGRAM on Windows + report_error("SO_LINGER","can't set socket option SO_LINGER"); + } } - // bind socket to an address and port number to listen on - if(bind (d_socket, (sockaddr*)&d_sockaddr_src, sizeof(struct sockaddr)) == -1) { - perror("socket bind"); - throw std::runtime_error("can't bind socket"); - } + // Get the destination address + connect(host, port); +} - // Not sure if we should throw here or allow retries - if(connect(d_socket, (sockaddr*)&d_sockaddr_dst, sizeof(struct sockaddr)) == -1) { - perror("socket connect"); - throw std::runtime_error("can't connect to socket"); - } +// public constructor that returns a shared_ptr - d_updated = true; - return d_socket != 0; +gr_udp_sink_sptr +gr_make_udp_sink (size_t itemsize, + const char *host, unsigned short port, + int payload_size, bool eof) +{ + return gnuradio::get_initial_sptr(new gr_udp_sink (itemsize, + host, port, + payload_size, eof)); } -void -gr_udp_sink::close() +gr_udp_sink::~gr_udp_sink () { - gruel::scoped_lock guard(d_mutex); // hold mutex for duration of this function + if (d_connected) + disconnect(); - if (d_socket){ + if (d_socket != -1){ shutdown(d_socket, SHUT_RDWR); - d_socket = 0; +#if defined(USING_WINSOCK) + closesocket(d_socket); +#else + ::close(d_socket); +#endif + d_socket = -1; } - d_updated = true; + +#if defined(USING_WINSOCK) // for Windows (with MinGW) + // free winsock resources + WSACleanup(); +#endif } int @@ -174,21 +171,31 @@ gr_udp_sink::work (int noutput_items, ssize_t total_size = noutput_items*d_itemsize; #if SNK_VERBOSE - printf("Entered upd_sink\n"); + printf("Entered udp_sink\n"); #endif + gruel::scoped_lock guard(d_mutex); // protect d_socket + while(bytes_sent < total_size) { bytes_to_send = std::min((ssize_t)d_payload_size, (total_size-bytes_sent)); - r = send(d_socket, (in+bytes_sent), bytes_to_send, 0); - if(r == -1) { // error on send command - perror("udp_sink"); // there should be no error case where this function - return -1; // should not exit immediately + if(d_connected) { + r = send(d_socket, (in+bytes_sent), bytes_to_send, 0); + if(r == -1) { // error on send command + if( is_error(ECONNREFUSED) ) + r = bytes_to_send; // discard data until receiver is started + else { + report_error("udp_sink",NULL); // there should be no error case where + return -1; // this function should not exit immediately + } + } } + else + r = bytes_to_send; // discarded for lack of connection bytes_sent += r; #if SNK_VERBOSE - printf("\tbyte sent: %d bytes\n", bytes); + printf("\tbyte sent: %d bytes\n", r); #endif } @@ -198,3 +205,98 @@ gr_udp_sink::work (int noutput_items, return noutput_items; } + +void gr_udp_sink::connect( const char *host, unsigned short port ) +{ + if(d_connected) + disconnect(); + + if(host != NULL ) { + // Get the destination address + struct addrinfo *ip_dst; + struct addrinfo hints; + memset( (void*)&hints, 0, sizeof(hints) ); + hints.ai_family = AF_INET; + hints.ai_socktype = SOCK_DGRAM; + hints.ai_protocol = IPPROTO_UDP; + char port_str[12]; + sprintf( port_str, "%d", port ); + + // FIXME leaks if report_error throws below + int ret = getaddrinfo( host, port_str, &hints, &ip_dst ); + if( ret != 0 ) + report_error("gr_udp_source/getaddrinfo", + "can't initialize destination socket" ); + + // don't need d_mutex lock when !d_connected + if(::connect(d_socket, ip_dst->ai_addr, ip_dst->ai_addrlen) == -1) { + report_error("socket connect","can't connect to socket"); + } + d_connected = true; + + freeaddrinfo(ip_dst); + } + + return; +} + +void gr_udp_sink::disconnect() +{ + if(!d_connected) + return; + + #if SNK_VERBOSE + printf("gr_udp_sink disconnecting\n"); + #endif + + gruel::scoped_lock guard(d_mutex); // protect d_socket from work() + + // Send a few zero-length packets to signal receiver we are done + if(d_eof) { + int i; + for( i = 0; i < 3; i++ ) + (void) send( d_socket, NULL, 0, 0 ); // ignore errors + } + + // Sending EOF can produce ERRCONNREFUSED errors that won't show up + // until the next send or recv, which might confuse us if it happens + // on a new connection. The following does a nonblocking recv to + // clear any such errors. + timeval timeout; + timeout.tv_sec = 0; // zero time for immediate return + timeout.tv_usec = 0; + fd_set readfds; + FD_ZERO(&readfds); + FD_SET(d_socket, &readfds); + int r = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); + if(r < 0) { + #if SNK_VERBOSE + report_error("udp_sink/select",NULL); + #endif + } + else if(r > 0) { // call recv() to get error return + r = recv(d_socket, (char*)&readfds, sizeof(readfds), 0); + if(r < 0) { + #if SNK_VERBOSE + report_error("udp_sink/recv",NULL); + #endif + } + } + + // Since I can't find any way to disconnect a datagram socket in Cygwin, + // we just leave it connected but disable sending. +#if 0 + // zeroed address structure should reset connection + struct sockaddr addr; + memset( (void*)&addr, 0, sizeof(addr) ); + // addr.sa_family = AF_UNSPEC; // doesn't work on Cygwin + // addr.sa_family = AF_INET; // doesn't work on Cygwin + + if(::connect(d_socket, &addr, sizeof(addr)) == -1) + report_error("socket connect","can't connect to socket"); +#endif + + d_connected = false; + + return; +} diff --git a/gnuradio-core/src/lib/io/gr_udp_sink.h b/gnuradio-core/src/lib/io/gr_udp_sink.h index f22b92dd0..421d514a4 100644 --- a/gnuradio-core/src/lib/io/gr_udp_sink.h +++ b/gnuradio-core/src/lib/io/gr_udp_sink.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2007,2008,2009 Free Software Foundation, Inc. + * Copyright 2007,2008,2009,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,18 +24,6 @@ #define INCLUDED_GR_UDP_SINK_H #include <gr_sync_block.h> -#include <boost/thread.hpp> -#if defined(HAVE_SOCKET) -#include <sys/socket.h> -#include <arpa/inet.h> -#elif defined(HAVE_WINDOWS_H) -#include <winsock2.h> -#include <windows.h> -#endif -#if defined(HAVE_NETINET_IN_H) -#include <netinet/in.h> -#endif - #include <gruel/thread.h> class gr_udp_sink; @@ -43,85 +31,75 @@ typedef boost::shared_ptr<gr_udp_sink> gr_udp_sink_sptr; gr_udp_sink_sptr gr_make_udp_sink (size_t itemsize, - const char *src, unsigned short port_src, - const char *dst, unsigned short port_dst, - int payload_size=1472); + const char *host, unsigned short port, + int payload_size=1472, bool eof=true); /*! * \brief Write stream to an UDP socket. * \ingroup sink_blk * * \param itemsize The size (in bytes) of the item datatype - * \param src The source address as either the host name or the 'numbers-and-dots' - * IP address - * \param port_src Destination port to bind to (0 allows socket to choose an appropriate port) - * \param dst The destination address as either the host name or the 'numbers-and-dots' - * IP address - * \param port_dst Destination port to connect to - * \param payload_size UDP payload size by default set to - * 1472 = (1500 MTU - (8 byte UDP header) - (20 byte IP header)) + * \param host The name or IP address of the receiving host; use + * NULL or None for no connection + * \param port Destination port to connect to on receiving host + * \param payload_size UDP payload size by default set to 1472 = + * (1500 MTU - (8 byte UDP header) - (20 byte IP header)) + * \param eof Send zero-length packet on disconnect */ class gr_udp_sink : public gr_sync_block { friend gr_udp_sink_sptr gr_make_udp_sink (size_t itemsize, - const char *src, unsigned short port_src, - const char *dst, unsigned short port_dst, - int payload_size); + const char *host, + unsigned short port, + int payload_size, bool eof); private: size_t d_itemsize; - bool d_updated; - gruel::mutex d_mutex; - int d_payload_size; // maximum transmission unit (packet length) - int d_socket; // handle to socket - int d_socket_rcv; // handle to socket retuned in the accept call - struct in_addr d_ip_src; // store the source ip info - struct in_addr d_ip_dst; // store the destination ip info - unsigned short d_port_src; // the port number to open for connections to this service - unsigned short d_port_dst; // port number of the remove system - struct sockaddr_in d_sockaddr_src; // store the source sockaddr data (formatted IP address and port number) - struct sockaddr_in d_sockaddr_dst; // store the destination sockaddr data (formatted IP address and port number) + int d_payload_size; // maximum transmission unit (packet length) + bool d_eof; // send zero-length packet on disconnect + int d_socket; // handle to socket + bool d_connected; // are we connected? + gruel::mutex d_mutex; // protects d_socket and d_connected protected: /*! * \brief UDP Sink Constructor * * \param itemsize The size (in bytes) of the item datatype - * \param src The source address as either the host name or the 'numbers-and-dots' - * IP address - * \param port_src Destination port to bind to (0 allows socket to choose an appropriate port) - * \param dst The destination address as either the host name or the 'numbers-and-dots' - * IP address - * \param port_dst Destination port to connect to + * \param host The name or IP address of the receiving host; use + * NULL or None for no connection + * \param port Destination port to connect to on receiving host * \param payload_size UDP payload size by default set to * 1472 = (1500 MTU - (8 byte UDP header) - (20 byte IP header)) + * \param eof Send zero-length packet on disconnect */ gr_udp_sink (size_t itemsize, - const char *src, unsigned short port_src, - const char *dst, unsigned short port_dst, - int payload_size); + const char *host, unsigned short port, + int payload_size, bool eof); public: ~gr_udp_sink (); - /*! - * \brief open a socket specified by the port and ip address info - * - * Opens a socket, binds to the address, and makes connectionless association - * over UDP. If any of these fail, the fuction retuns the error and exits. - */ - bool open(); + /*! \brief return the PAYLOAD_SIZE of the socket */ + int payload_size() { return d_payload_size; } - /*! - * \brief Close current socket. + /*! \brief Change the connection to a new destination + * + * \param host The name or IP address of the receiving host; use + * NULL or None to break the connection without closing + * \param port Destination port to connect to on receiving host * - * Shuts down read/write on the socket + * Calls disconnect() to terminate any current connection first. */ - void close(); + void connect( const char *host, unsigned short port ); - /*! \brief return the PAYLOAD_SIZE of the socket */ - int payload_size() { return d_payload_size; } + /*! \brief Send zero-length packet (if eof is requested) then stop sending + * + * Zero-byte packets can be interpreted as EOF by gr_udp_source. Note that + * disconnect occurs automatically when the sink is destroyed, but not when + * its top_block stops.*/ + void disconnect(); // should we export anything else? diff --git a/gnuradio-core/src/lib/io/gr_udp_sink.i b/gnuradio-core/src/lib/io/gr_udp_sink.i index 0f37b477b..a71006ae0 100644 --- a/gnuradio-core/src/lib/io/gr_udp_sink.i +++ b/gnuradio-core/src/lib/io/gr_udp_sink.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2007 Free Software Foundation, Inc. + * Copyright 2007,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -25,22 +25,22 @@ GR_SWIG_BLOCK_MAGIC(gr,udp_sink) gr_udp_sink_sptr gr_make_udp_sink (size_t itemsize, - const char *src, unsigned short port_src, - const char *dst, unsigned short port_dst, - int payload_size=1472); + const char *host, unsigned short port, + int payload_size=1472, bool eof=true) throw (std::runtime_error); class gr_udp_sink : public gr_sync_block { protected: gr_udp_sink (size_t itemsize, - const char *src, unsigned short port_src, - const char *dst, unsigned short port_dst, - int payload_size); - - bool open(); - void close(); - int payload_size() { return d_payload_size; } + const char *host, unsigned short port, + int payload_size, bool eof) + throw (std::runtime_error); public: ~gr_udp_sink (); + + int payload_size() { return d_payload_size; } + void connect( const char *host, unsigned short port ); + void disconnect(); + }; diff --git a/gnuradio-core/src/lib/io/gr_udp_source.cc b/gnuradio-core/src/lib/io/gr_udp_source.cc index d76d0ee32..ca31233de 100644 --- a/gnuradio-core/src/lib/io/gr_udp_source.cc +++ b/gnuradio-core/src/lib/io/gr_udp_source.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2007,2008,2009 Free Software Foundation, Inc. + * Copyright 2007,2008,2009,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -29,80 +29,126 @@ #include <errno.h> #include <stdio.h> #include <string.h> -#if defined(HAVE_SOCKET) + +#if defined(HAVE_NETDB_H) #include <netdb.h> +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif typedef void* optval_t; -#else + +// ntohs() on FreeBSD may require both netinet/in.h and arpa/inet.h, in order +#if defined(HAVE_NETINET_IN_H) +#include <netinet/in.h> +#endif +#if defined(HAVE_ARPA_INET_H) +#include <arpa/inet.h> +#endif + +#elif defined(HAVE_WINDOWS_H) +// if not posix, assume winsock +#define USING_WINSOCK +#include <winsock2.h> +#include <ws2tcpip.h> #define SHUT_RDWR 2 -#define inet_aton(N,A) ( (A)->s_addr = inet_addr(N), ( (A)->s_addr != INADDR_NONE ) ) typedef char* optval_t; #endif +#define USE_SELECT 1 // non-blocking receive on all platforms +#define USE_RCV_TIMEO 0 // non-blocking receive on all but Cygwin #define SRC_VERBOSE 0 -gr_udp_source::gr_udp_source(size_t itemsize, const char *src, - unsigned short port_src, int payload_size) +static int is_error( int perr ) +{ + // Compare error to posix error code; return nonzero if match. +#if defined(USING_WINSOCK) +#define ENOPROTOOPT 109 + // All codes to be checked for must be defined below + int werr = WSAGetLastError(); + switch( werr ) { + case WSAETIMEDOUT: + return( perr == EAGAIN ); + case WSAENOPROTOOPT: + return( perr == ENOPROTOOPT ); + default: + fprintf(stderr,"gr_udp_source/is_error: unknown error %d\n", perr ); + throw std::runtime_error("internal error"); + } + return 0; +#else + return( perr == errno ); +#endif +} + +static void report_error( const char *msg1, const char *msg2 ) +{ + // Deal with errors, both posix and winsock +#if defined(USING_WINSOCK) + int werr = WSAGetLastError(); + fprintf(stderr, "%s: winsock error %d\n", msg1, werr ); +#else + perror(msg1); +#endif + if( msg2 != NULL ) + throw std::runtime_error(msg2); + return; +} + +gr_udp_source::gr_udp_source(size_t itemsize, const char *host, + unsigned short port, int payload_size, + bool eof, bool wait) : gr_sync_block ("udp_source", gr_make_io_signature(0, 0, 0), gr_make_io_signature(1, 1, itemsize)), - d_itemsize(itemsize), d_updated(false), d_payload_size(payload_size), d_residual(0), d_temp_offset(0) + d_itemsize(itemsize), d_payload_size(payload_size), + d_eof(eof), d_wait(wait), d_socket(-1), d_residual(0), d_temp_offset(0) { int ret = 0; + +#if defined(USING_WINSOCK) // for Windows (with MinGW) + // initialize winsock DLL + WSADATA wsaData; + int iResult = WSAStartup( MAKEWORD(2,2), &wsaData ); + if( iResult != NO_ERROR ) { + report_error( "gr_udp_source WSAStartup", "can't open socket" ); + } +#endif // Set up the address stucture for the source address and port numbers // Get the source IP address from the host name - struct hostent *hsrc = gethostbyname(src); - if(hsrc) { // if the source was provided as a host namex - d_ip_src = *(struct in_addr*)hsrc->h_addr_list[0]; - } - else { // assume it was specified as an IP address - if((ret=inet_aton(src, &d_ip_src)) == 0) { // format IP address - perror("Not a valid source IP address or host name"); - throw std::runtime_error("can't initialize source socket"); - } - } + struct addrinfo *ip_src; // store the source IP address to use + struct addrinfo hints; + memset( (void*)&hints, 0, sizeof(hints) ); + hints.ai_family = AF_INET; + hints.ai_socktype = SOCK_DGRAM; + hints.ai_protocol = IPPROTO_UDP; + hints.ai_flags = AI_PASSIVE; + char port_str[12]; + sprintf( port_str, "%d", port ); - d_port_src = htons(port_src); // format port number - - d_sockaddr_src.sin_family = AF_INET; - d_sockaddr_src.sin_addr = d_ip_src; - d_sockaddr_src.sin_port = d_port_src; + // FIXME leaks if report_error throws below + ret = getaddrinfo( host, port_str, &hints, &ip_src ); + if( ret != 0 ) + report_error("gr_udp_source/getaddrinfo", + "can't initialize source socket" ); + // FIXME leaks if report_error throws below d_temp_buff = new char[d_payload_size]; // allow it to hold up to payload_size bytes - - open(); -} -gr_udp_source_sptr -gr_make_udp_source (size_t itemsize, const char *ipaddr, - unsigned short port, int payload_size) -{ - return gr_udp_source_sptr (new gr_udp_source (itemsize, ipaddr, - port, payload_size)); -} - -gr_udp_source::~gr_udp_source () -{ - delete [] d_temp_buff; - close(); -} - -bool -gr_udp_source::open() -{ - gruel::scoped_lock guard(d_mutex); // hold mutex for duration of this function // create socket - d_socket = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); + d_socket = socket(ip_src->ai_family, ip_src->ai_socktype, + ip_src->ai_protocol); if(d_socket == -1) { - perror("socket open"); - throw std::runtime_error("can't open socket"); + report_error("socket open","can't open socket"); } // Turn on reuse address int opt_val = 1; if(setsockopt(d_socket, SOL_SOCKET, SO_REUSEADDR, (optval_t)&opt_val, sizeof(int)) == -1) { - perror("SO_REUSEADDR"); - throw std::runtime_error("can't set socket option SO_REUSEADDR"); + report_error("SO_REUSEADDR","can't set socket option SO_REUSEADDR"); } // Don't wait when shutting down @@ -110,40 +156,61 @@ gr_udp_source::open() lngr.l_onoff = 1; lngr.l_linger = 0; if(setsockopt(d_socket, SOL_SOCKET, SO_LINGER, (optval_t)&lngr, sizeof(linger)) == -1) { - perror("SO_LINGER"); - throw std::runtime_error("can't set socket option SO_LINGER"); + if( !is_error(ENOPROTOOPT) ) { // no SO_LINGER for SOCK_DGRAM on Windows + report_error("SO_LINGER","can't set socket option SO_LINGER"); + } } +#if USE_RCV_TIMEO // Set a timeout on the receive function to not block indefinitely // This value can (and probably should) be changed + // Ignored on Cygwin +#if defined(USING_WINSOCK) + DWORD timeout = 1000; // milliseconds +#else timeval timeout; timeout.tv_sec = 1; timeout.tv_usec = 0; +#endif if(setsockopt(d_socket, SOL_SOCKET, SO_RCVTIMEO, (optval_t)&timeout, sizeof(timeout)) == -1) { - perror("SO_RCVTIMEO"); - throw std::runtime_error("can't set socket option SO_RCVTIMEO"); + report_error("SO_RCVTIMEO","can't set socket option SO_RCVTIMEO"); } +#endif // USE_RCV_TIMEO // bind socket to an address and port number to listen on - if(bind (d_socket, (sockaddr*)&d_sockaddr_src, sizeof(struct sockaddr)) == -1) { - perror("socket bind"); - throw std::runtime_error("can't bind socket"); + if(bind (d_socket, ip_src->ai_addr, ip_src->ai_addrlen) == -1) { + report_error("socket bind","can't bind socket"); } - - d_updated = true; - return d_socket != 0; + freeaddrinfo(ip_src); + +} + +gr_udp_source_sptr +gr_make_udp_source (size_t itemsize, const char *ipaddr, + unsigned short port, int payload_size, bool eof, bool wait) +{ + return gnuradio::get_initial_sptr(new gr_udp_source (itemsize, ipaddr, + port, payload_size, eof, wait)); } -void -gr_udp_source::close() +gr_udp_source::~gr_udp_source () { - gruel::scoped_lock guard(d_mutex); // hold mutex for duration of this function + delete [] d_temp_buff; - if (d_socket){ + if (d_socket != -1){ shutdown(d_socket, SHUT_RDWR); - d_socket = 0; +#if defined(USING_WINSOCK) + closesocket(d_socket); +#else + ::close(d_socket); +#endif + d_socket = -1; } - d_updated = true; + +#if defined(USING_WINSOCK) // for Windows (with MinGW) + // free winsock resources + WSACleanup(); +#endif } int @@ -175,29 +242,85 @@ gr_udp_source::work (int noutput_items, // Update indexing of amount of bytes left in the buffer d_residual -= nbytes; - d_temp_offset = d_temp_offset+d_residual; + d_temp_offset += nbytes; + + // Return now with what we've got. + assert(nbytes % d_itemsize == 0); + return nbytes/d_itemsize; } while(1) { // get the data into our output buffer and record the number of bytes + +#if USE_SELECT + // RCV_TIMEO doesn't work on all systems (e.g., Cygwin) + // use select() instead of, or in addition to RCV_TIMEO + fd_set readfds; + timeval timeout; + timeout.tv_sec = 1; // Init timeout each iteration. Select can modify it. + timeout.tv_usec = 0; + FD_ZERO(&readfds); + FD_SET(d_socket, &readfds); + r = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); + if(r < 0) { + report_error("udp_source/select",NULL); + return -1; + } + else if(r == 0 ) { // timed out + if( d_wait ) { + // Allow boost thread interrupt, then try again + boost::this_thread::interruption_point(); + continue; + } + else + return -1; + } +#endif // USE_SELECT + // This is a non-blocking call with a timeout set in the constructor r = recv(d_socket, d_temp_buff, d_payload_size, 0); // get the entire payload or the what's available + // If r > 0, round it down to a multiple of d_itemsize + // (If sender is broken, don't propagate problem) + if (r > 0) + r = (r/d_itemsize) * d_itemsize; + // Check if there was a problem; forget it if the operation just timed out if(r == -1) { - if(errno == EAGAIN) { // handle non-blocking call timeout + if( is_error(EAGAIN) ) { // handle non-blocking call timeout #if SRC_VERBOSE printf("UDP receive timed out\n"); #endif - // Break here to allow the rest of the flow graph time to run and so ctrl-C breaks - break; + if( d_wait ) { + // Allow boost thread interrupt, then try again + boost::this_thread::interruption_point(); + continue; + } + else + return -1; } else { - perror("udp_source"); + report_error("udp_source/recv",NULL); return -1; } } + else if(r==0) { + if(d_eof) { + // zero-length packet interpreted as EOF + + #if SNK_VERBOSE + printf("\tzero-length packet received; returning EOF\n"); + #endif + + return -1; + } + else{ + // do we need to allow boost thread interrupt? + boost::this_thread::interruption_point(); + continue; + } + } else { // Calculate the number of bytes we can take from the buffer in this call nbytes = std::min(r, total_bytes-bytes_received); @@ -235,3 +358,15 @@ gr_udp_source::work (int noutput_items, return bytes_received/d_itemsize; } +// Return port number of d_socket +int gr_udp_source::get_port(void) +{ + sockaddr_in name; + socklen_t len = sizeof(name); + int ret = getsockname( d_socket, (sockaddr*)&name, &len ); + if( ret ) { + report_error("gr_udp_source/getsockname",NULL); + return -1; + } + return ntohs(name.sin_port); +} diff --git a/gnuradio-core/src/lib/io/gr_udp_source.h b/gnuradio-core/src/lib/io/gr_udp_source.h index 61d719e4d..5d30fad30 100644 --- a/gnuradio-core/src/lib/io/gr_udp_source.h +++ b/gnuradio-core/src/lib/io/gr_udp_source.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2007,2008,2009 Free Software Foundation, Inc. + * Copyright 2007,2008,2009,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,54 +24,48 @@ #define INCLUDED_GR_UDP_SOURCE_H #include <gr_sync_block.h> -#if defined(HAVE_SOCKET) -#include <sys/socket.h> -#include <arpa/inet.h> -#elif defined(HAVE_WINDOWS_H) -#include <winsock2.h> -#include <windows.h> -#endif -#if defined(HAVE_NETINET_IN_H) -#include <netinet/in.h> -#endif - #include <gruel/thread.h> class gr_udp_source; typedef boost::shared_ptr<gr_udp_source> gr_udp_source_sptr; -gr_udp_source_sptr gr_make_udp_source(size_t itemsize, const char *src, - unsigned short port_src, int payload_size=1472); +gr_udp_source_sptr gr_make_udp_source(size_t itemsize, const char *host, + unsigned short port, + int payload_size=1472, + bool eof=true, bool wait=true); /*! * \brief Read stream from an UDP socket. * \ingroup source_blk * * \param itemsize The size (in bytes) of the item datatype - * \param src The source address as either the host name or the 'numbers-and-dots' - * IP address - * \param port_src The port number on which the socket listens for data - * \param payload_size UDP payload size by default set to - * 1472 = (1500 MTU - (8 byte UDP header) - (20 byte IP header)) + * \param host The name or IP address of the receiving host; can be + * NULL, None, or "0.0.0.0" to allow reading from any + * interface on the host + * \param port The port number on which to receive data; use 0 to + * have the system assign an unused port number + * \param payload_size UDP payload size by default set to 1472 = + * (1500 MTU - (8 byte UDP header) - (20 byte IP header)) + * \param eof Interpret zero-length packet as EOF (default: true) + * \param wait Wait for data if not immediately available + * (default: true) * */ class gr_udp_source : public gr_sync_block { - friend gr_udp_source_sptr gr_make_udp_source(size_t itemsize, const char *src, - unsigned short port_src, int payload_size); + friend gr_udp_source_sptr gr_make_udp_source(size_t itemsize, + const char *host, + unsigned short port, + int payload_size, + bool eof, bool wait); private: size_t d_itemsize; - bool d_updated; - gruel::mutex d_mutex; - - int d_payload_size; // maximum transmission unit (packet length) - int d_socket; // handle to socket - int d_socket_rcv; // handle to socket retuned in the accept call - struct in_addr d_ip_src; // store the source IP address to use - unsigned short d_port_src; // the port number to open for connections to this service - struct sockaddr_in d_sockaddr_src; // store the source sockaddr data (formatted IP address and port number) + int d_payload_size; // maximum transmission unit (packet length) + bool d_eof; // zero-length packet is EOF + bool d_wait; // wait if data if not immediately available + int d_socket; // handle to socket char *d_temp_buff; // hold buffer between calls ssize_t d_residual; // hold information about number of bytes stored in the temp buffer size_t d_temp_offset; // point to temp buffer location offset @@ -81,35 +75,29 @@ class gr_udp_source : public gr_sync_block * \brief UDP Source Constructor * * \param itemsize The size (in bytes) of the item datatype - * \param src The source address as either the host name or the 'numbers-and-dots' - * IP address - * \param port_src The port number on which the socket listens for data - * \param payload_size UDP payload size by default set to - * 1472 = (1500 MTU - (8 byte UDP header) - (20 byte IP header)) + * \param host The name or IP address of the receiving host; can be + * NULL, None, or "0.0.0.0" to allow reading from any + * interface on the host + * \param port The port number on which to receive data; use 0 to + * have the system assign an unused port number + * \param payload_size UDP payload size by default set to 1472 = + * (1500 MTU - (8 byte UDP header) - (20 byte IP header)) + * \param eof Interpret zero-length packet as EOF (default: true) + * \param wait Wait for data if not immediately available + * (default: true) */ - gr_udp_source(size_t itemsize, const char *src, unsigned short port_src, int payload_size); + gr_udp_source(size_t itemsize, const char *host, unsigned short port, + int payload_size, bool eof, bool wait); public: ~gr_udp_source(); - /*! - * \brief open a socket specified by the port and ip address info - * - * Opens a socket, binds to the address, and waits for a connection - * over UDP. If any of these fail, the fuction retuns the error and exits. - */ - bool open(); - - /*! - * \brief Close current socket. - * - * Shuts down read/write on the socket - */ - void close(); - /*! \brief return the PAYLOAD_SIZE of the socket */ int payload_size() { return d_payload_size; } + /*! \brief return the port number of the socket */ + int get_port(); + // should we export anything else? int work(int noutput_items, diff --git a/gnuradio-core/src/lib/io/gr_udp_source.i b/gnuradio-core/src/lib/io/gr_udp_source.i index fb39dad68..2001f33e9 100644 --- a/gnuradio-core/src/lib/io/gr_udp_source.i +++ b/gnuradio-core/src/lib/io/gr_udp_source.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2007 Free Software Foundation, Inc. + * Copyright 2007,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -23,20 +23,19 @@ GR_SWIG_BLOCK_MAGIC(gr,udp_source) gr_udp_source_sptr -gr_make_udp_source (size_t itemsize, const char *src, - unsigned short port_src, int payload_size=1472); +gr_make_udp_source (size_t itemsize, const char *host, + unsigned short port, int payload_size=1472, + bool eof=true, bool wait=true) throw (std::runtime_error); class gr_udp_source : public gr_sync_block { protected: - gr_udp_source (size_t itemsize, const char *src, - unsigned short port_src, int payload_size); + gr_udp_source (size_t itemsize, const char *host, + unsigned short port, int payload_size, bool eof, bool wait) throw (std::runtime_error); public: ~gr_udp_source (); - bool open(); - void close(); int payload_size() { return d_payload_size; } - + int get_port(); }; diff --git a/gnuradio-core/src/lib/io/gr_wavfile_sink.cc b/gnuradio-core/src/lib/io/gr_wavfile_sink.cc index 72e4ef51e..b60a6e3ab 100644 --- a/gnuradio-core/src/lib/io/gr_wavfile_sink.cc +++ b/gnuradio-core/src/lib/io/gr_wavfile_sink.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006,2007,2008,2009 Free Software Foundation, Inc. + * Copyright 2004,2006,2007,2008,2009,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -58,7 +58,7 @@ gr_make_wavfile_sink(const char *filename, unsigned int sample_rate, int bits_per_sample) { - return gr_wavfile_sink_sptr (new gr_wavfile_sink (filename, + return gnuradio::get_initial_sptr(new gr_wavfile_sink (filename, n_channels, sample_rate, bits_per_sample)); diff --git a/gnuradio-core/src/lib/io/gr_wavfile_source.cc b/gnuradio-core/src/lib/io/gr_wavfile_source.cc index 900f84efd..d00dd3028 100644 --- a/gnuradio-core/src/lib/io/gr_wavfile_source.cc +++ b/gnuradio-core/src/lib/io/gr_wavfile_source.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2008 Free Software Foundation, Inc. + * Copyright 2004,2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -52,7 +52,7 @@ gr_wavfile_source_sptr gr_make_wavfile_source (const char *filename, bool repeat) { - return gr_wavfile_source_sptr (new gr_wavfile_source (filename, repeat)); + return gnuradio::get_initial_sptr(new gr_wavfile_source (filename, repeat)); } diff --git a/gnuradio-core/src/lib/io/gri_logger.cc b/gnuradio-core/src/lib/io/gri_logger.cc deleted file mode 100644 index 473a7c5ed..000000000 --- a/gnuradio-core/src/lib/io/gri_logger.cc +++ /dev/null @@ -1,178 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#if 0 // This needs reimplementation with boost threads and synchronization - -#include <gri_logger.h> -#include <stdio.h> -#include <stdarg.h> -#include <stdexcept> -#include <boost/weak_ptr.hpp> -#include <string.h> - - -/* - * This class creates the thread that reads from the ringbuffer and - * and writes to the file. This is opaque to the user. - */ -class gri_log_poster : public omni_thread -{ - FILE *d_fp; - gr_buffer_sptr d_writer; - gr_buffer_reader_sptr d_reader; - omni_semaphore d_ringbuffer_ready; - volatile bool d_time_to_die; - volatile bool d_writer_overrun; - - virtual void* run_undetached(void * arg); - -public: - gri_log_poster(const char *filename); - ~gri_log_poster(); - - void kill() { d_time_to_die = true; post(); } - gr_buffer_sptr writer() const { return d_writer; } - void post() { d_ringbuffer_ready.post(); } - void note_writer_overrun() { d_writer_overrun = true; } -}; - -gri_log_poster::gri_log_poster(const char *filename) - : omni_thread(), - d_ringbuffer_ready(1, 1), // binary semaphore - d_time_to_die(false), - d_writer_overrun(false) -{ - if ((d_fp = fopen(filename, "w")) == 0){ - perror (filename); - throw std::runtime_error("can't open file"); - } - - // Create a 1MB buffer. - d_writer = gr_make_buffer(1 * 1024 * 1024, sizeof(unsigned char)); - d_reader = gr_buffer_add_reader(d_writer, 0); - - start_undetached(); // start the thread -} - -gri_log_poster::~gri_log_poster() -{ - if (d_fp != 0){ - fclose(d_fp); - d_fp = 0; - } -} - -/* - * This is the body of the logging thread. - */ -void * -gri_log_poster::run_undetached(void *arg) -{ - int nbytes; - - //fprintf(stderr, "Enter: run_undetached!\n"); - - while (!d_time_to_die){ - while ((nbytes = d_reader->items_available()) > 0){ - fwrite(d_reader->read_pointer(), 1, nbytes, d_fp); - d_reader->update_read_pointer(nbytes); - } - fflush(d_fp); - d_ringbuffer_ready.wait(); - - if (d_writer_overrun){ - fputs(">>>>> gri_logger: writer overrun. Info lost <<<<<\n", d_fp); - d_writer_overrun = false; - } - } - - // fprintf(stderr, "Exit: run_undetached!\n"); - return 0; -} - -// ------------------------------------------------------------------------ - -static boost::weak_ptr<gri_logger> s_singleton; // weak pointer IQ test ;-) -static omni_mutex s_singleton_mutex; - -gri_logger_sptr -gri_logger::singleton() -{ - omni_mutex_lock l(s_singleton_mutex); - gri_logger_sptr r; - - if (r = s_singleton.lock()) - return r; - - r = gri_logger_sptr(new gri_logger("gri_logger.log")); - s_singleton = r; - return r; -} - - -gri_logger::gri_logger(const char *filename) -{ - d_poster = new gri_log_poster(filename); -} - -gri_logger::~gri_logger() -{ - d_poster->kill(); - d_poster->join(NULL); -} - -void -gri_logger::write(const void *buf, size_t count) -{ - omni_mutex_lock l(d_write_mutex); - gr_buffer_sptr writer = d_poster->writer(); - - // either write it all, or drop it on the ground - if (count <= (size_t) writer->space_available()){ - memcpy(writer->write_pointer(), buf, count); - writer->update_write_pointer(count); - d_poster->post(); - } - else { - d_poster->note_writer_overrun(); - } -} - -void -gri_logger::printf(const char *format, ...) -{ - va_list ap; - char buf[4096]; - int n; - - va_start(ap, format); - n = vsnprintf(buf, sizeof(buf), format, ap); - va_end(ap); - if (n > -1 && n < (ssize_t) sizeof(buf)) - write(buf, n); -} - -#endif diff --git a/gnuradio-core/src/lib/io/gri_logger.h b/gnuradio-core/src/lib/io/gri_logger.h deleted file mode 100644 index 0a1414540..000000000 --- a/gnuradio-core/src/lib/io/gri_logger.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef INCLUDED_GRI_LOGGER_H -#define INCLUDED_GRI_LOGGER_H - -#if 0 // This needs reimplementation with boost threads and synchronization - -#include <stddef.h> -#include <gnuradio/omnithread.h> -#include <gr_buffer.h> - -class gri_log_poster; -class gri_logger; -typedef boost::shared_ptr<gri_logger> gri_logger_sptr; - - -/*! - * \brief non-blocking logging to a file. - * - * In reality, this may block, but only for a bounded time. - * Trust me, it's safe to use from portaudio and JACK callbacks. - */ -class gri_logger -{ - gri_log_poster *d_poster; - omni_mutex d_write_mutex; - -public: - static gri_logger_sptr singleton(); - - gri_logger(const char *filename); - ~gri_logger(); - - void write(const void *buf, size_t count); - void printf(const char *format, ...); -}; - -#endif - -#endif /* INCLUDED_GRI_LOGGER_H */ diff --git a/gnuradio-core/src/lib/runtime/Makefile.am b/gnuradio-core/src/lib/runtime/Makefile.am index b0e804277..abd789a1d 100644 --- a/gnuradio-core/src/lib/runtime/Makefile.am +++ b/gnuradio-core/src/lib/runtime/Makefile.am @@ -120,6 +120,7 @@ grinclude_HEADERS = \ gr_timer.h \ gr_tmp_path.h \ gr_types.h \ + gr_unittests.h \ gr_vmcircbuf.h noinst_HEADERS = \ diff --git a/gnuradio-core/src/lib/runtime/gr_sptr_magic.cc b/gnuradio-core/src/lib/runtime/gr_sptr_magic.cc index 96ffae85f..b0351248c 100644 --- a/gnuradio-core/src/lib/runtime/gr_sptr_magic.cc +++ b/gnuradio-core/src/lib/runtime/gr_sptr_magic.cc @@ -39,7 +39,7 @@ namespace gnuradio { detail::sptr_magic::create_and_stash_initial_sptr(gr_hier_block2 *p) { gr_basic_block_sptr sptr(p); - gruel::scoped_lock guard(); + gruel::scoped_lock guard(s_mutex); s_map.insert(sptr_map::value_type(static_cast<gr_basic_block *>(p), sptr)); } @@ -60,7 +60,7 @@ namespace gnuradio { * p is a subclass of gr_hier_block2, thus we've already created the shared pointer * and stashed it away. Fish it out and return it. */ - gruel::scoped_lock guard(); + gruel::scoped_lock guard(s_mutex); sptr_map::iterator pos = s_map.find(static_cast<gr_basic_block *>(p)); if (pos == s_map.end()) throw std::invalid_argument("gr_sptr_magic: invalid pointer!"); diff --git a/gnuradio-core/src/lib/runtime/gr_unittests.h b/gnuradio-core/src/lib/runtime/gr_unittests.h new file mode 100644 index 000000000..680e59ca4 --- /dev/null +++ b/gnuradio-core/src/lib/runtime/gr_unittests.h @@ -0,0 +1,70 @@ +/* -*- c++ -*- */ +/* + * Copyright 2010 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> + + +#ifdef MKDIR_TAKES_ONE_ARG +#define gr_mkdir(pathname, mode) mkdir(pathname) +#else +#define gr_mkdir(pathname, mode) mkdir((pathname), (mode)) +#endif + +/* + * Mostly taken from gr_preferences.cc/h + * The simplest thing that could possibly work: + * the key is the filename; the value is the file contents. + */ + +static void +ensure_unittest_path (const char *grpath, const char *path) +{ + struct stat statbuf; + if (stat (path, &statbuf) == 0 && S_ISDIR (statbuf.st_mode)) + return; + + // blindly try to make it // FIXME make this robust. C++ SUCKS! + gr_mkdir (grpath, 0750); + gr_mkdir (path, 0750); +} + +static void +get_unittest_path (const char *filename, char *fullpath, size_t pathsize) +{ + char path[200]; + char grpath[200]; + snprintf (grpath, sizeof(grpath), "%s/.gnuradio", getenv ("HOME")); + snprintf (path, sizeof(path), "%s/unittests", grpath); + snprintf (fullpath, pathsize, "%s/%s", path, filename); + + ensure_unittest_path(grpath, path); +} + |