8#ifndef UPB_MESSAGE_INTERNAL_MAP_H_
9#define UPB_MESSAGE_INTERNAL_MAP_H_
54 map->UPB_PRIVATE(is_frozen) =
true;
58 return map->UPB_PRIVATE(is_frozen);
85 memcpy(out, &key,
sizeof(key));
87 memcpy(out, key.
data, size);
95 if (!strp)
return false;
97 *msgval = upb_value_ptr(strp);
99 memcpy(msgval, val, size);
109 memcpy(out, &val, size);
114 if (
map->UPB_PRIVATE(is_strtable)) {
116 it.
t = &
map->
t.strtable;
124 intptr_t int_iter = 0;
125 memcpy(&int_iter, iter,
sizeof(intptr_t));
127 memcpy(iter, &int_iter,
sizeof(
size_t));
135 if (
map->UPB_PRIVATE(is_strtable)) {
146 if (
map->UPB_PRIVATE(is_strtable)) {
159 if (
map->UPB_PRIVATE(is_strtable)) {
185 if (
map->UPB_PRIVATE(is_strtable)) {
206 if (
map->UPB_PRIVATE(is_strtable)) {
207 return map->t.strtable.t.count;
#define UPB_API_INLINE
Definition def.inc:163
#define UPB_MAPTYPE_STRING
Definition def.inc:133
#define UPB_ASSERT(expr)
Definition def.inc:329
#define UPB_PRIVATE(x)
Definition def.inc:393
#define UPB_INLINE
Definition def.inc:144
upb_CType
Definition descriptor_constants.h:18
void upb_inttable_clear(upb_inttable *t)
bool upb_inttable_remove(upb_inttable *t, uintptr_t key, upb_value *val)
bool upb_inttable_done(const upb_inttable *t, intptr_t i)
bool upb_inttable_lookup(const upb_inttable *t, uintptr_t key, upb_value *v)
bool upb_inttable_insert(upb_inttable *t, uintptr_t key, upb_value val, upb_Arena *a)
bool upb_inttable_next(const upb_inttable *t, uintptr_t *key, upb_value *val, intptr_t *iter)
size_t upb_inttable_count(const upb_inttable *t)
UPB_API_INLINE void * upb_Arena_Malloc(struct upb_Arena *a, size_t size)
Definition arena.h:65
UPB_INLINE void UPB_PRIVATE _upb_Map_ShallowFreeze(struct upb_Map *map)
Definition map.h:53
UPB_API_INLINE bool upb_Map_IsFrozen(const struct upb_Map *map)
Definition map.h:57
UPB_INLINE size_t _upb_Map_Size(const struct upb_Map *map)
Definition map.h:205
UPB_INLINE upb_MapInsertStatus _upb_Map_Insert(struct upb_Map *map, const void *key, size_t key_size, void *val, size_t val_size, upb_Arena *a)
Definition map.h:172
UPB_INLINE void _upb_map_fromvalue(upb_value val, void *out, size_t size)
Definition map.h:104
UPB_INLINE size_t _upb_Map_CTypeSize(upb_CType ctype)
Definition map.h:216
UPB_INLINE bool _upb_Map_Delete(struct upb_Map *map, const void *key, size_t key_size, upb_value *val)
Definition map.h:142
UPB_INLINE bool _upb_Map_Get(const struct upb_Map *map, const void *key, size_t key_size, void *val, size_t val_size)
Definition map.h:155
struct upb_Map * _upb_Map_New(upb_Arena *a, size_t key_size, size_t value_size)
UPB_INLINE bool _upb_map_next(const struct upb_Map *map, size_t *iter)
Definition map.h:113
upb_MapInsertStatus
Definition map.h:25
@ kUpb_MapInsertStatus_OutOfMemory
Definition map.h:28
@ kUpb_MapInsertStatus_Inserted
Definition map.h:26
@ kUpb_MapInsertStatus_Replaced
Definition map.h:27
char _upb_Map_CTypeSizeTable[12]
UPB_INLINE void _upb_Map_Clear(struct upb_Map *map)
Definition map.h:132
UPB_INLINE uintptr_t _upb_map_tointkey(const void *key, size_t key_size)
Definition map.h:77
UPB_INLINE bool _upb_map_tovalue(const void *val, size_t size, upb_value *msgval, upb_Arena *a)
Definition map.h:91
UPB_INLINE upb_StringView _upb_map_tokey(const void *key, size_t size)
Definition map.h:69
UPB_INLINE void _upb_map_fromkey(upb_StringView key, void *out, size_t size)
Definition map.h:83
bool upb_strtable_lookup2(const upb_strtable *t, const char *key, size_t len, upb_value *v)
void upb_strtable_clear(upb_strtable *t)
bool upb_strtable_remove2(upb_strtable *t, const char *key, size_t len, upb_value *val)
void upb_strtable_next(upb_strtable_iter *i)
bool upb_strtable_insert(upb_strtable *t, const char *key, size_t len, upb_value val, upb_Arena *a)
bool upb_strtable_done(const upb_strtable_iter *i)
UPB_API_INLINE upb_StringView upb_StringView_FromDataAndSize(const char *data, size_t size)
Definition string_view.h:32
char val_size
Definition map.h:42
bool UPB_PRIVATE(is_frozen)
bool UPB_PRIVATE(is_strtable)
char key_size
Definition map.h:41
Definition string_view.h:23
const char * data
Definition string_view.h:24
size_t size
Definition string_view.h:25
Definition int_table.h:20
Definition str_table.h:124
size_t index
Definition str_table.h:126
const upb_strtable * t
Definition str_table.h:125
Definition str_table.h:22
upb_table t
Definition str_table.h:23
upb_strtable strtable
Definition map.h:34
upb_inttable inttable
Definition map.h:35