WPILibC++ 2027.0.0-alpha-3
Loading...
Searching...
No Matches
message.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_MINI_TABLE_MESSAGE_H_
9#define UPB_MINI_TABLE_MESSAGE_H_
10
11#include <stdint.h>
12
13#include "upb/mini_table/enum.h"
16
17// Must be last.
18#include "upb/port/def.inc"
19
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
27 const upb_MiniTable* m, uint32_t number);
28
30 const upb_MiniTable* m, uint32_t index);
31
33
35
36// DEPRECATED: use upb_MiniTable_SubMessage() instead
37// Returns the MiniTable for a message field, NULL if the field is unlinked.
39 const upb_MiniTable* m, const upb_MiniTableField* f);
40
41// Returns the MiniTable for a message field if it is a submessage, otherwise
42// returns NULL.
43//
44// WARNING: if dynamic tree shaking is in use, the return value may be the
45// "empty", zero-field placeholder message instead of the real message type.
46// If the message is later linked, this function will begin returning the real
47// message type.
49 const upb_MiniTable* m, const upb_MiniTableField* f);
50
51// Returns the MiniTable for a map field. The given field must refer to a map.
53 const upb_MiniTable* m, const upb_MiniTableField* f);
54
55// Returns the MiniTableEnum for a message field, NULL if the field is unlinked.
57 const upb_MiniTable* m, const upb_MiniTableField* f);
58
59// Returns the MiniTableField for the key of a map.
61 const upb_MiniTable* m);
62
63// Returns the MiniTableField for the value of a map.
65 const upb_MiniTable* m);
66
67// Returns true if this MiniTable field is linked to a MiniTable for the
68// sub-message.
70 const upb_MiniTableField* f);
71
72// If this field is in a oneof, returns the first field in the oneof.
73//
74// Otherwise returns NULL.
75//
76// Usage:
77// const upb_MiniTableField* field = upb_MiniTable_GetOneof(m, f);
78// do {
79// ..
80// } while (upb_MiniTable_NextOneofField(m, &field);
81//
83 const upb_MiniTableField* f);
84
85// Iterates to the next field in the oneof. If this is the last field in the
86// oneof, returns false. The ordering of fields in the oneof is not
87// guaranteed.
88// REQUIRES: |f| is the field initialized by upb_MiniTable_GetOneof and updated
89// by prior upb_MiniTable_NextOneofField calls.
91 const upb_MiniTableField** f);
92
93#ifdef __cplusplus
94} /* extern "C" */
95#endif
96
97#include "upb/port/undef.inc"
98
99#endif /* UPB_MINI_TABLE_MESSAGE_H_ */
#define UPB_API_INLINE
Definition def.inc:163
UPB_API_INLINE const struct upb_MiniTable * upb_MiniTable_SubMessage(const struct upb_MiniTable *m, const struct upb_MiniTableField *f)
Definition message.h:179
UPB_API_INLINE bool upb_MiniTable_IsMessageSet(const struct upb_MiniTable *m)
Definition message.h:113
UPB_API_INLINE const struct upb_MiniTableEnum * upb_MiniTable_GetSubEnumTable(const struct upb_MiniTable *m, const struct upb_MiniTableField *f)
Definition message.h:208
UPB_API_INLINE int upb_MiniTable_FieldCount(const struct upb_MiniTable *m)
Definition message.h:109
UPB_API_INLINE const struct upb_MiniTableField * upb_MiniTable_MapKey(const struct upb_MiniTable *m)
Definition message.h:215
UPB_API_INLINE const struct upb_MiniTable * upb_MiniTable_MapEntrySubMessage(const struct upb_MiniTable *m, const struct upb_MiniTableField *f)
Definition message.h:201
UPB_API_INLINE const struct upb_MiniTableField * upb_MiniTable_MapValue(const struct upb_MiniTable *m)
Definition message.h:223
UPB_API_INLINE const struct upb_MiniTableField * upb_MiniTable_GetFieldByIndex(const struct upb_MiniTable *m, uint32_t i)
Definition message.h:168
UPB_API_INLINE bool upb_MiniTable_FieldIsLinked(const struct upb_MiniTable *m, const struct upb_MiniTableField *f)
Definition message.h:196
UPB_API_INLINE const struct upb_MiniTableField * upb_MiniTable_FindFieldByNumber(const struct upb_MiniTable *m, uint32_t number)
Definition message.h:118
UPB_API_INLINE const struct upb_MiniTable * upb_MiniTable_GetSubMessageTable(const struct upb_MiniTable *m, const struct upb_MiniTableField *f)
Definition message.h:188
bool upb_MiniTable_NextOneofField(const upb_MiniTable *m, const upb_MiniTableField **f)
const upb_MiniTableField * upb_MiniTable_GetOneof(const upb_MiniTable *m, const upb_MiniTableField *f)
Definition enum.h:16
Definition field.h:21
Definition message.h:54