class BufferRegion

Defined at line 204 of file ../../src/connectivity/lib/network-device/cpp/network_device_client.h

A contiguous buffer region.

`Buffer`s are composed of N disjoint `BufferRegion`s, accessible through `BufferData`.

Public Methods

BufferRegion & operator= (BufferRegion && )

Move assignment deleted to abide by `Buffer` destruction semantics.

See `Buffer` for more details.

Defined at line 233 of file ../../src/connectivity/lib/network-device/cpp/network_device_client.h

void BufferRegion (BufferRegion && other)

Defined at line 234 of file ../../src/connectivity/lib/network-device/cpp/network_device_client.h

void CapLength (uint32_t len)

Caps this buffer to `len` bytes.

If the buffer's length is smaller than `len`, `CapLength` does nothing.

Defined at line 1099 of file ../../src/connectivity/lib/network-device/cpp/network_device_client.cc

uint32_t len ()

Defined at line 1106 of file ../../src/connectivity/lib/network-device/cpp/network_device_client.cc

cpp20::span<uint8_t> data ()

Defined at line 1108 of file ../../src/connectivity/lib/network-device/cpp/network_device_client.cc

cpp20::span<const uint8_t> data ()

Defined at line 1112 of file ../../src/connectivity/lib/network-device/cpp/network_device_client.cc

size_t Write (const void * src, size_t len, size_t offset)

Writes `len` bytes from `src` into this region starting at `offset`.

Returns the number of bytes that were written.

Defined at line 1116 of file ../../src/connectivity/lib/network-device/cpp/network_device_client.cc

size_t Read (void * dst, size_t len, size_t offset)

Reads `len` bytes from this region into `dst` starting at `offset`.

Returns the number of bytes that were read.

Defined at line 1123 of file ../../src/connectivity/lib/network-device/cpp/network_device_client.cc

size_t Write (size_t offset, const BufferRegion & src, size_t src_offset)

Writes the `src` region starting at `src_offset` into this region starting at `offset`.

Returns the number of bytes written.

Defined at line 1132 of file ../../src/connectivity/lib/network-device/cpp/network_device_client.cc

size_t PadTo (size_t size)

Zero pads this region to `size`, returning the new size of the buffer.

The returned value may be smaller than `size` if the amount of space available is not large

enough or larger if the buffer is already larger than `size.`

Defined at line 1142 of file ../../src/connectivity/lib/network-device/cpp/network_device_client.cc

Protected Methods

void BufferRegion ()

Defined at line 238 of file ../../src/connectivity/lib/network-device/cpp/network_device_client.h

Friends

class BufferData