|
VLink 2.0.0
A high-performance communication middleware
|
Compile-time type-detection and serialisation utilities for VLink messages. More...
#include <string>#include "./base/bytes.h"#include "./impl/types.h"#include "./internal/serializer-inl.h"Go to the source code of this file.
Namespaces | |
| namespace | vlink |
| namespace | Serializer |
| Compile-time type detection and codec dispatch for VLink messages. | |
| namespace | vlink::Serializer |
Enumerations | |
| enum | vlink::Serializer::Type : uint8_t { vlink::Serializer::kUnknownType = 0 , vlink::Serializer::kBytesType = 1 , vlink::Serializer::kDynamicType = 2 , vlink::Serializer::kCustomType = 3 , vlink::Serializer::kCdrType = 4 , vlink::Serializer::kProtoType = 5 , vlink::Serializer::kProtoPtrType = 6 , vlink::Serializer::kFlatTableType = 7 , vlink::Serializer::kFlatPtrType = 8 , vlink::Serializer::kFlatBuilderType = 9 , vlink::Serializer::kStringType = 10 , vlink::Serializer::kCharsType = 11 , vlink::Serializer::kStreamType = 12 , vlink::Serializer::kStandardType = 13 , vlink::Serializer::kStandardPtrType = 14 } |
| Identifies the serialisation codec to use for a given C++ type. More... | |
Functions | |
| constexpr bool | vlink::Serializer::is_supported (Type type) noexcept |
Returns true when type identifies a supported serializer. | |
Compile-time type-detection and serialisation utilities for VLink messages.
The Serializer namespace provides a unified serialisation and deserialisation interface that automatically selects the correct codec based on the C++ type of the message via constexpr if chains.
| Type constant | C++ Type Criteria | Notes |
|---|---|---|
kBytesType | T == Bytes | Pass-through, no-copy. |
kDynamicType | Has is_vlink_dynamic_data() member | Dynamic type via operator>>/<< |
kCdrType | Has serialize(Cdr&) and deserialize(Cdr&) | FastDDS CDR codec. |
kProtoType | Has SerializeToArray() and ParseFromArray() | Protobuf by value. |
kProtoPtrType | Pointer with SerializeToArray / ParseFromArray | Arena-managed proto pointer. |
kFlatTableType | Inherits flatbuffers::NativeTable | FlatBuffers native table. |
kFlatPtrType | Pointer to flatbuffers::Table subclass | Zero-copy FlatBuffers read. |
kFlatBuilderType | Has fbb_ member and Finish() | FlatBuffers builder. |
kCustomType | Has operator>>(Bytes&) and operator<<(const Bytes&) | User-defined codec. |
kStringType | T == std::string | UTF-8 string. |
kCharsType | Constructible as std::string but not std::string | C string literal / char*. |
kStreamType | Has operator<< and operator>> with stringstream | Stream-based text encoding. |
kStandardType | Trivial standard-layout value (POD) | Byte-copied directly. |
kStandardPtrType | Pointer to trivial standard-layout type | Zero-copy POD pointer. |
operator>> and operator<< on your type: dds://) use a special fast-path for CDR types (pointer passing instead of byte-copy). Pass the TransportType to the explicit overloads to activate the transport-specific path: static and inline. The namespace name starts with a capital letter by convention (matches VLink style). Direct use by application code is rarely needed; the framework calls these functions automatically inside publish(), listen(), invoke(), etc.