VLink  2.0.0
A high-performance communication middleware
vlink::zerocopy 命名空间参考

函数

struct VLINK_EXPORT_AND_ALIGNED (8) AudioFrame final
 
constexpr uint32_t version_major (uint32_t version) noexcept
 Extracts the major component from an encoded zero-copy wire version. 更多...
 

变量

constexpr uint32_t kWireVersion
 Encoded VLink library version stamped into every zero-copy wire envelope. 更多...
 

函数说明

◆ version_major()

constexpr uint32_t vlink::zerocopy::version_major ( uint32_t  version)
inlineconstexprnoexcept

Extracts the major component from an encoded zero-copy wire version.

参数
versionEncoded version as produced by kWireVersion.
返回
Major component, i.e. version / 1000000.
这是这个函数的调用关系图:

◆ VLINK_EXPORT_AND_ALIGNED()

struct vlink::zerocopy::VLINK_EXPORT_AND_ALIGNED ( )
final

Encoded sample format of the audio payload.

< Uninitialised / unspecified format.

< Signed 16-bit linear PCM.

< Signed 24-bit linear PCM packed into 3 bytes.

< Signed 32-bit linear PCM.

< IEEE-754 single-precision linear PCM.

< Unsigned 8-bit linear PCM.

< Opus codec payload.

< AAC codec payload.

< MP3 codec payload.

< FLAC codec payload.

Arrangement of multi-channel samples within the payload buffer.

< Uninitialised / unspecified layout.

< Channels interleaved per-sample (L R L R ...).

< Channels stored in consecutive contiguous planes.

Default-constructs an empty frame and asserts the 128-byte contract.

Frees the owned audio buffer when is_owner() is true.

Deep-copies target into a freshly allocated frame.

参数
targetSource frame to clone.

Steals target's allocation and metadata; target ends empty.

参数
targetSource frame moved from.

Deep-copy-assigns target; self-assignment is a no-op.

参数
targetSource frame to clone.
返回
Reference to *this.

Move-assigns target; self-assignment is a no-op.

参数
targetSource frame moved from.
返回
Reference to *this.

Deserialises an AudioFrame from bytes with zero-copy borrowing semantics.

参数
bytesWire buffer previously produced by operator>>.
返回
true on success; false on magic mismatch or size mismatch.

Serialises the struct snapshot plus audio bytes into bytes.

参数
bytesOutput buffer; resized automatically when too small.
返回
Always true.

Validates that bytes carries a well-formed AudioFrame envelope.

参数
bytesWire buffer to inspect.
返回
true when the magic sentinels match and the minimum length holds.

Total bytes that operator>> would write for this frame.

返回
sizeof(magic_begin) + sizeof(version) + sizeof(AudioFrame) + size() + sizeof(magic_end).

Whether the audio buffer pointer is non-null and its size is positive.

返回
true when the frame holds usable audio data.

Borrows target's audio buffer without copying.

参数
targetSource frame whose buffer must outlive *this.
返回
false on self-borrow, otherwise true.

Allocates (or reuses) an owned buffer and copies target's audio.

参数
targetSource frame to clone.
返回
false on self-copy, otherwise true.

Transfers ownership from target; target ends empty.

参数
targetSource frame moved from.
返回
false on self-move, otherwise true.

Allocates an uninitialised owned audio buffer of size bytes.

参数
sizeByte count; must be non-zero.
返回
false when size is zero, otherwise true.

Releases the owned buffer (if any) and resets metadata except reserved fields.

Borrows an externally owned audio buffer without copying.

参数
dataNon-null source pointer that must outlive *this.
sizeBuffer length in bytes; must be non-zero.
返回
false on invalid arguments or unchanged pointer, otherwise true.

Copies size bytes from data into an owned buffer.

参数
dataNon-null source pointer.
sizeNumber of bytes to copy; must be non-zero.
返回
false on invalid arguments or aliasing, otherwise true.

Compatibility alias for deep_copy(uint8_t*, size_t).

参数
dataSource pointer.
sizeNumber of bytes.
返回
Result of the delegated deep_copy call.

Capture-side timestamp in nanoseconds.

返回
Stored value.

Advertised frame duration in nanoseconds.

返回
Stored value.

Codec hint string (e.g. "PCM", "OPUS").

返回
Non-owning view into the embedded buffer.

Language tag used by speech-to-text consumers (e.g. "en", "zh").

返回
Non-owning view into the embedded buffer.

Microphone / sensor channel identifier.

返回
Stored value.

Nominal publish frequency in Hz.

返回
Stored value.

PCM sample rate in Hz (e.g. 48 000).

返回
Stored value.

Number of samples per channel within the buffer.

返回
Stored value.

Compressed bitrate in bits per second (zero for uncompressed PCM).

返回
Stored value.

Channel count (1 = mono, 2 = stereo, ...).

返回
Stored value.

Bit depth per PCM sample (16, 24, 32, ...).

返回
Stored value.

Encoded sample format tag.

返回
Format enum value.

Multi-channel layout tag.

返回
Layout enum value.

Read-only pointer to the audio bytes.

返回
Pointer to payload start.

Audio buffer size in bytes.

返回
Byte count.

Whether this frame owns its audio buffer.

返回
true when the destructor would free the buffer.

Stores the capture-side timestamp.

参数
update_time_nsTimestamp in nanoseconds.

Stores the advertised frame duration.

参数
duration_nsDuration in nanoseconds.

Stores the codec hint, truncated to sizeof(codec) - 1 bytes.

参数
codecCodec label.

Stores the language tag, truncated to sizeof(language) - 1 bytes.

参数
languageLanguage identifier.

Stores the microphone / sensor channel identifier.

参数
channelChannel id.

Stores the nominal publish frequency.

参数
freqFrequency in Hz.

Stores the PCM sample rate.

参数
sample_rateSample rate in Hz.

Stores the number of samples per channel.

参数
num_samplesSample count.

Stores the compressed bitrate.

参数
bitrateBitrate in bits per second.

Stores the channel count.

参数
num_channelsChannel count.

Stores the PCM bit depth.

参数
bit_depthBit depth.

Stores the sample format tag.

参数
formatFormat enum value.

Stores the channel layout tag.

参数
layoutLayout enum value.

Mutable accessor for the first wire-locked reserved field (uint8_t).

返回
Reference to reserved_buf_.

Mutable accessor for the second wire-locked reserved field (uint32_t).

返回
Reference to reserved_buf2_.

< Sequencing and timestamp metadata prefix.

< Marker probed by the VLink type-trait machinery.

Pixel / codec encoding of the image payload.

< Uninitialised / unspecified format.

< Planar YUV 4:2:0 (I420).

< Planar YUV 4:2:2.

< Planar YUV 4:4:4.

< Semi-planar Y + interleaved UV (4:2:0).

< Semi-planar Y + interleaved VU (4:2:0).

< Packed YUYV 4:2:2.

< Packed YVYU 4:2:2.

< Packed UYVY 4:2:2.

< Packed VYUY 4:2:2.

< Packed 24-bit BGR (3 bytes per pixel).

< Packed 24-bit RGB (3 bytes per pixel).

< Planar 24-bit RGB (separate R, G, B planes).

< JPEG bitstream.

< H.264 / AVC frame.

< H.265 / HEVC frame.

Stream-frame type for compressed video payloads.

< Uninitialised / unspecified frame type.

< Intra-coded key frame.

< Predicted frame referencing earlier frames.

< Bi-directionally predicted frame.

Default-constructs an empty frame and asserts the 80-byte contract.

Frees the owned pixel buffer when is_owner() is true.

Deep-copies target into a freshly allocated frame.

参数
targetSource frame to clone.

Steals target's allocation and metadata; target ends empty.

参数
targetSource frame moved from.

Deep-copy-assigns target; self-assignment is a no-op.

参数
targetSource frame to clone.
返回
Reference to *this.

Move-assigns target; self-assignment is a no-op.

参数
targetSource frame moved from.
返回
Reference to *this.

Deserialises a CameraFrame from bytes with zero-copy borrowing semantics.

Validates the magic-number envelope and total length, then borrows the pixel pointer from bytes. Callers must keep bytes alive for as long as this CameraFrame is in use.

参数
bytesWire buffer previously produced by operator>>.
返回
true on success; false on magic mismatch or size mismatch.

Serialises the struct snapshot plus pixel bytes into bytes.

参数
bytesOutput buffer; resized automatically when its size differs from the serialized size.
返回
Always true.

Validates that bytes carries a well-formed CameraFrame envelope.

参数
bytesWire buffer to inspect.
返回
true when both magic sentinels match and the minimum size holds.

Total bytes that operator>> would write for this frame.

返回
sizeof(magic_begin) + sizeof(version) + sizeof(CameraFrame) + size() + sizeof(magic_end).

Whether the pixel buffer pointer is non-null and its size is positive.

返回
true when the frame holds usable pixel data.

Borrows target's pixel buffer without copying.

参数
targetSource frame whose buffer must outlive *this.
返回
false on self-borrow, otherwise true.

Allocates (or reuses) an owned buffer and copies target's pixels.

参数
targetSource frame to clone.
返回
false on self-copy, otherwise true.

Transfers ownership from target; target ends empty.

参数
targetSource frame moved from.
返回
false on self-move, otherwise true.

Allocates an uninitialised owned pixel buffer of size bytes.

参数
sizeByte count; must be non-zero.
返回
false when size is zero, otherwise true.

Releases the owned buffer (if any) and resets metadata except reserved fields.

Borrows an externally owned pixel buffer without copying.

参数
dataNon-null source pointer that must outlive *this.
sizeBuffer length in bytes; must be non-zero.
返回
false on invalid arguments or unchanged pointer, otherwise true.

Copies size bytes from data into an owned buffer.

参数
dataNon-null source pointer.
sizeNumber of bytes to copy; must be non-zero.
返回
false on invalid arguments or aliasing, otherwise true.

Compatibility alias for deep_copy(uint8_t*, size_t).

参数
dataSource pointer.
sizeNumber of bytes.
返回
Result of the delegated deep_copy call.

Camera channel / sensor index.

返回
Stored channel id.

Image width in pixels.

返回
Stored width.

Image height in pixels.

返回
Stored height.

Capture frequency in frames per second.

返回
Stored frequency.

Pixel / codec encoding tag.

返回
Format enum value.

Video stream-frame type tag.

返回
Stream enum value.

Read-only pointer to the pixel bytes.

返回
Pointer to payload start; may be non-null with size() == 0 for empty deserialised frames.

Pixel buffer size in bytes.

返回
Byte count, or 0 when empty.

Whether this frame owns its pixel buffer.

返回
true when the destructor would free the buffer.

Stores the camera channel / sensor index.

参数
channelChannel id.

Stores the image width in pixels.

参数
widthPixel width.

Stores the image height in pixels.

参数
heightPixel height.

Stores the capture frequency.

参数
freqCapture rate in Hz.

Stores the pixel / codec encoding tag.

参数
formatFormat enum value.

Stores the video stream-frame type tag.

参数
streamStream enum value.

Mutable accessor for the 32-bit reserved slot in the wire format.

返回
Reference to reserved_buf_.

< Sequencing and timestamp metadata prefix.

< Marker probed by the VLink type-trait machinery.

< Coordinate-frame / sensor identifier; not necessarily NUL-terminated.

< Monotonically increasing per-publisher sequence; wraps at UINT32_MAX.

< Reserved bytes; part of the wire contract, must not be repurposed.

< Capture / acquisition timestamp in nanoseconds since the UNIX epoch.

< Dispatch / publish timestamp in nanoseconds since the UNIX epoch.

Default constructor that asserts the 40-byte sizeof contract.

The static_assert inside the constructor body guarantees that any accidental field reordering or padding change breaks the build instead of silently corrupting the wire format.

Returns a bounded view over frame_id so consumers cannot read past the buffer.

frame_id may be filled to its full 16-byte capacity without a terminator, so this helper uses strnlen to compute the view length safely.

返回
Non-owning view over the populated portion of frame_id.

Per-cell storage type tag (drives cell_size()).

< Uninitialised / unspecified cell type.

< Signed 8-bit cell (ROS nav_msgs/OccupancyGrid style).

< Unsigned 8-bit cell (0..255 costmap / grayscale).

< Unsigned 16-bit cell (high-resolution costmap).

< IEEE-754 single-precision cell (log-odds, probability, SDF).

Default-constructs an empty grid and asserts the 152-byte contract.

Frees the owned cell buffer when is_owner() is true.

Deep-copies target into a freshly allocated grid.

参数
targetSource grid to clone.

Steals target's allocation and metadata; target ends empty.

参数
targetSource grid moved from.

Deep-copy-assigns target; self-assignment is a no-op.

参数
targetSource grid to clone.
返回
Reference to *this.

Move-assigns target; self-assignment is a no-op.

参数
targetSource grid moved from.
返回
Reference to *this.

Deserialises an OccupancyGrid from bytes with zero-copy borrowing semantics.

参数
bytesWire buffer previously produced by operator>>.
返回
true on success; false on magic mismatch or size mismatch.

Serialises the struct snapshot plus cell bytes into bytes.

参数
bytesOutput buffer; resized automatically when its size differs from the serialized size.
返回
Always true.

Validates that bytes carries a well-formed OccupancyGrid envelope.

参数
bytesWire buffer to inspect.
返回
true when both magic sentinels match and the minimum size holds.

Total bytes that operator>> would write for this grid.

返回
sizeof(magic_begin) + sizeof(version) + sizeof(OccupancyGrid) + size() + sizeof(magic_end).

Whether the cell buffer pointer is non-null and the byte size is positive.

返回
true when the grid holds usable cell data.

Borrows target's cell buffer without copying.

参数
targetSource grid whose buffer must outlive *this.
返回
false on self-borrow, otherwise true.

Allocates (or reuses) an owned buffer and copies target's cells.

参数
targetSource grid to clone.
返回
false on self-copy, otherwise true.

Transfers ownership from target; target ends empty.

参数
targetSource grid moved from.
返回
false on self-move, otherwise true.

Allocates an uninitialised owned cell buffer of size bytes.

The caller is responsible for keeping size consistent with width() * height() * cell_size().

参数
sizeByte count; must be non-zero.
返回
false when size is zero, otherwise true.

Releases the owned buffer (if any) and resets metadata except reserved fields.

Borrows an externally owned cell buffer without copying.

参数
dataNon-null source pointer that must outlive *this.
sizeBuffer length in bytes; must be non-zero.
返回
false on invalid arguments or unchanged pointer, otherwise true.

Copies size bytes from data into an owned cell buffer.

参数
dataNon-null source pointer.
sizeNumber of bytes to copy; must be non-zero.
返回
false on invalid arguments or aliasing, otherwise true.

Compatibility alias for deep_copy(uint8_t*, size_t).

参数
dataSource pointer.
sizeNumber of bytes.
返回
Result of the delegated deep_copy call.

Producer-side timestamp recording when the map was last updated.

返回
Stored nanosecond timestamp.

Unique map identifier (e.g. "local", "global", "lane").

返回
Non-owning view into the embedded buffer.

Sensor / producer channel identifier.

返回
Stored channel id.

Nominal publish frequency in Hz.

返回
Stored value.

Grid width in cells (columns).

返回
Stored width.

Grid height in cells (rows).

返回
Stored height.

Number of cells whose value differs from default_value() (producer-supplied hint).

返回
Stored count; zero means "not provided".

Cell side length in metres.

返回
Stored resolution.

World-frame X coordinate of the bottom-left grid corner.

返回
Stored origin X.

World-frame Y coordinate of the bottom-left grid corner.

返回
Stored origin Y.

World-frame Z coordinate of the 2-D plane.

返回
Stored origin Z.

Yaw rotation of the grid origin in radians (REP-103).

返回
Stored origin yaw.

Lower bound of cell values used for normalisation / visualisation.

返回
Stored minimum.

Upper bound of cell values used for normalisation / visualisation.

返回
Stored maximum.

Value used for unknown / uninitialised cells.

返回
Stored default value (e.g. -1 for ROS int8 occupancy).

Threshold above which a cell is considered occupied.

返回
Stored threshold.

Threshold below which a cell is considered free.

返回
Stored threshold.

Per-cell storage type tag.

返回
CellType enum value.

Byte size of one cell derived from cell_type().

返回
Cell stride in bytes (0 for kCellUnknown).

Read-only pointer to the cell bytes.

返回
Pointer to payload start.

Cell buffer size in bytes.

返回
Byte count, or 0 when empty.

Whether this grid owns its cell buffer.

返回
true when the destructor would free the buffer.

Stores the producer-side map timestamp.

参数
update_time_nsTimestamp in nanoseconds.

Stores the unique map identifier (truncated to sizeof(map_id) - 1 bytes).

参数
map_idIdentifier string.

Stores the sensor / producer channel identifier.

参数
channelChannel id.

Stores the nominal publish frequency.

参数
freqFrequency in Hz.

Stores the grid width.

参数
widthNumber of columns.

Stores the grid height.

参数
heightNumber of rows.

Stores the count of cells differing from the default value.

参数
valid_cell_countProducer-supplied hint.

Stores the cell resolution.

参数
resolutionMetres per cell.

Stores the world-frame X origin.

参数
origin_xWorld X coordinate of the bottom-left corner.

Stores the world-frame Y origin.

参数
origin_yWorld Y coordinate of the bottom-left corner.

Stores the world-frame Z value of the 2-D plane.

参数
origin_zWorld Z coordinate of the plane.

Stores the yaw rotation of the grid origin.

参数
origin_yawRotation in radians (REP-103).

Stores the lower bound for cell values.

参数
value_minStored minimum.

Stores the upper bound for cell values.

参数
value_maxStored maximum.

Stores the value used for unknown cells.

参数
default_valueDefault cell value.

Stores the occupied threshold.

参数
occupied_thresholdStored threshold.

Stores the free threshold.

参数
free_thresholdStored threshold.

Stores the per-cell storage type tag.

参数
cell_typeCellType enum value.

Returns the byte size of one cell of type.

参数
typeCell type tag.
返回
Cell stride in bytes (0 for kCellUnknown).

Mutable accessor for the first wire-locked reserved field (uint16_t).

返回
Reference to reserved_buf_.

Mutable accessor for the second wire-locked reserved field (uint32_t).

返回
Reference to reserved_buf2_.

Mutable accessor for the third wire-locked reserved field (uint32_t).

返回
Reference to reserved_buf3_.

< Sequencing and timestamp metadata prefix.

< Marker probed by the VLink type-trait machinery.

Default-constructs an empty envelope and asserts the 80-byte contract.

Frees the owned tail buffer when is_owner() is true.

Deep-copies target into a freshly allocated envelope.

参数
targetSource envelope to clone.

Steals target's allocation and metadata; target ends empty.

参数
targetSource envelope moved from.

Deep-copy-assigns target; self-assignment is a no-op.

参数
targetSource envelope to clone.
返回
Reference to *this.

Move-assigns target; self-assignment is a no-op.

参数
targetSource envelope moved from.
返回
Reference to *this.

Deserialises an envelope from bytes with zero-copy borrowing semantics.

参数
bytesWire buffer previously produced by operator>>.
返回
true on success; false on magic mismatch or region inconsistency.

Serialises the struct snapshot plus tail buffer into bytes.

参数
bytesOutput buffer; reallocated automatically when undersized.
返回
Always true.

Proxy control identifier set by set_control_id().

返回
Stored control id.

Proxy operation mode set by set_mode().

返回
Stored mode value.

Microsecond-resolution timestamp set by set_timestamp().

返回
Timestamp.

Sequence number set by set_seq().

返回
Sequence number.

Coarse schema family tag set by set_schema().

返回
Numeric SchemaType value.

Shallow Bytes view of the raw payload region (no copy).

返回
Bytes pointing into the internal tail buffer; lifetime tracks *this.

View of the URL region within the internal tail buffer.

返回
Non-owning view, or empty when no URL was provided.

View of the serialisation-type region within the internal tail buffer.

返回
Non-owning view, or empty when no serialisation label was provided.

View of the optional source hostname region.

返回
Non-owning view, or empty when no hostname was provided.

Stores the proxy control identifier.

参数
control_idIdentifier value.

Stores the proxy operation mode.

参数
modeMode value.

Stores the microsecond-resolution timestamp.

参数
timestampTimestamp value.

Stores the message sequence number.

参数
seqSequence number.

Stores the coarse schema family tag.

参数
schemaNumeric SchemaType value.

Validates that bytes carries a well-formed ProxyData envelope.

参数
bytesWire buffer to inspect.
返回
true on magic match and minimum-size check.

Total bytes that operator>> writes for this envelope.

返回
sizeof(magic_begin) + sizeof(version) + sizeof(ProxyData) + size() + sizeof(magic_end).

Validates that internal region positions and sizes are consistent.

Confirms the four sub-regions are contiguous, sum to size(), and the data pointer is non-null. Useful after operator<< when forwarding untrusted input.

返回
true when the layout is internally consistent.

Borrows target's tail buffer without copying.

参数
targetSource envelope; its backing buffer must outlive *this.
返回
false on self-borrow, otherwise true.

Allocates (or reuses) an owned buffer and clones target's payload.

参数
targetSource envelope to clone.
返回
false on self-copy, otherwise true.

Transfers ownership from target; target ends empty.

参数
targetSource envelope moved from.
返回
false on self-move, otherwise true.

Builds the envelope by packing all four regions into a single allocation.

Allocates raw.size() + url.size() + ser.size() + hostname.size() bytes and copies each region in order. If any region (or the total) would exceed UINT32_MAX the envelope is cleared. Callers passing dynamic input must verify success via is_valid() or size().

参数
rawRaw payload bytes.
urlTopic URL string.
serSerialisation type label.
schemaOptional coarse schema family tag.
hostnameOptional source hostname.

Frees the owned buffer (if any) and zeroes every field.

Total size of the variable-length tail buffer.

返回
Byte count, or 0 when empty.

Whether this envelope currently owns its tail buffer.

返回
true when the destructor would free the buffer.

Mutable accessor for the first wire-locked reserved field (uint8_t).

返回
Reference to reserved_buf_.

Mutable accessor for the second wire-locked reserved field (uint16_t).

返回
Reference to reserved_buf2_.

< Marker probed by the VLink type-trait machinery.

Default-constructs an empty container and verifies the sizeof contract.

Releases the owned buffer when is_owner() is true.

Deep-copies the payload of target into a freshly allocated owned buffer.

参数
targetSource container to clone.

Steals target's ownership and metadata; target is left empty.

参数
targetSource container moved from.

Deep-copy-assigns from target; self-assignment is a no-op.

参数
targetSource container to clone.
返回
Reference to *this.

Move-assigns target's resources into *this; self-assignment is a no-op.

参数
targetSource container moved from.
返回
Reference to *this.

Deserialises a RawData from bytes using zero-copy borrowing semantics.

Validates the magic-number envelope and total length, then borrows the payload pointer from bytes. The caller must keep bytes alive for as long as this RawData is used.

参数
bytesWire buffer previously produced by operator>>.
返回
true on success; false on magic mismatch or size mismatch.

Serialises the struct snapshot plus payload into bytes.

参数
bytesOutput buffer; resized automatically when its size differs from the serialized size.
返回
Always true.

Validates that bytes carries a well-formed RawData envelope.

参数
bytesBuffer to inspect.
返回
true when the magic sentinels match and the minimum length holds.

Total bytes that operator>> would write for this container.

返回
sizeof(magic_begin) + sizeof(version) + sizeof(RawData) + size() + sizeof(magic_end).

Whether the payload pointer is non-null and the byte size is positive.

返回
true when the container holds usable data.

Borrows target's payload pointer without copying.

参数
targetSource container whose buffer must outlive *this.
返回
false on self-borrow, otherwise true.

Allocates (or reuses) an owned buffer and copies target's payload.

参数
targetSource container to clone.
返回
false on self-copy, otherwise true.

Transfers ownership from target; target becomes empty.

参数
targetSource container moved from.
返回
false on self-move, otherwise true.

Allocates an uninitialised owned buffer of size bytes.

参数
sizeByte count; must be non-zero.
返回
false when size is zero, otherwise true.

Releases the owned buffer (if any) and zeroes the Header.

Borrows an externally owned raw byte buffer without copying.

参数
dataNon-null source pointer that must outlive *this.
sizeBuffer length in bytes; must be non-zero.
返回
false on invalid arguments or unchanged pointer, otherwise true.

Copies size bytes from data into an owned buffer (allocating as needed).

参数
dataNon-null source pointer.
sizeNumber of bytes to copy; must be non-zero.
返回
false on invalid arguments or aliasing, otherwise true.

Compatibility alias for deep_copy(uint8_t*, size_t).

参数
dataSource pointer.
sizeNumber of bytes.
返回
Result of the delegated deep_copy call.

Mutable accessor for the 16-bit user-reserved field carried in the wire format.

返回
Reference to reserved_buf_.

Read-only pointer to the payload bytes.

返回
Pointer to payload start; may be non-null with size() == 0 for empty deserialised frames.

Payload size in bytes (0 when empty).

返回
Byte count.

Whether this container currently owns its buffer.

返回
true when the destructor would free the buffer.

< Sequencing and timestamp metadata prefix.

< Marker probed by the VLink type-trait machinery.

Maximum number of dimensions a single Tensor may carry.

Scalar element type tag (drives element_size()).

< Uninitialised / unspecified element type.

< bool (1 byte).

< int8_t (1 byte).

< uint8_t (1 byte).

< int16_t (2 bytes).

< uint16_t (2 bytes).

< int32_t (4 bytes).

< uint32_t (4 bytes).

< int64_t (8 bytes).

< uint64_t (8 bytes).

< IEEE-754 half precision (2 bytes).

< Brain float (2 bytes).

< IEEE-754 single precision (4 bytes).

< IEEE-754 double precision (8 bytes).

Device hint indicating where the data buffer physically lives.

< Host / CPU memory.

< Discrete or integrated GPU memory.

< Neural processing unit (e.g. automotive NPU).

< Digital signal processor.

Default-constructs an empty tensor and asserts the 248-byte contract.

Frees the owned data buffer when is_owner() is true.

Deep-copies target into a freshly allocated tensor.

参数
targetSource tensor to clone.

Steals target's allocation and metadata; target ends empty.

参数
targetSource tensor moved from.

Deep-copy-assigns target; self-assignment is a no-op.

参数
targetSource tensor to clone.
返回
Reference to *this.

Move-assigns target; self-assignment is a no-op.

参数
targetSource tensor moved from.
返回
Reference to *this.

Deserialises a Tensor from bytes with zero-copy borrowing semantics.

Two fields are sanitised after the struct snapshot is restored: rank_ is clamped to kMaxRank, and element_size_ is re-derived from dtype_ to stay consistent regardless of producer-side mistakes.

参数
bytesWire buffer previously produced by operator>>.
返回
true on success.

Serialises the struct snapshot plus element bytes into bytes.

参数
bytesOutput buffer; resized automatically when its size differs from the serialized size.
返回
Always true.

Validates that bytes carries a well-formed Tensor envelope.

参数
bytesWire buffer to inspect.
返回
true when both magic sentinels match and the minimum size holds.

Total bytes that operator>> would write for this tensor.

返回
sizeof(magic_begin) + sizeof(version) + sizeof(Tensor) + size() + sizeof(magic_end).

Whether the data buffer pointer is non-null and the byte size is positive.

返回
true when the tensor holds usable data.

Borrows target's data buffer without copying.

参数
targetSource tensor whose buffer must outlive *this.
返回
false on self-borrow, otherwise true.

Allocates (or reuses) an owned buffer and copies target's elements.

参数
targetSource tensor to clone.
返回
false on self-copy, otherwise true.

Transfers ownership from target; target ends empty.

参数
targetSource tensor moved from.
返回
false on self-move, otherwise true.

Allocates an uninitialised owned data buffer of size bytes.

The caller is responsible for keeping size consistent with num_elements() * element_size().

参数
sizeByte count; must be non-zero.
返回
false when size is zero, otherwise true.

Releases the owned buffer (if any) and resets metadata except reserved fields.

Borrows an externally owned data buffer without copying.

参数
dataNon-null source pointer that must outlive *this.
sizeBuffer length in bytes; must be non-zero.
返回
false on invalid arguments or unchanged pointer, otherwise true.

Copies size bytes from data into an owned buffer.

参数
dataNon-null source pointer.
sizeNumber of bytes to copy; must be non-zero.
返回
false on invalid arguments or aliasing, otherwise true.

Compatibility alias for deep_copy(uint8_t*, size_t).

参数
dataSource pointer.
sizeNumber of bytes.
返回
Result of the delegated deep_copy call.

Producer-side tensor timestamp in nanoseconds.

返回
Stored value.

Cached total element count (product of shape() dimensions).

返回
Stored element count.

Tensor name (e.g. "image", "hidden_state").

返回
Non-owning view into the embedded buffer.

Source model identifier.

返回
Non-owning view into the embedded buffer.

Layout label (e.g. "NCHW", "NHWC", "BLC").

返回
Non-owning view into the embedded buffer.

Read-only pointer to the kMaxRank-sized shape array.

返回
Pointer into the embedded array; never nullptr.

Shape value at dimension dim, or 0 if dim is out of range.

参数
dimDimension index.
返回
Shape entry.

Read-only pointer to the kMaxRank-sized stride array (in elements, not bytes).

返回
Pointer into the embedded array; never nullptr.

Stride value at dimension dim, or 0 if dim is out of range.

参数
dimDimension index.
返回
Stride entry.

Sensor / producer / output-port channel identifier.

返回
Stored channel id.

Nominal publish frequency in Hz.

返回
Stored value.

Cached batch size (typically shape_at(0)).

返回
Stored batch size.

INT8 quantisation scale (0 when unused).

返回
Stored scale.

INT8 quantisation zero point (0 when unused).

返回
Stored zero point.

Scalar element type tag.

返回
DataType enum value.

Actual tensor rank in the range 1..kMaxRank.

返回
Stored rank.

Device hint indicating where the data buffer lives.

返回
Device enum value.

Cached byte size of one element derived from dtype().

返回
Element size in bytes.

Read-only pointer to the element bytes.

返回
Pointer to payload start.

Element buffer size in bytes.

返回
Byte count.

Whether this tensor owns its data buffer.

返回
true when the destructor would free the buffer.

Stores the tensor timestamp.

参数
update_time_nsTimestamp in nanoseconds.

Stores the tensor name (truncated to sizeof(name) - 1 bytes).

参数
nameTensor name.

Stores the source model identifier (truncated to sizeof(model_id) - 1 bytes).

参数
model_idModel identifier.

Stores the layout label (truncated to sizeof(layout) - 1 bytes).

参数
layoutLayout descriptor.

Stores the full shape array and recomputes row-major strides plus num_elements.

rank is clamped to kMaxRank. Strides are derived assuming a contiguous row-major layout (last dimension changes fastest). batch_size is cached from shape[0] when rank > 0.

参数
shapePointer to a shape array of length rank.
rankNumber of valid dimensions.

Stores a single shape entry without recomputing strides.

参数
dimDimension index.
valueShape value.

Stores a single stride entry.

参数
dimDimension index.
valueStride value (in elements, not bytes).

Stores the sensor / producer / output-port channel identifier.

参数
channelChannel id.

Stores the nominal publish frequency.

参数
freqFrequency in Hz.

Stores the cached batch size.

参数
batch_sizeStored value.

Stores the INT8 quantisation scale.

参数
quant_scaleStored value.

Stores the INT8 quantisation zero point.

参数
quant_zero_pointStored value.

Stores the scalar element type tag and caches the derived element size.

参数
dtypeDataType enum value.

Stores the device hint.

参数
deviceDevice enum value.

Returns the byte size of one element of dtype.

参数
dtypeElement type tag.
返回
Element size in bytes (0 for kDataUnknown).

Mutable accessor for the first wire-locked reserved field (uint8_t).

返回
Reference to reserved_buf_.

Mutable accessor for the second wire-locked reserved field (uint16_t).

返回
Reference to reserved_buf2_.

Mutable accessor for the third wire-locked reserved field (uint32_t).

返回
Reference to reserved_buf3_.

< Sequencing and timestamp metadata prefix.

< Marker probed by the VLink type-trait machinery.

Pixel / codec encoding of the image payload.

< Uninitialised / unspecified format.

< Planar YUV 4:2:0 (I420).

< Planar YUV 4:2:2.

< Planar YUV 4:4:4.

< Semi-planar Y + interleaved UV (4:2:0).

< Semi-planar Y + interleaved VU (4:2:0).

< Packed YUYV 4:2:2.

< Packed YVYU 4:2:2.

< Packed UYVY 4:2:2.

< Packed VYUY 4:2:2.

< Packed 24-bit BGR (3 bytes per pixel).

< Packed 24-bit RGB (3 bytes per pixel).

< Planar 24-bit RGB (separate R, G, B planes).

< JPEG bitstream.

< H.264 / AVC frame.

< H.265 / HEVC frame.

Stream-frame type for compressed video payloads.

< Uninitialised / unspecified frame type.

< Intra-coded key frame.

< Predicted frame referencing earlier frames.

< Bi-directionally predicted frame.

Default-constructs an empty frame and asserts the 80-byte contract.

Frees the owned pixel buffer when is_owner() is true.

Deep-copies target into a freshly allocated frame.

参数
targetSource frame to clone.

Steals target's allocation and metadata; target ends empty.

参数
targetSource frame moved from.

Deep-copy-assigns target; self-assignment is a no-op.

参数
targetSource frame to clone.
返回
Reference to *this.

Move-assigns target; self-assignment is a no-op.

参数
targetSource frame moved from.
返回
Reference to *this.

Deserialises a CameraFrame from bytes with zero-copy borrowing semantics.

Validates the magic-number envelope and total length, then borrows the pixel pointer from bytes. Callers must keep bytes alive for as long as this CameraFrame is in use.

参数
bytesWire buffer previously produced by operator>>.
返回
true on success; false on magic mismatch or size mismatch.

Serialises the struct snapshot plus pixel bytes into bytes.

参数
bytesOutput buffer; resized automatically when its size differs from the serialized size.
返回
Always true.

Validates that bytes carries a well-formed CameraFrame envelope.

参数
bytesWire buffer to inspect.
返回
true when both magic sentinels match and the minimum size holds.

Total bytes that operator>> would write for this frame.

返回
sizeof(magic_begin) + sizeof(version) + sizeof(CameraFrame) + size() + sizeof(magic_end).

Whether the pixel buffer pointer is non-null and its size is positive.

返回
true when the frame holds usable pixel data.

Borrows target's pixel buffer without copying.

参数
targetSource frame whose buffer must outlive *this.
返回
false on self-borrow, otherwise true.

Allocates (or reuses) an owned buffer and copies target's pixels.

参数
targetSource frame to clone.
返回
false on self-copy, otherwise true.

Transfers ownership from target; target ends empty.

参数
targetSource frame moved from.
返回
false on self-move, otherwise true.

Allocates an uninitialised owned pixel buffer of size bytes.

参数
sizeByte count; must be non-zero.
返回
false when size is zero, otherwise true.

Releases the owned buffer (if any) and resets metadata except reserved fields.

Borrows an externally owned pixel buffer without copying.

参数
dataNon-null source pointer that must outlive *this.
sizeBuffer length in bytes; must be non-zero.
返回
false on invalid arguments or unchanged pointer, otherwise true.

Copies size bytes from data into an owned buffer.

参数
dataNon-null source pointer.
sizeNumber of bytes to copy; must be non-zero.
返回
false on invalid arguments or aliasing, otherwise true.

Compatibility alias for deep_copy(uint8_t*, size_t).

参数
dataSource pointer.
sizeNumber of bytes.
返回
Result of the delegated deep_copy call.

Camera channel / sensor index.

返回
Stored channel id.

Image width in pixels.

返回
Stored width.

Image height in pixels.

返回
Stored height.

Capture frequency in frames per second.

返回
Stored frequency.

Pixel / codec encoding tag.

返回
Format enum value.

Video stream-frame type tag.

返回
Stream enum value.

Read-only pointer to the pixel bytes.

返回
Pointer to payload start; may be non-null with size() == 0 for empty deserialised frames.

Pixel buffer size in bytes.

返回
Byte count, or 0 when empty.

Whether this frame owns its pixel buffer.

返回
true when the destructor would free the buffer.

Stores the camera channel / sensor index.

参数
channelChannel id.

Stores the image width in pixels.

参数
widthPixel width.

Stores the image height in pixels.

参数
heightPixel height.

Stores the capture frequency.

参数
freqCapture rate in Hz.

Stores the pixel / codec encoding tag.

参数
formatFormat enum value.

Stores the video stream-frame type tag.

参数
streamStream enum value.

Mutable accessor for the 32-bit reserved slot in the wire format.

返回
Reference to reserved_buf_.

< Sequencing and timestamp metadata prefix.

< Marker probed by the VLink type-trait machinery.

< Coordinate-frame / sensor identifier; not necessarily NUL-terminated.

< Monotonically increasing per-publisher sequence; wraps at UINT32_MAX.

< Reserved bytes; part of the wire contract, must not be repurposed.

< Capture / acquisition timestamp in nanoseconds since the UNIX epoch.

< Dispatch / publish timestamp in nanoseconds since the UNIX epoch.

Default constructor that asserts the 40-byte sizeof contract.

The static_assert inside the constructor body guarantees that any accidental field reordering or padding change breaks the build instead of silently corrupting the wire format.

Returns a bounded view over frame_id so consumers cannot read past the buffer.

frame_id may be filled to its full 16-byte capacity without a terminator, so this helper uses strnlen to compute the view length safely.

返回
Non-owning view over the populated portion of frame_id.

Per-cell storage type tag (drives cell_size()).

< Uninitialised / unspecified cell type.

< Signed 8-bit cell (ROS nav_msgs/OccupancyGrid style).

< Unsigned 8-bit cell (0..255 costmap / grayscale).

< Unsigned 16-bit cell (high-resolution costmap).

< IEEE-754 single-precision cell (log-odds, probability, SDF).

Default-constructs an empty grid and asserts the 152-byte contract.

Frees the owned cell buffer when is_owner() is true.

Deep-copies target into a freshly allocated grid.

参数
targetSource grid to clone.

Steals target's allocation and metadata; target ends empty.

参数
targetSource grid moved from.

Deep-copy-assigns target; self-assignment is a no-op.

参数
targetSource grid to clone.
返回
Reference to *this.

Move-assigns target; self-assignment is a no-op.

参数
targetSource grid moved from.
返回
Reference to *this.

Deserialises an OccupancyGrid from bytes with zero-copy borrowing semantics.

参数
bytesWire buffer previously produced by operator>>.
返回
true on success; false on magic mismatch or size mismatch.

Serialises the struct snapshot plus cell bytes into bytes.

参数
bytesOutput buffer; resized automatically when its size differs from the serialized size.
返回
Always true.

Validates that bytes carries a well-formed OccupancyGrid envelope.

参数
bytesWire buffer to inspect.
返回
true when both magic sentinels match and the minimum size holds.

Total bytes that operator>> would write for this grid.

返回
sizeof(magic_begin) + sizeof(version) + sizeof(OccupancyGrid) + size() + sizeof(magic_end).

Whether the cell buffer pointer is non-null and the byte size is positive.

返回
true when the grid holds usable cell data.

Borrows target's cell buffer without copying.

参数
targetSource grid whose buffer must outlive *this.
返回
false on self-borrow, otherwise true.

Allocates (or reuses) an owned buffer and copies target's cells.

参数
targetSource grid to clone.
返回
false on self-copy, otherwise true.

Transfers ownership from target; target ends empty.

参数
targetSource grid moved from.
返回
false on self-move, otherwise true.

Allocates an uninitialised owned cell buffer of size bytes.

The caller is responsible for keeping size consistent with width() * height() * cell_size().

参数
sizeByte count; must be non-zero.
返回
false when size is zero, otherwise true.

Releases the owned buffer (if any) and resets metadata except reserved fields.

Borrows an externally owned cell buffer without copying.

参数
dataNon-null source pointer that must outlive *this.
sizeBuffer length in bytes; must be non-zero.
返回
false on invalid arguments or unchanged pointer, otherwise true.

Copies size bytes from data into an owned cell buffer.

参数
dataNon-null source pointer.
sizeNumber of bytes to copy; must be non-zero.
返回
false on invalid arguments or aliasing, otherwise true.

Compatibility alias for deep_copy(uint8_t*, size_t).

参数
dataSource pointer.
sizeNumber of bytes.
返回
Result of the delegated deep_copy call.

Producer-side timestamp recording when the map was last updated.

返回
Stored nanosecond timestamp.

Unique map identifier (e.g. "local", "global", "lane").

返回
Non-owning view into the embedded buffer.

Sensor / producer channel identifier.

返回
Stored channel id.

Nominal publish frequency in Hz.

返回
Stored value.

Grid width in cells (columns).

返回
Stored width.

Grid height in cells (rows).

返回
Stored height.

Number of cells whose value differs from default_value() (producer-supplied hint).

返回
Stored count; zero means "not provided".

Cell side length in metres.

返回
Stored resolution.

World-frame X coordinate of the bottom-left grid corner.

返回
Stored origin X.

World-frame Y coordinate of the bottom-left grid corner.

返回
Stored origin Y.

World-frame Z coordinate of the 2-D plane.

返回
Stored origin Z.

Yaw rotation of the grid origin in radians (REP-103).

返回
Stored origin yaw.

Lower bound of cell values used for normalisation / visualisation.

返回
Stored minimum.

Upper bound of cell values used for normalisation / visualisation.

返回
Stored maximum.

Value used for unknown / uninitialised cells.

返回
Stored default value (e.g. -1 for ROS int8 occupancy).

Threshold above which a cell is considered occupied.

返回
Stored threshold.

Threshold below which a cell is considered free.

返回
Stored threshold.

Per-cell storage type tag.

返回
CellType enum value.

Byte size of one cell derived from cell_type().

返回
Cell stride in bytes (0 for kCellUnknown).

Read-only pointer to the cell bytes.

返回
Pointer to payload start.

Cell buffer size in bytes.

返回
Byte count, or 0 when empty.

Whether this grid owns its cell buffer.

返回
true when the destructor would free the buffer.

Stores the producer-side map timestamp.

参数
update_time_nsTimestamp in nanoseconds.

Stores the unique map identifier (truncated to sizeof(map_id) - 1 bytes).

参数
map_idIdentifier string.

Stores the sensor / producer channel identifier.

参数
channelChannel id.

Stores the nominal publish frequency.

参数
freqFrequency in Hz.

Stores the grid width.

参数
widthNumber of columns.

Stores the grid height.

参数
heightNumber of rows.

Stores the count of cells differing from the default value.

参数
valid_cell_countProducer-supplied hint.

Stores the cell resolution.

参数
resolutionMetres per cell.

Stores the world-frame X origin.

参数
origin_xWorld X coordinate of the bottom-left corner.

Stores the world-frame Y origin.

参数
origin_yWorld Y coordinate of the bottom-left corner.

Stores the world-frame Z value of the 2-D plane.

参数
origin_zWorld Z coordinate of the plane.

Stores the yaw rotation of the grid origin.

参数
origin_yawRotation in radians (REP-103).

Stores the lower bound for cell values.

参数
value_minStored minimum.

Stores the upper bound for cell values.

参数
value_maxStored maximum.

Stores the value used for unknown cells.

参数
default_valueDefault cell value.

Stores the occupied threshold.

参数
occupied_thresholdStored threshold.

Stores the free threshold.

参数
free_thresholdStored threshold.

Stores the per-cell storage type tag.

参数
cell_typeCellType enum value.

Returns the byte size of one cell of type.

参数
typeCell type tag.
返回
Cell stride in bytes (0 for kCellUnknown).

Mutable accessor for the first wire-locked reserved field (uint16_t).

返回
Reference to reserved_buf_.

Mutable accessor for the second wire-locked reserved field (uint32_t).

返回
Reference to reserved_buf2_.

Mutable accessor for the third wire-locked reserved field (uint32_t).

返回
Reference to reserved_buf3_.

< Sequencing and timestamp metadata prefix.

< Marker probed by the VLink type-trait machinery.

Default-constructs an empty envelope and asserts the 80-byte contract.

Frees the owned tail buffer when is_owner() is true.

Deep-copies target into a freshly allocated envelope.

参数
targetSource envelope to clone.

Steals target's allocation and metadata; target ends empty.

参数
targetSource envelope moved from.

Deep-copy-assigns target; self-assignment is a no-op.

参数
targetSource envelope to clone.
返回
Reference to *this.

Move-assigns target; self-assignment is a no-op.

参数
targetSource envelope moved from.
返回
Reference to *this.

Deserialises an envelope from bytes with zero-copy borrowing semantics.

参数
bytesWire buffer previously produced by operator>>.
返回
true on success; false on magic mismatch or region inconsistency.

Serialises the struct snapshot plus tail buffer into bytes.

参数
bytesOutput buffer; reallocated automatically when undersized.
返回
Always true.

Proxy control identifier set by set_control_id().

返回
Stored control id.

Proxy operation mode set by set_mode().

返回
Stored mode value.

Microsecond-resolution timestamp set by set_timestamp().

返回
Timestamp.

Sequence number set by set_seq().

返回
Sequence number.

Coarse schema family tag set by set_schema().

返回
Numeric SchemaType value.

Shallow Bytes view of the raw payload region (no copy).

返回
Bytes pointing into the internal tail buffer; lifetime tracks *this.

View of the URL region within the internal tail buffer.

返回
Non-owning view, or empty when no URL was provided.

View of the serialisation-type region within the internal tail buffer.

返回
Non-owning view, or empty when no serialisation label was provided.

View of the optional source hostname region.

返回
Non-owning view, or empty when no hostname was provided.

Stores the proxy control identifier.

参数
control_idIdentifier value.

Stores the proxy operation mode.

参数
modeMode value.

Stores the microsecond-resolution timestamp.

参数
timestampTimestamp value.

Stores the message sequence number.

参数
seqSequence number.

Stores the coarse schema family tag.

参数
schemaNumeric SchemaType value.

Validates that bytes carries a well-formed ProxyData envelope.

参数
bytesWire buffer to inspect.
返回
true on magic match and minimum-size check.

Total bytes that operator>> writes for this envelope.

返回
sizeof(magic_begin) + sizeof(version) + sizeof(ProxyData) + size() + sizeof(magic_end).

Validates that internal region positions and sizes are consistent.

Confirms the four sub-regions are contiguous, sum to size(), and the data pointer is non-null. Useful after operator<< when forwarding untrusted input.

返回
true when the layout is internally consistent.

Borrows target's tail buffer without copying.

参数
targetSource envelope; its backing buffer must outlive *this.
返回
false on self-borrow, otherwise true.

Allocates (or reuses) an owned buffer and clones target's payload.

参数
targetSource envelope to clone.
返回
false on self-copy, otherwise true.

Transfers ownership from target; target ends empty.

参数
targetSource envelope moved from.
返回
false on self-move, otherwise true.

Builds the envelope by packing all four regions into a single allocation.

Allocates raw.size() + url.size() + ser.size() + hostname.size() bytes and copies each region in order. If any region (or the total) would exceed UINT32_MAX the envelope is cleared. Callers passing dynamic input must verify success via is_valid() or size().

参数
rawRaw payload bytes.
urlTopic URL string.
serSerialisation type label.
schemaOptional coarse schema family tag.
hostnameOptional source hostname.

Frees the owned buffer (if any) and zeroes every field.

Total size of the variable-length tail buffer.

返回
Byte count, or 0 when empty.

Whether this envelope currently owns its tail buffer.

返回
true when the destructor would free the buffer.

Mutable accessor for the first wire-locked reserved field (uint8_t).

返回
Reference to reserved_buf_.

Mutable accessor for the second wire-locked reserved field (uint16_t).

返回
Reference to reserved_buf2_.

< Marker probed by the VLink type-trait machinery.

Default-constructs an empty container and verifies the sizeof contract.

Releases the owned buffer when is_owner() is true.

Deep-copies the payload of target into a freshly allocated owned buffer.

参数
targetSource container to clone.

Steals target's ownership and metadata; target is left empty.

参数
targetSource container moved from.

Deep-copy-assigns from target; self-assignment is a no-op.

参数
targetSource container to clone.
返回
Reference to *this.

Move-assigns target's resources into *this; self-assignment is a no-op.

参数
targetSource container moved from.
返回
Reference to *this.

Deserialises a RawData from bytes using zero-copy borrowing semantics.

Validates the magic-number envelope and total length, then borrows the payload pointer from bytes. The caller must keep bytes alive for as long as this RawData is used.

参数
bytesWire buffer previously produced by operator>>.
返回
true on success; false on magic mismatch or size mismatch.

Serialises the struct snapshot plus payload into bytes.

参数
bytesOutput buffer; resized automatically when its size differs from the serialized size.
返回
Always true.

Validates that bytes carries a well-formed RawData envelope.

参数
bytesBuffer to inspect.
返回
true when the magic sentinels match and the minimum length holds.

Total bytes that operator>> would write for this container.

返回
sizeof(magic_begin) + sizeof(version) + sizeof(RawData) + size() + sizeof(magic_end).

Whether the payload pointer is non-null and the byte size is positive.

返回
true when the container holds usable data.

Borrows target's payload pointer without copying.

参数
targetSource container whose buffer must outlive *this.
返回
false on self-borrow, otherwise true.

Allocates (or reuses) an owned buffer and copies target's payload.

参数
targetSource container to clone.
返回
false on self-copy, otherwise true.

Transfers ownership from target; target becomes empty.

参数
targetSource container moved from.
返回
false on self-move, otherwise true.

Allocates an uninitialised owned buffer of size bytes.

参数
sizeByte count; must be non-zero.
返回
false when size is zero, otherwise true.

Releases the owned buffer (if any) and zeroes the Header.

Borrows an externally owned raw byte buffer without copying.

参数
dataNon-null source pointer that must outlive *this.
sizeBuffer length in bytes; must be non-zero.
返回
false on invalid arguments or unchanged pointer, otherwise true.

Copies size bytes from data into an owned buffer (allocating as needed).

参数
dataNon-null source pointer.
sizeNumber of bytes to copy; must be non-zero.
返回
false on invalid arguments or aliasing, otherwise true.

Compatibility alias for deep_copy(uint8_t*, size_t).

参数
dataSource pointer.
sizeNumber of bytes.
返回
Result of the delegated deep_copy call.

Mutable accessor for the 16-bit user-reserved field carried in the wire format.

返回
Reference to reserved_buf_.

Read-only pointer to the payload bytes.

返回
Pointer to payload start; may be non-null with size() == 0 for empty deserialised frames.

Payload size in bytes (0 when empty).

返回
Byte count.

Whether this container currently owns its buffer.

返回
true when the destructor would free the buffer.

< Sequencing and timestamp metadata prefix.

< Marker probed by the VLink type-trait machinery.

Maximum number of dimensions a single Tensor may carry.

Scalar element type tag (drives element_size()).

< Uninitialised / unspecified element type.

< bool (1 byte).

< int8_t (1 byte).

< uint8_t (1 byte).

< int16_t (2 bytes).

< uint16_t (2 bytes).

< int32_t (4 bytes).

< uint32_t (4 bytes).

< int64_t (8 bytes).

< uint64_t (8 bytes).

< IEEE-754 half precision (2 bytes).

< Brain float (2 bytes).

< IEEE-754 single precision (4 bytes).

< IEEE-754 double precision (8 bytes).

Device hint indicating where the data buffer physically lives.

< Host / CPU memory.

< Discrete or integrated GPU memory.

< Neural processing unit (e.g. automotive NPU).

< Digital signal processor.

Default-constructs an empty tensor and asserts the 248-byte contract.

Frees the owned data buffer when is_owner() is true.

Deep-copies target into a freshly allocated tensor.

参数
targetSource tensor to clone.

Steals target's allocation and metadata; target ends empty.

参数
targetSource tensor moved from.

Deep-copy-assigns target; self-assignment is a no-op.

参数
targetSource tensor to clone.
返回
Reference to *this.

Move-assigns target; self-assignment is a no-op.

参数
targetSource tensor moved from.
返回
Reference to *this.

Deserialises a Tensor from bytes with zero-copy borrowing semantics.

Two fields are sanitised after the struct snapshot is restored: rank_ is clamped to kMaxRank, and element_size_ is re-derived from dtype_ to stay consistent regardless of producer-side mistakes.

参数
bytesWire buffer previously produced by operator>>.
返回
true on success.

Serialises the struct snapshot plus element bytes into bytes.

参数
bytesOutput buffer; resized automatically when its size differs from the serialized size.
返回
Always true.

Validates that bytes carries a well-formed Tensor envelope.

参数
bytesWire buffer to inspect.
返回
true when both magic sentinels match and the minimum size holds.

Total bytes that operator>> would write for this tensor.

返回
sizeof(magic_begin) + sizeof(version) + sizeof(Tensor) + size() + sizeof(magic_end).

Whether the data buffer pointer is non-null and the byte size is positive.

返回
true when the tensor holds usable data.

Borrows target's data buffer without copying.

参数
targetSource tensor whose buffer must outlive *this.
返回
false on self-borrow, otherwise true.

Allocates (or reuses) an owned buffer and copies target's elements.

参数
targetSource tensor to clone.
返回
false on self-copy, otherwise true.

Transfers ownership from target; target ends empty.

参数
targetSource tensor moved from.
返回
false on self-move, otherwise true.

Allocates an uninitialised owned data buffer of size bytes.

The caller is responsible for keeping size consistent with num_elements() * element_size().

参数
sizeByte count; must be non-zero.
返回
false when size is zero, otherwise true.

Releases the owned buffer (if any) and resets metadata except reserved fields.

Borrows an externally owned data buffer without copying.

参数
dataNon-null source pointer that must outlive *this.
sizeBuffer length in bytes; must be non-zero.
返回
false on invalid arguments or unchanged pointer, otherwise true.

Copies size bytes from data into an owned buffer.

参数
dataNon-null source pointer.
sizeNumber of bytes to copy; must be non-zero.
返回
false on invalid arguments or aliasing, otherwise true.

Compatibility alias for deep_copy(uint8_t*, size_t).

参数
dataSource pointer.
sizeNumber of bytes.
返回
Result of the delegated deep_copy call.

Producer-side tensor timestamp in nanoseconds.

返回
Stored value.

Cached total element count (product of shape() dimensions).

返回
Stored element count.

Tensor name (e.g. "image", "hidden_state").

返回
Non-owning view into the embedded buffer.

Source model identifier.

返回
Non-owning view into the embedded buffer.

Layout label (e.g. "NCHW", "NHWC", "BLC").

返回
Non-owning view into the embedded buffer.

Read-only pointer to the kMaxRank-sized shape array.

返回
Pointer into the embedded array; never nullptr.

Shape value at dimension dim, or 0 if dim is out of range.

参数
dimDimension index.
返回
Shape entry.

Read-only pointer to the kMaxRank-sized stride array (in elements, not bytes).

返回
Pointer into the embedded array; never nullptr.

Stride value at dimension dim, or 0 if dim is out of range.

参数
dimDimension index.
返回
Stride entry.

Sensor / producer / output-port channel identifier.

返回
Stored channel id.

Nominal publish frequency in Hz.

返回
Stored value.

Cached batch size (typically shape_at(0)).

返回
Stored batch size.

INT8 quantisation scale (0 when unused).

返回
Stored scale.

INT8 quantisation zero point (0 when unused).

返回
Stored zero point.

Scalar element type tag.

返回
DataType enum value.

Actual tensor rank in the range 1..kMaxRank.

返回
Stored rank.

Device hint indicating where the data buffer lives.

返回
Device enum value.

Cached byte size of one element derived from dtype().

返回
Element size in bytes.

Read-only pointer to the element bytes.

返回
Pointer to payload start.

Element buffer size in bytes.

返回
Byte count.

Whether this tensor owns its data buffer.

返回
true when the destructor would free the buffer.

Stores the tensor timestamp.

参数
update_time_nsTimestamp in nanoseconds.

Stores the tensor name (truncated to sizeof(name) - 1 bytes).

参数
nameTensor name.

Stores the source model identifier (truncated to sizeof(model_id) - 1 bytes).

参数
model_idModel identifier.

Stores the layout label (truncated to sizeof(layout) - 1 bytes).

参数
layoutLayout descriptor.

Stores the full shape array and recomputes row-major strides plus num_elements.

rank is clamped to kMaxRank. Strides are derived assuming a contiguous row-major layout (last dimension changes fastest). batch_size is cached from shape[0] when rank > 0.

参数
shapePointer to a shape array of length rank.
rankNumber of valid dimensions.

Stores a single shape entry without recomputing strides.

参数
dimDimension index.
valueShape value.

Stores a single stride entry.

参数
dimDimension index.
valueStride value (in elements, not bytes).

Stores the sensor / producer / output-port channel identifier.

参数
channelChannel id.

Stores the nominal publish frequency.

参数
freqFrequency in Hz.

Stores the cached batch size.

参数
batch_sizeStored value.

Stores the INT8 quantisation scale.

参数
quant_scaleStored value.

Stores the INT8 quantisation zero point.

参数
quant_zero_pointStored value.

Stores the scalar element type tag and caches the derived element size.

参数
dtypeDataType enum value.

Stores the device hint.

参数
deviceDevice enum value.

Returns the byte size of one element of dtype.

参数
dtypeElement type tag.
返回
Element size in bytes (0 for kDataUnknown).

Mutable accessor for the first wire-locked reserved field (uint8_t).

返回
Reference to reserved_buf_.

Mutable accessor for the second wire-locked reserved field (uint16_t).

返回
Reference to reserved_buf2_.

Mutable accessor for the third wire-locked reserved field (uint32_t).

返回
Reference to reserved_buf3_.

< Sequencing and timestamp metadata prefix.

< Marker probed by the VLink type-trait machinery.

变量说明

◆ kWireVersion

constexpr uint32_t vlink::zerocopy::kWireVersion
inlineconstexpr
初始值:
= (static_cast<uint32_t>(VLINK_VERSION_MAJOR) * 1000000U) +
(static_cast<uint32_t>(VLINK_VERSION_MINOR) * 1000U) +
static_cast<uint32_t>(VLINK_VERSION_PATCH)
#define VLINK_VERSION_PATCH
Definition: version.h:94
#define VLINK_VERSION_MAJOR
Definition: version.h:92
#define VLINK_VERSION_MINOR
Definition: version.h:93

Encoded VLink library version stamped into every zero-copy wire envelope.

The library version triple is packed as decimal major*1000000 + minor*1000 + patch (each component in 0..100), e.g. version 2.10.8 encodes as the integer 2010008. Producers write this uint32_t immediately after the begin-magic sentinel; consumers reject any payload whose major component differs from the local kWireVersion (see version_major()). Minor and patch components are carried for diagnostics but are not gated.