|
VLink
2.0.0
A high-performance communication middleware
|
Wire-format-neutral wrapper around one serialised schema blob. More...
#include <types.h>
Static Public Member Functions | |
| static bool | is_valid_type (SchemaType schema_type) noexcept |
Returns whether schema_type is within the supported enum range. More... | |
| static bool | is_real_type (SchemaType schema_type) noexcept |
Returns whether schema_type carries concrete schema metadata. More... | |
| static std::string_view | convert_type (SchemaType schema_type) noexcept |
| Converts a schema type to its canonical persisted encoding label. More... | |
| static SchemaType | convert_encoding (std::string_view encoding) noexcept |
Parses an encoding string back into a SchemaType value. More... | |
| static constexpr SchemaType | infer_ser_type (std::string_view ser_type) noexcept |
Infers a coarse schema family from a concrete ser_type string. More... | |
| 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. More... | |
Public Attributes | |
| std::string | name |
| Schema subject (usually a fully qualified message or table name). More... | |
| std::string | encoding |
Schema encoding identifier, e.g. "protobuf" or "flatbuffers". More... | |
| SchemaType | schema_type {SchemaType::kUnknown} |
Coarse runtime family derived from encoding. More... | |
| Bytes | data |
| Raw serialised schema bytes (FileDescriptorSet, BFBS, ...). More... | |
Wire-format-neutral wrapper around one serialised schema blob.
Consumed by schema-aware tooling such as bag readers, MCAP writers and schema plugins. encoding stores the original schema payload encoding (for example "protobuf", "flatbuffers" or "vlink_msg"); the schema_type field exposes the coarse runtime family used by discovery, bag routing and proxy consumers.
|
staticnoexcept |
Parses an encoding string back into a SchemaType value.
| encoding | Encoding label such as "protobuf", "fbs", "blob" or "zerocopy". |
SchemaType, or SchemaType::kUnknown.
|
staticnoexcept |
Converts a schema type to its canonical persisted encoding label.
| schema_type | Value to convert. |
|
staticconstexprnoexcept |
Infers a coarse schema family from a concrete ser_type string.
Details.
Intentionally conservative:
"vlink::zerocopy::" prefix.SchemaType::kRaw.| ser_type | Concrete serialisation type string. |
SchemaType::kUnknown.
|
staticnoexcept |
Returns whether schema_type carries concrete schema metadata.
Unlike is_valid_type(), excludes kUnknown and kRaw. Used by schema caching / bag embedding code to decide whether the schema can be indexed or persisted as a real schema entry.
| schema_type | Value to classify. |
true for protobuf, flatbuffers and zero-copy families.
|
staticnoexcept |
Returns whether schema_type is within the supported enum range.
| schema_type | Value to validate. |
true when schema_type names a defined enum member.
|
staticnoexcept |
Resolves the best available schema family from explicit, encoding and ser hints.
Resolution order:
schema_type when it is already known.encoding.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 serialised schema bytes (FileDescriptorSet, BFBS, ...).
| std::string vlink::SchemaData::encoding |
Schema encoding identifier, e.g. "protobuf" or "flatbuffers".
| std::string vlink::SchemaData::name |
Schema subject (usually a fully qualified message or table name).
| SchemaType vlink::SchemaData::schema_type {SchemaType::kUnknown} |
Coarse runtime family derived from encoding.