VLink 2.0.0
A high-performance communication middleware
载入中...
搜索中...
未找到
vlink::McapReader类 参考final

Concrete MCAP-format bag file player. 更多...

#include <mcap_reader.h>

类 vlink::McapReader 继承关系图:
vlink::McapReader 的协作图:

Public 成员函数

 McapReader (const std::string &path, bool read_only=true, bool try_to_fix=false)
 Constructs an McapReader for the given path.
 ~McapReader () override
 Destructor – stops playback and releases the MCAP file handle.
void bind_plugin_interface (const std::shared_ptr< BagReaderPluginInterface > &plugin_interface) override
 Attaches a BagReaderPluginInterface for custom URL/type conversion.
void register_status_callback (StatusCallback &&status_callback) override
 Registers a callback fired whenever the playback status changes.
void register_ready_callback (ReadyCallback &&ready_callback) override
 Registers a callback fired when the reader is ready to start playing.
void register_finish_callback (FinishCallback &&finish_callback) override
 Registers a callback fired when playback ends or is interrupted.
void register_output_callback (OutputCallback &&output_callback) override
 Registers the callback that receives replayed messages.
void play (const Config &config) override
 Starts playback with the given configuration.
void stop () override
 Stops playback and resets the reader to the beginning.
void pause () override
 Pauses playback at the current position.
void resume () override
 Resumes a paused playback from the current position.
void pause_to_next () override
 Advances one message while paused, then pauses again.
void jump (int64_t begin_time, double rate, int times, bool force_to_play=false) override
 Seeks to begin_time and resumes playback.
std::future< bool > check () override
 Verifies the integrity of the MCAP file asynchronously.
std::future< bool > reindex () override
 Rebuilds the index tables asynchronously.
std::future< bool > fix (bool rebuild=false) override
 Repairs a corrupt MCAP file asynchronously.
void tag (const std::string &tag_name) override
 Updates the tag name stored in the bag metadata.
int64_t get_timestamp () const override
 Returns the current playback position as a recording-relative timestamp.
int64_t get_real_timestamp () const override
 Returns the real elapsed wall-clock time since playback started.
Status get_status () const override
 Returns the current playback status.
const Infoget_info () const override
 Returns the bag file metadata and per-URL statistics.
std::vector< SchemaDatadetect_schema () override
 Scans the MCAP file and returns all embedded schemas.
std::string get_ser_type (const std::string &url) const override
 Returns the serialisation type string for a given URL.
SchemaType get_schema_type (const std::string &url) const override
 Returns the coarse schema family for a given URL.
bool is_split_mode () const override
 Returns true if the bag spans multiple split files.
int get_split_index () const override
 Returns the zero-based index of the current split file being read.
bool is_jumping () const override
 Returns true if a jump-to-timestamp seek is currently in progress.

Protected 成员函数

size_t get_max_task_count () const override
 Returns the maximum queue depth.
void on_begin () override
 Called from the loop thread just before the first task is processed.
void on_end () override
 Called from the loop thread just after the last task has been processed.

额外继承的成员函数

 Playback state of the reader. 更多...
 Queue implementation type. 更多...
 Idle strategy controlling CPU and latency trade-offs. 更多...
 Pre-defined task priority levels for kPriorityType loops. 更多...

详细描述

Concrete MCAP-format bag file player.

All virtual methods from BagReader are implemented. Prefer using BagReader::create() for format-agnostic construction.

构造及析构函数说明

◆ McapReader()

vlink::McapReader::McapReader ( const std::string & path,
bool read_only = true,
bool try_to_fix = false )
explicit

Constructs an McapReader for the given path.

参数
pathPath to the .vcap / .vcapx file.
read_onlyOpen in read-only mode.
try_to_fixAttempt repair if the file is corrupt.
这是这个函数的调用关系图:

◆ ~McapReader()

vlink::McapReader::~McapReader ( )
override

Destructor – stops playback and releases the MCAP file handle.

成员函数说明

◆ bind_plugin_interface()

void vlink::McapReader::bind_plugin_interface ( const std::shared_ptr< BagReaderPluginInterface > & plugin_interface)
overridevirtual

Attaches a BagReaderPluginInterface for custom URL/type conversion.

参数
plugin_interfacePlugin to bind. May be nullptr to detach.

重载 vlink::BagReader .

◆ check()

std::future< bool > vlink::McapReader::check ( )
overridevirtual

Verifies the integrity of the MCAP file asynchronously.

返回
std::future<bool> that resolves to true if the file is intact.

实现了 vlink::BagReader.

◆ detect_schema()

std::vector< SchemaData > vlink::McapReader::detect_schema ( )
nodiscardoverridevirtual

Scans the MCAP file and returns all embedded schemas.

返回
Vector of SchemaData descriptors found in the file.

实现了 vlink::BagReader.

◆ fix()

std::future< bool > vlink::McapReader::fix ( bool rebuild = false)
overridevirtual

Repairs a corrupt MCAP file asynchronously.

参数
rebuildIf true, rebuilds the entire index from scratch.
返回
std::future<bool> that resolves to true if repair succeeded.

实现了 vlink::BagReader.

◆ get_info()

const Info & vlink::McapReader::get_info ( ) const
nodiscardoverridevirtual

Returns the bag file metadata and per-URL statistics.

返回
Const reference to the Info struct populated at open time.

实现了 vlink::BagReader.

◆ get_max_task_count()

size_t vlink::McapReader::get_max_task_count ( ) const
overrideprotectedvirtual

Returns the maximum queue depth.

返回
kMaxTaskSize (10000) by default.

重载 vlink::MessageLoop .

◆ get_real_timestamp()

int64_t vlink::McapReader::get_real_timestamp ( ) const
nodiscardoverridevirtual

Returns the real elapsed wall-clock time since playback started.

返回
Elapsed wall-clock time in milliseconds.

实现了 vlink::BagReader.

◆ get_schema_type()

SchemaType vlink::McapReader::get_schema_type ( const std::string & url) const
nodiscardoverridevirtual

Returns the coarse schema family for a given URL.

参数
urlTopic URL to look up.
返回
Schema family, or SchemaType::kUnknown if unavailable.

实现了 vlink::BagReader.

◆ get_ser_type()

std::string vlink::McapReader::get_ser_type ( const std::string & url) const
nodiscardoverridevirtual

Returns the serialisation type string for a given URL.

参数
urlTopic URL to look up.
返回
Serialisation type (e.g., "demo.proto.PointCloud"), or empty if unknown.

实现了 vlink::BagReader.

◆ get_split_index()

int vlink::McapReader::get_split_index ( ) const
nodiscardoverridevirtual

Returns the zero-based index of the current split file being read.

实现了 vlink::BagReader.

◆ get_status()

Status vlink::McapReader::get_status ( ) const
nodiscardoverridevirtual

Returns the current playback status.

返回
One of kStopped, kPaused, or kPlaying.

实现了 vlink::BagReader.

◆ get_timestamp()

int64_t vlink::McapReader::get_timestamp ( ) const
nodiscardoverridevirtual

Returns the current playback position as a recording-relative timestamp.

返回
Current position in milliseconds relative to the recording start.

实现了 vlink::BagReader.

◆ is_jumping()

bool vlink::McapReader::is_jumping ( ) const
nodiscardoverridevirtual

Returns true if a jump-to-timestamp seek is currently in progress.

实现了 vlink::BagReader.

◆ is_split_mode()

bool vlink::McapReader::is_split_mode ( ) const
nodiscardoverridevirtual

Returns true if the bag spans multiple split files.

实现了 vlink::BagReader.

◆ jump()

void vlink::McapReader::jump ( int64_t begin_time,
double rate,
int times,
bool force_to_play = false )
overridevirtual

Seeks to begin_time and resumes playback.

参数
begin_timeSeek target timestamp in milliseconds (relative to recording start).
rateNew playback rate multiplier.
timesNumber of loops after the jump.
force_to_playIf true, forces play state even if currently paused.

实现了 vlink::BagReader.

◆ on_begin()

void vlink::McapReader::on_begin ( )
overrideprotectedvirtual

Called from the loop thread just before the first task is processed.

Override in subclasses to perform per-thread initialisation.

重载 vlink::MessageLoop .

◆ on_end()

void vlink::McapReader::on_end ( )
overrideprotectedvirtual

Called from the loop thread just after the last task has been processed.

Override in subclasses to perform per-thread cleanup.

重载 vlink::MessageLoop .

函数调用图:

◆ pause()

void vlink::McapReader::pause ( )
overridevirtual

Pauses playback at the current position.

实现了 vlink::BagReader.

◆ pause_to_next()

void vlink::McapReader::pause_to_next ( )
overridevirtual

Advances one message while paused, then pauses again.

实现了 vlink::BagReader.

◆ play()

void vlink::McapReader::play ( const Config & config)
overridevirtual

Starts playback with the given configuration.

参数
configPlayback configuration (rate, times, filters, etc.).

实现了 vlink::BagReader.

◆ register_finish_callback()

void vlink::McapReader::register_finish_callback ( FinishCallback && finish_callback)
overridevirtual

Registers a callback fired when playback ends or is interrupted.

参数
finish_callbackCallback receiving the is_interrupted flag.

重载 vlink::BagReader .

◆ register_output_callback()

void vlink::McapReader::register_output_callback ( OutputCallback && output_callback)
overridevirtual

Registers the callback that receives replayed messages.

参数
output_callbackCalled for each message during playback.

重载 vlink::BagReader .

◆ register_ready_callback()

void vlink::McapReader::register_ready_callback ( ReadyCallback && ready_callback)
overridevirtual

Registers a callback fired when the reader is ready to start playing.

参数
ready_callbackCallback invoked once the file is open and parsed.

重载 vlink::BagReader .

◆ register_status_callback()

void vlink::McapReader::register_status_callback ( StatusCallback && status_callback)
overridevirtual

Registers a callback fired whenever the playback status changes.

参数
status_callbackCallback receiving the new Status value.

重载 vlink::BagReader .

◆ reindex()

std::future< bool > vlink::McapReader::reindex ( )
overridevirtual

Rebuilds the index tables asynchronously.

返回
std::future<bool> that resolves to true on success.

实现了 vlink::BagReader.

◆ resume()

void vlink::McapReader::resume ( )
overridevirtual

Resumes a paused playback from the current position.

实现了 vlink::BagReader.

◆ stop()

void vlink::McapReader::stop ( )
overridevirtual

Stops playback and resets the reader to the beginning.

实现了 vlink::BagReader.

◆ tag()

void vlink::McapReader::tag ( const std::string & tag_name)
overridevirtual

Updates the tag name stored in the bag metadata.

参数
tag_nameNew tag name string.

实现了 vlink::BagReader.


该类的文档由以下文件生成: