diff options
Diffstat (limited to 'gnuradio-core')
45 files changed, 1499 insertions, 45 deletions
diff --git a/gnuradio-core/.gitignore b/gnuradio-core/.gitignore new file mode 100644 index 000000000..53edad32f --- /dev/null +++ b/gnuradio-core/.gitignore @@ -0,0 +1,32 @@ +/*.cache +/*.la +/*.lo +/*.pc +/.deps +/.la +/.libs +/.lo +/Makefile +/Makefile.in +/aclocal.m4 +/autom4te.cache +/config.cache +/config.h +/config.h.in +/config.log +/config.status +/configure +/depcomp +/install-sh +/libtool +/ltmain.sh +/make.log +/missing +/missing +/mkinstalldirs +/py-compile +/stamp-h +/stamp-h.in +/stamp-h1 +/stamp-h1.in +/stamp-h2.in diff --git a/gnuradio-core/src/.gitignore b/gnuradio-core/src/.gitignore new file mode 100644 index 000000000..a02b6ff73 --- /dev/null +++ b/gnuradio-core/src/.gitignore @@ -0,0 +1,8 @@ +/Makefile +/Makefile.in +/.la +/.lo +/.deps +/.libs +/*.la +/*.lo diff --git a/gnuradio-core/src/gen_interpolator_taps/.gitignore b/gnuradio-core/src/gen_interpolator_taps/.gitignore new file mode 100644 index 000000000..363c633e1 --- /dev/null +++ b/gnuradio-core/src/gen_interpolator_taps/.gitignore @@ -0,0 +1,7 @@ +/Makefile +/Makefile.in +/.deps +/.libs +/*.la +/*.lo +/gen_interpolator_taps diff --git a/gnuradio-core/src/lib/.gitignore b/gnuradio-core/src/lib/.gitignore new file mode 100644 index 000000000..e3bc1ee6a --- /dev/null +++ b/gnuradio-core/src/lib/.gitignore @@ -0,0 +1,9 @@ +/Makefile +/Makefile.in +/.la +/.lo +/.deps +/.libs +/*.la +/*.lo +/gnuradio-config-info diff --git a/gnuradio-core/src/lib/filter/.gitignore b/gnuradio-core/src/lib/filter/.gitignore new file mode 100644 index 000000000..2d009f154 --- /dev/null +++ b/gnuradio-core/src/lib/filter/.gitignore @@ -0,0 +1,214 @@ +/Makefile +/Makefile.in +/.la +/.lo +/.deps +/.libs +/*.la +/*.lo +/*.pyc +/generate-stamp +/# +/--- +/generate +/files: +/don't +/go +/in +/CVS +/--- +/GrFIRfilterCCC.cc +/GrFIRfilterCCC.h +/GrFIRfilterCCF.cc +/GrFIRfilterCCF.h +/GrFIRfilterFCC.cc +/GrFIRfilterFCC.h +/GrFIRfilterFFF.cc +/GrFIRfilterFFF.h +/GrFIRfilterFSF.cc +/GrFIRfilterFSF.h +/GrFIRfilterSCC.cc +/GrFIRfilterSCC.h +/GrFIRfilterSIS.cc +/GrFIRfilterSIS.h +/GrFreqXlatingFIRfilterCCC.cc +/GrFreqXlatingFIRfilterCCC.h +/GrFreqXlatingFIRfilterCCF.cc +/GrFreqXlatingFIRfilterCCF.h +/GrFreqXlatingFIRfilterFCC.cc +/GrFreqXlatingFIRfilterFCC.h +/GrFreqXlatingFIRfilterFCF.cc +/GrFreqXlatingFIRfilterFCF.h +/GrFreqXlatingFIRfilterSCC.cc +/GrFreqXlatingFIRfilterSCC.h +/GrFreqXlatingFIRfilterSCF.cc +/GrFreqXlatingFIRfilterSCF.h +/gr_fir_CCC.cc +/gr_fir_CCC.h +/gr_fir_CCC_generic.cc +/gr_fir_CCC_generic.h +/gr_fir_CCF.cc +/gr_fir_CCF.h +/gr_fir_CCF_generic.cc +/gr_fir_CCF_generic.h +/gr_fir_FCC.cc +/gr_fir_FCC.h +/gr_fir_FCC_generic.cc +/gr_fir_FCC_generic.h +/gr_fir_FFF.cc +/gr_fir_FFF.h +/gr_fir_FFF_generic.cc +/gr_fir_FFF_generic.h +/gr_fir_FSF.cc +/gr_fir_FSF.h +/gr_fir_FSF_generic.cc +/gr_fir_FSF_generic.h +/gr_fir_SCC.cc +/gr_fir_SCC.h +/gr_fir_SCC_generic.cc +/gr_fir_SCC_generic.h +/gr_fir_SIS.cc +/gr_fir_SIS.h +/gr_fir_SIS_generic.cc +/gr_fir_SIS_generic.h +/gr_fir_sysconfig.cc +/gr_fir_sysconfig.h +/gr_fir_sysconfig_generic.cc +/gr_fir_sysconfig_generic.h +/gr_fir_util.cc +/gr_fir_util.h +/GrFIRfilterCCC.i +/GrFIRfilterCCF.i +/GrFIRfilterFCC.i +/GrFIRfilterFFF.i +/GrFIRfilterFSF.i +/GrFIRfilterSCC.i +/GrFIRfilterSIS.i +/GrFreqXlatingFIRfilterCCC.i +/GrFreqXlatingFIRfilterCCF.i +/GrFreqXlatingFIRfilterFCC.i +/GrFreqXlatingFIRfilterFCF.i +/GrFreqXlatingFIRfilterSCC.i +/GrFreqXlatingFIRfilterSCF.i +/# +/--- +/end +/generated +/files +/--- +/filter_generated.i +/gr_fir_ccc.cc +/gr_fir_ccc.h +/gr_fir_ccc_generic.cc +/gr_fir_ccc_generic.h +/gr_fir_ccf.cc +/gr_fir_ccf.h +/gr_fir_ccf_generic.cc +/gr_fir_ccf_generic.h +/gr_fir_fcc.cc +/gr_fir_fcc.h +/gr_fir_fcc_generic.cc +/gr_fir_fcc_generic.h +/gr_fir_fff.cc +/gr_fir_fff.h +/gr_fir_fff_generic.cc +/gr_fir_fff_generic.h +/gr_fir_fsf.cc +/gr_fir_fsf.h +/gr_fir_fsf_generic.cc +/gr_fir_fsf_generic.h +/gr_fir_scc.cc +/gr_fir_scc.h +/gr_fir_scc_generic.cc +/gr_fir_scc_generic.h +/gr_fir_filter_ccc.cc +/gr_fir_filter_ccc.h +/gr_fir_filter_ccc.i +/gr_fir_filter_ccf.cc +/gr_fir_filter_ccf.h +/gr_fir_filter_ccf.i +/gr_fir_filter_fcc.cc +/gr_fir_filter_fcc.h +/gr_fir_filter_fcc.i +/gr_fir_filter_fff.cc +/gr_fir_filter_fff.h +/gr_fir_filter_fff.i +/gr_fir_filter_fsf.cc +/gr_fir_filter_fsf.h +/gr_fir_filter_fsf.i +/gr_fir_filter_scc.cc +/gr_fir_filter_scc.h +/gr_fir_filter_scc.i +/gr_freq_xlating_fir_filter_ccc.cc +/gr_freq_xlating_fir_filter_ccc.h +/gr_freq_xlating_fir_filter_ccc.i +/gr_freq_xlating_fir_filter_ccf.cc +/gr_freq_xlating_fir_filter_ccf.h +/gr_freq_xlating_fir_filter_ccf.i +/gr_freq_xlating_fir_filter_fcc.cc +/gr_freq_xlating_fir_filter_fcc.h +/gr_freq_xlating_fir_filter_fcc.i +/gr_freq_xlating_fir_filter_fcf.cc +/gr_freq_xlating_fir_filter_fcf.h +/gr_freq_xlating_fir_filter_fcf.i +/gr_freq_xlating_fir_filter_scc.cc +/gr_freq_xlating_fir_filter_scc.h +/gr_freq_xlating_fir_filter_scc.i +/gr_freq_xlating_fir_filter_scf.cc +/gr_freq_xlating_fir_filter_scf.h +/gr_freq_xlating_fir_filter_scf.i +/gr_interp_fir_filter_ccc.cc +/gr_interp_fir_filter_ccc.h +/gr_interp_fir_filter_ccc.i +/gr_interp_fir_filter_ccf.cc +/gr_interp_fir_filter_ccf.h +/gr_interp_fir_filter_ccf.i +/gr_interp_fir_filter_fcc.cc +/gr_interp_fir_filter_fcc.h +/gr_interp_fir_filter_fcc.i +/gr_interp_fir_filter_fff.cc +/gr_interp_fir_filter_fff.h +/gr_interp_fir_filter_fff.i +/gr_interp_fir_filter_fsf.cc +/gr_interp_fir_filter_fsf.h +/gr_interp_fir_filter_fsf.i +/gr_interp_fir_filter_scc.cc +/gr_interp_fir_filter_scc.h +/gr_interp_fir_filter_scc.i +/gr_rational_resampler_ccc.cc +/gr_rational_resampler_ccc.h +/gr_rational_resampler_ccc.i +/gr_rational_resampler_ccf.cc +/gr_rational_resampler_ccf.h +/gr_rational_resampler_ccf.i +/gr_rational_resampler_fcc.cc +/gr_rational_resampler_fcc.h +/gr_rational_resampler_fcc.i +/gr_rational_resampler_fff.cc +/gr_rational_resampler_fff.h +/gr_rational_resampler_fff.i +/gr_rational_resampler_fsf.cc +/gr_rational_resampler_fsf.h +/gr_rational_resampler_fsf.i +/gr_rational_resampler_scc.cc +/gr_rational_resampler_scc.h +/gr_rational_resampler_scc.i +/gr_rational_resampler_base_ccc.cc +/gr_rational_resampler_base_ccc.h +/gr_rational_resampler_base_ccc.i +/gr_rational_resampler_base_ccf.cc +/gr_rational_resampler_base_ccf.h +/gr_rational_resampler_base_ccf.i +/gr_rational_resampler_base_fcc.cc +/gr_rational_resampler_base_fcc.h +/gr_rational_resampler_base_fcc.i +/gr_rational_resampler_base_fff.cc +/gr_rational_resampler_base_fff.h +/gr_rational_resampler_base_fff.i +/gr_rational_resampler_base_fsf.cc +/gr_rational_resampler_base_fsf.h +/gr_rational_resampler_base_fsf.i +/gr_rational_resampler_base_scc.cc +/gr_rational_resampler_base_scc.h +/gr_rational_resampler_base_scc.i +/stamp-* diff --git a/gnuradio-core/src/lib/g72x/.gitignore b/gnuradio-core/src/lib/g72x/.gitignore new file mode 100644 index 000000000..a02b6ff73 --- /dev/null +++ b/gnuradio-core/src/lib/g72x/.gitignore @@ -0,0 +1,8 @@ +/Makefile +/Makefile.in +/.la +/.lo +/.deps +/.libs +/*.la +/*.lo diff --git a/gnuradio-core/src/lib/general/.gitignore b/gnuradio-core/src/lib/general/.gitignore new file mode 100644 index 000000000..4f3696f58 --- /dev/null +++ b/gnuradio-core/src/lib/general/.gitignore @@ -0,0 +1,323 @@ +/Makefile +/Makefile.in +/.la +/.lo +/.deps +/.libs +/*.la +/*.lo +/*.pyc +/generate-stamp +/gr_constants.cc +/GrFIRfilterCCC.cc +/GrFIRfilterCCC.h +/GrFIRfilterCCF.cc +/GrFIRfilterCCF.h +/GrFIRfilterFCC.cc +/GrFIRfilterFCC.h +/GrFIRfilterFFF.cc +/GrFIRfilterFFF.h +/GrFIRfilterFSF.cc +/GrFIRfilterFSF.h +/GrFIRfilterSCC.cc +/GrFIRfilterSCC.h +/GrFIRfilterSIS.cc +/GrFIRfilterSIS.h +/GrFreqXlatingFIRfilterCCC.cc +/GrFreqXlatingFIRfilterCCC.h +/GrFreqXlatingFIRfilterCCF.cc +/GrFreqXlatingFIRfilterCCF.h +/GrFreqXlatingFIRfilterFCC.cc +/GrFreqXlatingFIRfilterFCC.h +/GrFreqXlatingFIRfilterFCF.cc +/GrFreqXlatingFIRfilterFCF.h +/GrFreqXlatingFIRfilterSCC.cc +/GrFreqXlatingFIRfilterSCC.h +/GrFreqXlatingFIRfilterSCF.cc +/GrFreqXlatingFIRfilterSCF.h +/gr_fir_CCC.cc +/gr_fir_CCC.h +/gr_fir_CCC_generic.cc +/gr_fir_CCC_generic.h +/gr_fir_CCF.cc +/gr_fir_CCF.h +/gr_fir_CCF_generic.cc +/gr_fir_CCF_generic.h +/gr_fir_FCC.cc +/gr_fir_FCC.h +/gr_fir_FCC_generic.cc +/gr_fir_FCC_generic.h +/gr_fir_FFF.cc +/gr_fir_FFF.h +/gr_fir_FFF_generic.cc +/gr_fir_FFF_generic.h +/gr_fir_FSF.cc +/gr_fir_FSF.h +/gr_fir_FSF_generic.cc +/gr_fir_FSF_generic.h +/gr_fir_SCC.cc +/gr_fir_SCC.h +/gr_fir_SCC_generic.cc +/gr_fir_SCC_generic.h +/gr_fir_SIS.cc +/gr_fir_SIS.h +/gr_fir_SIS_generic.cc +/gr_fir_SIS_generic.h +/gr_fir_sysconfig.cc +/gr_fir_sysconfig.h +/gr_fir_sysconfig_generic.cc +/gr_fir_sysconfig_generic.h +/gr_fir_util.cc +/gr_fir_util.h +/GrFIRfilterCCC.i +/GrFIRfilterCCF.i +/GrFIRfilterFCC.i +/GrFIRfilterFFF.i +/GrFIRfilterFSF.i +/GrFIRfilterSCC.i +/GrFIRfilterSIS.i +/GrFreqXlatingFIRfilterCCC.i +/GrFreqXlatingFIRfilterCCF.i +/GrFreqXlatingFIRfilterFCC.i +/GrFreqXlatingFIRfilterFCF.i +/GrFreqXlatingFIRfilterSCC.i +/GrFreqXlatingFIRfilterSCF.i +/# --- generated files --- +/gr_add_cc.cc +/gr_add_cc.h +/gr_add_cc.i +/gr_add_const_c.cc +/gr_add_const_c.h +/gr_add_const_c.i +/gr_add_const_cc.cc +/gr_add_const_cc.h +/gr_add_const_cc.i +/gr_add_const_f.cc +/gr_add_const_f.h +/gr_add_const_f.i +/gr_add_const_ff.cc +/gr_add_const_ff.h +/gr_add_const_ff.i +/gr_add_const_i.cc +/gr_add_const_i.h +/gr_add_const_i.i +/gr_add_const_ii.cc +/gr_add_const_ii.h +/gr_add_const_ii.i +/gr_add_const_s.cc +/gr_add_const_s.h +/gr_add_const_s.i +/gr_add_const_sf.cc +/gr_add_const_sf.h +/gr_add_const_sf.i +/gr_add_const_ss.cc +/gr_add_const_ss.h +/gr_add_const_ss.i +/gr_add_const_vcc.cc +/gr_add_const_vcc.h +/gr_add_const_vcc.i +/gr_add_const_vff.cc +/gr_add_const_vff.h +/gr_add_const_vff.i +/gr_add_const_vii.cc +/gr_add_const_vii.h +/gr_add_const_vii.i +/gr_add_const_vss.cc +/gr_add_const_vss.h +/gr_add_const_vss.i +/gr_add_ff.cc +/gr_add_ff.h +/gr_add_ff.i +/gr_add_ii.cc +/gr_add_ii.h +/gr_add_ii.i +/gr_add_ss.cc +/gr_add_ss.h +/gr_add_ss.i +/gr_add_vcc.cc +/gr_add_vcc.h +/gr_add_vcc.i +/gr_add_vff.cc +/gr_add_vff.h +/gr_add_vff.i +/gr_add_vii.cc +/gr_add_vii.h +/gr_add_vii.i +/gr_add_vss.cc +/gr_add_vss.h +/gr_add_vss.i +/gr_divide_cc.cc +/gr_divide_cc.h +/gr_divide_cc.i +/gr_divide_ff.cc +/gr_divide_ff.h +/gr_divide_ff.i +/gr_divide_ii.cc +/gr_divide_ii.h +/gr_divide_ii.i +/gr_divide_ss.cc +/gr_divide_ss.h +/gr_divide_ss.i +/gr_multiply_cc.cc +/gr_multiply_cc.h +/gr_multiply_cc.i +/gr_multiply_const_cc.cc +/gr_multiply_const_cc.h +/gr_multiply_const_cc.i +/gr_multiply_const_ff.cc +/gr_multiply_const_ff.h +/gr_multiply_const_ff.i +/gr_multiply_const_ii.cc +/gr_multiply_const_ii.h +/gr_multiply_const_ii.i +/gr_multiply_const_ss.cc +/gr_multiply_const_ss.h +/gr_multiply_const_ss.i +/gr_multiply_ff.cc +/gr_multiply_ff.h +/gr_multiply_ff.i +/gr_multiply_ii.cc +/gr_multiply_ii.h +/gr_multiply_ii.i +/gr_multiply_ss.cc +/gr_multiply_ss.h +/gr_multiply_ss.i +/gr_multiply_vcc.cc +/gr_multiply_vcc.h +/gr_multiply_vcc.i +/gr_multiply_vff.cc +/gr_multiply_vff.h +/gr_multiply_vff.i +/gr_multiply_vii.cc +/gr_multiply_vii.h +/gr_multiply_vii.i +/gr_multiply_vss.cc +/gr_multiply_vss.h +/gr_multiply_vss.i +/gr_multiply_const_vcc.cc +/gr_multiply_const_vcc.h +/gr_multiply_const_vcc.i +/gr_multiply_const_vff.cc +/gr_multiply_const_vff.h +/gr_multiply_const_vff.i +/gr_multiply_const_vii.cc +/gr_multiply_const_vii.h +/gr_multiply_const_vii.i +/gr_multiply_const_vss.cc +/gr_multiply_const_vss.h +/gr_multiply_const_vss.i +/gr_noise_source_c.cc +/gr_noise_source_c.h +/gr_noise_source_c.i +/gr_noise_source_f.cc +/gr_noise_source_f.h +/gr_noise_source_f.i +/gr_noise_source_i.cc +/gr_noise_source_i.h +/gr_noise_source_i.i +/gr_noise_source_s.cc +/gr_noise_source_s.h +/gr_noise_source_s.i +/gr_sig_source_c.cc +/gr_sig_source_c.h +/gr_sig_source_c.i +/gr_sig_source_f.cc +/gr_sig_source_f.h +/gr_sig_source_f.i +/gr_sig_source_i.cc +/gr_sig_source_i.h +/gr_sig_source_i.i +/gr_sig_source_s.cc +/gr_sig_source_s.h +/gr_sig_source_s.i +/gr_sub_cc.cc +/gr_sub_cc.h +/gr_sub_cc.i +/gr_sub_ff.cc +/gr_sub_ff.h +/gr_sub_ff.i +/gr_sub_ii.cc +/gr_sub_ii.h +/gr_sub_ii.i +/gr_sub_ss.cc +/gr_sub_ss.h +/gr_sub_ss.i +/gr_vector_sink_b.cc +/gr_vector_sink_b.h +/gr_vector_sink_b.i +/gr_vector_sink_c.cc +/gr_vector_sink_c.h +/gr_vector_sink_c.i +/gr_vector_sink_f.cc +/gr_vector_sink_f.h +/gr_vector_sink_f.i +/gr_vector_sink_i.cc +/gr_vector_sink_i.h +/gr_vector_sink_i.i +/gr_vector_sink_s.cc +/gr_vector_sink_s.h +/gr_vector_sink_s.i +/gr_vector_source_b.cc +/gr_vector_source_b.h +/gr_vector_source_b.i +/gr_vector_source_c.cc +/gr_vector_source_c.h +/gr_vector_source_c.i +/gr_vector_source_f.cc +/gr_vector_source_f.h +/gr_vector_source_f.i +/gr_vector_source_i.cc +/gr_vector_source_i.h +/gr_vector_source_i.i +/gr_vector_source_s.cc +/gr_vector_source_s.h +/gr_vector_source_s.i +/gr_mute_cc.cc +/gr_mute_cc.h +/gr_mute_cc.i +/gr_mute_ff.cc +/gr_mute_ff.h +/gr_mute_ff.i +/gr_mute_ii.cc +/gr_mute_ii.h +/gr_mute_ii.i +/gr_mute_ss.cc +/gr_mute_ss.h +/gr_mute_ss.i +/gr_chunks_to_symbols_bc.cc +/gr_chunks_to_symbols_bc.h +/gr_chunks_to_symbols_bc.i +/gr_chunks_to_symbols_bf.cc +/gr_chunks_to_symbols_bf.h +/gr_chunks_to_symbols_bf.i +/gr_chunks_to_symbols_ic.cc +/gr_chunks_to_symbols_ic.h +/gr_chunks_to_symbols_ic.i +/gr_chunks_to_symbols_if.cc +/gr_chunks_to_symbols_if.h +/gr_chunks_to_symbols_if.i +/gr_chunks_to_symbols_sc.cc +/gr_chunks_to_symbols_sc.h +/gr_chunks_to_symbols_sc.i +/gr_chunks_to_symbols_sf.cc +/gr_chunks_to_symbols_sf.h +/gr_chunks_to_symbols_sf.i +/gr_packed_to_unpacked_bb.cc +/gr_packed_to_unpacked_bb.h +/gr_packed_to_unpacked_bb.i +/gr_packed_to_unpacked_ii.cc +/gr_packed_to_unpacked_ii.h +/gr_packed_to_unpacked_ii.i +/gr_packed_to_unpacked_ss.cc +/gr_packed_to_unpacked_ss.h +/gr_packed_to_unpacked_ss.i +/gr_unpacked_to_packed_bb.cc +/gr_unpacked_to_packed_bb.h +/gr_unpacked_to_packed_bb.i +/gr_unpacked_to_packed_ii.cc +/gr_unpacked_to_packed_ii.h +/gr_unpacked_to_packed_ii.i +/gr_unpacked_to_packed_ss.cc +/gr_unpacked_to_packed_ss.h +/gr_unpacked_to_packed_ss.i +/# --- end generated files --- diff --git a/gnuradio-core/src/lib/general/gr_head.cc b/gnuradio-core/src/lib/general/gr_head.cc index 94a00cc68..01035ffcd 100644 --- a/gnuradio-core/src/lib/general/gr_head.cc +++ b/gnuradio-core/src/lib/general/gr_head.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2009 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -35,10 +35,10 @@ gr_head::gr_head (size_t sizeof_stream_item, int nitems) { } -gr_block_sptr +gr_head_sptr gr_make_head (size_t sizeof_stream_item, int nitems) { - return gr_block_sptr (new gr_head (sizeof_stream_item, nitems)); + return gnuradio::get_initial_sptr(new gr_head (sizeof_stream_item, nitems)); } int diff --git a/gnuradio-core/src/lib/general/gr_head.h b/gnuradio-core/src/lib/general/gr_head.h index cd97d6399..430d5f8b9 100644 --- a/gnuradio-core/src/lib/general/gr_head.h +++ b/gnuradio-core/src/lib/general/gr_head.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2009 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -26,6 +26,9 @@ #include <gr_sync_block.h> #include <stddef.h> // size_t +class gr_head; +typedef boost::shared_ptr<gr_head> gr_head_sptr; + /*! * \brief copies the first N items to the output then signals done * \ingroup slicedice_blk @@ -35,7 +38,7 @@ class gr_head : public gr_sync_block { - friend gr_block_sptr gr_make_head (size_t sizeof_stream_item, int nitems); + friend gr_head_sptr gr_make_head (size_t sizeof_stream_item, int nitems); gr_head (size_t sizeof_stream_item, int nitems); int d_nitems; @@ -45,9 +48,11 @@ class gr_head : public gr_sync_block int work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + + void reset() { d_ncopied_items = 0; } }; -gr_block_sptr +gr_head_sptr gr_make_head (size_t sizeof_stream_item, int nitems); diff --git a/gnuradio-core/src/lib/general/gr_head.i b/gnuradio-core/src/lib/general/gr_head.i index 324bb08ec..2a88b885f 100644 --- a/gnuradio-core/src/lib/general/gr_head.i +++ b/gnuradio-core/src/lib/general/gr_head.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2009 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -20,11 +20,13 @@ * Boston, MA 02110-1301, USA. */ -%ignore gr_head; +GR_SWIG_BLOCK_MAGIC(gr,head); + +gr_head_sptr gr_make_head(size_t sizeof_stream_item, int nitems); + class gr_head : public gr_block { - friend gr_block_sptr gr_make_head (size_t sizeof_stream_item, int nitems); - gr_head (size_t sizeof_stream_item, int nitems); + gr_head(); +public: + void reset(); }; -%rename(head) gr_make_head; -gr_block_sptr gr_make_head (size_t sizeof_stream_item, int nitems); diff --git a/gnuradio-core/src/lib/gengen/.gitignore b/gnuradio-core/src/lib/gengen/.gitignore new file mode 100644 index 000000000..ecd4cb0d5 --- /dev/null +++ b/gnuradio-core/src/lib/gengen/.gitignore @@ -0,0 +1,418 @@ +/Makefile +/Makefile.in +/.la +/.lo +/.deps +/.libs +/*.la +/*.lo +/*.pyc +/generate-stamp +/GrFIRfilterCCC.cc +/GrFIRfilterCCC.h +/GrFIRfilterCCF.cc +/GrFIRfilterCCF.h +/GrFIRfilterFCC.cc +/GrFIRfilterFCC.h +/GrFIRfilterFFF.cc +/GrFIRfilterFFF.h +/GrFIRfilterFSF.cc +/GrFIRfilterFSF.h +/GrFIRfilterSCC.cc +/GrFIRfilterSCC.h +/GrFIRfilterSIS.cc +/GrFIRfilterSIS.h +/GrFreqXlatingFIRfilterCCC.cc +/GrFreqXlatingFIRfilterCCC.h +/GrFreqXlatingFIRfilterCCF.cc +/GrFreqXlatingFIRfilterCCF.h +/GrFreqXlatingFIRfilterFCC.cc +/GrFreqXlatingFIRfilterFCC.h +/GrFreqXlatingFIRfilterFCF.cc +/GrFreqXlatingFIRfilterFCF.h +/GrFreqXlatingFIRfilterSCC.cc +/GrFreqXlatingFIRfilterSCC.h +/GrFreqXlatingFIRfilterSCF.cc +/GrFreqXlatingFIRfilterSCF.h +/gr_fir_CCC.cc +/gr_fir_CCC.h +/gr_fir_CCC_generic.cc +/gr_fir_CCC_generic.h +/gr_fir_CCF.cc +/gr_fir_CCF.h +/gr_fir_CCF_generic.cc +/gr_fir_CCF_generic.h +/gr_fir_FCC.cc +/gr_fir_FCC.h +/gr_fir_FCC_generic.cc +/gr_fir_FCC_generic.h +/gr_fir_FFF.cc +/gr_fir_FFF.h +/gr_fir_FFF_generic.cc +/gr_fir_FFF_generic.h +/gr_fir_FSF.cc +/gr_fir_FSF.h +/gr_fir_FSF_generic.cc +/gr_fir_FSF_generic.h +/gr_fir_SCC.cc +/gr_fir_SCC.h +/gr_fir_SCC_generic.cc +/gr_fir_SCC_generic.h +/gr_fir_SIS.cc +/gr_fir_SIS.h +/gr_fir_SIS_generic.cc +/gr_fir_SIS_generic.h +/gr_fir_sysconfig.cc +/gr_fir_sysconfig.h +/gr_fir_sysconfig_generic.cc +/gr_fir_sysconfig_generic.h +/gr_fir_util.cc +/gr_fir_util.h +/GrFIRfilterCCC.i +/GrFIRfilterCCF.i +/GrFIRfilterFCC.i +/GrFIRfilterFFF.i +/GrFIRfilterFSF.i +/GrFIRfilterSCC.i +/GrFIRfilterSIS.i +/GrFreqXlatingFIRfilterCCC.i +/GrFreqXlatingFIRfilterCCF.i +/GrFreqXlatingFIRfilterFCC.i +/GrFreqXlatingFIRfilterFCF.i +/GrFreqXlatingFIRfilterSCC.i +/GrFreqXlatingFIRfilterSCF.i +/# --- generated files --- +/gr_add_cc.cc +/gr_add_cc.h +/gr_add_cc.i +/gr_add_const_c.cc +/gr_add_const_cc.cc +/gr_add_const_cc.h +/gr_add_const_cc.i +/gr_add_const_c.h +/gr_add_const_c.i +/gr_add_const_f.cc +/gr_add_const_ff.cc +/gr_add_const_ff.h +/gr_add_const_ff.i +/gr_add_const_f.h +/gr_add_const_f.i +/gr_add_const_i.cc +/gr_add_const_i.h +/gr_add_const_i.i +/gr_add_const_ii.cc +/gr_add_const_ii.h +/gr_add_const_ii.i +/gr_add_const_s.cc +/gr_add_const_sf.cc +/gr_add_const_sf.h +/gr_add_const_sf.i +/gr_add_const_s.h +/gr_add_const_s.i +/gr_add_const_ss.cc +/gr_add_const_ss.h +/gr_add_const_ss.i +/gr_add_const_vcc.cc +/gr_add_const_vcc.h +/gr_add_const_vcc.i +/gr_add_const_vff.cc +/gr_add_const_vff.h +/gr_add_const_vff.i +/gr_add_const_vii.cc +/gr_add_const_vii.h +/gr_add_const_vii.i +/gr_add_const_vss.cc +/gr_add_const_vss.h +/gr_add_const_vss.i +/gr_add_ff.cc +/gr_add_ff.h +/gr_add_ff.i +/gr_add_ii.cc +/gr_add_ii.h +/gr_add_ii.i +/gr_add_ss.cc +/gr_add_ss.h +/gr_add_ss.i +/gr_and_bb.cc +/gr_and_bb.h +/gr_and_bb.i +/gr_and_ii.cc +/gr_and_ii.h +/gr_and_ii.i +/gr_and_ss.cc +/gr_and_ss.h +/gr_and_ss.i +/gr_argmax_fs.cc +/gr_argmax_fs.h +/gr_argmax_fs.i +/gr_argmax_is.cc +/gr_argmax_is.h +/gr_argmax_is.i +/gr_argmax_ss.cc +/gr_argmax_ss.h +/gr_argmax_ss.i +/gr_chunks_to_symbols_bc.cc +/gr_chunks_to_symbols_bc.h +/gr_chunks_to_symbols_bc.i +/gr_chunks_to_symbols_bf.cc +/gr_chunks_to_symbols_bf.h +/gr_chunks_to_symbols_bf.i +/gr_chunks_to_symbols_ic.cc +/gr_chunks_to_symbols_ic.h +/gr_chunks_to_symbols_ic.i +/gr_chunks_to_symbols_if.cc +/gr_chunks_to_symbols_if.h +/gr_chunks_to_symbols_if.i +/gr_chunks_to_symbols_sc.cc +/gr_chunks_to_symbols_sc.h +/gr_chunks_to_symbols_sc.i +/gr_chunks_to_symbols_sf.cc +/gr_chunks_to_symbols_sf.h +/gr_chunks_to_symbols_sf.i +/gr_divide_cc.cc +/gr_divide_cc.h +/gr_divide_cc.i +/gr_divide_ff.cc +/gr_divide_ff.h +/gr_divide_ff.i +/gr_divide_ii.cc +/gr_divide_ii.h +/gr_divide_ii.i +/gr_divide_ss.cc +/gr_divide_ss.h +/gr_divide_ss.i +/gr_integrate_cc.cc +/gr_integrate_cc.h +/gr_integrate_cc.i +/gr_integrate_ff.cc +/gr_integrate_ff.h +/gr_integrate_ff.i +/gr_integrate_ii.cc +/gr_integrate_ii.h +/gr_integrate_ii.i +/gr_integrate_ss.cc +/gr_integrate_ss.h +/gr_integrate_ss.i +/gr_max_ff.cc +/gr_max_ff.h +/gr_max_ff.i +/gr_max_ii.cc +/gr_max_ii.h +/gr_max_ii.i +/gr_max_ss.cc +/gr_max_ss.h +/gr_max_ss.i +/gr_multiply_cc.cc +/gr_multiply_cc.h +/gr_multiply_cc.i +/gr_multiply_const_cc.cc +/gr_multiply_const_cc.h +/gr_multiply_const_cc.i +/gr_multiply_const_ff.cc +/gr_multiply_const_ff.h +/gr_multiply_const_ff.i +/gr_multiply_const_ii.cc +/gr_multiply_const_ii.h +/gr_multiply_const_ii.i +/gr_multiply_const_ss.cc +/gr_multiply_const_ss.h +/gr_multiply_const_ss.i +/gr_multiply_const_vcc.cc +/gr_multiply_const_vcc.h +/gr_multiply_const_vcc.i +/gr_multiply_const_vff.cc +/gr_multiply_const_vff.h +/gr_multiply_const_vff.i +/gr_multiply_const_vii.cc +/gr_multiply_const_vii.h +/gr_multiply_const_vii.i +/gr_multiply_const_vss.cc +/gr_multiply_const_vss.h +/gr_multiply_const_vss.i +/gr_multiply_ff.cc +/gr_multiply_ff.h +/gr_multiply_ff.i +/gr_multiply_ii.cc +/gr_multiply_ii.h +/gr_multiply_ii.i +/gr_multiply_ss.cc +/gr_multiply_ss.h +/gr_multiply_ss.i +/gr_mute_cc.cc +/gr_mute_cc.h +/gr_mute_cc.i +/gr_mute_ff.cc +/gr_mute_ff.h +/gr_mute_ff.i +/gr_mute_ii.cc +/gr_mute_ii.h +/gr_mute_ii.i +/gr_mute_ss.cc +/gr_mute_ss.h +/gr_mute_ss.i +/gr_noise_source_c.cc +/gr_noise_source_c.h +/gr_noise_source_c.i +/gr_noise_source_f.cc +/gr_noise_source_f.h +/gr_noise_source_f.i +/gr_noise_source_i.cc +/gr_noise_source_i.h +/gr_noise_source_i.i +/gr_noise_source_s.cc +/gr_noise_source_s.h +/gr_noise_source_s.i +/gr_not_bb.cc +/gr_not_bb.h +/gr_not_bb.i +/gr_not_ii.cc +/gr_not_ii.h +/gr_not_ii.i +/gr_not_ss.cc +/gr_not_ss.h +/gr_not_ss.i +/gr_or_bb.cc +/gr_or_bb.h +/gr_or_bb.i +/gr_or_ii.cc +/gr_or_ii.h +/gr_or_ii.i +/gr_or_ss.cc +/gr_or_ss.h +/gr_or_ss.i +/gr_packed_to_unpacked_bb.cc +/gr_packed_to_unpacked_bb.h +/gr_packed_to_unpacked_bb.i +/gr_packed_to_unpacked_ii.cc +/gr_packed_to_unpacked_ii.h +/gr_packed_to_unpacked_ii.i +/gr_packed_to_unpacked_ss.cc +/gr_packed_to_unpacked_ss.h +/gr_packed_to_unpacked_ss.i +/gr_peak_detector_fb.cc +/gr_peak_detector_fb.h +/gr_peak_detector_fb.i +/gr_peak_detector_ff.cc +/gr_peak_detector_ff.h +/gr_peak_detector_ff.i +/gr_peak_detector_ib.cc +/gr_peak_detector_ib.h +/gr_peak_detector_ib.i +/gr_peak_detector_ii.cc +/gr_peak_detector_ii.h +/gr_peak_detector_ii.i +/gr_peak_detector_sb.cc +/gr_peak_detector_sb.h +/gr_peak_detector_sb.i +/gr_peak_detector_ss.cc +/gr_peak_detector_ss.h +/gr_peak_detector_ss.i +/gr_prefix.cc +/gr_sample_and_hold_bb.cc +/gr_sample_and_hold_bb.h +/gr_sample_and_hold_bb.i +/gr_sample_and_hold_ff.cc +/gr_sample_and_hold_ff.h +/gr_sample_and_hold_ff.i +/gr_sample_and_hold_ii.cc +/gr_sample_and_hold_ii.h +/gr_sample_and_hold_ii.i +/gr_sample_and_hold_ss.cc +/gr_sample_and_hold_ss.h +/gr_sample_and_hold_ss.i +/gr_sig_source_c.cc +/gr_sig_source_c.h +/gr_sig_source_c.i +/gr_sig_source_f.cc +/gr_sig_source_f.h +/gr_sig_source_f.i +/gr_sig_source_i.cc +/gr_sig_source_i.h +/gr_sig_source_i.i +/gr_sig_source_s.cc +/gr_sig_source_s.h +/gr_sig_source_s.i +/gr_sub_cc.cc +/gr_sub_cc.h +/gr_sub_cc.i +/gr_sub_ff.cc +/gr_sub_ff.h +/gr_sub_ff.i +/gr_sub_ii.cc +/gr_sub_ii.h +/gr_sub_ii.i +/gr_sub_ss.cc +/gr_sub_ss.h +/gr_sub_ss.i +/gr_unpacked_to_packed_bb.cc +/gr_unpacked_to_packed_bb.h +/gr_unpacked_to_packed_bb.i +/gr_unpacked_to_packed_ii.cc +/gr_unpacked_to_packed_ii.h +/gr_unpacked_to_packed_ii.i +/gr_unpacked_to_packed_ss.cc +/gr_unpacked_to_packed_ss.h +/gr_unpacked_to_packed_ss.i +/gr_vector_sink_b.cc +/gr_vector_sink_b.h +/gr_vector_sink_b.i +/gr_vector_sink_c.cc +/gr_vector_sink_c.h +/gr_vector_sink_c.i +/gr_vector_sink_f.cc +/gr_vector_sink_f.h +/gr_vector_sink_f.i +/gr_vector_sink_i.cc +/gr_vector_sink_i.h +/gr_vector_sink_i.i +/gr_vector_sink_s.cc +/gr_vector_sink_s.h +/gr_vector_sink_s.i +/gr_vector_source_b.cc +/gr_vector_source_b.h +/gr_vector_source_b.i +/gr_vector_source_c.cc +/gr_vector_source_c.h +/gr_vector_source_c.i +/gr_vector_source_f.cc +/gr_vector_source_f.h +/gr_vector_source_f.i +/gr_vector_source_i.cc +/gr_vector_source_i.h +/gr_vector_source_i.i +/gr_vector_source_s.cc +/gr_vector_source_s.h +/gr_vector_source_s.i +/gr_xor_bb.cc +/gr_xor_bb.h +/gr_xor_bb.i +/gr_xor_ii.cc +/gr_xor_ii.h +/gr_xor_ii.i +/gr_xor_ss.cc +/gr_xor_ss.h +/gr_xor_ss.i +/gr_moving_average_cc.cc +/gr_moving_average_cc.h +/gr_moving_average_cc.i +/gr_moving_average_ff.cc +/gr_moving_average_ff.h +/gr_moving_average_ff.i +/gr_moving_average_ss.cc +/gr_moving_average_ss.h +/gr_moving_average_ss.i +/gr_moving_average_ii.cc +/gr_moving_average_ii.h +/gr_moving_average_ii.i +/gr_and_const_bb.cc +/gr_and_const_ss.h +/gr_and_const_ss.i +/gr_and_const_ii.cc +/gr_and_const_bb.h +/gr_and_const_ss.cc +/gr_and_const_bb.i +/gr_and_const_ii.h +/gr_and_const_ii.i +/# --- end generated files --- +/stamp-* +/gengen_generated.i diff --git a/gnuradio-core/src/lib/gengen/gr_vector_sink_X.h.t b/gnuradio-core/src/lib/gengen/gr_vector_sink_X.h.t index b5fdf88fd..7ba5ee9e9 100644 --- a/gnuradio-core/src/lib/gengen/gr_vector_sink_X.h.t +++ b/gnuradio-core/src/lib/gengen/gr_vector_sink_X.h.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2008 Free Software Foundation, Inc. + * Copyright 2004,2008,2009 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -50,7 +50,8 @@ class @NAME@ : public gr_sync_block { gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); - void clear() {d_data.clear();} + void reset() {d_data.clear();} + void clear() {reset(); } // deprecated std::vector<@TYPE@> data () const; }; diff --git a/gnuradio-core/src/lib/gengen/gr_vector_sink_X.i.t b/gnuradio-core/src/lib/gengen/gr_vector_sink_X.i.t index 22d6faa1a..a49276a99 100644 --- a/gnuradio-core/src/lib/gengen/gr_vector_sink_X.i.t +++ b/gnuradio-core/src/lib/gengen/gr_vector_sink_X.i.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2008 Free Software Foundation, Inc. + * Copyright 2004,2008,2009 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,8 @@ class @NAME@ : public gr_sync_block { @NAME@ (int vlen); public: - void clear() {d_data.clear();} + void clear(); // deprecated + void reset(); std::vector<@TYPE@> data () const; }; diff --git a/gnuradio-core/src/lib/hier/.gitignore b/gnuradio-core/src/lib/hier/.gitignore new file mode 100644 index 000000000..89a768d46 --- /dev/null +++ b/gnuradio-core/src/lib/hier/.gitignore @@ -0,0 +1,4 @@ +/Makefile +/Makefile.in +/.libs +/.deps diff --git a/gnuradio-core/src/lib/io/.gitignore b/gnuradio-core/src/lib/io/.gitignore new file mode 100644 index 000000000..a02b6ff73 --- /dev/null +++ b/gnuradio-core/src/lib/io/.gitignore @@ -0,0 +1,8 @@ +/Makefile +/Makefile.in +/.la +/.lo +/.deps +/.libs +/*.la +/*.lo diff --git a/gnuradio-core/src/lib/missing/.gitignore b/gnuradio-core/src/lib/missing/.gitignore new file mode 100644 index 000000000..a02b6ff73 --- /dev/null +++ b/gnuradio-core/src/lib/missing/.gitignore @@ -0,0 +1,8 @@ +/Makefile +/Makefile.in +/.la +/.lo +/.deps +/.libs +/*.la +/*.lo diff --git a/gnuradio-core/src/lib/reed-solomon/.gitignore b/gnuradio-core/src/lib/reed-solomon/.gitignore new file mode 100644 index 000000000..f137f5c67 --- /dev/null +++ b/gnuradio-core/src/lib/reed-solomon/.gitignore @@ -0,0 +1,9 @@ +/Makefile +/Makefile.in +/.la +/.lo +/.deps +/.libs +/*.la +/*.lo +/rstest diff --git a/gnuradio-core/src/lib/runtime/.gitignore b/gnuradio-core/src/lib/runtime/.gitignore new file mode 100644 index 000000000..a02b6ff73 --- /dev/null +++ b/gnuradio-core/src/lib/runtime/.gitignore @@ -0,0 +1,8 @@ +/Makefile +/Makefile.in +/.la +/.lo +/.deps +/.libs +/*.la +/*.lo diff --git a/gnuradio-core/src/lib/runtime/Makefile.am b/gnuradio-core/src/lib/runtime/Makefile.am index 14ab464ad..b0e804277 100644 --- a/gnuradio-core/src/lib/runtime/Makefile.am +++ b/gnuradio-core/src/lib/runtime/Makefile.am @@ -44,6 +44,7 @@ libruntime_la_SOURCES = \ gr_io_signature.cc \ gr_local_sighandler.cc \ gr_message.cc \ + gr_msg_accepter.cc \ gr_msg_handler.cc \ gr_msg_queue.cc \ gr_pagesize.cc \ @@ -96,6 +97,7 @@ grinclude_HEADERS = \ gr_io_signature.h \ gr_local_sighandler.h \ gr_message.h \ + gr_msg_accepter.h \ gr_msg_handler.h \ gr_msg_queue.h \ gr_pagesize.h \ diff --git a/gnuradio-core/src/lib/runtime/gr_basic_block.cc b/gnuradio-core/src/lib/runtime/gr_basic_block.cc index 71ccc0245..2fa1066cb 100644 --- a/gnuradio-core/src/lib/runtime/gr_basic_block.cc +++ b/gnuradio-core/src/lib/runtime/gr_basic_block.cc @@ -41,8 +41,7 @@ gr_basic_block_ncurrently_allocated() gr_basic_block::gr_basic_block(const std::string &name, gr_io_signature_sptr input_signature, gr_io_signature_sptr output_signature) - : gruel::msg_accepter_msgq(gruel::make_msg_queue(0)), - d_name(name), + : d_name(name), d_input_signature(input_signature), d_output_signature(output_signature), d_unique_id(s_next_id++), diff --git a/gnuradio-core/src/lib/runtime/gr_basic_block.h b/gnuradio-core/src/lib/runtime/gr_basic_block.h index 27ec0fd89..b8797fdc6 100644 --- a/gnuradio-core/src/lib/runtime/gr_basic_block.h +++ b/gnuradio-core/src/lib/runtime/gr_basic_block.h @@ -26,7 +26,7 @@ #include <gr_runtime_types.h> #include <gr_sptr_magic.h> #include <boost/enable_shared_from_this.hpp> -#include <gruel/msg_accepter_msgq.h> +#include <gr_msg_accepter.h> #include <string> /*! @@ -40,7 +40,7 @@ * signal processing functions. */ -class gr_basic_block : gruel::msg_accepter_msgq, public boost::enable_shared_from_this<gr_basic_block> +class gr_basic_block : public gr_msg_accepter, public boost::enable_shared_from_this<gr_basic_block> { protected: friend class gr_flowgraph; diff --git a/gnuradio-core/src/lib/runtime/gr_block.cc b/gnuradio-core/src/lib/runtime/gr_block.cc index b8b1bd9c7..8915f3360 100644 --- a/gnuradio-core/src/lib/runtime/gr_block.cc +++ b/gnuradio-core/src/lib/runtime/gr_block.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2009 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -99,6 +99,12 @@ gr_block::consume_each (int how_many_items) d_detail->consume_each (how_many_items); } +void +gr_block::produce (int which_output, int how_many_items) +{ + d_detail->produce (which_output, how_many_items); +} + int gr_block::fixed_rate_ninput_to_noutput(int ninput) { diff --git a/gnuradio-core/src/lib/runtime/gr_block.h b/gnuradio-core/src/lib/runtime/gr_block.h index 354695c0b..b6f724dde 100644 --- a/gnuradio-core/src/lib/runtime/gr_block.h +++ b/gnuradio-core/src/lib/runtime/gr_block.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2007 Free Software Foundation, Inc. + * Copyright 2004,2007,2009 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -57,6 +57,12 @@ class gr_block : public gr_basic_block { public: + //! Magic return values from general_work + enum { + WORK_CALLED_PRODUCE = -2, + WORK_DONE = -1 + }; + virtual ~gr_block (); /*! @@ -70,7 +76,7 @@ class gr_block : public gr_basic_block { void set_history (unsigned history) { d_history = history; } /*! - * \brief return true if this block has a fixed input to output rate + * \brief Return true if this block has a fixed input to output rate. * * If true, then fixed_rate_in_to_out and fixed_rate_out_to_in may be called. */ @@ -150,6 +156,13 @@ class gr_block : public gr_basic_block { void consume_each (int how_many_items); /*! + * \brief Tell the scheduler \p how_many_items were produced on output stream \p which_output. + * + * If the block's general_work method calls produce, \p general_work must return WORK_CALLED_PRODUCE. + */ + void produce (int which_output, int how_many_items); + + /*! * \brief Set the approximate output rate / input rate * * Provide a hint to the buffer allocator and scheduler. @@ -191,7 +204,7 @@ class gr_block : public gr_basic_block { int d_output_multiple; double d_relative_rate; // approx output_rate / input_rate - gr_block_detail_sptr d_detail; // implementation details + gr_block_detail_sptr d_detail; // implementation details unsigned d_history; bool d_fixed_rate; diff --git a/gnuradio-core/src/lib/runtime/gr_block_detail.cc b/gnuradio-core/src/lib/runtime/gr_block_detail.cc index ae1ea2562..38d4a13ca 100644 --- a/gnuradio-core/src/lib/runtime/gr_block_detail.cc +++ b/gnuradio-core/src/lib/runtime/gr_block_detail.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2009 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -36,7 +36,8 @@ gr_block_detail_ncurrently_allocated () } gr_block_detail::gr_block_detail (unsigned int ninputs, unsigned int noutputs) - : d_ninputs (ninputs), d_noutputs (noutputs), + : d_produce_or(0), + d_ninputs (ninputs), d_noutputs (noutputs), d_input (ninputs), d_output (noutputs), d_done (false) { @@ -100,9 +101,27 @@ gr_block_detail::consume_each (int how_many_items) } void +gr_block_detail::produce (int which_output, int how_many_items) +{ + if (how_many_items > 0){ + d_output[which_output]->update_write_pointer (how_many_items); + d_produce_or |= how_many_items; + } +} + +void gr_block_detail::produce_each (int how_many_items) { - if (how_many_items > 0) + if (how_many_items > 0){ for (int i = 0; i < noutputs (); i++) d_output[i]->update_write_pointer (how_many_items); + d_produce_or |= how_many_items; + } +} + + +void +gr_block_detail::_post(pmt::pmt_t msg) +{ + d_tpb.insert_tail(msg); } diff --git a/gnuradio-core/src/lib/runtime/gr_block_detail.h b/gnuradio-core/src/lib/runtime/gr_block_detail.h index 2856c402c..c5787a5ad 100644 --- a/gnuradio-core/src/lib/runtime/gr_block_detail.h +++ b/gnuradio-core/src/lib/runtime/gr_block_detail.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2009 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -74,12 +74,22 @@ class gr_block_detail { void consume_each (int how_many_items); /*! + * \brief Tell the scheduler \p how_many_items were produced on output stream \p which_output. + */ + void produce (int which_output, int how_many_items); + + /*! * \brief Tell the scheduler \p how_many_items were produced on each output stream. */ void produce_each (int how_many_items); + /*! + * Accept msg, place in queue, arrange for thread to be awakened if it's not already. + */ + void _post(pmt::pmt_t msg); gr_tpb_detail d_tpb; // used by thread-per-block scheduler + int d_produce_or; // ---------------------------------------------------------------------------- diff --git a/gnuradio-core/src/lib/runtime/gr_block_executor.cc b/gnuradio-core/src/lib/runtime/gr_block_executor.cc index e8d30b963..2c21a0b0f 100644 --- a/gnuradio-core/src/lib/runtime/gr_block_executor.cc +++ b/gnuradio-core/src/lib/runtime/gr_block_executor.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2008 Free Software Foundation, Inc. + * Copyright 2004,2008,2009 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -290,6 +290,7 @@ gr_block_executor::run_one_iteration() setup_call_to_work: + d->d_produce_or = 0; for (int i = 0; i < d->noutputs (); i++) d_output_items[i] = d->output(i)->write_pointer(); @@ -299,11 +300,13 @@ gr_block_executor::run_one_iteration() LOG(*d_log << " general_work: noutput_items = " << noutput_items << " result = " << n << std::endl); - if (n == -1) // block is done + if (n == gr_block::WORK_DONE) goto were_done; - d->produce_each (n); // advance write pointers - if (n > 0) + if (n != gr_block::WORK_CALLED_PRODUCE) + d->produce_each (n); // advance write pointers + + if (d->d_produce_or > 0) // block produced something return READY; // We didn't produce any output even though we called general_work. @@ -312,7 +315,7 @@ gr_block_executor::run_one_iteration() // If this is a source, it's broken. if (d->source_p()){ std::cerr << "gr_block_executor: source " << m - << " returned 0 from work. We're marking it DONE.\n"; + << " produced no output. We're marking it DONE.\n"; // FIXME maybe we ought to raise an exception... goto were_done; } diff --git a/gnuradio-core/src/lib/runtime/gr_msg_accepter.cc b/gnuradio-core/src/lib/runtime/gr_msg_accepter.cc new file mode 100644 index 000000000..89876ae29 --- /dev/null +++ b/gnuradio-core/src/lib/runtime/gr_msg_accepter.cc @@ -0,0 +1,59 @@ +/* -*- c++ -*- */ +/* + * Copyright 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 this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#if HAVE_CONFIG_H +#include <config.h> +#endif + +#include <gr_msg_accepter.h> +#include <gr_block.h> +#include <gr_block_detail.h> +#include <gr_hier_block2.h> +#include <stdexcept> + +using namespace pmt; + +gr_msg_accepter::gr_msg_accepter() +{ +} + +gr_msg_accepter::~gr_msg_accepter() +{ + // NOP, required as virtual destructor +} + +void +gr_msg_accepter::post(pmt_t msg) +{ + // Notify derived class, handled case by case + gr_block *p = dynamic_cast<gr_block *>(this); + if (p) { + p->detail()->_post(msg); + return; + } + gr_hier_block2 *p2 = dynamic_cast<gr_hier_block2 *>(this); + if (p2){ + // FIXME do the right thing + return; + } + + throw std::runtime_error("unknown derived class"); +} diff --git a/gnuradio-core/src/lib/runtime/gr_msg_accepter.h b/gnuradio-core/src/lib/runtime/gr_msg_accepter.h new file mode 100644 index 000000000..79a631f3a --- /dev/null +++ b/gnuradio-core/src/lib/runtime/gr_msg_accepter.h @@ -0,0 +1,42 @@ +/* -*- c++ -*- */ +/* + * Copyright 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 this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef INCLUDED_GR_MSG_ACCEPTER_H +#define INCLUDED_GR_MSG_ACCEPTER_H + +#include <gruel/msg_accepter.h> +#include <gruel/pmt.h> + +/*! + * \brief Accepts messages and inserts them into a message queue, then notifies + * subclass gr_basic_block there is a message pending. + */ +class gr_msg_accepter : public gruel::msg_accepter +{ +public: + gr_msg_accepter(); + ~gr_msg_accepter(); + + void post(pmt::pmt_t msg); + +}; + +#endif /* INCLUDED_GR_MSG_ACCEPTER_H */ diff --git a/gnuradio-core/src/lib/runtime/gr_tpb_detail.cc b/gnuradio-core/src/lib/runtime/gr_tpb_detail.cc index 02e8deed8..c6311ccaa 100644 --- a/gnuradio-core/src/lib/runtime/gr_tpb_detail.cc +++ b/gnuradio-core/src/lib/runtime/gr_tpb_detail.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2008,2009 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -27,6 +27,8 @@ #include <gr_block_detail.h> #include <gr_buffer.h> +using namespace pmt; + /* * We assume that no worker threads are ever running when the * graph structure is being manipulated, thus it's safe for us to poke @@ -65,3 +67,44 @@ gr_tpb_detail::notify_neighbors(gr_block_detail *d) notify_downstream(d); notify_upstream(d); } + +void +gr_tpb_detail::insert_tail(pmt::pmt_t msg) +{ + gruel::scoped_lock guard(mutex); + + msg_queue.push_back(msg); + + // wake up thread if BLKD_IN or BLKD_OUT + input_cond.notify_one(); + output_cond.notify_one(); +} + +pmt_t +gr_tpb_detail::delete_head_nowait() +{ + gruel::scoped_lock guard(mutex); + + if (empty_p()) + return pmt_t(); + + pmt_t m(msg_queue.front()); + msg_queue.pop_front(); + + return m; +} + +/* + * Caller must already be holding the mutex + */ +pmt_t +gr_tpb_detail::delete_head_nowait_already_holding_mutex() +{ + if (empty_p()) + return pmt_t(); + + pmt_t m(msg_queue.front()); + msg_queue.pop_front(); + + return m; +} diff --git a/gnuradio-core/src/lib/runtime/gr_tpb_detail.h b/gnuradio-core/src/lib/runtime/gr_tpb_detail.h index ab955240b..acfa264c7 100644 --- a/gnuradio-core/src/lib/runtime/gr_tpb_detail.h +++ b/gnuradio-core/src/lib/runtime/gr_tpb_detail.h @@ -22,6 +22,8 @@ #define INCLUDED_GR_TPB_DETAIL_H #include <gruel/thread.h> +#include <deque> +#include <gruel/pmt.h> class gr_block_detail; @@ -36,9 +38,12 @@ struct gr_tpb_detail { bool output_changed; gruel::condition_variable output_cond; - gr_tpb_detail() - : input_changed(false), output_changed(false) {} +private: + std::deque<pmt::pmt_t> msg_queue; +public: + gr_tpb_detail() + : input_changed(false), output_changed(false) { } //! Called by us to tell all our upstream blocks that their output may have changed. void notify_upstream(gr_block_detail *d); @@ -56,6 +61,23 @@ struct gr_tpb_detail { input_changed = false; output_changed = false; } + + //! is the queue empty? + bool empty_p() const { return msg_queue.empty(); } + + //| Acquires and release the mutex + void insert_tail(pmt::pmt_t msg); + + /*! + * \returns returns pmt at head of queue or pmt_t() if empty. + */ + pmt::pmt_t delete_head_nowait(); + + /*! + * \returns returns pmt at head of queue or pmt_t() if empty. + * Caller must already be holding the mutex + */ + pmt::pmt_t delete_head_nowait_already_holding_mutex(); private: diff --git a/gnuradio-core/src/lib/runtime/gr_tpb_thread_body.cc b/gnuradio-core/src/lib/runtime/gr_tpb_thread_body.cc index 458b16d64..03eef17d9 100644 --- a/gnuradio-core/src/lib/runtime/gr_tpb_thread_body.cc +++ b/gnuradio-core/src/lib/runtime/gr_tpb_thread_body.cc @@ -24,17 +24,26 @@ #include <gr_tpb_thread_body.h> #include <iostream> #include <boost/thread.hpp> +#include <gruel/pmt.h> + +using namespace pmt; gr_tpb_thread_body::gr_tpb_thread_body(gr_block_sptr block) : d_exec(block) { // std::cerr << "gr_tpb_thread_body: " << block << std::endl; - gr_block_detail *d = block->detail().get(); + gr_block_detail *d = block->detail().get(); gr_block_executor::state s; + pmt_t msg; + while (1){ boost::this_thread::interruption_point(); + + // handle any queued up messages + while ((msg = d->d_tpb.delete_head_nowait())) + block->handle_msg(msg); d->d_tpb.clear_changed(); s = d_exec.run_one_iteration(); @@ -55,16 +64,39 @@ gr_tpb_thread_body::gr_tpb_thread_body(gr_block_sptr block) case gr_block_executor::BLKD_IN: // Wait for input. { gruel::scoped_lock guard(d->d_tpb.mutex); - while(!d->d_tpb.input_changed) - d->d_tpb.input_cond.wait(guard); + while (!d->d_tpb.input_changed){ + + // wait for input or message + while(!d->d_tpb.input_changed && d->d_tpb.empty_p()) + d->d_tpb.input_cond.wait(guard); + + // handle all pending messages + while ((msg = d->d_tpb.delete_head_nowait_already_holding_mutex())){ + guard.unlock(); // release lock while processing msg + block->handle_msg(msg); + guard.lock(); + } + } } break; + case gr_block_executor::BLKD_OUT: // Wait for output buffer space. { gruel::scoped_lock guard(d->d_tpb.mutex); - while(!d->d_tpb.output_changed) - d->d_tpb.output_cond.wait(guard); + while (!d->d_tpb.output_changed){ + + // wait for output room or message + while(!d->d_tpb.output_changed && d->d_tpb.empty_p()) + d->d_tpb.output_cond.wait(guard); + + // handle all pending messages + while ((msg = d->d_tpb.delete_head_nowait_already_holding_mutex())){ + guard.unlock(); // release lock while processing msg + block->handle_msg(msg); + guard.lock(); + } + } } break; diff --git a/gnuradio-core/src/lib/swig/.gitignore b/gnuradio-core/src/lib/swig/.gitignore new file mode 100644 index 000000000..9d7d01056 --- /dev/null +++ b/gnuradio-core/src/lib/swig/.gitignore @@ -0,0 +1,36 @@ +/Makefile +/Makefile.in +/.la +/.lo +/.deps +/.libs +/*.la +/*.lo +/*.pyc +/swigrun.py +/swigrun_wrap.c +/Makefile.swigdeps.new +/gnuradio_swig_py_runtime.d +/gnuradio_swig_py_general.d +/gnuradio_swig_py_gengen.d +/gnuradio_swig_py_filter.d +/gnuradio_swig_py_io.d +/gnuradio_swig_bug_workaround.h +/gnuradio_swig_py_runtime.cc +/gnuradio_swig_py_runtime.h +/gnuradio_swig_py_runtime.py +/gnuradio_swig_py_general.cc +/gnuradio_swig_py_general.h +/gnuradio_swig_py_general.py +/gnuradio_swig_py_gengen.cc +/gnuradio_swig_py_gengen.h +/gnuradio_swig_py_gengen.py +/gnuradio_swig_py_filter.cc +/gnuradio_swig_py_filter.h +/gnuradio_swig_py_filter.py +/gnuradio_swig_py_io.cc +/gnuradio_swig_py_io.h +/gnuradio_swig_py_io.py +/gnuradio_swig_py_hier.cc +/gnuradio_swig_py_hier.h +/gnuradio_swig_py_hier.py diff --git a/gnuradio-core/src/lib/viterbi/.gitignore b/gnuradio-core/src/lib/viterbi/.gitignore new file mode 100644 index 000000000..85bb5cc04 --- /dev/null +++ b/gnuradio-core/src/lib/viterbi/.gitignore @@ -0,0 +1,6 @@ +/Makefile +/Makefile.in +/.libs +/.deps +/encode +/decode diff --git a/gnuradio-core/src/python/.gitignore b/gnuradio-core/src/python/.gitignore new file mode 100644 index 000000000..f9c5da0db --- /dev/null +++ b/gnuradio-core/src/python/.gitignore @@ -0,0 +1,8 @@ +/Makefile +/Makefile.in +/.deps +/.libs +/*.la +/*.lo +/*.pyc +/*.pyo diff --git a/gnuradio-core/src/python/bin/.gitignore b/gnuradio-core/src/python/bin/.gitignore new file mode 100644 index 000000000..f9c5da0db --- /dev/null +++ b/gnuradio-core/src/python/bin/.gitignore @@ -0,0 +1,8 @@ +/Makefile +/Makefile.in +/.deps +/.libs +/*.la +/*.lo +/*.pyc +/*.pyo diff --git a/gnuradio-core/src/python/gnuradio/.gitignore b/gnuradio-core/src/python/gnuradio/.gitignore new file mode 100644 index 000000000..f9c5da0db --- /dev/null +++ b/gnuradio-core/src/python/gnuradio/.gitignore @@ -0,0 +1,8 @@ +/Makefile +/Makefile.in +/.deps +/.libs +/*.la +/*.lo +/*.pyc +/*.pyo diff --git a/gnuradio-core/src/python/gnuradio/blks2/.gitignore b/gnuradio-core/src/python/gnuradio/blks2/.gitignore new file mode 100644 index 000000000..b6950912c --- /dev/null +++ b/gnuradio-core/src/python/gnuradio/blks2/.gitignore @@ -0,0 +1,3 @@ +/Makefile +/Makefile.in +/*.pyc diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/.gitignore b/gnuradio-core/src/python/gnuradio/blks2impl/.gitignore new file mode 100644 index 000000000..f9c5da0db --- /dev/null +++ b/gnuradio-core/src/python/gnuradio/blks2impl/.gitignore @@ -0,0 +1,8 @@ +/Makefile +/Makefile.in +/.deps +/.libs +/*.la +/*.lo +/*.pyc +/*.pyo diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py index b1b3dfcab..e40d9636a 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py @@ -24,7 +24,7 @@ from gnuradio import gr class pfb_arb_resampler_ccf(gr.hier_block2): ''' - Convinience wrapper for the polyphase filterbank arbitrary resampler. + Convenience wrapper for the polyphase filterbank arbitrary resampler. The block takes a single complex stream in and outputs a single complex stream out. As such, it requires no extra glue to handle the input/output @@ -45,6 +45,5 @@ class pfb_arb_resampler_ccf(gr.hier_block2): self.connect(self, self.pfb) self.connect(self.pfb, self) - - - + def set_taps(self, taps): + self.pfb.set_taps(taps) diff --git a/gnuradio-core/src/python/gnuradio/gr/.gitignore b/gnuradio-core/src/python/gnuradio/gr/.gitignore new file mode 100644 index 000000000..bf03975bb --- /dev/null +++ b/gnuradio-core/src/python/gnuradio/gr/.gitignore @@ -0,0 +1,9 @@ +/Makefile +/Makefile.in +/.deps +/.libs +/*.la +/*.lo +/*.pyc +/*.pyo +/run_tests diff --git a/gnuradio-core/src/python/gnuradio/gru/.gitignore b/gnuradio-core/src/python/gnuradio/gru/.gitignore new file mode 100644 index 000000000..f9c5da0db --- /dev/null +++ b/gnuradio-core/src/python/gnuradio/gru/.gitignore @@ -0,0 +1,8 @@ +/Makefile +/Makefile.in +/.deps +/.libs +/*.la +/*.lo +/*.pyc +/*.pyo diff --git a/gnuradio-core/src/python/gnuradio/gruimpl/.gitignore b/gnuradio-core/src/python/gnuradio/gruimpl/.gitignore new file mode 100644 index 000000000..f9c5da0db --- /dev/null +++ b/gnuradio-core/src/python/gnuradio/gruimpl/.gitignore @@ -0,0 +1,8 @@ +/Makefile +/Makefile.in +/.deps +/.libs +/*.la +/*.lo +/*.pyc +/*.pyo diff --git a/gnuradio-core/src/python/gnuradio/vocoder/.gitignore b/gnuradio-core/src/python/gnuradio/vocoder/.gitignore new file mode 100644 index 000000000..b336cc7ce --- /dev/null +++ b/gnuradio-core/src/python/gnuradio/vocoder/.gitignore @@ -0,0 +1,2 @@ +/Makefile +/Makefile.in diff --git a/gnuradio-core/src/tests/.gitignore b/gnuradio-core/src/tests/.gitignore new file mode 100644 index 000000000..8687003d4 --- /dev/null +++ b/gnuradio-core/src/tests/.gitignore @@ -0,0 +1,28 @@ +/Makefile +/Makefile.in +/.la +/.lo +/.deps +/.libs +/*.la +/*.lo +/t1 +/test_dtv +/check_dups +/test_gr +/test_all +/exercise_correlator +/test_grbase +/test_vmcircbuf +/test_atsc +/test_general +/test_runtime +/test_filter +/benchmark_dotprod_fff +/benchmark_dotprod_ccc +/benchmark_dotprod_fcc +/benchmark_dotprod_scc +/benchmark_nco +/benchmark_dotprod_ccf +/benchmark_dotprod_fsf +/benchmark_vco diff --git a/gnuradio-core/src/utils/.gitignore b/gnuradio-core/src/utils/.gitignore new file mode 100644 index 000000000..a02b6ff73 --- /dev/null +++ b/gnuradio-core/src/utils/.gitignore @@ -0,0 +1,8 @@ +/Makefile +/Makefile.in +/.la +/.lo +/.deps +/.libs +/*.la +/*.lo |