|
VLink
2.0.0
A high-performance communication middleware
|
Generic zero-copy byte-buffer container with a Header prefix.
More...
Go to the source code of this file.
Namespaces | |
| vlink | |
| vlink::zerocopy | |
Functions | |
| struct | vlink::zerocopy::VLINK_EXPORT_AND_ALIGNED (8) AudioFrame final |
Generic zero-copy byte-buffer container with a Header prefix.
RawData is the most lightweight container in the vlink::zerocopy family. It pairs an opaque payload (any application-defined byte blob: Protobuf wire bytes, FlatBuffer tables, compressed frames, encrypted CAN snapshots, ...) with a 40-byte Header so that consumers can sequence and time-stamp the payload without parsing it. Use RawData whenever the payload schema is opaque to VLink, or when a higher-level layer wraps its own framing on top.
| Ownership mode | How to create | Frees on destruction |
|---|---|---|
| Owned | create(size) | Yes |
| Borrowed | shallow_copy(ptr, size) | No |
| Deserialised | operator<<(bytes) | No (borrows bytes) |
RawData is POD; the canonical serialiser is memcpy(). The sizeof value is locked by static_assert and forms a permanent binary contract: VLink zero-copy containers have NO forward and NO backward compatibility across versions, and every field including the reserved slot is part of that contract. reserved_buf_ travels through the wire format unchanged. It is exposed via get_reserved() so applications can stash a flag or minor sub-type id without inflating the struct, but the slot must not be redefined later – doing so would silently break any peer that still expects the old meaning.