Skip to content

Commit

Permalink
added docs to read_only_interface for seek, set_filter & reset_filter
Browse files Browse the repository at this point in the history
  • Loading branch information
lihui815 committed Aug 10, 2021
1 parent 12aac3b commit 9ecd46b
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down

0 comments on commit 9ecd46b

Please sign in to comment.