1 /* This file was generated by upbc (the upb compiler) from the input
4 * udpa/core/v1/collection_entry.proto
6 * Do not edit -- your changes will be discarded when the file is
9 #ifndef UDPA_CORE_V1_COLLECTION_ENTRY_PROTO_UPB_H_
10 #define UDPA_CORE_V1_COLLECTION_ENTRY_PROTO_UPB_H_
13 #include "upb/decode.h"
14 #include "upb/decode_fast.h"
15 #include "upb/encode.h"
17 #include "upb/port_def.inc"
23 struct udpa_core_v1_CollectionEntry;
24 struct udpa_core_v1_CollectionEntry_InlineEntry;
25 typedef struct udpa_core_v1_CollectionEntry udpa_core_v1_CollectionEntry;
26 typedef struct udpa_core_v1_CollectionEntry_InlineEntry udpa_core_v1_CollectionEntry_InlineEntry;
27 extern const upb_msglayout udpa_core_v1_CollectionEntry_msginit;
28 extern const upb_msglayout udpa_core_v1_CollectionEntry_InlineEntry_msginit;
29 struct google_protobuf_Any;
30 struct udpa_core_v1_ResourceLocator;
31 extern const upb_msglayout google_protobuf_Any_msginit;
32 extern const upb_msglayout udpa_core_v1_ResourceLocator_msginit;
35 /* udpa.core.v1.CollectionEntry */
37 UPB_INLINE udpa_core_v1_CollectionEntry *udpa_core_v1_CollectionEntry_new(upb_arena *arena) {
38 return (udpa_core_v1_CollectionEntry *)_upb_msg_new(&udpa_core_v1_CollectionEntry_msginit, arena);
40 UPB_INLINE udpa_core_v1_CollectionEntry *udpa_core_v1_CollectionEntry_parse(const char *buf, size_t size,
42 udpa_core_v1_CollectionEntry *ret = udpa_core_v1_CollectionEntry_new(arena);
43 return (ret && upb_decode(buf, size, ret, &udpa_core_v1_CollectionEntry_msginit, arena)) ? ret : NULL;
45 UPB_INLINE udpa_core_v1_CollectionEntry *udpa_core_v1_CollectionEntry_parse_ex(const char *buf, size_t size,
46 upb_arena *arena, int options) {
47 udpa_core_v1_CollectionEntry *ret = udpa_core_v1_CollectionEntry_new(arena);
48 return (ret && _upb_decode(buf, size, ret, &udpa_core_v1_CollectionEntry_msginit, arena, options))
51 UPB_INLINE char *udpa_core_v1_CollectionEntry_serialize(const udpa_core_v1_CollectionEntry *msg, upb_arena *arena, size_t *len) {
52 return upb_encode(msg, &udpa_core_v1_CollectionEntry_msginit, arena, len);
56 udpa_core_v1_CollectionEntry_resource_specifier_locator = 1,
57 udpa_core_v1_CollectionEntry_resource_specifier_inline_entry = 2,
58 udpa_core_v1_CollectionEntry_resource_specifier_NOT_SET = 0
59 } udpa_core_v1_CollectionEntry_resource_specifier_oneofcases;
60 UPB_INLINE udpa_core_v1_CollectionEntry_resource_specifier_oneofcases udpa_core_v1_CollectionEntry_resource_specifier_case(const udpa_core_v1_CollectionEntry* msg) { return (udpa_core_v1_CollectionEntry_resource_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
62 UPB_INLINE bool udpa_core_v1_CollectionEntry_has_locator(const udpa_core_v1_CollectionEntry *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
63 UPB_INLINE const struct udpa_core_v1_ResourceLocator* udpa_core_v1_CollectionEntry_locator(const udpa_core_v1_CollectionEntry *msg) { return UPB_READ_ONEOF(msg, const struct udpa_core_v1_ResourceLocator*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
64 UPB_INLINE bool udpa_core_v1_CollectionEntry_has_inline_entry(const udpa_core_v1_CollectionEntry *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
65 UPB_INLINE const udpa_core_v1_CollectionEntry_InlineEntry* udpa_core_v1_CollectionEntry_inline_entry(const udpa_core_v1_CollectionEntry *msg) { return UPB_READ_ONEOF(msg, const udpa_core_v1_CollectionEntry_InlineEntry*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
67 UPB_INLINE void udpa_core_v1_CollectionEntry_set_locator(udpa_core_v1_CollectionEntry *msg, struct udpa_core_v1_ResourceLocator* value) {
68 UPB_WRITE_ONEOF(msg, struct udpa_core_v1_ResourceLocator*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
70 UPB_INLINE struct udpa_core_v1_ResourceLocator* udpa_core_v1_CollectionEntry_mutable_locator(udpa_core_v1_CollectionEntry *msg, upb_arena *arena) {
71 struct udpa_core_v1_ResourceLocator* sub = (struct udpa_core_v1_ResourceLocator*)udpa_core_v1_CollectionEntry_locator(msg);
73 sub = (struct udpa_core_v1_ResourceLocator*)_upb_msg_new(&udpa_core_v1_ResourceLocator_msginit, arena);
74 if (!sub) return NULL;
75 udpa_core_v1_CollectionEntry_set_locator(msg, sub);
79 UPB_INLINE void udpa_core_v1_CollectionEntry_set_inline_entry(udpa_core_v1_CollectionEntry *msg, udpa_core_v1_CollectionEntry_InlineEntry* value) {
80 UPB_WRITE_ONEOF(msg, udpa_core_v1_CollectionEntry_InlineEntry*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
82 UPB_INLINE struct udpa_core_v1_CollectionEntry_InlineEntry* udpa_core_v1_CollectionEntry_mutable_inline_entry(udpa_core_v1_CollectionEntry *msg, upb_arena *arena) {
83 struct udpa_core_v1_CollectionEntry_InlineEntry* sub = (struct udpa_core_v1_CollectionEntry_InlineEntry*)udpa_core_v1_CollectionEntry_inline_entry(msg);
85 sub = (struct udpa_core_v1_CollectionEntry_InlineEntry*)_upb_msg_new(&udpa_core_v1_CollectionEntry_InlineEntry_msginit, arena);
86 if (!sub) return NULL;
87 udpa_core_v1_CollectionEntry_set_inline_entry(msg, sub);
92 /* udpa.core.v1.CollectionEntry.InlineEntry */
94 UPB_INLINE udpa_core_v1_CollectionEntry_InlineEntry *udpa_core_v1_CollectionEntry_InlineEntry_new(upb_arena *arena) {
95 return (udpa_core_v1_CollectionEntry_InlineEntry *)_upb_msg_new(&udpa_core_v1_CollectionEntry_InlineEntry_msginit, arena);
97 UPB_INLINE udpa_core_v1_CollectionEntry_InlineEntry *udpa_core_v1_CollectionEntry_InlineEntry_parse(const char *buf, size_t size,
99 udpa_core_v1_CollectionEntry_InlineEntry *ret = udpa_core_v1_CollectionEntry_InlineEntry_new(arena);
100 return (ret && upb_decode(buf, size, ret, &udpa_core_v1_CollectionEntry_InlineEntry_msginit, arena)) ? ret : NULL;
102 UPB_INLINE udpa_core_v1_CollectionEntry_InlineEntry *udpa_core_v1_CollectionEntry_InlineEntry_parse_ex(const char *buf, size_t size,
103 upb_arena *arena, int options) {
104 udpa_core_v1_CollectionEntry_InlineEntry *ret = udpa_core_v1_CollectionEntry_InlineEntry_new(arena);
105 return (ret && _upb_decode(buf, size, ret, &udpa_core_v1_CollectionEntry_InlineEntry_msginit, arena, options))
108 UPB_INLINE char *udpa_core_v1_CollectionEntry_InlineEntry_serialize(const udpa_core_v1_CollectionEntry_InlineEntry *msg, upb_arena *arena, size_t *len) {
109 return upb_encode(msg, &udpa_core_v1_CollectionEntry_InlineEntry_msginit, arena, len);
112 UPB_INLINE upb_strview udpa_core_v1_CollectionEntry_InlineEntry_name(const udpa_core_v1_CollectionEntry_InlineEntry *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
113 UPB_INLINE upb_strview udpa_core_v1_CollectionEntry_InlineEntry_version(const udpa_core_v1_CollectionEntry_InlineEntry *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
114 UPB_INLINE bool udpa_core_v1_CollectionEntry_InlineEntry_has_resource(const udpa_core_v1_CollectionEntry_InlineEntry *msg) { return _upb_hasbit(msg, 1); }
115 UPB_INLINE const struct google_protobuf_Any* udpa_core_v1_CollectionEntry_InlineEntry_resource(const udpa_core_v1_CollectionEntry_InlineEntry *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_Any*); }
117 UPB_INLINE void udpa_core_v1_CollectionEntry_InlineEntry_set_name(udpa_core_v1_CollectionEntry_InlineEntry *msg, upb_strview value) {
118 *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
120 UPB_INLINE void udpa_core_v1_CollectionEntry_InlineEntry_set_version(udpa_core_v1_CollectionEntry_InlineEntry *msg, upb_strview value) {
121 *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
123 UPB_INLINE void udpa_core_v1_CollectionEntry_InlineEntry_set_resource(udpa_core_v1_CollectionEntry_InlineEntry *msg, struct google_protobuf_Any* value) {
125 *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_Any*) = value;
127 UPB_INLINE struct google_protobuf_Any* udpa_core_v1_CollectionEntry_InlineEntry_mutable_resource(udpa_core_v1_CollectionEntry_InlineEntry *msg, upb_arena *arena) {
128 struct google_protobuf_Any* sub = (struct google_protobuf_Any*)udpa_core_v1_CollectionEntry_InlineEntry_resource(msg);
130 sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
131 if (!sub) return NULL;
132 udpa_core_v1_CollectionEntry_InlineEntry_set_resource(msg, sub);
141 #include "upb/port_undef.inc"
143 #endif /* UDPA_CORE_V1_COLLECTION_ENTRY_PROTO_UPB_H_ */