|
VLink
2.0.0
A high-performance communication middleware
|
Polymorphic contract for runtime schema lookup and dynamic message construction. More...
#include <schema_plugin_interface.h>
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< SchemaData > | get_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 |
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.
| using vlink::SchemaPluginInterface::FlatbuffersParserPtr = void* |
Opaque alias for a flatbuffers::Parser pointer pre-loaded with a root type.
| using vlink::SchemaPluginInterface::FlatbuffersSchemaPtr = void* |
Opaque alias for a reflection::Schema pointer (FlatBuffers BFBS).
| using vlink::SchemaPluginInterface::ProtobufDescriptorPtr = void* |
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.
| using vlink::SchemaPluginInterface::ProtobufMessagePtr = void* |
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.
|
protecteddefault |
|
protectedvirtualdefault |
|
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.
| name | Fully qualified FlatBuffers root type name. |
nullptr when the name is unknown. Implemented in vlink::SchemaPluginBase.
|
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.
| name | Fully qualified Protobuf message name. |
Message pointer, or nullptr when the name is unknown. Implemented in vlink::SchemaPluginBase.
|
pure virtual |
Enumerates every schema known to the plugin, optionally filtered by family.
| schema_type | Family filter, or SchemaType::kUnknown to return all families. |
SchemaData entries owned by the caller. Implemented in vlink::SchemaPluginBase.
|
pure virtual |
Reports the plugin's version and build identity.
VersionInfo describing the loaded plugin binary.
|
pure virtual |
Returns a verified BFBS reflection schema handle for a FlatBuffers root type.
| name | Fully qualified FlatBuffers root type name. |
reflection::Schema pointer, or nullptr when the name is unknown. Implemented in vlink::SchemaPluginBase.
|
pure virtual |
Returns the Protobuf descriptor for a fully qualified message name.
| name | Fully qualified Protobuf message name (e.g. "demo.proto.PointCloud"). |
Descriptor pointer, or nullptr when the name is unknown. Implemented in vlink::SchemaPluginBase.
|
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.
| name | Serialisation type name or fully qualified message name. |
| schema_type | Family hint, or SchemaType::kUnknown for family-agnostic lookup. |
SchemaData on success, or a name-only record on miss. Implemented in vlink::SchemaPluginBase.