discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] Order of tags returned by gr::block::get_tags_in_rang


From: Jon Szymaniak
Subject: [Discuss-gnuradio] Order of tags returned by gr::block::get_tags_in_range()/window()
Date: Wed, 24 Jun 2015 13:06:51 -0400

Hi all,

When calling gr::block::get_tags_in_range() or gr::block::get_tags_in_window(), does the GNU Radio API guarantee that the returned vector will be sorted based upon the tag offsets (from "earliest" to "latest")?

Since the API docs [1] do not explicitly state this to be the case, I would assume the answer is "No."

Additionally, I see the wiki [2] seems to confirm this:
"Any tag that is connected to the first 100 items will be placed into this vector, although not in any specific order."

However, after a cursory review of the underlying buffer_reader::get_tags_in_range() and related functions, I see that the tags are stored in a std::multimap with the offset as the key (thereby sorting entries via the offset).
This map appears to be iterated over from start offset to end offset while inserting tags into the std::vector<gr::tags_t>. Therefore, this should return them ordered, as I desire in this case.

Just curious if anyone could comment on/correct the above observations, as well as elaborate on exactly what the API shall (not) guarantee, regardless of the current implementation.

Thank you,
Jon


[1] https://gnuradio.org/doc/doxygen/classgr_1_1block.html#aa0272555827fe26a1878e53ce4be092c
[2] http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorial_Programming_Topics#522-Tag-offsets-and-noutput_items

reply via email to

[Prev in Thread] Current Thread [Next in Thread]