VLink  2.0.0
A high-performance communication middleware
vlink::SchemaPluginBase Class Reference

Reusable base implementation of SchemaPluginInterface for mixed Protobuf / FlatBuffers metadata. More...

#include <schema_plugin_base.h>

Inheritance diagram for vlink::SchemaPluginBase:
Collaboration diagram for vlink::SchemaPluginBase:

Protected Member Functions

 SchemaPluginBase ()
 Initialises the schema caches and primes the VLink memory pool. More...
 
 ~SchemaPluginBase () override
 Releases cached dynamic messages and FlatBuffers parsers owned by the plugin. More...
 
SchemaData search_schema (const std::string &name, SchemaType schema_type=SchemaType::kUnknown) override
 Locates a schema by name within an optional family. More...
 
std::vector< SchemaDataget_all_schemas (SchemaType schema_type=SchemaType::kUnknown) override
 Returns every cached schema, optionally restricted to a single family. More...
 
ProtobufDescriptorPtr search_protobuf_descriptor (const std::string &name) override
 Returns the Protobuf descriptor for a fully qualified type name. More...
 
ProtobufMessagePtr create_protobuf_message (const std::string &name) override
 Returns a cached dynamic Protobuf message instance for the type. More...
 
FlatbuffersSchemaPtr search_flatbuffers_schema (const std::string &name) override
 Returns a verified FlatBuffers BFBS reflection schema. More...
 
FlatbuffersParserPtr create_flatbuffers_parser (const std::string &name) override
 Returns a freshly constructed FlatBuffers parser for the named root type. More...
 

Additional Inherited Members

Detailed Description

Reusable base implementation of SchemaPluginInterface for mixed Protobuf / FlatBuffers metadata.

Concrete plugins derive from this class and typically only override get_version_info(). The base class is header-only so that linked Protobuf descriptors and registered BFBS blobs remain in the same translation unit as the plugin binary, which is required for the static registries to publish the expected types.

Internal caches are protected by a single mutex; all public methods are safe to call from multiple threads.

Constructor & Destructor Documentation

◆ SchemaPluginBase()

vlink::SchemaPluginBase::SchemaPluginBase ( )
inlineprotected

Initialises the schema caches and primes the VLink memory pool.

Details.

Here is the call graph for this function:

◆ ~SchemaPluginBase()

vlink::SchemaPluginBase::~SchemaPluginBase ( )
inlineoverrideprotected

Releases cached dynamic messages and FlatBuffers parsers owned by the plugin.

Member Function Documentation

◆ create_flatbuffers_parser()

SchemaPluginInterface::FlatbuffersParserPtr vlink::SchemaPluginBase::create_flatbuffers_parser ( const std::string &  name)
inlineoverrideprotectedvirtual

Returns a freshly constructed FlatBuffers parser for the named root type.

Parameters
nameFully qualified FlatBuffers root type name.
Returns
Opaque flatbuffers::Parser pointer, or nullptr when unknown.

Implements vlink::SchemaPluginInterface.

◆ create_protobuf_message()

SchemaPluginInterface::ProtobufMessagePtr vlink::SchemaPluginBase::create_protobuf_message ( const std::string &  name)
inlineoverrideprotectedvirtual

Returns a cached dynamic Protobuf message instance for the type.

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

Implements vlink::SchemaPluginInterface.

◆ get_all_schemas()

std::vector< SchemaData > vlink::SchemaPluginBase::get_all_schemas ( SchemaType  schema_type = SchemaType::kUnknown)
inlineoverrideprotectedvirtual

Returns every cached schema, optionally restricted to a single family.

Parameters
schema_typeFamily filter, or SchemaType::kUnknown for everything.
Returns
Snapshot vector of cached entries.

Implements vlink::SchemaPluginInterface.

◆ search_flatbuffers_schema()

SchemaPluginInterface::FlatbuffersSchemaPtr vlink::SchemaPluginBase::search_flatbuffers_schema ( const std::string &  name)
inlineoverrideprotectedvirtual

Returns a verified FlatBuffers BFBS reflection schema.

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

Implements vlink::SchemaPluginInterface.

Here is the call graph for this function:

◆ search_protobuf_descriptor()

SchemaPluginInterface::ProtobufDescriptorPtr vlink::SchemaPluginBase::search_protobuf_descriptor ( const std::string &  name)
inlineoverrideprotectedvirtual

Returns the Protobuf descriptor for a fully qualified type name.

Parameters
nameFully qualified Protobuf message name.
Returns
Opaque descriptor pointer, or nullptr when unknown.

Implements vlink::SchemaPluginInterface.

◆ search_schema()

SchemaData vlink::SchemaPluginBase::search_schema ( const std::string &  name,
SchemaType  schema_type = SchemaType::kUnknown 
)
inlineoverrideprotectedvirtual

Locates a schema by name within an optional family.

Parameters
nameSerialisation type or fully qualified message name.
schema_typeFamily hint, or SchemaType::kUnknown for cross-family probing.
Returns
Cached or freshly imported SchemaData, or an empty record on miss.

Implements vlink::SchemaPluginInterface.

Here is the call graph for this function:

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