• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
23 struct xds_core_v3_CollectionEntry;
24 struct xds_core_v3_CollectionEntry_InlineEntry;
25 typedef struct xds_core_v3_CollectionEntry xds_core_v3_CollectionEntry;
26 typedef struct xds_core_v3_CollectionEntry_InlineEntry xds_core_v3_CollectionEntry_InlineEntry;
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;
30 struct xds_core_v3_ResourceLocator;
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 
xds_core_v3_CollectionEntry_new(upb_arena * arena)37 UPB_INLINE xds_core_v3_CollectionEntry *xds_core_v3_CollectionEntry_new(upb_arena *arena) {
38   return (xds_core_v3_CollectionEntry *)_upb_msg_new(&xds_core_v3_CollectionEntry_msginit, arena);
39 }
xds_core_v3_CollectionEntry_parse(const char * buf,size_t size,upb_arena * arena)40 UPB_INLINE xds_core_v3_CollectionEntry *xds_core_v3_CollectionEntry_parse(const char *buf, size_t size,
41                         upb_arena *arena) {
42   xds_core_v3_CollectionEntry *ret = xds_core_v3_CollectionEntry_new(arena);
43   return (ret && upb_decode(buf, size, ret, &xds_core_v3_CollectionEntry_msginit, arena)) ? ret : NULL;
44 }
xds_core_v3_CollectionEntry_parse_ex(const char * buf,size_t size,upb_arena * arena,int options)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) {
47   xds_core_v3_CollectionEntry *ret = xds_core_v3_CollectionEntry_new(arena);
48   return (ret && _upb_decode(buf, size, ret, &xds_core_v3_CollectionEntry_msginit, arena, options))
49       ? ret : NULL;
50 }
xds_core_v3_CollectionEntry_serialize(const xds_core_v3_CollectionEntry * msg,upb_arena * arena,size_t * len)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 {
56   xds_core_v3_CollectionEntry_resource_specifier_locator = 1,
57   xds_core_v3_CollectionEntry_resource_specifier_inline_entry = 2,
58   xds_core_v3_CollectionEntry_resource_specifier_NOT_SET = 0
59 } xds_core_v3_CollectionEntry_resource_specifier_oneofcases;
xds_core_v3_CollectionEntry_resource_specifier_case(const xds_core_v3_CollectionEntry * msg)60 UPB_INLINE xds_core_v3_CollectionEntry_resource_specifier_oneofcases xds_core_v3_CollectionEntry_resource_specifier_case(const xds_core_v3_CollectionEntry* msg) { return (xds_core_v3_CollectionEntry_resource_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
61 
xds_core_v3_CollectionEntry_has_locator(const xds_core_v3_CollectionEntry * msg)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; }
xds_core_v3_CollectionEntry_locator(const xds_core_v3_CollectionEntry * msg)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); }
xds_core_v3_CollectionEntry_has_inline_entry(const xds_core_v3_CollectionEntry * msg)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; }
xds_core_v3_CollectionEntry_inline_entry(const xds_core_v3_CollectionEntry * msg)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 
xds_core_v3_CollectionEntry_set_locator(xds_core_v3_CollectionEntry * msg,struct xds_core_v3_ResourceLocator * value)67 UPB_INLINE void xds_core_v3_CollectionEntry_set_locator(xds_core_v3_CollectionEntry *msg, struct xds_core_v3_ResourceLocator* value) {
68   UPB_WRITE_ONEOF(msg, struct xds_core_v3_ResourceLocator*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
69 }
xds_core_v3_CollectionEntry_mutable_locator(xds_core_v3_CollectionEntry * msg,upb_arena * arena)70 UPB_INLINE struct xds_core_v3_ResourceLocator* xds_core_v3_CollectionEntry_mutable_locator(xds_core_v3_CollectionEntry *msg, upb_arena *arena) {
71   struct xds_core_v3_ResourceLocator* sub = (struct xds_core_v3_ResourceLocator*)xds_core_v3_CollectionEntry_locator(msg);
72   if (sub == NULL) {
73     sub = (struct xds_core_v3_ResourceLocator*)_upb_msg_new(&xds_core_v3_ResourceLocator_msginit, arena);
74     if (!sub) return NULL;
75     xds_core_v3_CollectionEntry_set_locator(msg, sub);
76   }
77   return sub;
78 }
xds_core_v3_CollectionEntry_set_inline_entry(xds_core_v3_CollectionEntry * msg,xds_core_v3_CollectionEntry_InlineEntry * value)79 UPB_INLINE void xds_core_v3_CollectionEntry_set_inline_entry(xds_core_v3_CollectionEntry *msg, xds_core_v3_CollectionEntry_InlineEntry* value) {
80   UPB_WRITE_ONEOF(msg, xds_core_v3_CollectionEntry_InlineEntry*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
81 }
xds_core_v3_CollectionEntry_mutable_inline_entry(xds_core_v3_CollectionEntry * msg,upb_arena * arena)82 UPB_INLINE struct xds_core_v3_CollectionEntry_InlineEntry* xds_core_v3_CollectionEntry_mutable_inline_entry(xds_core_v3_CollectionEntry *msg, upb_arena *arena) {
83   struct xds_core_v3_CollectionEntry_InlineEntry* sub = (struct xds_core_v3_CollectionEntry_InlineEntry*)xds_core_v3_CollectionEntry_inline_entry(msg);
84   if (sub == NULL) {
85     sub = (struct xds_core_v3_CollectionEntry_InlineEntry*)_upb_msg_new(&xds_core_v3_CollectionEntry_InlineEntry_msginit, arena);
86     if (!sub) return NULL;
87     xds_core_v3_CollectionEntry_set_inline_entry(msg, sub);
88   }
89   return sub;
90 }
91 
92 /* xds.core.v3.CollectionEntry.InlineEntry */
93 
xds_core_v3_CollectionEntry_InlineEntry_new(upb_arena * arena)94 UPB_INLINE xds_core_v3_CollectionEntry_InlineEntry *xds_core_v3_CollectionEntry_InlineEntry_new(upb_arena *arena) {
95   return (xds_core_v3_CollectionEntry_InlineEntry *)_upb_msg_new(&xds_core_v3_CollectionEntry_InlineEntry_msginit, arena);
96 }
xds_core_v3_CollectionEntry_InlineEntry_parse(const char * buf,size_t size,upb_arena * arena)97 UPB_INLINE xds_core_v3_CollectionEntry_InlineEntry *xds_core_v3_CollectionEntry_InlineEntry_parse(const char *buf, size_t size,
98                         upb_arena *arena) {
99   xds_core_v3_CollectionEntry_InlineEntry *ret = xds_core_v3_CollectionEntry_InlineEntry_new(arena);
100   return (ret && upb_decode(buf, size, ret, &xds_core_v3_CollectionEntry_InlineEntry_msginit, arena)) ? ret : NULL;
101 }
xds_core_v3_CollectionEntry_InlineEntry_parse_ex(const char * buf,size_t size,upb_arena * arena,int options)102 UPB_INLINE xds_core_v3_CollectionEntry_InlineEntry *xds_core_v3_CollectionEntry_InlineEntry_parse_ex(const char *buf, size_t size,
103                            upb_arena *arena, int options) {
104   xds_core_v3_CollectionEntry_InlineEntry *ret = xds_core_v3_CollectionEntry_InlineEntry_new(arena);
105   return (ret && _upb_decode(buf, size, ret, &xds_core_v3_CollectionEntry_InlineEntry_msginit, arena, options))
106       ? ret : NULL;
107 }
xds_core_v3_CollectionEntry_InlineEntry_serialize(const xds_core_v3_CollectionEntry_InlineEntry * msg,upb_arena * arena,size_t * len)108 UPB_INLINE char *xds_core_v3_CollectionEntry_InlineEntry_serialize(const xds_core_v3_CollectionEntry_InlineEntry *msg, upb_arena *arena, size_t *len) {
109   return upb_encode(msg, &xds_core_v3_CollectionEntry_InlineEntry_msginit, arena, len);
110 }
111 
xds_core_v3_CollectionEntry_InlineEntry_name(const xds_core_v3_CollectionEntry_InlineEntry * msg)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); }
xds_core_v3_CollectionEntry_InlineEntry_version(const xds_core_v3_CollectionEntry_InlineEntry * msg)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); }
xds_core_v3_CollectionEntry_InlineEntry_has_resource(const xds_core_v3_CollectionEntry_InlineEntry * msg)114 UPB_INLINE bool xds_core_v3_CollectionEntry_InlineEntry_has_resource(const xds_core_v3_CollectionEntry_InlineEntry *msg) { return _upb_hasbit(msg, 1); }
xds_core_v3_CollectionEntry_InlineEntry_resource(const xds_core_v3_CollectionEntry_InlineEntry * msg)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 
xds_core_v3_CollectionEntry_InlineEntry_set_name(xds_core_v3_CollectionEntry_InlineEntry * msg,upb_strview value)117 UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_set_name(xds_core_v3_CollectionEntry_InlineEntry *msg, upb_strview value) {
118   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
119 }
xds_core_v3_CollectionEntry_InlineEntry_set_version(xds_core_v3_CollectionEntry_InlineEntry * msg,upb_strview value)120 UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_set_version(xds_core_v3_CollectionEntry_InlineEntry *msg, upb_strview value) {
121   *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
122 }
xds_core_v3_CollectionEntry_InlineEntry_set_resource(xds_core_v3_CollectionEntry_InlineEntry * msg,struct google_protobuf_Any * value)123 UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_set_resource(xds_core_v3_CollectionEntry_InlineEntry *msg, struct google_protobuf_Any* value) {
124   _upb_sethas(msg, 1);
125   *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_Any*) = value;
126 }
xds_core_v3_CollectionEntry_InlineEntry_mutable_resource(xds_core_v3_CollectionEntry_InlineEntry * msg,upb_arena * arena)127 UPB_INLINE struct google_protobuf_Any* xds_core_v3_CollectionEntry_InlineEntry_mutable_resource(xds_core_v3_CollectionEntry_InlineEntry *msg, upb_arena *arena) {
128   struct google_protobuf_Any* sub = (struct google_protobuf_Any*)xds_core_v3_CollectionEntry_InlineEntry_resource(msg);
129   if (sub == NULL) {
130     sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
131     if (!sub) return NULL;
132     xds_core_v3_CollectionEntry_InlineEntry_set_resource(msg, sub);
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_ */
144