diff options
Diffstat (limited to 'gnuradio-core/src/lib/general')
7 files changed, 17 insertions, 41 deletions
diff --git a/gnuradio-core/src/lib/general/gr_annotator_1to1.cc b/gnuradio-core/src/lib/general/gr_annotator_1to1.cc index 511b356e5..d12bfbf04 100644 --- a/gnuradio-core/src/lib/general/gr_annotator_1to1.cc +++ b/gnuradio-core/src/lib/general/gr_annotator_1to1.cc @@ -69,10 +69,10 @@ gr_annotator_1to1::work (int noutput_items, for(int i = 0; i < ninputs; i++) { abs_N = nitems_read(i); - std::vector<pmt::pmt_t> all_tags; + std::vector<gr_tag_t> all_tags; get_tags_in_range(all_tags, i, abs_N, abs_N + noutput_items); - std::vector<pmt::pmt_t>::iterator itr; + std::vector<gr_tag_t>::iterator itr; for(itr = all_tags.begin(); itr != all_tags.end(); itr++) { d_stored_tags.push_back(*itr); } diff --git a/gnuradio-core/src/lib/general/gr_annotator_1to1.h b/gnuradio-core/src/lib/general/gr_annotator_1to1.h index d866407fe..a62720224 100644 --- a/gnuradio-core/src/lib/general/gr_annotator_1to1.h +++ b/gnuradio-core/src/lib/general/gr_annotator_1to1.h @@ -54,7 +54,7 @@ class GR_CORE_API gr_annotator_1to1 : public gr_sync_block gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); - std::vector<pmt::pmt_t> data() const + std::vector<gr_tag_t> data() const { return d_stored_tags; } @@ -66,7 +66,7 @@ protected: size_t d_itemsize; uint64_t d_when; uint64_t d_tag_counter; - std::vector<pmt::pmt_t> d_stored_tags; + std::vector<gr_tag_t> d_stored_tags; friend GR_CORE_API gr_annotator_1to1_sptr gr_make_annotator_1to1 (int when, size_t sizeof_stream_item); diff --git a/gnuradio-core/src/lib/general/gr_annotator_1to1.i b/gnuradio-core/src/lib/general/gr_annotator_1to1.i index f29ecbf53..2c8149a3c 100644 --- a/gnuradio-core/src/lib/general/gr_annotator_1to1.i +++ b/gnuradio-core/src/lib/general/gr_annotator_1to1.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2010 Free Software Foundation, Inc. + * Copyright 2010-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -22,15 +22,4 @@ GR_SWIG_BLOCK_MAGIC(gr,annotator_1to1); -gr_annotator_1to1_sptr gr_make_annotator_1to1 (int when, - size_t sizeof_stream_item); - -class gr_annotator_1to1 : public gr_sync_block -{ -public: - std::vector<pmt::pmt_t> data() const; - -private: - gr_annotator_1to1 (int when, size_t sizeof_stream_item); -}; - +%include <gr_annotator_1to1.h> diff --git a/gnuradio-core/src/lib/general/gr_annotator_alltoall.cc b/gnuradio-core/src/lib/general/gr_annotator_alltoall.cc index 344fd088b..dd31bff78 100644 --- a/gnuradio-core/src/lib/general/gr_annotator_alltoall.cc +++ b/gnuradio-core/src/lib/general/gr_annotator_alltoall.cc @@ -70,10 +70,10 @@ gr_annotator_alltoall::work (int noutput_items, abs_N = nitems_read(i); end_N = abs_N + (uint64_t)(noutput_items); - std::vector<pmt::pmt_t> all_tags; + std::vector<gr_tag_t> all_tags; get_tags_in_range(all_tags, i, abs_N, end_N); - std::vector<pmt::pmt_t>::iterator itr; + std::vector<gr_tag_t>::iterator itr; for(itr = all_tags.begin(); itr != all_tags.end(); itr++) { d_stored_tags.push_back(*itr); } diff --git a/gnuradio-core/src/lib/general/gr_annotator_alltoall.h b/gnuradio-core/src/lib/general/gr_annotator_alltoall.h index 259b2e54c..fe8b736c2 100644 --- a/gnuradio-core/src/lib/general/gr_annotator_alltoall.h +++ b/gnuradio-core/src/lib/general/gr_annotator_alltoall.h @@ -55,7 +55,7 @@ class GR_CORE_API gr_annotator_alltoall : public gr_sync_block gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); - std::vector<pmt::pmt_t> data() const + std::vector<gr_tag_t> data() const { return d_stored_tags; } @@ -67,7 +67,7 @@ protected: size_t d_itemsize; uint64_t d_when; uint64_t d_tag_counter; - std::vector<pmt::pmt_t> d_stored_tags; + std::vector<gr_tag_t> d_stored_tags; friend GR_CORE_API gr_annotator_alltoall_sptr gr_make_annotator_alltoall (int when, size_t sizeof_stream_item); diff --git a/gnuradio-core/src/lib/general/gr_annotator_alltoall.i b/gnuradio-core/src/lib/general/gr_annotator_alltoall.i index f9bf6dd9a..49bd1e446 100644 --- a/gnuradio-core/src/lib/general/gr_annotator_alltoall.i +++ b/gnuradio-core/src/lib/general/gr_annotator_alltoall.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2010 Free Software Foundation, Inc. + * Copyright 2010-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -22,15 +22,4 @@ GR_SWIG_BLOCK_MAGIC(gr,annotator_alltoall); -gr_annotator_alltoall_sptr gr_make_annotator_alltoall (int when, - size_t sizeof_stream_item); - -class gr_annotator_alltoall : public gr_sync_block -{ -public: - std::vector<pmt::pmt_t> data() const; - -private: - gr_annotator_alltoall (int when, size_t sizeof_stream_item); -}; - +%include <gr_annotator_alltoall.h> 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 8bccefa95..3f98a003b 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 @@ -91,15 +91,13 @@ gr_keep_one_in_n::general_work (int noutput_items, // Because we have set TPP_DONT, we have to propagate the tags here manually. // Adjustment of the tag sample value is done using the float d_decim_rate. - std::vector<pmt::pmt_t> tags; - std::vector<pmt::pmt_t>::iterator t; + std::vector<gr_tag_t> tags; + std::vector<gr_tag_t>::iterator t; get_tags_in_range(tags, 0, nitems_read(0), nitems_read(0)+ni); for(t = tags.begin(); t != tags.end(); t++) { - uint64_t newcount = pmt::pmt_to_uint64(pmt::pmt_tuple_ref(*t, 0)); - add_item_tag(0, newcount * d_decim_rate, - pmt::pmt_tuple_ref(*t, 1), - pmt::pmt_tuple_ref(*t, 2), - pmt::pmt_tuple_ref(*t, 3)); + gr_tag_t new_tag = *t; + new_tag.offset *= d_decim_rate; + add_item_tag(0, new_tag); } consume_each (ni); |