VLink  2.0.0
A high-performance communication middleware
vlink::SchemaPluginInterface Class Referenceabstract

Polymorphic contract for runtime schema lookup and dynamic message construction. More...

#include <schema_plugin_interface.h>

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

Classes

struct  VersionInfo
 Build provenance reported by a concrete plugin implementation. More...
 

Public Types

using ProtobufDescriptorPtr = void *
 Opaque alias for a google::protobuf::Descriptor pointer. More...
 
using ProtobufMessagePtr = void *
 Opaque alias for a google::protobuf::Message pointer. More...
 
using FlatbuffersSchemaPtr = void *
 Opaque alias for a reflection::Schema pointer (FlatBuffers BFBS). More...
 
using FlatbuffersParserPtr = void *
 Opaque alias for a flatbuffers::Parser pointer pre-loaded with a root type. More...
 

Public Member Functions

virtual VersionInfo get_version_info () const =0
 Reports the plugin's version and build identity. More...
 
virtual SchemaData search_schema (const std::string &name, SchemaType schema_type=SchemaType::kUnknown)=0
 Resolves a single schema record by name, optionally restricted to one family. More...
 
virtual std::vector< SchemaDataget_all_schemas (SchemaType schema_type=SchemaType::kUnknown)=0
 Enumerates every schema known to the plugin, optionally filtered by family. More...
 
virtual ProtobufDescriptorPtr search_protobuf_descriptor (const std::string &name)=0
 Returns the Protobuf descriptor for a fully qualified message name. More...
 
virtual ProtobufMessagePtr create_protobuf_message (const std::string &name)=0
 Returns a cached dynamic Message instance for the given Protobuf type. More...
 
virtual FlatbuffersSchemaPtr search_flatbuffers_schema (const std::string &name)=0
 Returns a verified BFBS reflection schema handle for a FlatBuffers root type. More...
 
virtual FlatbuffersParserPtr create_flatbuffers_parser (const std::string &name)=0
 Returns a freshly built flatbuffers::Parser pre-loaded with the requested root. More...
 

Protected Member Functions

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

Detailed Description

Polymorphic contract for runtime schema lookup and dynamic message construction.

Instances are obtained through Plugin::load<SchemaPluginInterface>() or, more commonly, via the SchemaPluginManager singleton. Opaque void* aliases keep the contract free of Protobuf and FlatBuffers headers so that downstream binaries that do not link those libraries can still consume the interface; callers that statically link the matching library are expected to reinterpret_cast back to the concrete pointer type.

Member Typedef Documentation

◆ FlatbuffersParserPtr

Opaque alias for a flatbuffers::Parser pointer pre-loaded with a root type.

◆ FlatbuffersSchemaPtr

Opaque alias for a reflection::Schema pointer (FlatBuffers BFBS).

◆ ProtobufDescriptorPtr

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

Callers that statically link Protobuf may cast this back to google::protobuf::Descriptor* and use the full reflection API.

◆ ProtobufMessagePtr

Opaque alias for a google::protobuf::Message pointer.

The lifetime of the underlying message is owned by the plugin; callers must not delete the returned pointer.

Constructor & Destructor Documentation

◆ SchemaPluginInterface()

vlink::SchemaPluginInterface::SchemaPluginInterface ( )
protecteddefault

◆ ~SchemaPluginInterface()

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

Member Function Documentation

◆ create_flatbuffers_parser()

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

Returns a freshly built flatbuffers::Parser pre-loaded with the requested root.

Each successful call returns a distinct parser instance whose lifetime is owned by the plugin. This avoids cross-thread parser reuse, which is unsafe.

Parameters
nameFully qualified FlatBuffers root type name.
Returns
Opaque parser pointer, or nullptr when the name is unknown.

Implemented in vlink::SchemaPluginBase.

◆ create_protobuf_message()

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

Returns a cached dynamic Message instance for the given Protobuf type.

The instance is owned by the plugin; callers may copy from it but must not delete it.

Parameters
nameFully qualified Protobuf message name.
Returns
Opaque Message pointer, or nullptr when the name is unknown.

Implemented in vlink::SchemaPluginBase.

◆ get_all_schemas()

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

Enumerates every schema known to the plugin, optionally filtered by family.

Parameters
schema_typeFamily filter, or SchemaType::kUnknown to return all families.
Returns
Snapshot vector of SchemaData entries owned by the caller.

Implemented in vlink::SchemaPluginBase.

◆ get_version_info()

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

Reports the plugin's version and build identity.

Returns
Populated VersionInfo describing the loaded plugin binary.

◆ search_flatbuffers_schema()

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

Returns a verified BFBS reflection schema handle for a FlatBuffers root type.

Parameters
nameFully qualified FlatBuffers root type name.
Returns
Opaque reflection::Schema pointer, or nullptr when the name is unknown.

Implemented in vlink::SchemaPluginBase.

◆ search_protobuf_descriptor()

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

Returns the Protobuf descriptor for a fully qualified message name.

Parameters
nameFully qualified Protobuf message name (e.g. "demo.proto.PointCloud").
Returns
Opaque Descriptor pointer, or nullptr when the name is unknown.

Implemented in vlink::SchemaPluginBase.

◆ search_schema()

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

Resolves a single schema record by name, optionally restricted to one family.

When schema_type is SchemaType::kUnknown the plugin probes every supported family and returns the unique match; ambiguous names yield an empty record. Supplying a concrete SchemaType selects the matching backend directly and skips the probing.

Parameters
nameSerialisation type name or fully qualified message name.
schema_typeFamily hint, or SchemaType::kUnknown for family-agnostic lookup.
Returns
Matching SchemaData on success, or a name-only record on miss.

Implemented in vlink::SchemaPluginBase.


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