A map that holds objects indexed by id.
More...
|
#define | PW_MAP_INIT(extend) (struct pw_map) { PW_ARRAY_INIT(extend), SPA_ID_INVALID } |
|
#define | pw_map_get_size(m) pw_array_get_len(&(m)->items, union pw_map_item) |
|
#define | pw_map_get_item(m, id) pw_array_get_unchecked(&(m)->items,id,union pw_map_item) |
|
#define | pw_map_item_is_free(item) ((item)->next & 0x1) |
|
#define | pw_map_id_is_free(m, id) (pw_map_item_is_free(pw_map_get_item(m,id))) |
|
#define | pw_map_check_id(m, id) ((id) < pw_map_get_size(m)) |
|
#define | pw_map_has_item(m, id) (pw_map_check_id(m,id) && !pw_map_id_is_free(m, id)) |
|
#define | pw_map_lookup_unchecked(m, id) pw_map_get_item(m,id)->data |
|
#define | PW_MAP_ID_TO_PTR(id) (SPA_UINT32_TO_PTR((id)<<1)) |
| Convert an id to a pointer that can be inserted into the map. More...
|
|
#define | PW_MAP_PTR_TO_ID(p) (SPA_PTR_TO_UINT32(p)>>1) |
| Convert a pointer to an id that can be retrieved from the map. More...
|
|
A map that holds objects indexed by id.
◆ pw_map_check_id
◆ pw_map_get_item
◆ pw_map_get_size
◆ pw_map_has_item
◆ pw_map_id_is_free
◆ PW_MAP_ID_TO_PTR
Convert an id to a pointer that can be inserted into the map.
◆ PW_MAP_INIT
◆ pw_map_item_is_free
#define pw_map_item_is_free |
( |
|
item | ) |
((item)->next & 0x1) |
◆ pw_map_lookup_unchecked
◆ PW_MAP_PTR_TO_ID
Convert a pointer to an id that can be retrieved from the map.