• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
23 struct envoy_type_v3_Percent;
24 struct envoy_type_v3_FractionalPercent;
25 typedef struct envoy_type_v3_Percent envoy_type_v3_Percent;
26 typedef struct envoy_type_v3_FractionalPercent envoy_type_v3_FractionalPercent;
27 extern const upb_msglayout envoy_type_v3_Percent_msginit;
28 extern const upb_msglayout envoy_type_v3_FractionalPercent_msginit;
29 
30 typedef enum {
31   envoy_type_v3_FractionalPercent_HUNDRED = 0,
32   envoy_type_v3_FractionalPercent_TEN_THOUSAND = 1,
33   envoy_type_v3_FractionalPercent_MILLION = 2
34 } envoy_type_v3_FractionalPercent_DenominatorType;
35 
36 
37 /* envoy.type.v3.Percent */
38 
envoy_type_v3_Percent_new(upb_arena * arena)39 UPB_INLINE envoy_type_v3_Percent *envoy_type_v3_Percent_new(upb_arena *arena) {
40   return (envoy_type_v3_Percent *)_upb_msg_new(&envoy_type_v3_Percent_msginit, arena);
41 }
envoy_type_v3_Percent_parse(const char * buf,size_t size,upb_arena * arena)42 UPB_INLINE envoy_type_v3_Percent *envoy_type_v3_Percent_parse(const char *buf, size_t size,
43                         upb_arena *arena) {
44   envoy_type_v3_Percent *ret = envoy_type_v3_Percent_new(arena);
45   return (ret && upb_decode(buf, size, ret, &envoy_type_v3_Percent_msginit, arena)) ? ret : NULL;
46 }
envoy_type_v3_Percent_parse_ex(const char * buf,size_t size,upb_arena * arena,int options)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) {
49   envoy_type_v3_Percent *ret = envoy_type_v3_Percent_new(arena);
50   return (ret && _upb_decode(buf, size, ret, &envoy_type_v3_Percent_msginit, arena, options))
51       ? ret : NULL;
52 }
envoy_type_v3_Percent_serialize(const envoy_type_v3_Percent * msg,upb_arena * arena,size_t * len)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 
envoy_type_v3_Percent_value(const envoy_type_v3_Percent * msg)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 
envoy_type_v3_Percent_set_value(envoy_type_v3_Percent * msg,double value)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 
envoy_type_v3_FractionalPercent_new(upb_arena * arena)65 UPB_INLINE envoy_type_v3_FractionalPercent *envoy_type_v3_FractionalPercent_new(upb_arena *arena) {
66   return (envoy_type_v3_FractionalPercent *)_upb_msg_new(&envoy_type_v3_FractionalPercent_msginit, arena);
67 }
envoy_type_v3_FractionalPercent_parse(const char * buf,size_t size,upb_arena * arena)68 UPB_INLINE envoy_type_v3_FractionalPercent *envoy_type_v3_FractionalPercent_parse(const char *buf, size_t size,
69                         upb_arena *arena) {
70   envoy_type_v3_FractionalPercent *ret = envoy_type_v3_FractionalPercent_new(arena);
71   return (ret && upb_decode(buf, size, ret, &envoy_type_v3_FractionalPercent_msginit, arena)) ? ret : NULL;
72 }
envoy_type_v3_FractionalPercent_parse_ex(const char * buf,size_t size,upb_arena * arena,int options)73 UPB_INLINE envoy_type_v3_FractionalPercent *envoy_type_v3_FractionalPercent_parse_ex(const char *buf, size_t size,
74                            upb_arena *arena, int options) {
75   envoy_type_v3_FractionalPercent *ret = envoy_type_v3_FractionalPercent_new(arena);
76   return (ret && _upb_decode(buf, size, ret, &envoy_type_v3_FractionalPercent_msginit, arena, options))
77       ? ret : NULL;
78 }
envoy_type_v3_FractionalPercent_serialize(const envoy_type_v3_FractionalPercent * msg,upb_arena * arena,size_t * len)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 
envoy_type_v3_FractionalPercent_numerator(const envoy_type_v3_FractionalPercent * msg)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); }
envoy_type_v3_FractionalPercent_denominator(const envoy_type_v3_FractionalPercent * msg)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 
envoy_type_v3_FractionalPercent_set_numerator(envoy_type_v3_FractionalPercent * msg,uint32_t value)86 UPB_INLINE void envoy_type_v3_FractionalPercent_set_numerator(envoy_type_v3_FractionalPercent *msg, uint32_t value) {
87   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value;
88 }
envoy_type_v3_FractionalPercent_set_denominator(envoy_type_v3_FractionalPercent * msg,int32_t value)89 UPB_INLINE void envoy_type_v3_FractionalPercent_set_denominator(envoy_type_v3_FractionalPercent *msg, int32_t value) {
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_ */
100