GRPC C++  1.39.1
collection_entry.upb.h
Go to the documentation of this file.
1 /* This file was generated by upbc (the upb compiler) from the input
2  * file:
3  *
4  * xds/core/v3/collection_entry.proto
5  *
6  * Do not edit -- your changes will be discarded when the file is
7  * regenerated. */
8 
9 #ifndef XDS_CORE_V3_COLLECTION_ENTRY_PROTO_UPB_H_
10 #define XDS_CORE_V3_COLLECTION_ENTRY_PROTO_UPB_H_
11 
12 #include "upb/msg.h"
13 #include "upb/decode.h"
14 #include "upb/decode_fast.h"
15 #include "upb/encode.h"
16 
17 #include "upb/port_def.inc"
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
27 extern const upb_msglayout xds_core_v3_CollectionEntry_msginit;
28 extern const upb_msglayout xds_core_v3_CollectionEntry_InlineEntry_msginit;
29 struct google_protobuf_Any;
31 extern const upb_msglayout google_protobuf_Any_msginit;
32 extern const upb_msglayout xds_core_v3_ResourceLocator_msginit;
33 
34 
35 /* xds.core.v3.CollectionEntry */
36 
39 }
40 UPB_INLINE xds_core_v3_CollectionEntry *xds_core_v3_CollectionEntry_parse(const char *buf, size_t size,
41  upb_arena *arena) {
43  return (ret && upb_decode(buf, size, ret, &xds_core_v3_CollectionEntry_msginit, arena)) ? ret : NULL;
44 }
45 UPB_INLINE xds_core_v3_CollectionEntry *xds_core_v3_CollectionEntry_parse_ex(const char *buf, size_t size,
46  upb_arena *arena, int options) {
48  return (ret && _upb_decode(buf, size, ret, &xds_core_v3_CollectionEntry_msginit, arena, options))
49  ? ret : NULL;
50 }
51 UPB_INLINE char *xds_core_v3_CollectionEntry_serialize(const xds_core_v3_CollectionEntry *msg, upb_arena *arena, size_t *len) {
52  return upb_encode(msg, &xds_core_v3_CollectionEntry_msginit, arena, len);
53 }
54 
55 typedef enum {
61 
62 UPB_INLINE bool xds_core_v3_CollectionEntry_has_locator(const xds_core_v3_CollectionEntry *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
63 UPB_INLINE const struct xds_core_v3_ResourceLocator* xds_core_v3_CollectionEntry_locator(const xds_core_v3_CollectionEntry *msg) { return UPB_READ_ONEOF(msg, const struct xds_core_v3_ResourceLocator*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
64 UPB_INLINE bool xds_core_v3_CollectionEntry_has_inline_entry(const xds_core_v3_CollectionEntry *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
65 UPB_INLINE const xds_core_v3_CollectionEntry_InlineEntry* xds_core_v3_CollectionEntry_inline_entry(const xds_core_v3_CollectionEntry *msg) { return UPB_READ_ONEOF(msg, const xds_core_v3_CollectionEntry_InlineEntry*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
66 
68  UPB_WRITE_ONEOF(msg, struct xds_core_v3_ResourceLocator*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
69 }
72  if (sub == NULL) {
74  if (!sub) return NULL;
76  }
77  return sub;
78 }
80  UPB_WRITE_ONEOF(msg, xds_core_v3_CollectionEntry_InlineEntry*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
81 }
84  if (sub == NULL) {
86  if (!sub) return NULL;
88  }
89  return sub;
90 }
91 
92 /* xds.core.v3.CollectionEntry.InlineEntry */
93 
96 }
98  upb_arena *arena) {
100  return (ret && upb_decode(buf, size, ret, &xds_core_v3_CollectionEntry_InlineEntry_msginit, arena)) ? ret : NULL;
101 }
103  upb_arena *arena, int options) {
105  return (ret && _upb_decode(buf, size, ret, &xds_core_v3_CollectionEntry_InlineEntry_msginit, arena, options))
106  ? ret : NULL;
107 }
109  return upb_encode(msg, &xds_core_v3_CollectionEntry_InlineEntry_msginit, arena, len);
110 }
111 
112 UPB_INLINE upb_strview xds_core_v3_CollectionEntry_InlineEntry_name(const xds_core_v3_CollectionEntry_InlineEntry *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
113 UPB_INLINE upb_strview xds_core_v3_CollectionEntry_InlineEntry_version(const xds_core_v3_CollectionEntry_InlineEntry *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
115 UPB_INLINE const struct google_protobuf_Any* xds_core_v3_CollectionEntry_InlineEntry_resource(const xds_core_v3_CollectionEntry_InlineEntry *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_Any*); }
116 
118  *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
119 }
121  *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
122 }
124  _upb_sethas(msg, 1);
125  *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_Any*) = value;
126 }
129  if (sub == NULL) {
130  sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
131  if (!sub) return NULL;
133  }
134  return sub;
135 }
136 
137 #ifdef __cplusplus
138 } /* extern "C" */
139 #endif
140 
141 #include "upb/port_undef.inc"
142 
143 #endif /* XDS_CORE_V3_COLLECTION_ENTRY_PROTO_UPB_H_ */
struct google_protobuf_Any google_protobuf_Any
Definition: any.upb.h:24
const upb_msglayout xds_core_v3_ResourceLocator_msginit
Definition: resource_locator.upb.c:32
UPB_INLINE bool xds_core_v3_CollectionEntry_InlineEntry_has_resource(const xds_core_v3_CollectionEntry_InlineEntry *msg)
Definition: collection_entry.upb.h:114
UPB_INLINE xds_core_v3_CollectionEntry_InlineEntry * xds_core_v3_CollectionEntry_InlineEntry_parse(const char *buf, size_t size, upb_arena *arena)
Definition: collection_entry.upb.h:97
UPB_INLINE struct xds_core_v3_ResourceLocator * xds_core_v3_CollectionEntry_mutable_locator(xds_core_v3_CollectionEntry *msg, upb_arena *arena)
Definition: collection_entry.upb.h:70
UPB_INLINE bool xds_core_v3_CollectionEntry_has_inline_entry(const xds_core_v3_CollectionEntry *msg)
Definition: collection_entry.upb.h:64
UPB_INLINE const xds_core_v3_CollectionEntry_InlineEntry * xds_core_v3_CollectionEntry_inline_entry(const xds_core_v3_CollectionEntry *msg)
Definition: collection_entry.upb.h:65
UPB_INLINE void xds_core_v3_CollectionEntry_set_locator(xds_core_v3_CollectionEntry *msg, struct xds_core_v3_ResourceLocator *value)
Definition: collection_entry.upb.h:67
const upb_msglayout xds_core_v3_CollectionEntry_msginit
Definition: collection_entry.upb.c:29
const upb_msglayout xds_core_v3_CollectionEntry_InlineEntry_msginit
Definition: collection_entry.upb.c:45
UPB_INLINE char * xds_core_v3_CollectionEntry_InlineEntry_serialize(const xds_core_v3_CollectionEntry_InlineEntry *msg, upb_arena *arena, size_t *len)
Definition: collection_entry.upb.h:108
UPB_INLINE xds_core_v3_CollectionEntry_InlineEntry * xds_core_v3_CollectionEntry_InlineEntry_new(upb_arena *arena)
Definition: collection_entry.upb.h:94
struct xds_core_v3_CollectionEntry_InlineEntry xds_core_v3_CollectionEntry_InlineEntry
Definition: collection_entry.upb.h:26
UPB_INLINE xds_core_v3_CollectionEntry * xds_core_v3_CollectionEntry_parse_ex(const char *buf, size_t size, upb_arena *arena, int options)
Definition: collection_entry.upb.h:45
xds_core_v3_CollectionEntry_resource_specifier_oneofcases
Definition: collection_entry.upb.h:55
@ xds_core_v3_CollectionEntry_resource_specifier_NOT_SET
Definition: collection_entry.upb.h:58
@ xds_core_v3_CollectionEntry_resource_specifier_inline_entry
Definition: collection_entry.upb.h:57
@ xds_core_v3_CollectionEntry_resource_specifier_locator
Definition: collection_entry.upb.h:56
UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_set_resource(xds_core_v3_CollectionEntry_InlineEntry *msg, struct google_protobuf_Any *value)
Definition: collection_entry.upb.h:123
UPB_INLINE char * xds_core_v3_CollectionEntry_serialize(const xds_core_v3_CollectionEntry *msg, upb_arena *arena, size_t *len)
Definition: collection_entry.upb.h:51
struct xds_core_v3_CollectionEntry xds_core_v3_CollectionEntry
Definition: collection_entry.upb.h:25
UPB_INLINE struct xds_core_v3_CollectionEntry_InlineEntry * xds_core_v3_CollectionEntry_mutable_inline_entry(xds_core_v3_CollectionEntry *msg, upb_arena *arena)
Definition: collection_entry.upb.h:82
UPB_INLINE xds_core_v3_CollectionEntry * xds_core_v3_CollectionEntry_new(upb_arena *arena)
Definition: collection_entry.upb.h:37
UPB_INLINE struct google_protobuf_Any * xds_core_v3_CollectionEntry_InlineEntry_mutable_resource(xds_core_v3_CollectionEntry_InlineEntry *msg, upb_arena *arena)
Definition: collection_entry.upb.h:127
UPB_INLINE xds_core_v3_CollectionEntry_resource_specifier_oneofcases xds_core_v3_CollectionEntry_resource_specifier_case(const xds_core_v3_CollectionEntry *msg)
Definition: collection_entry.upb.h:60
UPB_INLINE const struct google_protobuf_Any * xds_core_v3_CollectionEntry_InlineEntry_resource(const xds_core_v3_CollectionEntry_InlineEntry *msg)
Definition: collection_entry.upb.h:115
UPB_INLINE void xds_core_v3_CollectionEntry_set_inline_entry(xds_core_v3_CollectionEntry *msg, xds_core_v3_CollectionEntry_InlineEntry *value)
Definition: collection_entry.upb.h:79
UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_set_version(xds_core_v3_CollectionEntry_InlineEntry *msg, upb_strview value)
Definition: collection_entry.upb.h:120
UPB_INLINE upb_strview xds_core_v3_CollectionEntry_InlineEntry_name(const xds_core_v3_CollectionEntry_InlineEntry *msg)
Definition: collection_entry.upb.h:112
UPB_INLINE upb_strview xds_core_v3_CollectionEntry_InlineEntry_version(const xds_core_v3_CollectionEntry_InlineEntry *msg)
Definition: collection_entry.upb.h:113
UPB_INLINE xds_core_v3_CollectionEntry * xds_core_v3_CollectionEntry_parse(const char *buf, size_t size, upb_arena *arena)
Definition: collection_entry.upb.h:40
UPB_INLINE xds_core_v3_CollectionEntry_InlineEntry * xds_core_v3_CollectionEntry_InlineEntry_parse_ex(const char *buf, size_t size, upb_arena *arena, int options)
Definition: collection_entry.upb.h:102
UPB_INLINE bool xds_core_v3_CollectionEntry_has_locator(const xds_core_v3_CollectionEntry *msg)
Definition: collection_entry.upb.h:62
UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_set_name(xds_core_v3_CollectionEntry_InlineEntry *msg, upb_strview value)
Definition: collection_entry.upb.h:117
const upb_msglayout google_protobuf_Any_msginit
Definition: any.upb.c:20
UPB_INLINE const struct xds_core_v3_ResourceLocator * xds_core_v3_CollectionEntry_locator(const xds_core_v3_CollectionEntry *msg)
Definition: collection_entry.upb.h:63
struct xds_core_v3_ResourceLocator xds_core_v3_ResourceLocator
Definition: resource_locator.upb.h:25
upb_arena * arena
Definition: xds_api.cc:909