VLink 2.0.0
A high-performance communication middleware
载入中...
搜索中...
未找到
vlink::SchemaData结构体 参考final

Carries one serialized schema blob for runtime registration or embedding. 更多...

#include <types.h>

vlink::SchemaData 的协作图:

静态 Public 成员函数

static bool is_valid_type (SchemaType schema_type) noexcept
 Returns whether a schema type enum value is within the supported range.
static bool is_real_type (SchemaType schema_type) noexcept
 Returns whether a schema type carries concrete runtime schema metadata.
static std::string_view convert_type (SchemaType schema_type) noexcept
 Converts a schema type to its canonical persisted encoding label.
static SchemaType convert_encoding (std::string_view encoding) noexcept
 Parses a schema type from an encoding label.
static constexpr SchemaType infer_ser_type (std::string_view ser_type) noexcept
 Infers a coarse schema family directly from a concrete ser_type string.
static SchemaType resolve_type (SchemaType schema_type, std::string_view ser_type={}, std::string_view encoding={}) noexcept
 Resolves the best available schema family from explicit, encoding and ser hints.

Public 属性

std::string name
 Schema subject name, typically a fully-qualified message or table type.
std::string encoding
 Schema encoding identifier (e.g. "protobuf" or "flatbuffers").
SchemaType schema_type {SchemaType::kUnknown}
 Coarse runtime schema family derived from encoding.
Bytes data
 Raw serialized schema bytes (e.g. FileDescriptorSet or BFBS).

详细描述

Carries one serialized schema blob for runtime registration or embedding.

Used by schema-aware tools such as bag readers, MCAP writers, and schema plugins to move imported schema metadata around without assuming a specific schema language. The encoding field stores the original schema payload encoding (for example "protobuf", "flatbuffers", or "vlink_msg"), while schema_type captures the coarse runtime family used by discovery, bag routing, and proxy consumers.

成员函数说明

◆ convert_encoding()

SchemaType vlink::SchemaData::convert_encoding ( std::string_view encoding)
staticnodiscardnoexcept

Parses a schema type from an encoding label.

参数
encodingEncoding string such as "protobuf", "fbs", "blob", or "zerocopy".
返回
Matching schema type, or SchemaType::kUnknown.
函数调用图:

◆ convert_type()

std::string_view vlink::SchemaData::convert_type ( SchemaType schema_type)
staticnodiscardnoexcept

Converts a schema type to its canonical persisted encoding label.

参数
schema_typeSchema type to convert.
返回
Canonical encoding string, or an empty view for unknown values.

◆ infer_ser_type()

SchemaType vlink::SchemaData::infer_ser_type ( std::string_view ser_type)
staticnodiscardconstexprnoexcept

Infers a coarse schema family directly from a concrete ser_type string.

Details

This lightweight constexpr helper is intentionally conservative:

  • zero-copy types are recognised by the "vlink::zerocopy::" prefix
  • textual/raw payload types map to SchemaType::kRaw
  • protobuf / flatbuffers are not guessed from names here
参数
ser_typeConcrete serialisation type string.
返回
Matching schema family, or SchemaType::kUnknown.
函数调用图:
这是这个函数的调用关系图:

◆ is_real_type()

bool vlink::SchemaData::is_real_type ( SchemaType schema_type)
staticnodiscardnoexcept

Returns whether a schema type carries concrete runtime schema metadata.

Unlike is_valid_type(), this excludes kUnknown and kRaw. It is used by schema caching / bag embedding code to decide whether a schema can be indexed or persisted as a real schema entry.

参数
schema_typeSchema type value to classify.
返回
true for protobuf / flatbuffers / zerocopy families.

◆ is_valid_type()

bool vlink::SchemaData::is_valid_type ( SchemaType schema_type)
staticnodiscardnoexcept

Returns whether a schema type enum value is within the supported range.

参数
schema_typeSchema type value to validate.
返回
true when schema_type is a supported enum member.

◆ resolve_type()

SchemaType vlink::SchemaData::resolve_type ( SchemaType schema_type,
std::string_view ser_type = {},
std::string_view encoding = {} )
staticnodiscardnoexcept

Resolves the best available schema family from explicit, encoding and ser hints.

Resolution order is:

  1. explicit schema_type when already known
  2. inferred family from encoding
  3. inferred family from ser_type
参数
schema_typeExplicit schema family hint.
ser_typeConcrete serialisation type string.
encodingPersisted schema encoding label.
返回
Best-effort resolved schema family, or SchemaType::kUnknown.

类成员变量说明

◆ data

Bytes vlink::SchemaData::data

Raw serialized schema bytes (e.g. FileDescriptorSet or BFBS).

◆ encoding

std::string vlink::SchemaData::encoding

Schema encoding identifier (e.g. "protobuf" or "flatbuffers").

◆ name

std::string vlink::SchemaData::name

Schema subject name, typically a fully-qualified message or table type.

◆ schema_type

SchemaType vlink::SchemaData::schema_type {SchemaType::kUnknown}

Coarse runtime schema family derived from encoding.


该结构体的文档由以下文件生成: