C/C++ API Reference
Loading...
Searching...
No Matches
entry.h
1// Copyright 2025 The Pigweed Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License"); you may not
4// use this file except in compliance with the License. You may obtain a copy of
5// the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12// License for the specific language governing permissions and limitations under
13// the License.
14#pragma once
15
16#include <cstddef>
17#include <cstdint>
18#include <limits>
19
20namespace pw::multibuf_impl {
21
34union Entry {
37 using size_type = uint16_t;
38
40 static constexpr size_t kMaxSize = ~(1U << 15);
41
43 std::byte* data;
44
46 struct BaseView {
49
53
56
60 } base_view;
61
64 struct View {
67
73
76
81 } view;
82};
83
84} // namespace pw::multibuf_impl
The first entry after the data.
Definition: entry.h:46
size_type shared
Definition: entry.h:59
size_type owned
Definition: entry.h:52
size_type offset
Starting offset within the buffer of the data to present.
Definition: entry.h:48
size_type length
Amount of data from the buffer to present.
Definition: entry.h:55
Definition: entry.h:64
size_type length
Amount of data from the buffer to present.
Definition: entry.h:75
size_type offset
Starting offset within the buffer of the data to present.
Definition: entry.h:66
size_type boundary
Definition: entry.h:80
size_type sealed
Definition: entry.h:72
Definition: entry.h:34
std::byte * data
Pointer to memory.
Definition: entry.h:43
static constexpr size_t kMaxSize
Offset and length must fit in 15 bits.
Definition: entry.h:40
uint16_t size_type
Definition: entry.h:37