VLink 2.0.0
A high-performance communication middleware
Loading...
Searching...
No Matches
bag_reader_plugin_interface.h File Reference

Plugin interface for custom bag reader URL/type transformation and message processing. More...

#include <cstdint>
#include <functional>
#include <string>
#include <utility>
#include "../base/plugin.h"
#include "../impl/types.h"
Include dependency graph for bag_reader_plugin_interface.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

 Abstract plugin interface for custom bag reading, URL conversion, and message relay. More...
 Plugin version and build metadata returned by get_version_info(). More...

Namespaces

Detailed Description

Plugin interface for custom bag reader URL/type transformation and message processing.

BagReaderPluginInterface is loaded dynamically via the Plugin system and bound to a BagReader instance with BagReader::bind_plugin_interface(). It allows a plugin to:

  1. Remap URLs and serialisation typesconvert_url_meta() is called for every URL found in the bag, enabling renaming or type overriding before playback begins.
  2. Intercept messagespush() receives every replayed message, allowing the plugin to transform, filter, or republish them before forwarding via output_callback_.
Example plugin implementation
class MyPlugin : public vlink::BagReaderPluginInterface {
public:
VersionInfo get_version_info() const override { return {"MyPlugin", "1.0.0", ...}; }
bool convert_url_meta(std::string& url, std::string& ser_type, vlink::SchemaType& schema_type) override {
// Optionally remap url / ser_type / schema_type here
return true;
}
void push(int64_t ts, const std::string& url,
vlink::ActionType action, const vlink::Bytes& data) override {
if (output_callback_) output_callback_(ts, url, action, data);
}
};
#define VLINK_PLUGIN_DECLARE(ImplementType, VersionMajor, VersionMinor)
Declares a plugin creation and destruction interface.
Definition plugin.h:380