GRPC C++  1.39.1
resource_locator.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/resource_locator.proto
5  *
6  * Do not edit -- your changes will be discarded when the file is
7  * regenerated. */
8 
9 #ifndef XDS_CORE_V3_RESOURCE_LOCATOR_PROTO_UPB_H_
10 #define XDS_CORE_V3_RESOURCE_LOCATOR_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_ResourceLocator_msginit;
28 extern const upb_msglayout xds_core_v3_ResourceLocator_Directive_msginit;
30 extern const upb_msglayout xds_core_v3_ContextParams_msginit;
31 
32 typedef enum {
37 
38 
39 /* xds.core.v3.ResourceLocator */
40 
43 }
44 UPB_INLINE xds_core_v3_ResourceLocator *xds_core_v3_ResourceLocator_parse(const char *buf, size_t size,
45  upb_arena *arena) {
47  return (ret && upb_decode(buf, size, ret, &xds_core_v3_ResourceLocator_msginit, arena)) ? ret : NULL;
48 }
49 UPB_INLINE xds_core_v3_ResourceLocator *xds_core_v3_ResourceLocator_parse_ex(const char *buf, size_t size,
50  upb_arena *arena, int options) {
52  return (ret && _upb_decode(buf, size, ret, &xds_core_v3_ResourceLocator_msginit, arena, options))
53  ? ret : NULL;
54 }
55 UPB_INLINE char *xds_core_v3_ResourceLocator_serialize(const xds_core_v3_ResourceLocator *msg, upb_arena *arena, size_t *len) {
56  return upb_encode(msg, &xds_core_v3_ResourceLocator_msginit, arena, len);
57 }
58 
59 typedef enum {
64 
65 UPB_INLINE int32_t xds_core_v3_ResourceLocator_scheme(const xds_core_v3_ResourceLocator *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
66 UPB_INLINE upb_strview xds_core_v3_ResourceLocator_id(const xds_core_v3_ResourceLocator *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
67 UPB_INLINE upb_strview xds_core_v3_ResourceLocator_authority(const xds_core_v3_ResourceLocator *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
68 UPB_INLINE upb_strview xds_core_v3_ResourceLocator_resource_type(const xds_core_v3_ResourceLocator *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview); }
69 UPB_INLINE bool xds_core_v3_ResourceLocator_has_exact_context(const xds_core_v3_ResourceLocator *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 5; }
70 UPB_INLINE const struct xds_core_v3_ContextParams* xds_core_v3_ResourceLocator_exact_context(const xds_core_v3_ResourceLocator *msg) { return UPB_READ_ONEOF(msg, const struct xds_core_v3_ContextParams*, UPB_SIZE(32, 64), UPB_SIZE(36, 72), 5, NULL); }
71 UPB_INLINE bool xds_core_v3_ResourceLocator_has_directives(const xds_core_v3_ResourceLocator *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
72 UPB_INLINE const xds_core_v3_ResourceLocator_Directive* const* xds_core_v3_ResourceLocator_directives(const xds_core_v3_ResourceLocator *msg, size_t *len) { return (const xds_core_v3_ResourceLocator_Directive* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
73 
75  *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
76 }
77 UPB_INLINE void xds_core_v3_ResourceLocator_set_id(xds_core_v3_ResourceLocator *msg, upb_strview value) {
78  *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
79 }
81  *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
82 }
84  *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
85 }
87  UPB_WRITE_ONEOF(msg, struct xds_core_v3_ContextParams*, UPB_SIZE(32, 64), value, UPB_SIZE(36, 72), 5);
88 }
91  if (sub == NULL) {
93  if (!sub) return NULL;
95  }
96  return sub;
97 }
99  return (xds_core_v3_ResourceLocator_Directive**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
100 }
102  return (xds_core_v3_ResourceLocator_Directive**)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena);
103 }
106  bool ok = _upb_array_append_accessor2(
107  msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena);
108  if (!ok) return NULL;
109  return sub;
110 }
111 
112 /* xds.core.v3.ResourceLocator.Directive */
113 
116 }
118  upb_arena *arena) {
120  return (ret && upb_decode(buf, size, ret, &xds_core_v3_ResourceLocator_Directive_msginit, arena)) ? ret : NULL;
121 }
123  upb_arena *arena, int options) {
125  return (ret && _upb_decode(buf, size, ret, &xds_core_v3_ResourceLocator_Directive_msginit, arena, options))
126  ? ret : NULL;
127 }
129  return upb_encode(msg, &xds_core_v3_ResourceLocator_Directive_msginit, arena, len);
130 }
131 
132 typedef enum {
138 
139 UPB_INLINE bool xds_core_v3_ResourceLocator_Directive_has_alt(const xds_core_v3_ResourceLocator_Directive *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
140 UPB_INLINE const xds_core_v3_ResourceLocator* xds_core_v3_ResourceLocator_Directive_alt(const xds_core_v3_ResourceLocator_Directive *msg) { return UPB_READ_ONEOF(msg, const xds_core_v3_ResourceLocator*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, NULL); }
141 UPB_INLINE bool xds_core_v3_ResourceLocator_Directive_has_entry(const xds_core_v3_ResourceLocator_Directive *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
142 UPB_INLINE upb_strview xds_core_v3_ResourceLocator_Directive_entry(const xds_core_v3_ResourceLocator_Directive *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 2, upb_strview_make("", strlen(""))); }
143 
145  UPB_WRITE_ONEOF(msg, xds_core_v3_ResourceLocator*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
146 }
149  if (sub == NULL) {
151  if (!sub) return NULL;
153  }
154  return sub;
155 }
157  UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 2);
158 }
159 
160 #ifdef __cplusplus
161 } /* extern "C" */
162 #endif
163 
164 #include "upb/port_undef.inc"
165 
166 #endif /* XDS_CORE_V3_RESOURCE_LOCATOR_PROTO_UPB_H_ */
struct xds_core_v3_ContextParams xds_core_v3_ContextParams
Definition: context_params.upb.h:25
const upb_msglayout xds_core_v3_ResourceLocator_msginit
Definition: resource_locator.upb.c:32
UPB_INLINE bool xds_core_v3_ResourceLocator_Directive_has_alt(const xds_core_v3_ResourceLocator_Directive *msg)
Definition: resource_locator.upb.h:139
UPB_INLINE const struct xds_core_v3_ContextParams * xds_core_v3_ResourceLocator_exact_context(const xds_core_v3_ResourceLocator *msg)
Definition: resource_locator.upb.h:70
xds_core_v3_ResourceLocator_Scheme
Definition: resource_locator.upb.h:32
@ xds_core_v3_ResourceLocator_XDSTP
Definition: resource_locator.upb.h:33
@ xds_core_v3_ResourceLocator_FILE
Definition: resource_locator.upb.h:35
@ xds_core_v3_ResourceLocator_HTTP
Definition: resource_locator.upb.h:34
UPB_INLINE upb_strview xds_core_v3_ResourceLocator_Directive_entry(const xds_core_v3_ResourceLocator_Directive *msg)
Definition: resource_locator.upb.h:142
UPB_INLINE void xds_core_v3_ResourceLocator_set_exact_context(xds_core_v3_ResourceLocator *msg, struct xds_core_v3_ContextParams *value)
Definition: resource_locator.upb.h:86
UPB_INLINE bool xds_core_v3_ResourceLocator_Directive_has_entry(const xds_core_v3_ResourceLocator_Directive *msg)
Definition: resource_locator.upb.h:141
UPB_INLINE char * xds_core_v3_ResourceLocator_serialize(const xds_core_v3_ResourceLocator *msg, upb_arena *arena, size_t *len)
Definition: resource_locator.upb.h:55
UPB_INLINE xds_core_v3_ResourceLocator_Directive * xds_core_v3_ResourceLocator_Directive_parse(const char *buf, size_t size, upb_arena *arena)
Definition: resource_locator.upb.h:117
UPB_INLINE xds_core_v3_ResourceLocator_context_param_specifier_oneofcases xds_core_v3_ResourceLocator_context_param_specifier_case(const xds_core_v3_ResourceLocator *msg)
Definition: resource_locator.upb.h:63
UPB_INLINE void xds_core_v3_ResourceLocator_set_id(xds_core_v3_ResourceLocator *msg, upb_strview value)
Definition: resource_locator.upb.h:77
struct xds_core_v3_ResourceLocator xds_core_v3_ResourceLocator
Definition: resource_locator.upb.h:25
UPB_INLINE xds_core_v3_ResourceLocator_Directive * xds_core_v3_ResourceLocator_Directive_new(upb_arena *arena)
Definition: resource_locator.upb.h:114
UPB_INLINE const xds_core_v3_ResourceLocator * xds_core_v3_ResourceLocator_Directive_alt(const xds_core_v3_ResourceLocator_Directive *msg)
Definition: resource_locator.upb.h:140
UPB_INLINE xds_core_v3_ResourceLocator_Directive ** xds_core_v3_ResourceLocator_mutable_directives(xds_core_v3_ResourceLocator *msg, size_t *len)
Definition: resource_locator.upb.h:98
UPB_INLINE upb_strview xds_core_v3_ResourceLocator_authority(const xds_core_v3_ResourceLocator *msg)
Definition: resource_locator.upb.h:67
UPB_INLINE xds_core_v3_ResourceLocator * xds_core_v3_ResourceLocator_parse(const char *buf, size_t size, upb_arena *arena)
Definition: resource_locator.upb.h:44
UPB_INLINE void xds_core_v3_ResourceLocator_Directive_set_entry(xds_core_v3_ResourceLocator_Directive *msg, upb_strview value)
Definition: resource_locator.upb.h:156
UPB_INLINE char * xds_core_v3_ResourceLocator_Directive_serialize(const xds_core_v3_ResourceLocator_Directive *msg, upb_arena *arena, size_t *len)
Definition: resource_locator.upb.h:128
UPB_INLINE void xds_core_v3_ResourceLocator_Directive_set_alt(xds_core_v3_ResourceLocator_Directive *msg, xds_core_v3_ResourceLocator *value)
Definition: resource_locator.upb.h:144
UPB_INLINE struct xds_core_v3_ContextParams * xds_core_v3_ResourceLocator_mutable_exact_context(xds_core_v3_ResourceLocator *msg, upb_arena *arena)
Definition: resource_locator.upb.h:89
xds_core_v3_ResourceLocator_context_param_specifier_oneofcases
Definition: resource_locator.upb.h:59
@ xds_core_v3_ResourceLocator_context_param_specifier_NOT_SET
Definition: resource_locator.upb.h:61
@ xds_core_v3_ResourceLocator_context_param_specifier_exact_context
Definition: resource_locator.upb.h:60
const upb_msglayout xds_core_v3_ContextParams_msginit
Definition: context_params.upb.c:24
UPB_INLINE struct xds_core_v3_ResourceLocator_Directive * xds_core_v3_ResourceLocator_add_directives(xds_core_v3_ResourceLocator *msg, upb_arena *arena)
Definition: resource_locator.upb.h:104
UPB_INLINE bool xds_core_v3_ResourceLocator_has_exact_context(const xds_core_v3_ResourceLocator *msg)
Definition: resource_locator.upb.h:69
UPB_INLINE struct xds_core_v3_ResourceLocator * xds_core_v3_ResourceLocator_Directive_mutable_alt(xds_core_v3_ResourceLocator_Directive *msg, upb_arena *arena)
Definition: resource_locator.upb.h:147
UPB_INLINE xds_core_v3_ResourceLocator_Directive_directive_oneofcases xds_core_v3_ResourceLocator_Directive_directive_case(const xds_core_v3_ResourceLocator_Directive *msg)
Definition: resource_locator.upb.h:137
UPB_INLINE void xds_core_v3_ResourceLocator_set_authority(xds_core_v3_ResourceLocator *msg, upb_strview value)
Definition: resource_locator.upb.h:80
xds_core_v3_ResourceLocator_Directive_directive_oneofcases
Definition: resource_locator.upb.h:132
@ xds_core_v3_ResourceLocator_Directive_directive_alt
Definition: resource_locator.upb.h:133
@ xds_core_v3_ResourceLocator_Directive_directive_entry
Definition: resource_locator.upb.h:134
@ xds_core_v3_ResourceLocator_Directive_directive_NOT_SET
Definition: resource_locator.upb.h:135
UPB_INLINE upb_strview xds_core_v3_ResourceLocator_id(const xds_core_v3_ResourceLocator *msg)
Definition: resource_locator.upb.h:66
UPB_INLINE const xds_core_v3_ResourceLocator_Directive *const * xds_core_v3_ResourceLocator_directives(const xds_core_v3_ResourceLocator *msg, size_t *len)
Definition: resource_locator.upb.h:72
UPB_INLINE void xds_core_v3_ResourceLocator_set_resource_type(xds_core_v3_ResourceLocator *msg, upb_strview value)
Definition: resource_locator.upb.h:83
UPB_INLINE int32_t xds_core_v3_ResourceLocator_scheme(const xds_core_v3_ResourceLocator *msg)
Definition: resource_locator.upb.h:65
UPB_INLINE void xds_core_v3_ResourceLocator_set_scheme(xds_core_v3_ResourceLocator *msg, int32_t value)
Definition: resource_locator.upb.h:74
struct xds_core_v3_ResourceLocator_Directive xds_core_v3_ResourceLocator_Directive
Definition: resource_locator.upb.h:26
const upb_msglayout xds_core_v3_ResourceLocator_Directive_msginit
Definition: resource_locator.upb.c:47
UPB_INLINE xds_core_v3_ResourceLocator_Directive * xds_core_v3_ResourceLocator_Directive_parse_ex(const char *buf, size_t size, upb_arena *arena, int options)
Definition: resource_locator.upb.h:122
UPB_INLINE upb_strview xds_core_v3_ResourceLocator_resource_type(const xds_core_v3_ResourceLocator *msg)
Definition: resource_locator.upb.h:68
UPB_INLINE bool xds_core_v3_ResourceLocator_has_directives(const xds_core_v3_ResourceLocator *msg)
Definition: resource_locator.upb.h:71
UPB_INLINE xds_core_v3_ResourceLocator_Directive ** xds_core_v3_ResourceLocator_resize_directives(xds_core_v3_ResourceLocator *msg, size_t len, upb_arena *arena)
Definition: resource_locator.upb.h:101
UPB_INLINE xds_core_v3_ResourceLocator * xds_core_v3_ResourceLocator_new(upb_arena *arena)
Definition: resource_locator.upb.h:41
UPB_INLINE xds_core_v3_ResourceLocator * xds_core_v3_ResourceLocator_parse_ex(const char *buf, size_t size, upb_arena *arena, int options)
Definition: resource_locator.upb.h:49
upb_arena * arena
Definition: xds_api.cc:909