Class ReadOnlyInterface

Inheritance Relationships

Base Types

Derived Type

Class Documentation

class ReadOnlyInterface : public rosbag2_storage::storage_interfaces::BaseInfoInterface, public rosbag2_storage::storage_interfaces::BaseIOInterface, public rosbag2_storage::storage_interfaces::BaseReadInterface

Subclassed by rosbag2_storage::storage_interfaces::ReadWriteInterface

Public Functions

virtual ~ReadOnlyInterface() = default
virtual void open(const StorageOptions &storage_options, IOFlag io_flag = IOFlag::READ_ONLY) override = 0

Opens the storage plugin.

Parameters:
  • storage_options – contains necessary info such as file uri and storage plugin.

  • io_flag – is a hint for the type of storage plugin to open depending on the io operations requested.

  • config_file_uri – is a path to a storage specific file path. If IOFlag::READ_ONLY is passed, then only read operations are guaranteed. The uri passed should be the exact relative path to the bagfile. If IOFlag::READ_WRITE is passed, then a new bagfile is created with guaranteed read and write operations. The storage plugin will append the uri in the case of creating a new bagfile backing. The storage can load specific configurations by accessing a config file given in the config_file_uri parameter.

virtual uint64_t get_bagfile_size() const override = 0

Returns the size of the bagfile.

Returns:

the size of the bagfile in bytes.

virtual std::string get_storage_identifier() const override = 0

Returns the identifier for the storage plugin.

Returns:

the identifier.

virtual void set_filter(const StorageFilter &storage_filter) = 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 reset_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 seek(const rcutils_time_point_value_t &timestamp) = 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.

Public Static Functions

static inline std::string get_package_name()
static inline std::string get_base_class_name()