VLink 2.0.0
A high-performance communication middleware
载入中...
搜索中...
未找到
bag_reader_plugin_interface.h 文件参考

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

#include <cstdint>
#include <functional>
#include <string>
#include <utility>
#include "../base/plugin.h"
#include "../impl/types.h"
bag_reader_plugin_interface.h 的引用(Include)关系图:
此图展示该文件被哪些文件直接或间接地引用了:

浏览该文件的源代码.

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

命名空间

详细描述

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.
定义 plugin.h:380