Go to the documentation of this file.
35 #ifndef UPB_MSG_INT_H_
36 #define UPB_MSG_INT_H_
47 #include "upb/port_def.inc"
81 #define kUpb_NoSub ((uint16_t)-1)
90 #define kUpb_FieldMode_Mask 3
145 if (uval < 64)
return e->mask & (1 << uval);
147 int n = e->value_count;
148 for (
int i = 0;
i <
n;
i++) {
149 if (e->values[
i] == val)
return true;
224 int n =
l->required_count;
225 assert(0 <
n &&
n <= 63);
226 return ((1
ULL <<
n) - 1) << 1;
404 return ~(ptrdiff_t)
f->presence;
454 const size_t bytes =
sizeof(
upb_Array) + (init_size << elem_size_lg2);
456 if (!arr)
return NULL;
459 arr->
size = init_size;
530 size_t elem_size = 1 << elem_size_lg2;
533 if (!arr || arr->
len == arr->
size) {
637 if (!strp)
return false;
639 *msgval = upb_value_ptr(strp);
658 return map->table.t.count;
662 size_t key_size,
void* val,
size_t val_size) {
711 const void*
key,
size_t key_size,
void* val,
714 if (!
map)
return false;
721 if (!
map)
return NULL;
726 size_t key_size,
void* val,
size_t val_size,
736 const void*
key,
size_t key_size) {
738 if (!
map)
return false;
772 memcpy(strp, val,
sizeof(*strp));
803 if (s->entries) free(s->entries);
811 s->size = sorted->
start;
816 if (sorted->
pos == sorted->
end)
return false;
829 #include "upb/port_undef.inc"
UPB_INLINE uint64_t upb_MiniTable_requiredmask(const upb_MiniTable *l)
UPB_INLINE bool _upb_Map_Delete(upb_Map *map, const void *key, size_t key_size)
UPB_INLINE bool _upb_hasbit_field(const upb_Message *msg, const upb_MiniTable_Field *f)
const upb_MiniTable_Extension ** exts
bool upb_strtable_done(const upb_strtable_iter *i)
return memset(p, 0, total)
bool _upb_extreg_add(upb_ExtensionRegistry *r, const upb_MiniTable_Extension **e, size_t count)
UPB_INLINE uint32_t _upb_UInt32_FromU(unsigned v)
UPB_INLINE void * _upb_msg_map_next(const upb_Message *msg, size_t ofs, size_t *iter)
UPB_INLINE void _upb_msg_map_value(const void *msg, void *val, size_t size)
const upb_MiniTable_Enum * subenum
const upb_MiniTable_Enum ** enums
const upb_MiniTable_Field * fields
UPB_INLINE uint32_t _upb_getoneofcase_field(const upb_Message *msg, const upb_MiniTable_Field *f)
@ kUpb_LabelFlags_IsPacked
UPB_INLINE size_t _upb_Map_Size(const upb_Map *map)
const typedef char * _upb_FieldParser(struct upb_Decoder *d, const char *ptr, upb_Message *msg, intptr_t table, uint64_t hasbits, uint64_t data)
const struct upb_MiniTable * submsg
upb_Message_Extension * _upb_Message_Getorcreateext(upb_Message *msg, const upb_MiniTable_Extension *ext, upb_Arena *arena)
UPB_INLINE upb_Message * _upb_Message_New_inl(const upb_MiniTable *l, upb_Arena *a)
#define UPB_ALIGN_UP(size, align)
#define UPB_UNREACHABLE()
const upb_MiniTable_Extension * ext
bool _upb_Message_AddUnknown(upb_Message *msg, const char *data, size_t len, upb_Arena *arena)
UPB_INLINE void * _upb_Array_Resize_accessor(void *msg, size_t ofs, size_t size, upb_CType type, upb_Arena *arena)
UPB_INLINE upb_Message_Internal * upb_Message_Getinternal(upb_Message *msg)
UPB_INLINE void _upb_sethas(const upb_Message *msg, size_t idx)
UPB_INLINE char * upb_tabstr(upb_tabkey key, uint32_t *len)
bool upb_strtable_lookup2(const upb_strtable *t, const char *key, size_t len, upb_value *v)
UPB_INLINE void _upb_array_detach(const void *msg, size_t ofs)
UPB_INLINE uint32_t * _upb_oneofcase(upb_Message *msg, size_t case_ofs)
UPB_INLINE bool _upb_Map_Set(upb_Map *map, const void *key, size_t key_size, void *val, size_t val_size, upb_Arena *a)
#define UPB_PTR_AT(msg, ofs, type)
UPB_INLINE bool _upb_map_tovalue(const void *val, size_t size, upb_value *msgval, upb_Arena *a)
_upb_FastTable_Entry fasttable[]
grpc_core::ScopedArenaPtr arena
UPB_INLINE bool _upb_array_reserve(upb_Array *arr, size_t size, upb_Arena *arena)
@ kUpb_LabelFlags_IsExtension
union upb_MapEntry::@708 k
const upb_MiniTable_Extension * _upb_extreg_get(const upb_ExtensionRegistry *r, const upb_MiniTable *l, uint32_t num)
UPB_INLINE bool _upb_msg_map_delete(upb_Message *msg, size_t ofs, const void *key, size_t key_size)
@ kUpb_ExtMode_NonExtendable
upb_Map * _upb_Map_New(upb_Arena *a, size_t key_size, size_t value_size)
UPB_INLINE void _upb_map_fromvalue(upb_value val, void *out, size_t size)
UPB_INLINE bool _upb_msg_map_get(const upb_Message *msg, size_t ofs, const void *key, size_t key_size, void *val, size_t val_size)
UPB_INLINE int _upb_sizelg2(upb_CType type)
void _upb_Message_Clearext(upb_Message *msg, const upb_MiniTable_Extension *ext)
UPB_INLINE void _upb_clearhas_field(const upb_Message *msg, const upb_MiniTable_Field *f)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
UPB_INLINE void _upb_map_fromkey(upb_StringView key, void *out, size_t size)
UPB_INLINE bool _upb_Map_Get(const upb_Map *map, const void *key, size_t key_size, void *val, size_t val_size)
UPB_INLINE bool _upb_has_submsg_nohasbit(const upb_Message *msg, size_t ofs)
const upb_MiniTable_Sub * subs
const upb_Message_Extension * _upb_Message_Getexts(const upb_Message *msg, size_t *count)
@ kUpb_ExtMode_IsMapEntry
UPB_INLINE void * _upb_map_next(const upb_Map *map, size_t *iter)
UPB_INLINE void _upb_mapsorter_popmap(_upb_mapsorter *s, _upb_sortedmap *sorted)
UPB_INLINE bool _upb_Array_Append_accessor2(void *msg, size_t ofs, int elem_size_lg2, const void *value, upb_Arena *arena)
UPB_INLINE bool upb_IsRepeatedOrMap(const upb_MiniTable_Field *field)
bool _upb_array_realloc(upb_Array *arr, size_t min_size, upb_Arena *arena)
UPB_INLINE bool upb_MiniTable_Enum_CheckValue(const upb_MiniTable_Enum *e, int32_t val)
#define UPB_SIZE(size32, size64)
UPB_INLINE void * upb_Arena_Malloc(upb_Arena *a, size_t size)
void _upb_Message_Clear(upb_Message *msg, const upb_MiniTable *l)
UPB_INLINE size_t _upb_oneofcase_ofs(const upb_MiniTable_Field *f)
UPB_INLINE bool _upb_hasbit(const upb_Message *msg, size_t idx)
unsigned __int64 uint64_t
union upb_MapEntry::@709 v
UPB_INLINE upb_FieldMode upb_FieldMode_Get(const upb_MiniTable_Field *field)
UPB_INLINE void _upb_Map_Clear(upb_Map *map)
const UPB_INLINE void * _upb_array_accessor(const void *msg, size_t ofs, size_t *size)
void upb_strtable_next(upb_strtable_iter *i)
UPB_INLINE uint64_t _upb_UInt64_FromULL(unsigned long long v)
_W64 unsigned int uintptr_t
upb_MiniTable_Field field
UPB_INLINE void * _upb_array_mutable_accessor(void *msg, size_t ofs, size_t *size)
@ kUpb_ExtMode_Extendable
void * _upb_Array_Resize_fallback(upb_Array **arr_ptr, size_t size, int elem_size_lg2, upb_Arena *arena)
const upb_Message_Extension * _upb_Message_Getext(const upb_Message *msg, const upb_MiniTable_Extension *ext)
const upb_MiniTable * extendee
upb_Message * _upb_Message_New(const upb_MiniTable *l, upb_Arena *a)
bool _upb_mapsorter_pushmap(_upb_mapsorter *s, upb_FieldType key_type, const upb_Map *map, _upb_sortedmap *sorted)
const UPB_INLINE void * _upb_array_constptr(const upb_Array *arr)
UPB_INLINE uintptr_t _upb_array_tagptr(void *ptr, int elem_size_lg2)
UPB_INLINE bool _upb_msg_map_set(upb_Message *msg, size_t ofs, const void *key, size_t key_size, void *val, size_t val_size, upb_Arena *arena)
const upb_MiniTable ** msgs
#define UPB_MAPTYPE_STRING
const FieldDescriptor * field
@ kUpb_ExtMode_IsMessageSet_ITEM
UPB_INLINE bool upb_strtable_remove2(upb_strtable *t, const char *key, size_t len, upb_value *val)
UPB_INLINE void _upb_mapsorter_destroy(_upb_mapsorter *s)
static const upb_tabent * str_tabent(const upb_strtable_iter *i)
UPB_INLINE void _upb_sethas_field(const upb_Message *msg, const upb_MiniTable_Field *f)
void _upb_Message_DiscardUnknown_shallow(upb_Message *msg)
UniquePtr< SSL_SESSION > ret
UPB_INLINE void * _upb_array_ptr(upb_Array *arr)
UPB_INLINE bool _upb_Array_Append_accessor(void *msg, size_t ofs, size_t elem_size, upb_CType type, const void *value, upb_Arena *arena)
UPB_INLINE size_t upb_msg_sizeof(const upb_MiniTable *l)
UPB_INLINE upb_StringView upb_StringView_FromDataAndSize(const char *data, size_t size)
UPB_INLINE size_t _upb_msg_map_size(const upb_Message *msg, size_t ofs)
@ kUpb_ExtMode_IsMessageSet
UPB_INLINE bool _upb_Array_Resize(upb_Array *arr, size_t size, upb_Arena *arena)
UPB_INLINE upb_strview upb_tabstrview(upb_tabkey key)
UPB_INLINE void _upb_msg_map_clear(upb_Message *msg, size_t ofs)
UPB_INLINE upb_Array * _upb_Array_New(upb_Arena *a, size_t init_size, int elem_size_lg2)
UPB_INLINE uintptr_t _upb_tag_arrptr(void *ptr, int elem_size_lg2)
UPB_INLINE int32_t _upb_Int32_FromI(int v)
UPB_INLINE void _upb_mapsorter_init(_upb_mapsorter *s)
void upb_strtable_clear(upb_strtable *t)
UPB_INLINE upb_StringView _upb_map_tokey(const void *key, size_t size)
UPB_INLINE void * _upb_Array_Resize_accessor2(void *msg, size_t ofs, size_t size, int elem_size_lg2, upb_Arena *arena)
UPB_INLINE void _upb_msg_map_set_value(void *msg, const void *val, size_t size)
UPB_INLINE uint32_t * _upb_oneofcase_field(upb_Message *msg, const upb_MiniTable_Field *f)
bool _upb_Array_Append_fallback(upb_Array **arr_ptr, const void *value, int elem_size_lg2, upb_Arena *arena)
UPB_INLINE int64_t _upb_Int64_FromLL(long long v)
UPB_INLINE size_t _upb_Message_Hasidx(const upb_MiniTable_Field *f)
UPB_INLINE bool upb_IsSubMessage(const upb_MiniTable_Field *field)
@ kUpb_FieldRep_StringView
UPB_INLINE void _upb_clearhas(const upb_Message *msg, size_t idx)
_upb_FieldParser * field_parser
UPB_INLINE void _upb_msg_map_key(const void *msg, void *key, size_t size)
UPB_INLINE bool upb_strtable_insert(upb_strtable *t, const char *key, upb_value val)
char _upb_CTypeo_size[12]
UPB_INLINE bool _upb_sortedmap_next(_upb_mapsorter *s, const upb_Map *map, _upb_sortedmap *sorted, upb_MapEntry *ent)
UPB_INLINE uint32_t _upb_getoneofcase(const void *msg, size_t case_ofs)
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:00:41