Abstract plugin interface for custom bag reading, URL conversion, and message relay.
More...
#include <bag_reader_plugin_interface.h>
|
| 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.
|
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
Initial value:
std::function<void(int64_t timestamp,
const std::string& url,
ActionType action_type,
const Bytes& data)>
Versatile 128-byte byte buffer with SBO, five ownership modes and compression helpers.
Definition bytes.h:113
ActionType
Identifies the type of message action for recording purposes.
Definition types.h:162
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.
- Parameters
-
| url | URL string from the bag index (may be modified). |
| ser_type | Serialisation type string (may be modified). |
| schema_type | Coarse schema family (may be modified). |
- Returns
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.
- Returns
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.
- Parameters
-
| timestamp | Message timestamp in microseconds. |
| url | Topic URL string. |
| action_type | Action type. |
| data | Serialized 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.
- Parameters
-
| output_callback | Callback to store in output_callback_. |
◆ output_callback_
The documentation for this class was generated from the following file: