summaryrefslogtreecommitdiff
path: root/gnuradio-core
diff options
context:
space:
mode:
authorTom Rondeau2010-10-31 17:11:34 -0400
committerTom Rondeau2010-10-31 17:11:34 -0400
commite6dedf7fb1075e22e8ea46c9c8d456ba92f92df1 (patch)
tree44def16e78846985f67632736e9199e1d322613c /gnuradio-core
parente3b866883186ed2fbf125964a7ca3a3a3022675c (diff)
downloadgnuradio-e6dedf7fb1075e22e8ea46c9c8d456ba92f92df1.tar.gz
gnuradio-e6dedf7fb1075e22e8ea46c9c8d456ba92f92df1.tar.bz2
gnuradio-e6dedf7fb1075e22e8ea46c9c8d456ba92f92df1.zip
Adds functional ability to call get_tags_in_range with a specified key.
Diffstat (limited to 'gnuradio-core')
-rw-r--r--gnuradio-core/src/lib/runtime/gr_block_detail.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_block_detail.cc b/gnuradio-core/src/lib/runtime/gr_block_detail.cc
index 6a920f7c0..18f3601fc 100644
--- a/gnuradio-core/src/lib/runtime/gr_block_detail.cc
+++ b/gnuradio-core/src/lib/runtime/gr_block_detail.cc
@@ -191,5 +191,23 @@ gr_block_detail::get_tags_in_range(unsigned int which_output,
std::list<pmt::pmt_t> found_items;
std::list<pmt::pmt_t>::iterator itr = d_item_tags.begin();
+ gr_uint64 item_time;
+ pmt::pmt_t itemkey;
+ while(itr != d_item_tags.end()) {
+ item_time = pmt::pmt_to_uint64(pmt::pmt_tuple_ref(*itr, 0));
+
+ // items are pushed onto list in sequential order; stop if we're past end
+ if(item_time > end) {
+ break;
+ }
+
+ itemkey = pmt::pmt_tuple_ref(*itr, 2);
+ if((item_time > start) && (item_time < end) && (key == itemkey)) {
+ found_items.push_back(*itr);
+ }
+
+ itr++;
+ }
+
return found_items;
}