GRPC Core  18.0.0
metadata.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  * envoy/type/matcher/v3/metadata.proto
5  *
6  * Do not edit -- your changes will be discarded when the file is
7  * regenerated. */
8 
9 #ifndef ENVOY_TYPE_MATCHER_V3_METADATA_PROTO_UPB_H_
10 #define ENVOY_TYPE_MATCHER_V3_METADATA_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 envoy_type_matcher_v3_MetadataMatcher_msginit;
30 extern const upb_msglayout envoy_type_matcher_v3_ValueMatcher_msginit;
31 
32 
33 /* envoy.type.matcher.v3.MetadataMatcher */
34 
37 }
39  upb_arena *arena) {
41  return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_msginit, arena)) ? ret : NULL;
42 }
44  upb_arena *arena, int options) {
46  return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_msginit, arena, options))
47  ? ret : NULL;
48 }
50  return upb_encode(msg, &envoy_type_matcher_v3_MetadataMatcher_msginit, arena, len);
51 }
52 
53 UPB_INLINE upb_strview envoy_type_matcher_v3_MetadataMatcher_filter(const envoy_type_matcher_v3_MetadataMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
54 UPB_INLINE bool envoy_type_matcher_v3_MetadataMatcher_has_path(const envoy_type_matcher_v3_MetadataMatcher *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
55 UPB_INLINE const envoy_type_matcher_v3_MetadataMatcher_PathSegment* const* envoy_type_matcher_v3_MetadataMatcher_path(const envoy_type_matcher_v3_MetadataMatcher *msg, size_t *len) { return (const envoy_type_matcher_v3_MetadataMatcher_PathSegment* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
56 UPB_INLINE bool envoy_type_matcher_v3_MetadataMatcher_has_value(const envoy_type_matcher_v3_MetadataMatcher *msg) { return _upb_hasbit(msg, 1); }
57 UPB_INLINE const struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_MetadataMatcher_value(const envoy_type_matcher_v3_MetadataMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_type_matcher_v3_ValueMatcher*); }
58 
60  *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
61 }
63  return (envoy_type_matcher_v3_MetadataMatcher_PathSegment**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
64 }
66  return (envoy_type_matcher_v3_MetadataMatcher_PathSegment**)_upb_array_resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
67 }
70  bool ok = _upb_array_append_accessor2(
71  msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena);
72  if (!ok) return NULL;
73  return sub;
74 }
76  _upb_sethas(msg, 1);
77  *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_type_matcher_v3_ValueMatcher*) = value;
78 }
81  if (sub == NULL) {
83  if (!sub) return NULL;
85  }
86  return sub;
87 }
88 
89 /* envoy.type.matcher.v3.MetadataMatcher.PathSegment */
90 
93 }
95  upb_arena *arena) {
97  return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, arena)) ? ret : NULL;
98 }
100  upb_arena *arena, int options) {
102  return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, arena, options))
103  ? ret : NULL;
104 }
107 }
108 
109 typedef enum {
114 
115 UPB_INLINE bool envoy_type_matcher_v3_MetadataMatcher_PathSegment_has_key(const envoy_type_matcher_v3_MetadataMatcher_PathSegment *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
116 UPB_INLINE upb_strview envoy_type_matcher_v3_MetadataMatcher_PathSegment_key(const envoy_type_matcher_v3_MetadataMatcher_PathSegment *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, upb_strview_make("", strlen(""))); }
117 
119  UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
120 }
121 
122 #ifdef __cplusplus
123 } /* extern "C" */
124 #endif
125 
126 #include "upb/port_undef.inc"
127 
128 #endif /* ENVOY_TYPE_MATCHER_V3_METADATA_PROTO_UPB_H_ */
const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit
Definition: metadata.upb.c:40
UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment * envoy_type_matcher_v3_MetadataMatcher_PathSegment_new(upb_arena *arena)
Definition: metadata.upb.h:91
UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment * envoy_type_matcher_v3_MetadataMatcher_PathSegment_parse_ex(const char *buf, size_t size, upb_arena *arena, int options)
Definition: metadata.upb.h:99
envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_oneofcases
Definition: metadata.upb.h:109
@ envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_key
Definition: metadata.upb.h:110
@ envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_NOT_SET
Definition: metadata.upb.h:111
UPB_INLINE envoy_type_matcher_v3_MetadataMatcher * envoy_type_matcher_v3_MetadataMatcher_new(upb_arena *arena)
Definition: metadata.upb.h:35
const upb_msglayout envoy_type_matcher_v3_ValueMatcher_msginit
Definition: value.upb.c:36
UPB_INLINE upb_strview envoy_type_matcher_v3_MetadataMatcher_filter(const envoy_type_matcher_v3_MetadataMatcher *msg)
Definition: metadata.upb.h:53
UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment * envoy_type_matcher_v3_MetadataMatcher_PathSegment_parse(const char *buf, size_t size, upb_arena *arena)
Definition: metadata.upb.h:94
UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_set_filter(envoy_type_matcher_v3_MetadataMatcher *msg, upb_strview value)
Definition: metadata.upb.h:59
const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_msginit
Definition: metadata.upb.c:30
UPB_INLINE bool envoy_type_matcher_v3_MetadataMatcher_has_path(const envoy_type_matcher_v3_MetadataMatcher *msg)
Definition: metadata.upb.h:54
struct envoy_type_matcher_v3_MetadataMatcher envoy_type_matcher_v3_MetadataMatcher
Definition: metadata.upb.h:25
UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment ** envoy_type_matcher_v3_MetadataMatcher_resize_path(envoy_type_matcher_v3_MetadataMatcher *msg, size_t len, upb_arena *arena)
Definition: metadata.upb.h:65
UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment ** envoy_type_matcher_v3_MetadataMatcher_mutable_path(envoy_type_matcher_v3_MetadataMatcher *msg, size_t *len)
Definition: metadata.upb.h:62
struct envoy_type_matcher_v3_MetadataMatcher_PathSegment envoy_type_matcher_v3_MetadataMatcher_PathSegment
Definition: metadata.upb.h:26
UPB_INLINE const envoy_type_matcher_v3_MetadataMatcher_PathSegment *const * envoy_type_matcher_v3_MetadataMatcher_path(const envoy_type_matcher_v3_MetadataMatcher *msg, size_t *len)
Definition: metadata.upb.h:55
UPB_INLINE envoy_type_matcher_v3_MetadataMatcher * envoy_type_matcher_v3_MetadataMatcher_parse_ex(const char *buf, size_t size, upb_arena *arena, int options)
Definition: metadata.upb.h:43
UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_oneofcases envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_case(const envoy_type_matcher_v3_MetadataMatcher_PathSegment *msg)
Definition: metadata.upb.h:113
UPB_INLINE envoy_type_matcher_v3_MetadataMatcher * envoy_type_matcher_v3_MetadataMatcher_parse(const char *buf, size_t size, upb_arena *arena)
Definition: metadata.upb.h:38
UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_PathSegment_set_key(envoy_type_matcher_v3_MetadataMatcher_PathSegment *msg, upb_strview value)
Definition: metadata.upb.h:118
UPB_INLINE upb_strview envoy_type_matcher_v3_MetadataMatcher_PathSegment_key(const envoy_type_matcher_v3_MetadataMatcher_PathSegment *msg)
Definition: metadata.upb.h:116
UPB_INLINE char * envoy_type_matcher_v3_MetadataMatcher_serialize(const envoy_type_matcher_v3_MetadataMatcher *msg, upb_arena *arena, size_t *len)
Definition: metadata.upb.h:49
UPB_INLINE bool envoy_type_matcher_v3_MetadataMatcher_has_value(const envoy_type_matcher_v3_MetadataMatcher *msg)
Definition: metadata.upb.h:56
UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_set_value(envoy_type_matcher_v3_MetadataMatcher *msg, struct envoy_type_matcher_v3_ValueMatcher *value)
Definition: metadata.upb.h:75
UPB_INLINE struct envoy_type_matcher_v3_ValueMatcher * envoy_type_matcher_v3_MetadataMatcher_mutable_value(envoy_type_matcher_v3_MetadataMatcher *msg, upb_arena *arena)
Definition: metadata.upb.h:79
UPB_INLINE char * envoy_type_matcher_v3_MetadataMatcher_PathSegment_serialize(const envoy_type_matcher_v3_MetadataMatcher_PathSegment *msg, upb_arena *arena, size_t *len)
Definition: metadata.upb.h:105
UPB_INLINE bool envoy_type_matcher_v3_MetadataMatcher_PathSegment_has_key(const envoy_type_matcher_v3_MetadataMatcher_PathSegment *msg)
Definition: metadata.upb.h:115
UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher_PathSegment * envoy_type_matcher_v3_MetadataMatcher_add_path(envoy_type_matcher_v3_MetadataMatcher *msg, upb_arena *arena)
Definition: metadata.upb.h:68
UPB_INLINE const struct envoy_type_matcher_v3_ValueMatcher * envoy_type_matcher_v3_MetadataMatcher_value(const envoy_type_matcher_v3_MetadataMatcher *msg)
Definition: metadata.upb.h:57
struct envoy_type_matcher_v3_ValueMatcher envoy_type_matcher_v3_ValueMatcher
Definition: value.upb.h:26
upb_arena * arena
Definition: xds_api.cc:909