C/C++ API Reference
Loading...
Searching...
No Matches
pw::multibuf_impl::Entry Union Reference

Overview

Describes either a memory location or a view of an associated location.

This module stores byte buffers in queues using sequences of entries. The first entry holds an address, and subsequent entries hold the offset and lengths of ever-narrower views of that data. This provides a compact representation of data encoded using nested or layered protocols.

For example, in a TCP/IP stack:

  • The first entry hold addresses to Ethernet frames.
  • The second entry holds a zero offset and the whole frame length.
  • The third entry holds the offset and length describing the IP data.
  • The fourth entry holds the offset and length describing the TCP data.

Classes

struct  BaseView
 The first entry after the data. More...
 
struct  View
 

Public Types

using size_type = uint16_t
 

Public Attributes

std::byte * data
 Pointer to memory.
 
struct pw::multibuf_impl::Entry::BaseView base_view
 
struct pw::multibuf_impl::Entry::View view
 

Static Public Attributes

static constexpr size_t kMaxSize = ~(1U << 15)
 Offset and length must fit in 15 bits.
 

Member Typedef Documentation

◆ size_type

Entries fit in a single word on 32-bit platforms and larger. Fields are ordered in such a way to ensure this is true on supported platforms.


The documentation for this union was generated from the following file: