VLink 2.0.0
A high-performance communication middleware
Loading...
Searching...
No Matches
vlink::BagReaderPluginInterface Class Referenceabstract

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

#include <bag_reader_plugin_interface.h>

Collaboration diagram for vlink::BagReaderPluginInterface:

Classes

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

Public Types

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

Public Member Functions

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 Member Functions

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

Protected Attributes

OutputCallback output_callback_

Detailed Description

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().

Member Typedef Documentation

◆ OutputCallback

Initial value:
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.

Constructor & Destructor Documentation

◆ BagReaderPluginInterface()

vlink::BagReaderPluginInterface::BagReaderPluginInterface ( )
protecteddefault

◆ ~BagReaderPluginInterface()

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

Member Function Documentation

◆ 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
urlURL string from the bag index (may be modified).
ser_typeSerialisation type string (may be modified).
schema_typeCoarse 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
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.

Parameters
output_callbackCallback to store in output_callback_.

Member Data Documentation

◆ output_callback_

OutputCallback vlink::BagReaderPluginInterface::output_callback_
protected

The documentation for this class was generated from the following file: