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

Default mixed-schema plugin base class for Protobuf and FlatBuffers. More...

#include <schema_plugin_base.h>

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

Protected Member Functions

 SchemaPluginBase ()
 Constructs the base plugin and initialises the VLink memory pool.
 ~SchemaPluginBase () override
 Destroys cached runtime objects owned by the plugin.
SchemaData search_schema (const std::string &name, SchemaType schema_type=SchemaType::kUnknown) override
 Finds one schema blob constrained by schema family.
std::vector< SchemaDataget_all_schemas (SchemaType schema_type=SchemaType::kUnknown) override
 Returns all cached schemas filtered by schema family.
ProtobufDescriptorPtr search_protobuf_descriptor (const std::string &name) override
 Looks up a Protobuf descriptor by fully-qualified type name.
ProtobufMessagePtr create_protobuf_message (const std::string &name) override
 Creates a cached Protobuf dynamic message prototype for a type.
FlatbuffersSchemaPtr search_flatbuffers_schema (const std::string &name) override
 Finds the BFBS reflection schema for a FlatBuffers root type.
FlatbuffersParserPtr create_flatbuffers_parser (const std::string &name) override
 Creates a FlatBuffers parser preloaded with the named root type.

Additional Inherited Members

Detailed Description

Default mixed-schema plugin base class for Protobuf and FlatBuffers.

The intended usage model is:

  1. Protobuf types are already linked into the same plugin/library, so lookups go straight to the generated descriptor pool.
  2. FlatBuffers BFBS blobs are generated at build time and explicitly registered into the static registry owned by the current plugin/library.

This keeps protobuf behaviour compatible with the previous protobuf-only runtime implementation while filling the missing FlatBuffers reflection and parser hooks.

Constructor & Destructor Documentation

◆ SchemaPluginBase()

vlink::SchemaPluginBase::SchemaPluginBase ( )
inlineprotected

Constructs the base plugin and initialises the VLink memory pool.

Details.

Here is the call graph for this function:

◆ ~SchemaPluginBase()

vlink::SchemaPluginBase::~SchemaPluginBase ( )
inlineoverrideprotected

Destroys cached runtime objects owned by the plugin.

Member Function Documentation

◆ create_flatbuffers_parser()

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

Creates a FlatBuffers parser preloaded with the named root type.

Parameters
nameFully-qualified FlatBuffers root type.
Returns
Opaque flatbuffers::Parser handle, or nullptr if not found.

Implements vlink::SchemaPluginInterface.

◆ create_protobuf_message()

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

Creates a cached Protobuf dynamic message prototype for a type.

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

Implements vlink::SchemaPluginInterface.

◆ get_all_schemas()

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

Returns all cached schemas filtered by schema family.

Parameters
schema_typeSchema family to filter on; SchemaType::kUnknown returns all.
Returns
Vector of cached schemas belonging to schema_type.

Implements vlink::SchemaPluginInterface.

◆ search_flatbuffers_schema()

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

Finds the BFBS reflection schema for a FlatBuffers root type.

Parameters
nameFully-qualified FlatBuffers root type.
Returns
Opaque reflection::Schema handle, or nullptr if not found.

Implements vlink::SchemaPluginInterface.

◆ search_protobuf_descriptor()

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

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

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

Implements vlink::SchemaPluginInterface.

◆ search_schema()

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

Finds one schema blob constrained by schema family.

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

Implements vlink::SchemaPluginInterface.

Here is the call graph for this function:

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