GRPC C++  1.39.1
percent.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/v3/percent.proto
5  *
6  * Do not edit -- your changes will be discarded when the file is
7  * regenerated. */
8 
9 #ifndef ENVOY_TYPE_V3_PERCENT_PROTO_UPB_H_
10 #define ENVOY_TYPE_V3_PERCENT_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_v3_Percent_msginit;
28 extern const upb_msglayout envoy_type_v3_FractionalPercent_msginit;
29 
30 typedef enum {
35 
36 
37 /* envoy.type.v3.Percent */
38 
41 }
42 UPB_INLINE envoy_type_v3_Percent *envoy_type_v3_Percent_parse(const char *buf, size_t size,
43  upb_arena *arena) {
45  return (ret && upb_decode(buf, size, ret, &envoy_type_v3_Percent_msginit, arena)) ? ret : NULL;
46 }
47 UPB_INLINE envoy_type_v3_Percent *envoy_type_v3_Percent_parse_ex(const char *buf, size_t size,
48  upb_arena *arena, int options) {
50  return (ret && _upb_decode(buf, size, ret, &envoy_type_v3_Percent_msginit, arena, options))
51  ? ret : NULL;
52 }
53 UPB_INLINE char *envoy_type_v3_Percent_serialize(const envoy_type_v3_Percent *msg, upb_arena *arena, size_t *len) {
54  return upb_encode(msg, &envoy_type_v3_Percent_msginit, arena, len);
55 }
56 
57 UPB_INLINE double envoy_type_v3_Percent_value(const envoy_type_v3_Percent *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); }
58 
59 UPB_INLINE void envoy_type_v3_Percent_set_value(envoy_type_v3_Percent *msg, double value) {
60  *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value;
61 }
62 
63 /* envoy.type.v3.FractionalPercent */
64 
67 }
69  upb_arena *arena) {
71  return (ret && upb_decode(buf, size, ret, &envoy_type_v3_FractionalPercent_msginit, arena)) ? ret : NULL;
72 }
74  upb_arena *arena, int options) {
76  return (ret && _upb_decode(buf, size, ret, &envoy_type_v3_FractionalPercent_msginit, arena, options))
77  ? ret : NULL;
78 }
79 UPB_INLINE char *envoy_type_v3_FractionalPercent_serialize(const envoy_type_v3_FractionalPercent *msg, upb_arena *arena, size_t *len) {
80  return upb_encode(msg, &envoy_type_v3_FractionalPercent_msginit, arena, len);
81 }
82 
83 UPB_INLINE uint32_t envoy_type_v3_FractionalPercent_numerator(const envoy_type_v3_FractionalPercent *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); }
84 UPB_INLINE int32_t envoy_type_v3_FractionalPercent_denominator(const envoy_type_v3_FractionalPercent *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
85 
87  *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value;
88 }
90  *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
91 }
92 
93 #ifdef __cplusplus
94 } /* extern "C" */
95 #endif
96 
97 #include "upb/port_undef.inc"
98 
99 #endif /* ENVOY_TYPE_V3_PERCENT_PROTO_UPB_H_ */
const upb_msglayout envoy_type_v3_Percent_msginit
Definition: percent.upb.c:22
UPB_INLINE void envoy_type_v3_FractionalPercent_set_numerator(envoy_type_v3_FractionalPercent *msg, uint32_t value)
Definition: percent.upb.h:86
struct envoy_type_v3_Percent envoy_type_v3_Percent
Definition: percent.upb.h:25
UPB_INLINE envoy_type_v3_Percent * envoy_type_v3_Percent_parse_ex(const char *buf, size_t size, upb_arena *arena, int options)
Definition: percent.upb.h:47
const upb_msglayout envoy_type_v3_FractionalPercent_msginit
Definition: percent.upb.c:33
UPB_INLINE envoy_type_v3_FractionalPercent * envoy_type_v3_FractionalPercent_new(upb_arena *arena)
Definition: percent.upb.h:65
struct envoy_type_v3_FractionalPercent envoy_type_v3_FractionalPercent
Definition: percent.upb.h:26
UPB_INLINE int32_t envoy_type_v3_FractionalPercent_denominator(const envoy_type_v3_FractionalPercent *msg)
Definition: percent.upb.h:84
envoy_type_v3_FractionalPercent_DenominatorType
Definition: percent.upb.h:30
@ envoy_type_v3_FractionalPercent_HUNDRED
Definition: percent.upb.h:31
@ envoy_type_v3_FractionalPercent_MILLION
Definition: percent.upb.h:33
@ envoy_type_v3_FractionalPercent_TEN_THOUSAND
Definition: percent.upb.h:32
UPB_INLINE envoy_type_v3_FractionalPercent * envoy_type_v3_FractionalPercent_parse_ex(const char *buf, size_t size, upb_arena *arena, int options)
Definition: percent.upb.h:73
UPB_INLINE void envoy_type_v3_FractionalPercent_set_denominator(envoy_type_v3_FractionalPercent *msg, int32_t value)
Definition: percent.upb.h:89
UPB_INLINE envoy_type_v3_Percent * envoy_type_v3_Percent_parse(const char *buf, size_t size, upb_arena *arena)
Definition: percent.upb.h:42
UPB_INLINE char * envoy_type_v3_FractionalPercent_serialize(const envoy_type_v3_FractionalPercent *msg, upb_arena *arena, size_t *len)
Definition: percent.upb.h:79
UPB_INLINE char * envoy_type_v3_Percent_serialize(const envoy_type_v3_Percent *msg, upb_arena *arena, size_t *len)
Definition: percent.upb.h:53
UPB_INLINE envoy_type_v3_FractionalPercent * envoy_type_v3_FractionalPercent_parse(const char *buf, size_t size, upb_arena *arena)
Definition: percent.upb.h:68
UPB_INLINE envoy_type_v3_Percent * envoy_type_v3_Percent_new(upb_arena *arena)
Definition: percent.upb.h:39
UPB_INLINE double envoy_type_v3_Percent_value(const envoy_type_v3_Percent *msg)
Definition: percent.upb.h:57
UPB_INLINE uint32_t envoy_type_v3_FractionalPercent_numerator(const envoy_type_v3_FractionalPercent *msg)
Definition: percent.upb.h:83
UPB_INLINE void envoy_type_v3_Percent_set_value(envoy_type_v3_Percent *msg, double value)
Definition: percent.upb.h:59
upb_arena * arena
Definition: xds_api.cc:909