79 explicit DatabaseReader(
const std::string& path,
bool read_only =
true,
bool try_to_fix =
false);
156 void jump(int64_t begin_time,
double rate,
int times,
bool force_to_play =
false)
override;
178 std::future<bool>
fix(
bool rebuild =
false)
override;
185 void tag(
const std::string& tag_name)
override;
228 [[nodiscard]] std::string
get_ser_type(
const std::string& url)
const override;
261 void update_status(
Status status);
267 void prepare_file(
void* file);
269 void open(
const std::string& path);
273 int get_reset_index(
const Config& config);
275 void read(
const Config& config);
277 std::unique_ptr<struct DatabaseReaderImpl> impl_;
Abstract base class for VLink bag file playback with time-based seeking and rate control.
BagReader(const std::string &path, bool read_only=true, bool try_to_fix=false)
Constructs the reader for path.
Status
Playback state of the reader.
定义 bag_reader.h:109
std::function< void(bool is_interrupted)> FinishCallback
Callback fired when playback has finished (or was interrupted).
定义 bag_reader.h:225
std::function< void()> ReadyCallback
Callback fired when the reader has opened the file and is ready to start playing.
定义 bag_reader.h:218
std::function< void(Status status)> StatusCallback
Callback fired whenever the playback Status changes.
定义 bag_reader.h:213
std::function< void(int64_t microseconds_timestamp, const std::string &url, ActionType action_type, const Bytes &data)> OutputCallback
Callback type fired for each replayed message.
定义 bag_reader.h:205
void register_output_callback(OutputCallback &&output_callback) override
Registers the callback that receives replayed messages.
const Info & get_info() const override
Returns the bag file metadata and per-URL statistics.
void on_begin() override
Called from the loop thread just before the first task is processed.
void register_ready_callback(ReadyCallback &&ready_callback) override
Registers a callback fired when the reader is ready to start playing.
void on_end() override
Called from the loop thread just after the last task has been processed.
std::string get_ser_type(const std::string &url) const override
Returns the serialisation type string for a given URL.
std::future< bool > reindex() override
Rebuilds the index tables asynchronously.
void register_status_callback(StatusCallback &&status_callback) override
Registers a callback fired whenever the playback status changes.
void jump(int64_t begin_time, double rate, int times, bool force_to_play=false) override
Seeks to begin_time and resumes playback.
std::vector< SchemaData > detect_schema() override
Scans the SQLite bag and returns all embedded schemas.
void play(const Config &config) override
Starts playback with the given configuration.
int64_t get_real_timestamp() const override
Returns the real elapsed wall-clock time since playback started.
DatabaseReader(const std::string &path, bool read_only=true, bool try_to_fix=false)
Constructs a DatabaseReader for the given path.
bool is_split_mode() const override
Returns true if the bag spans multiple split files.
void stop() override
Stops playback and resets the reader to the beginning.
Status get_status() const override
Returns the current playback status.
void register_finish_callback(FinishCallback &&finish_callback) override
Registers a callback fired when playback ends or is interrupted.
std::future< bool > check() override
Verifies the integrity of the SQLite bag file asynchronously.
int64_t get_timestamp() const override
Returns the current playback position as a recording-relative timestamp.
size_t get_max_task_count() const override
Returns the maximum queue depth.
void tag(const std::string &tag_name) override
Updates the tag name stored in the bag metadata.
int get_split_index() const override
Returns the zero-based index of the current split file being read.
std::future< bool > fix(bool rebuild=false) override
Repairs a corrupt SQLite bag file asynchronously.
SchemaType get_schema_type(const std::string &url) const override
Returns the coarse schema family for a given URL.
void resume() override
Resumes a paused playback from the current position.
bool is_jumping() const override
Returns true if a jump-to-timestamp seek is currently in progress.
void pause() override
Pauses playback at the current position.
~DatabaseReader() override
Destructor – stops playback and closes the SQLite database handle.
void pause_to_next() override
Advances one message while paused, then pauses again.
void bind_plugin_interface(const std::shared_ptr< BagReaderPluginInterface > &plugin_interface) override
Attaches a BagReaderPluginInterface for custom URL/type conversion.
#define VLINK_EXPORT
定义 macros.h:85
#define VLINK_DISALLOW_COPY_AND_ASSIGN(classname)
Deletes the copy constructor and copy-assignment operator of classname.
定义 macros.h:184
SchemaType
Coarse runtime schema family used by discovery, bag metadata, and proxy routing.
定义 types.h:184
Playback configuration passed to play().
定义 bag_reader.h:181
Metadata extracted from the bag file header and index.
定义 bag_reader.h:122