GRPC Core  18.0.0
typed_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  * udpa/type/v1/typed_struct.proto
5  *
6  * Do not edit -- your changes will be discarded when the file is
7  * regenerated. */
8 
9 #ifndef UDPA_TYPE_V1_TYPED_STRUCT_PROTO_UPB_H_
10 #define UDPA_TYPE_V1_TYPED_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 
25 extern const upb_msglayout udpa_type_v1_TypedStruct_msginit;
27 extern const upb_msglayout google_protobuf_Struct_msginit;
28 
29 
30 /* udpa.type.v1.TypedStruct */
31 
34 }
35 UPB_INLINE udpa_type_v1_TypedStruct *udpa_type_v1_TypedStruct_parse(const char *buf, size_t size,
36  upb_arena *arena) {
38  return (ret && upb_decode(buf, size, ret, &udpa_type_v1_TypedStruct_msginit, arena)) ? ret : NULL;
39 }
40 UPB_INLINE udpa_type_v1_TypedStruct *udpa_type_v1_TypedStruct_parse_ex(const char *buf, size_t size,
41  upb_arena *arena, int options) {
43  return (ret && _upb_decode(buf, size, ret, &udpa_type_v1_TypedStruct_msginit, arena, options))
44  ? ret : NULL;
45 }
46 UPB_INLINE char *udpa_type_v1_TypedStruct_serialize(const udpa_type_v1_TypedStruct *msg, upb_arena *arena, size_t *len) {
47  return upb_encode(msg, &udpa_type_v1_TypedStruct_msginit, arena, len);
48 }
49 
50 UPB_INLINE upb_strview udpa_type_v1_TypedStruct_type_url(const udpa_type_v1_TypedStruct *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
51 UPB_INLINE bool udpa_type_v1_TypedStruct_has_value(const udpa_type_v1_TypedStruct *msg) { return _upb_hasbit(msg, 1); }
52 UPB_INLINE const struct google_protobuf_Struct* udpa_type_v1_TypedStruct_value(const udpa_type_v1_TypedStruct *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Struct*); }
53 
54 UPB_INLINE void udpa_type_v1_TypedStruct_set_type_url(udpa_type_v1_TypedStruct *msg, upb_strview value) {
55  *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
56 }
58  _upb_sethas(msg, 1);
59  *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Struct*) = value;
60 }
63  if (sub == NULL) {
64  sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
65  if (!sub) return NULL;
67  }
68  return sub;
69 }
70 
71 #ifdef __cplusplus
72 } /* extern "C" */
73 #endif
74 
75 #include "upb/port_undef.inc"
76 
77 #endif /* UDPA_TYPE_V1_TYPED_STRUCT_PROTO_UPB_H_ */
struct google_protobuf_Struct google_protobuf_Struct
Definition: struct.upb.h:27
UPB_INLINE udpa_type_v1_TypedStruct * udpa_type_v1_TypedStruct_new(upb_arena *arena)
Definition: typed_struct.upb.h:32
UPB_INLINE struct google_protobuf_Struct * udpa_type_v1_TypedStruct_mutable_value(udpa_type_v1_TypedStruct *msg, upb_arena *arena)
Definition: typed_struct.upb.h:61
UPB_INLINE char * udpa_type_v1_TypedStruct_serialize(const udpa_type_v1_TypedStruct *msg, upb_arena *arena, size_t *len)
Definition: typed_struct.upb.h:46
const upb_msglayout udpa_type_v1_TypedStruct_msginit
Definition: typed_struct.upb.c:26
UPB_INLINE const struct google_protobuf_Struct * udpa_type_v1_TypedStruct_value(const udpa_type_v1_TypedStruct *msg)
Definition: typed_struct.upb.h:52
const upb_msglayout google_protobuf_Struct_msginit
Definition: struct.upb.c:23
UPB_INLINE void udpa_type_v1_TypedStruct_set_value(udpa_type_v1_TypedStruct *msg, struct google_protobuf_Struct *value)
Definition: typed_struct.upb.h:57
UPB_INLINE void udpa_type_v1_TypedStruct_set_type_url(udpa_type_v1_TypedStruct *msg, upb_strview value)
Definition: typed_struct.upb.h:54
UPB_INLINE upb_strview udpa_type_v1_TypedStruct_type_url(const udpa_type_v1_TypedStruct *msg)
Definition: typed_struct.upb.h:50
UPB_INLINE udpa_type_v1_TypedStruct * udpa_type_v1_TypedStruct_parse_ex(const char *buf, size_t size, upb_arena *arena, int options)
Definition: typed_struct.upb.h:40
UPB_INLINE udpa_type_v1_TypedStruct * udpa_type_v1_TypedStruct_parse(const char *buf, size_t size, upb_arena *arena)
Definition: typed_struct.upb.h:35
struct udpa_type_v1_TypedStruct udpa_type_v1_TypedStruct
Definition: typed_struct.upb.h:24
UPB_INLINE bool udpa_type_v1_TypedStruct_has_value(const udpa_type_v1_TypedStruct *msg)
Definition: typed_struct.upb.h:51
upb_arena * arena
Definition: xds_api.cc:909