GRPC Core  9.0.0
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/percent.proto
5  *
6  * Do not edit -- your changes will be discarded when the file is
7  * regenerated. */
8 
9 #ifndef ENVOY_TYPE_PERCENT_PROTO_UPB_H_
10 #define ENVOY_TYPE_PERCENT_PROTO_UPB_H_
11 
12 #include "upb/generated_util.h"
13 #include "upb/msg.h"
14 #include "upb/decode.h"
15 #include "upb/encode.h"
16 
17 #include "upb/port_def.inc"
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 struct envoy_type_Percent;
27 extern const upb_msglayout envoy_type_Percent_msginit;
28 extern const upb_msglayout envoy_type_FractionalPercent_msginit;
29 
30 typedef enum {
35 
36 
37 /* envoy.type.Percent */
38 
39 UPB_INLINE envoy_type_Percent *envoy_type_Percent_new(upb_arena *arena) {
40  return (envoy_type_Percent *)upb_msg_new(&envoy_type_Percent_msginit, arena);
41 }
42 UPB_INLINE envoy_type_Percent *envoy_type_Percent_parse(const char *buf, size_t size,
43  upb_arena *arena) {
45  return (ret && upb_decode(buf, size, ret, &envoy_type_Percent_msginit, arena)) ? ret : NULL;
46 }
47 UPB_INLINE char *envoy_type_Percent_serialize(const envoy_type_Percent *msg, upb_arena *arena, size_t *len) {
48  return upb_encode(msg, &envoy_type_Percent_msginit, arena, len);
49 }
50 
51 UPB_INLINE double envoy_type_Percent_value(const envoy_type_Percent *msg) { return UPB_FIELD_AT(msg, double, UPB_SIZE(0, 0)); }
52 
53 UPB_INLINE void envoy_type_Percent_set_value(envoy_type_Percent *msg, double value) {
54  UPB_FIELD_AT(msg, double, UPB_SIZE(0, 0)) = value;
55 }
56 
57 /* envoy.type.FractionalPercent */
58 
61 }
62 UPB_INLINE envoy_type_FractionalPercent *envoy_type_FractionalPercent_parse(const char *buf, size_t size,
63  upb_arena *arena) {
65  return (ret && upb_decode(buf, size, ret, &envoy_type_FractionalPercent_msginit, arena)) ? ret : NULL;
66 }
67 UPB_INLINE char *envoy_type_FractionalPercent_serialize(const envoy_type_FractionalPercent *msg, upb_arena *arena, size_t *len) {
68  return upb_encode(msg, &envoy_type_FractionalPercent_msginit, arena, len);
69 }
70 
71 UPB_INLINE uint32_t envoy_type_FractionalPercent_numerator(const envoy_type_FractionalPercent *msg) { return UPB_FIELD_AT(msg, uint32_t, UPB_SIZE(8, 8)); }
72 UPB_INLINE int32_t envoy_type_FractionalPercent_denominator(const envoy_type_FractionalPercent *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(0, 0)); }
73 
75  UPB_FIELD_AT(msg, uint32_t, UPB_SIZE(8, 8)) = value;
76 }
78  UPB_FIELD_AT(msg, int32_t, UPB_SIZE(0, 0)) = value;
79 }
80 
81 #ifdef __cplusplus
82 } /* extern "C" */
83 #endif
84 
85 #include "upb/port_undef.inc"
86 
87 #endif /* ENVOY_TYPE_PERCENT_PROTO_UPB_H_ */
UPB_INLINE char * envoy_type_Percent_serialize(const envoy_type_Percent *msg, upb_arena *arena, size_t *len)
Definition: percent.upb.h:47
UPB_INLINE envoy_type_Percent * envoy_type_Percent_parse(const char *buf, size_t size, upb_arena *arena)
Definition: percent.upb.h:42
struct envoy_type_Percent envoy_type_Percent
Definition: percent.upb.h:25
UPB_INLINE int32_t envoy_type_FractionalPercent_denominator(const envoy_type_FractionalPercent *msg)
Definition: percent.upb.h:72
UPB_INLINE void envoy_type_FractionalPercent_set_denominator(envoy_type_FractionalPercent *msg, int32_t value)
Definition: percent.upb.h:77
UPB_INLINE envoy_type_FractionalPercent * envoy_type_FractionalPercent_new(upb_arena *arena)
Definition: percent.upb.h:59
envoy_type_FractionalPercent_DenominatorType
Definition: percent.upb.h:30
@ envoy_type_FractionalPercent_TEN_THOUSAND
Definition: percent.upb.h:32
@ envoy_type_FractionalPercent_HUNDRED
Definition: percent.upb.h:31
@ envoy_type_FractionalPercent_MILLION
Definition: percent.upb.h:33
UPB_INLINE envoy_type_Percent * envoy_type_Percent_new(upb_arena *arena)
Definition: percent.upb.h:39
UPB_INLINE envoy_type_FractionalPercent * envoy_type_FractionalPercent_parse(const char *buf, size_t size, upb_arena *arena)
Definition: percent.upb.h:62
struct envoy_type_FractionalPercent envoy_type_FractionalPercent
Definition: percent.upb.h:26
UPB_INLINE double envoy_type_Percent_value(const envoy_type_Percent *msg)
Definition: percent.upb.h:51
UPB_INLINE char * envoy_type_FractionalPercent_serialize(const envoy_type_FractionalPercent *msg, upb_arena *arena, size_t *len)
Definition: percent.upb.h:67
const upb_msglayout envoy_type_Percent_msginit
Definition: percent.upb.c:20
UPB_INLINE uint32_t envoy_type_FractionalPercent_numerator(const envoy_type_FractionalPercent *msg)
Definition: percent.upb.h:71
UPB_INLINE void envoy_type_Percent_set_value(envoy_type_Percent *msg, double value)
Definition: percent.upb.h:53
const upb_msglayout envoy_type_FractionalPercent_msginit
Definition: percent.upb.c:31
UPB_INLINE void envoy_type_FractionalPercent_set_numerator(envoy_type_FractionalPercent *msg, uint32_t value)
Definition: percent.upb.h:74