GRPC C++  1.39.1
struct.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/struct.proto
5  *
6  * Do not edit -- your changes will be discarded when the file is
7  * regenerated. */
8 
9 #ifndef ENVOY_TYPE_MATCHER_V3_STRUCT_PROTO_UPB_H_
10 #define ENVOY_TYPE_MATCHER_V3_STRUCT_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_StructMatcher_msginit;
30 extern const upb_msglayout envoy_type_matcher_v3_ValueMatcher_msginit;
31 
32 
33 /* envoy.type.matcher.v3.StructMatcher */
34 
37 }
39  upb_arena *arena) {
41  return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_msginit, arena)) ? ret : NULL;
42 }
44  upb_arena *arena, int options) {
46  return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_msginit, arena, options))
47  ? ret : NULL;
48 }
49 UPB_INLINE char *envoy_type_matcher_v3_StructMatcher_serialize(const envoy_type_matcher_v3_StructMatcher *msg, upb_arena *arena, size_t *len) {
50  return upb_encode(msg, &envoy_type_matcher_v3_StructMatcher_msginit, arena, len);
51 }
52 
53 UPB_INLINE bool envoy_type_matcher_v3_StructMatcher_has_path(const envoy_type_matcher_v3_StructMatcher *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
54 UPB_INLINE const envoy_type_matcher_v3_StructMatcher_PathSegment* const* envoy_type_matcher_v3_StructMatcher_path(const envoy_type_matcher_v3_StructMatcher *msg, size_t *len) { return (const envoy_type_matcher_v3_StructMatcher_PathSegment* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
55 UPB_INLINE bool envoy_type_matcher_v3_StructMatcher_has_value(const envoy_type_matcher_v3_StructMatcher *msg) { return _upb_hasbit(msg, 1); }
56 UPB_INLINE const struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_StructMatcher_value(const envoy_type_matcher_v3_StructMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_matcher_v3_ValueMatcher*); }
57 
59  return (envoy_type_matcher_v3_StructMatcher_PathSegment**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
60 }
62  return (envoy_type_matcher_v3_StructMatcher_PathSegment**)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
63 }
66  bool ok = _upb_array_append_accessor2(
67  msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
68  if (!ok) return NULL;
69  return sub;
70 }
72  _upb_sethas(msg, 1);
73  *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_matcher_v3_ValueMatcher*) = value;
74 }
77  if (sub == NULL) {
79  if (!sub) return NULL;
81  }
82  return sub;
83 }
84 
85 /* envoy.type.matcher.v3.StructMatcher.PathSegment */
86 
89 }
91  upb_arena *arena) {
93  return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena)) ? ret : NULL;
94 }
96  upb_arena *arena, int options) {
98  return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena, options))
99  ? ret : NULL;
100 }
102  return upb_encode(msg, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena, len);
103 }
104 
105 typedef enum {
110 
111 UPB_INLINE bool envoy_type_matcher_v3_StructMatcher_PathSegment_has_key(const envoy_type_matcher_v3_StructMatcher_PathSegment *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
112 UPB_INLINE upb_strview envoy_type_matcher_v3_StructMatcher_PathSegment_key(const envoy_type_matcher_v3_StructMatcher_PathSegment *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, upb_strview_make("", strlen(""))); }
113 
115  UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
116 }
117 
118 #ifdef __cplusplus
119 } /* extern "C" */
120 #endif
121 
122 #include "upb/port_undef.inc"
123 
124 #endif /* ENVOY_TYPE_MATCHER_V3_STRUCT_PROTO_UPB_H_ */
UPB_INLINE upb_strview envoy_type_matcher_v3_StructMatcher_PathSegment_key(const envoy_type_matcher_v3_StructMatcher_PathSegment *msg)
Definition: struct.upb.h:112
UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment * envoy_type_matcher_v3_StructMatcher_PathSegment_new(upb_arena *arena)
Definition: struct.upb.h:87
UPB_INLINE envoy_type_matcher_v3_StructMatcher * envoy_type_matcher_v3_StructMatcher_parse_ex(const char *buf, size_t size, upb_arena *arena, int options)
Definition: struct.upb.h:43
UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment ** envoy_type_matcher_v3_StructMatcher_resize_path(envoy_type_matcher_v3_StructMatcher *msg, size_t len, upb_arena *arena)
Definition: struct.upb.h:61
const upb_msglayout envoy_type_matcher_v3_ValueMatcher_msginit
Definition: value.upb.c:36
UPB_INLINE struct envoy_type_matcher_v3_ValueMatcher * envoy_type_matcher_v3_StructMatcher_mutable_value(envoy_type_matcher_v3_StructMatcher *msg, upb_arena *arena)
Definition: struct.upb.h:75
UPB_INLINE bool envoy_type_matcher_v3_StructMatcher_has_value(const envoy_type_matcher_v3_StructMatcher *msg)
Definition: struct.upb.h:55
UPB_INLINE bool envoy_type_matcher_v3_StructMatcher_has_path(const envoy_type_matcher_v3_StructMatcher *msg)
Definition: struct.upb.h:53
UPB_INLINE envoy_type_matcher_v3_StructMatcher * envoy_type_matcher_v3_StructMatcher_parse(const char *buf, size_t size, upb_arena *arena)
Definition: struct.upb.h:38
UPB_INLINE const envoy_type_matcher_v3_StructMatcher_PathSegment *const * envoy_type_matcher_v3_StructMatcher_path(const envoy_type_matcher_v3_StructMatcher *msg, size_t *len)
Definition: struct.upb.h:54
UPB_INLINE envoy_type_matcher_v3_StructMatcher * envoy_type_matcher_v3_StructMatcher_new(upb_arena *arena)
Definition: struct.upb.h:35
struct envoy_type_matcher_v3_StructMatcher_PathSegment envoy_type_matcher_v3_StructMatcher_PathSegment
Definition: struct.upb.h:26
UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment * envoy_type_matcher_v3_StructMatcher_PathSegment_parse_ex(const char *buf, size_t size, upb_arena *arena, int options)
Definition: struct.upb.h:95
UPB_INLINE char * envoy_type_matcher_v3_StructMatcher_PathSegment_serialize(const envoy_type_matcher_v3_StructMatcher_PathSegment *msg, upb_arena *arena, size_t *len)
Definition: struct.upb.h:101
UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment ** envoy_type_matcher_v3_StructMatcher_mutable_path(envoy_type_matcher_v3_StructMatcher *msg, size_t *len)
Definition: struct.upb.h:58
UPB_INLINE const struct envoy_type_matcher_v3_ValueMatcher * envoy_type_matcher_v3_StructMatcher_value(const envoy_type_matcher_v3_StructMatcher *msg)
Definition: struct.upb.h:56
UPB_INLINE bool envoy_type_matcher_v3_StructMatcher_PathSegment_has_key(const envoy_type_matcher_v3_StructMatcher_PathSegment *msg)
Definition: struct.upb.h:111
const upb_msglayout envoy_type_matcher_v3_StructMatcher_PathSegment_msginit
Definition: struct.upb.c:39
UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment * envoy_type_matcher_v3_StructMatcher_PathSegment_parse(const char *buf, size_t size, upb_arena *arena)
Definition: struct.upb.h:90
const upb_msglayout envoy_type_matcher_v3_StructMatcher_msginit
Definition: struct.upb.c:29
UPB_INLINE void envoy_type_matcher_v3_StructMatcher_PathSegment_set_key(envoy_type_matcher_v3_StructMatcher_PathSegment *msg, upb_strview value)
Definition: struct.upb.h:114
UPB_INLINE void envoy_type_matcher_v3_StructMatcher_set_value(envoy_type_matcher_v3_StructMatcher *msg, struct envoy_type_matcher_v3_ValueMatcher *value)
Definition: struct.upb.h:71
UPB_INLINE char * envoy_type_matcher_v3_StructMatcher_serialize(const envoy_type_matcher_v3_StructMatcher *msg, upb_arena *arena, size_t *len)
Definition: struct.upb.h:49
UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment_segment_oneofcases envoy_type_matcher_v3_StructMatcher_PathSegment_segment_case(const envoy_type_matcher_v3_StructMatcher_PathSegment *msg)
Definition: struct.upb.h:109
envoy_type_matcher_v3_StructMatcher_PathSegment_segment_oneofcases
Definition: struct.upb.h:105
@ envoy_type_matcher_v3_StructMatcher_PathSegment_segment_NOT_SET
Definition: struct.upb.h:107
@ envoy_type_matcher_v3_StructMatcher_PathSegment_segment_key
Definition: struct.upb.h:106
UPB_INLINE struct envoy_type_matcher_v3_StructMatcher_PathSegment * envoy_type_matcher_v3_StructMatcher_add_path(envoy_type_matcher_v3_StructMatcher *msg, upb_arena *arena)
Definition: struct.upb.h:64
struct envoy_type_matcher_v3_StructMatcher envoy_type_matcher_v3_StructMatcher
Definition: struct.upb.h:25
struct envoy_type_matcher_v3_ValueMatcher envoy_type_matcher_v3_ValueMatcher
Definition: value.upb.h:26
upb_arena * arena
Definition: xds_api.cc:909