|
VLink 2.0.0
A high-performance communication middleware
|
Carries one serialized schema blob for runtime registration or embedding. 更多...
#include <types.h>
静态 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.
|
staticnodiscardnoexcept |
Parses a schema type from an encoding label.
| encoding | Encoding string such as "protobuf", "fbs", "blob", or "zerocopy". |
SchemaType::kUnknown.
|
staticnodiscardnoexcept |
Converts a schema type to its canonical persisted encoding label.
| schema_type | Schema type to convert. |
|
staticnodiscardconstexprnoexcept |
Infers a coarse schema family directly from a concrete ser_type string.
Details
This lightweight constexpr helper is intentionally conservative:
"vlink::zerocopy::" prefixSchemaType::kRaw | ser_type | Concrete serialisation type string. |
SchemaType::kUnknown.
|
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_type | Schema type value to classify. |
true for protobuf / flatbuffers / zerocopy families.
|
staticnodiscardnoexcept |
Returns whether a schema type enum value is within the supported range.
| schema_type | Schema type value to validate. |
true when schema_type is a supported enum member.
|
staticnodiscardnoexcept |
Resolves the best available schema family from explicit, encoding and ser hints.
Resolution order is:
schema_type when already knownencoding ser_type | schema_type | Explicit schema family hint. |
| ser_type | Concrete serialisation type string. |
| encoding | Persisted schema encoding label. |
SchemaType::kUnknown. | Bytes vlink::SchemaData::data |
Raw serialized schema bytes (e.g. FileDescriptorSet or BFBS).
| std::string vlink::SchemaData::encoding |
Schema encoding identifier (e.g. "protobuf" or "flatbuffers").
| std::string vlink::SchemaData::name |
Schema subject name, typically a fully-qualified message or table type.
| SchemaType vlink::SchemaData::schema_type {SchemaType::kUnknown} |
Coarse runtime schema family derived from encoding.