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

Abstract plugin interface for custom bag reading, URL conversion, and message relay. 更多...

#include <bag_reader_plugin_interface.h>

vlink::BagReaderPluginInterface 的协作图:

struct  VersionInfo
 Plugin version and build metadata returned by get_version_info(). 更多...

Public 类型

using OutputCallback
 Callback type used to forward processed messages to the BagReader output.

Public 成员函数

virtual VersionInfo get_version_info () const =0
 Returns version and build metadata for this plugin.
void register_output_callback (OutputCallback &&output_callback)
 Registers the output callback used to forward messages after processing.
virtual bool convert_url_meta (std::string &url, std::string &ser_type, SchemaType &schema_type)=0
 Called for each URL in the bag to allow remapping of address, serialisation type, and schema family.
virtual void push (int64_t timestamp, const std::string &url, ActionType action_type, const Bytes &data)=0
 Called for each replayed message, allowing interception and transformation.

Protected 成员函数

 BagReaderPluginInterface ()=default
virtual ~BagReaderPluginInterface ()=default

Protected 属性

OutputCallback output_callback_

详细描述

Abstract plugin interface for custom bag reading, URL conversion, and message relay.

Loaded as a dynamic plugin via Plugin::load<BagReaderPluginInterface>(). Bind to a reader with BagReader::bind_plugin_interface().

成员类型定义说明

◆ OutputCallback

初始值:
std::function<void(int64_t timestamp, const std::string& url, ActionType action_type, const Bytes& data)>

Callback type used to forward processed messages to the BagReader output.

Stored in output_callback_. Call this inside push() to forward a message.

构造及析构函数说明

◆ BagReaderPluginInterface()

vlink::BagReaderPluginInterface::BagReaderPluginInterface ( )
protecteddefault

◆ ~BagReaderPluginInterface()

virtual vlink::BagReaderPluginInterface::~BagReaderPluginInterface ( )
protectedvirtualdefault

成员函数说明

◆ convert_url_meta()

virtual bool vlink::BagReaderPluginInterface::convert_url_meta ( std::string & url,
std::string & ser_type,
SchemaType & schema_type )
pure virtual

Called for each URL in the bag to allow remapping of address, serialisation type, and schema family.

Implementations may modify url, ser_type, and/or schema_type in-place. Return true to accept the URL; return false to exclude it from playback.

参数
urlURL string from the bag index (may be modified).
ser_typeSerialisation type string (may be modified).
schema_typeCoarse schema family (may be modified).
返回
true to include this URL in playback; false to exclude it.

◆ get_version_info()

virtual VersionInfo vlink::BagReaderPluginInterface::get_version_info ( ) const
nodiscardpure virtual

Returns version and build metadata for this plugin.

返回
VersionInfo struct with name, version, timestamp, tag, and commit ID.

◆ push()

virtual void vlink::BagReaderPluginInterface::push ( int64_t timestamp,
const std::string & url,
ActionType action_type,
const Bytes & data )
pure virtual

Called for each replayed message, allowing interception and transformation.

Implementations should process the message and call output_callback_ to forward it. Dropping or delaying messages is permitted.

参数
timestampMessage timestamp in microseconds.
urlTopic URL string.
action_typeAction type.
dataSerialized payload bytes.

◆ register_output_callback()

void vlink::BagReaderPluginInterface::register_output_callback ( OutputCallback && output_callback)
inline

Registers the output callback used to forward messages after processing.

Details

Called by BagReader::bind_plugin_interface() to inject its output pipeline. The plugin must call output_callback_ from push() to deliver messages.

参数
output_callbackCallback to store in output_callback_.

类成员变量说明

◆ output_callback_

OutputCallback vlink::BagReaderPluginInterface::output_callback_
protected

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