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

Abstract interface for runtime schema lookup and dynamic object creation. 更多...

#include <schema_plugin_interface.h>

类 vlink::SchemaPluginInterface 继承关系图:
vlink::SchemaPluginInterface 的协作图:

struct  VersionInfo
 Plugin version and build metadata. 更多...

Public 类型

using ProtobufDescriptorPtr = void*
 Opaque pointer type for a google::protobuf::Descriptor.
using ProtobufMessagePtr = void*
 Opaque pointer type for a google::protobuf::Message instance.
using FlatbuffersSchemaPtr = void*
 Opaque pointer type for a FlatBuffers reflection::Schema instance.
using FlatbuffersParserPtr = void*
 Opaque pointer type for a runtime FlatBuffers Parser instance.

Public 成员函数

virtual VersionInfo get_version_info () const =0
 Returns version and build metadata for this plugin.
virtual SchemaData search_schema (const std::string &name, SchemaType schema_type=SchemaType::kUnknown)=0
 Finds one schema constrained by schema family.
virtual std::vector< SchemaDataget_all_schemas (SchemaType schema_type=SchemaType::kUnknown)=0
 Returns all imported or cached schemas filtered by schema family.
virtual ProtobufDescriptorPtr search_protobuf_descriptor (const std::string &name)=0
 Looks up a Protobuf descriptor by fully-qualified message name.
virtual ProtobufMessagePtr create_protobuf_message (const std::string &name)=0
 Creates a Protobuf dynamic message prototype for the named type.
virtual FlatbuffersSchemaPtr search_flatbuffers_schema (const std::string &name)=0
 Looks up a FlatBuffers binary-schema reflection handle by type name.
virtual FlatbuffersParserPtr create_flatbuffers_parser (const std::string &name)=0
 Creates a FlatBuffers parser preloaded with the named schema.

Protected 成员函数

 SchemaPluginInterface ()=default
virtual ~SchemaPluginInterface ()=default

详细描述

Abstract interface for runtime schema lookup and dynamic object creation.

Loaded as a dynamic plugin via Plugin::load<SchemaPluginInterface>(). SchemaPluginManager provides a convenient singleton accessor.

The interface intentionally exposes both generic schema APIs and encoding-specific runtime hooks:

  • Generic APIs such as search_schema() and get_all_schemas() are used by bag/database/MCAP embedding logic.
  • Protobuf-specific hooks are consumed by cli/eproto and webviz protobuf decoders.
  • FlatBuffers-specific hooks are consumed by cli/efbs and runtime BFBS-based decoders.

成员类型定义说明

◆ FlatbuffersParserPtr

Opaque pointer type for a runtime FlatBuffers Parser instance.

Callers may cast this to flatbuffers::Parser* when FlatBuffers headers are available.

◆ FlatbuffersSchemaPtr

Opaque pointer type for a FlatBuffers reflection::Schema instance.

Callers that include FlatBuffers reflection headers may cast this to reflection::Schema* directly.

◆ ProtobufDescriptorPtr

Opaque pointer type for a google::protobuf::Descriptor.

Callers that know the concrete plugin implementation may cast this to google::protobuf::Descriptor* directly.

◆ ProtobufMessagePtr

Opaque pointer type for a google::protobuf::Message instance.

Callers may cast this to google::protobuf::Message* for dynamic access.

构造及析构函数说明

◆ SchemaPluginInterface()

vlink::SchemaPluginInterface::SchemaPluginInterface ( )
protecteddefault
这是这个函数的调用关系图:

◆ ~SchemaPluginInterface()

virtual vlink::SchemaPluginInterface::~SchemaPluginInterface ( )
protectedvirtualdefault

成员函数说明

◆ create_flatbuffers_parser()

virtual FlatbuffersParserPtr vlink::SchemaPluginInterface::create_flatbuffers_parser ( const std::string & name)
nodiscardpure virtual

Creates a FlatBuffers parser preloaded with the named schema.

The returned parser is backed by the plugin lifetime and already contains the BFBS schema plus the requested root type. For non-FlatBuffers types this returns nullptr.

参数
nameFully-qualified FlatBuffers root type name.
返回
Opaque runtime parser handle, or nullptr if not found.

vlink::SchemaPluginBase 内被实现.

函数调用图:

◆ create_protobuf_message()

virtual ProtobufMessagePtr vlink::SchemaPluginInterface::create_protobuf_message ( const std::string & name)
nodiscardpure virtual

Creates a Protobuf dynamic message prototype for the named type.

For non-Protobuf types this returns nullptr.

参数
nameFully-qualified Protobuf message type name.
返回
Opaque Message pointer, or nullptr if not found.

vlink::SchemaPluginBase 内被实现.

◆ get_all_schemas()

virtual std::vector< SchemaData > vlink::SchemaPluginInterface::get_all_schemas ( SchemaType schema_type = SchemaType::kUnknown)
nodiscardpure virtual

Returns all imported or cached schemas filtered by schema family.

参数
schema_typeSchema family to filter on; SchemaType::kUnknown returns every cached schema.
返回
List of schemas belonging to schema_type.

vlink::SchemaPluginBase 内被实现.

◆ get_version_info()

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

Returns version and build metadata for this plugin.

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

◆ search_flatbuffers_schema()

virtual FlatbuffersSchemaPtr vlink::SchemaPluginInterface::search_flatbuffers_schema ( const std::string & name)
nodiscardpure virtual

Looks up a FlatBuffers binary-schema reflection handle by type name.

The returned handle points at the BFBS-backed reflection::Schema for the requested root type. For non-FlatBuffers types this returns nullptr.

参数
nameFully-qualified FlatBuffers root type name.
返回
Opaque BFBS reflection schema handle, or nullptr if not found.

vlink::SchemaPluginBase 内被实现.

◆ search_protobuf_descriptor()

virtual ProtobufDescriptorPtr vlink::SchemaPluginInterface::search_protobuf_descriptor ( const std::string & name)
nodiscardpure virtual

Looks up a Protobuf descriptor by fully-qualified message name.

For non-Protobuf types this returns nullptr.

参数
nameFully-qualified Protobuf message type name.
返回
Opaque Descriptor pointer, or nullptr if not found.

vlink::SchemaPluginBase 内被实现.

◆ search_schema()

virtual SchemaData vlink::SchemaPluginInterface::search_schema ( const std::string & name,
SchemaType schema_type = SchemaType::kUnknown )
nodiscardpure virtual

Finds one schema constrained by schema family.

Callers that already know the expected schema family (for example derived from compile-time traits or discovery metadata) should supply schema_type to skip family-agnostic probing. Passing SchemaType::kUnknown still performs a best-effort lookup across every registered family.

参数
nameSerialization type / message type name.
schema_typeCoarse schema family hint, or SchemaType::kUnknown for family-agnostic lookup.
返回
Matching SchemaData, or an empty schema when not found.

vlink::SchemaPluginBase 内被实现.


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