WPILibC++
2027.0.0-alpha-3
Loading...
Searching...
No Matches
map_entry.h
Go to the documentation of this file.
1
// Protocol Buffers - Google's data interchange format
2
// Copyright 2023 Google LLC. All rights reserved.
3
//
4
// Use of this source code is governed by a BSD-style
5
// license that can be found in the LICENSE file or at
6
// https://developers.google.com/open-source/licenses/bsd
7
8
#ifndef UPB_MESSAGE_INTERNAL_MAP_ENTRY_H_
9
#define UPB_MESSAGE_INTERNAL_MAP_ENTRY_H_
10
11
#include <stdint.h>
12
13
#include "
upb/base/string_view.h
"
14
#include "
upb/hash/common.h
"
15
#include "
upb/message/internal/types.h
"
16
17
// Map entries aren't actually stored for map fields, they are only used during
18
// parsing. (It helps a lot if all map entry messages have the same layout.)
19
// The mini_table layout code will ensure that all map entries have this layout.
20
//
21
// Note that users can and do create map entries directly, which will also use
22
// this layout.
23
24
typedef
struct
{
25
struct
upb_Message
message;
26
// We only need 2 hasbits max, but due to alignment we'll use 8 bytes here,
27
// and the uint64_t helps make this clear.
28
uint64_t
hasbits
;
29
union
{
30
upb_StringView
str
;
// For str/bytes.
31
upb_value
val
;
// For all other types.
32
double
d
[2];
// Padding for 32-bit builds.
33
} k;
34
union
{
35
upb_StringView
str;
// For str/bytes.
36
upb_value
val;
// For all other types.
37
double
d[2];
// Padding for 32-bit builds.
38
} v;
39
}
upb_MapEntry
;
40
41
#endif
// UPB_MESSAGE_INTERNAL_MAP_ENTRY_H_
common.h
string_view.h
upb_MapEntry
Definition
map_entry.h:24
upb_MapEntry::str
upb_StringView str
Definition
map_entry.h:30
upb_MapEntry::val
upb_value val
Definition
map_entry.h:31
upb_MapEntry::hasbits
uint64_t hasbits
Definition
map_entry.h:28
upb_Message
Definition
types.h:18
upb_Message::d
double d
Definition
types.h:21
upb_StringView
Definition
string_view.h:23
upb_value
Definition
common.h:44
types.h
upb
message
internal
map_entry.h
Generated on Fri Oct 24 2025 05:38:27 for WPILibC++ by
1.12.0