From 9ecd46b7cdc783fb5820923f216d6c1c5798f050 Mon Sep 17 00:00:00 2001 From: Sonia Jin Date: Tue, 10 Aug 2021 12:18:58 -0400 Subject: [PATCH] added docs to read_only_interface for seek, set_filter & reset_filter --- .../read_only_interface.hpp | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/rosbag2_storage/include/rosbag2_storage/storage_interfaces/read_only_interface.hpp b/rosbag2_storage/include/rosbag2_storage/storage_interfaces/read_only_interface.hpp index 7b61d05382..c158eb6b27 100644 --- a/rosbag2_storage/include/rosbag2_storage/storage_interfaces/read_only_interface.hpp +++ b/rosbag2_storage/include/rosbag2_storage/storage_interfaces/read_only_interface.hpp @@ -44,10 +44,36 @@ class ROSBAG2_STORAGE_PUBLIC ReadOnlyInterface std::string get_storage_identifier() const override = 0; + /** + Sets filters on messages. This occurs in place, meaning that messages satisfying + the filter that were already read before applying the filter will not be re-read + by read_next() unless seek(t) is also called to an earlier timestamp t. + */ virtual void set_filter(const StorageFilter & storage_filter) = 0; + /** + Removes any previously set storage filter. This occurs in place, meaning that + after a reset, read_next() will not return either previously read or unread + messages that occur before the timestamp of the last-read message. + */ virtual void reset_filter() = 0; + /** + Seeks to a given timestamp. Running read_next() after seek(t) + will return a message that is equal to or after time t. Running read_next() + repeatedly until the end of the storage should return all messages equal to + or after time t. + + If a filter has been previously set, it will persist, meaning + that the next message returned will need to both satisfy the filter, + and satisfy the seek time requirement. + + seek(t) can jump forward or backward in time. If t is earlier than the + first message message timestamp that satisfies the storage filter, then read_next() + will return that first message. If t is later than the last message timestamp, then + read_next() will behave as if the end of the file has been reached, and has_next() + will return false. + */ virtual void seek(const rcutils_time_point_value_t & timestamp) = 0; };