summaryrefslogtreecommitdiff
path: root/gnuradio-core
diff options
context:
space:
mode:
authorTom Rondeau2010-11-06 13:03:28 -0400
committerTom Rondeau2010-11-06 13:03:28 -0400
commitd58d250c82ff8b106aec02f5222cea385b74d729 (patch)
tree6bb77b6fed8bfb064f8ec0425674451916dc506e /gnuradio-core
parentbf079e66e50f4aff775175c288e952b6325ea71c (diff)
downloadgnuradio-d58d250c82ff8b106aec02f5222cea385b74d729.tar.gz
gnuradio-d58d250c82ff8b106aec02f5222cea385b74d729.tar.bz2
gnuradio-d58d250c82ff8b106aec02f5222cea385b74d729.zip
buffer_reader does not hold its own tags but looks upstream to the associated buffer to get them.
Diffstat (limited to 'gnuradio-core')
-rw-r--r--gnuradio-core/src/lib/runtime/gr_buffer.cc4
-rw-r--r--gnuradio-core/src/lib/runtime/gr_buffer.h6
2 files changed, 6 insertions, 4 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_buffer.cc b/gnuradio-core/src/lib/runtime/gr_buffer.cc
index 58cffe495..9048d57a4 100644
--- a/gnuradio-core/src/lib/runtime/gr_buffer.cc
+++ b/gnuradio-core/src/lib/runtime/gr_buffer.cc
@@ -268,10 +268,10 @@ gr_buffer_reader::get_tags_in_range(gr_uint64 abs_start,
gr_uint64 abs_end)
{
std::deque<pmt::pmt_t> found_items;
- std::deque<pmt::pmt_t>::iterator itr = d_item_tags.begin();
+ std::deque<pmt::pmt_t>::iterator itr = d_buffer->get_tags_begin();
gr_uint64 item_time;
- while(itr != d_item_tags.end()) {
+ while(itr != d_buffer->get_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
diff --git a/gnuradio-core/src/lib/runtime/gr_buffer.h b/gnuradio-core/src/lib/runtime/gr_buffer.h
index 6498ee296..8174b7e67 100644
--- a/gnuradio-core/src/lib/runtime/gr_buffer.h
+++ b/gnuradio-core/src/lib/runtime/gr_buffer.h
@@ -104,6 +104,9 @@ class gr_buffer {
*/
void add_item_tag(const pmt::pmt_t &tag);
+ std::deque<pmt::pmt_t>::iterator get_tags_begin() { return d_item_tags.begin(); }
+ std::deque<pmt::pmt_t>::iterator get_tags_end() { return d_item_tags.end(); }
+
// -------------------------------------------------------------------------
private:
@@ -121,7 +124,7 @@ class gr_buffer {
std::vector<gr_buffer_reader *> d_readers;
boost::weak_ptr<gr_block> d_link; // block that writes to this buffer
- std::deque<pmt::pmt_t> d_item_tags;
+ std::deque<pmt::pmt_t> d_item_tags; // temp. store tags until moved to reader
//
// The mutex protects d_write_index, d_abs_write_offset, d_done and the d_read_index's
@@ -276,7 +279,6 @@ class gr_buffer_reader {
unsigned int d_read_index; // in items [0,d->buffer.d_bufsize)
gr_uint64 d_abs_read_offset; // num items seen since the start
boost::weak_ptr<gr_block> d_link; // block that reads via this buffer reader
- std::deque<pmt::pmt_t> d_item_tags;
//! constructor is private. Use gr_buffer::add_reader to create instances
gr_buffer_reader (gr_buffer_sptr buffer, unsigned int read_index, gr_block_sptr link);