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

Abstract interface for runtime schema lookup and dynamic object creation. More...

#include <schema_plugin_interface.h>

Inheritance diagram for vlink::SchemaPluginInterface:
Collaboration diagram for vlink::SchemaPluginInterface:

Classes

struct  VersionInfo
 Plugin version and build metadata. More...

Public Types

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

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

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

Detailed Description

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.

Member Typedef Documentation

◆ 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.

Constructor & Destructor Documentation

◆ SchemaPluginInterface()

vlink::SchemaPluginInterface::SchemaPluginInterface ( )
protecteddefault
Here is the caller graph for this function:

◆ ~SchemaPluginInterface()

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

Member Function Documentation

◆ 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.

Parameters
nameFully-qualified FlatBuffers root type name.
Returns
Opaque runtime parser handle, or nullptr if not found.

Implemented in vlink::SchemaPluginBase.

Here is the call graph for this function:

◆ 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.

Parameters
nameFully-qualified Protobuf message type name.
Returns
Opaque Message pointer, or nullptr if not found.

Implemented in 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.

Parameters
schema_typeSchema family to filter on; SchemaType::kUnknown returns every cached schema.
Returns
List of schemas belonging to schema_type.

Implemented in vlink::SchemaPluginBase.

◆ get_version_info()

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

Returns version and build metadata for this plugin.

Returns
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.

Parameters
nameFully-qualified FlatBuffers root type name.
Returns
Opaque BFBS reflection schema handle, or nullptr if not found.

Implemented in 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.

Parameters
nameFully-qualified Protobuf message type name.
Returns
Opaque Descriptor pointer, or nullptr if not found.

Implemented in 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.

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

Implemented in vlink::SchemaPluginBase.


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