51#ifndef NRF_802154_BSMAP_H_
52#define NRF_802154_BSMAP_H_
159#define NRF_802154_BSMAP_ENTRY_SIZE(key_size, value_size) ((key_size) + (value_size))
168#define NRF_802154_BSMAP_MEMORY_SIZE(key_size, value_size, capacity) \
169 (NRF_802154_BSMAP_ENTRY_SIZE((key_size), (value_size)) * (capacity))
177#define NRF_802154_BSMAP_AUX_MEMORY_SIZE(key_size, value_size) \
178 NRF_802154_BSMAP_ENTRY_SIZE((key_size), (value_size))
253 const void * p_value,
254 void * p_aux_memory);
277 void * p_aux_memory);
367 const void * p_value,
368 void * p_aux_memory);
382 void * p_aux_memory);
bool nrf_802154_bsmap_rec_delete(nrf_802154_bsmap_t *p_bsmap, const void *p_key, void *p_aux_memory)
Delete a record associated with a key from the BSMAP.
void nrf_802154_bsmap_iterator_finish(nrf_802154_bsmap_iterator_t *p_iter)
Finish the iteration over a BSMAP the iterator is bound to.
void nrf_802154_bsmap_iterator_rec_delete(nrf_802154_bsmap_iterator_t *p_iter, void *p_aux_memory)
Delete a record at given iterator.
bool nrf_802154_bsmap_iterator_is_valid(const nrf_802154_bsmap_iterator_t *p_iter)
Check if iterator points to an existing item in the BSMAP.
void nrf_802154_bsmap_iterator_next(nrf_802154_bsmap_iterator_t *p_iter)
Move the BSMAP iterator to the next position.
void nrf_802154_bsmap_iterator_rec_value_get(const nrf_802154_bsmap_iterator_t *p_iter, void *p_value)
Get the value part of record at given iterator.
void nrf_802154_bsmap_clear(nrf_802154_bsmap_t *p_bsmap)
Remove all entries from the BSMAP.
void nrf_802154_bsmap_iterator_rec_key_get(const nrf_802154_bsmap_iterator_t *p_iter, void *p_key)
Get the key part of record at given iterator.
void nrf_802154_bsmap_iterator_rec_value_write(const nrf_802154_bsmap_iterator_t *p_iter, const void *p_value, void *p_aux_memory)
Write the value part of record at given iterator.
void nrf_802154_bsmap_init(nrf_802154_bsmap_t *p_bsmap, size_t key_size, size_t value_size, size_t capacity, void *p_memory)
Initialize the BSMAP object.
bool nrf_802154_bsmap_rec_get(const nrf_802154_bsmap_t *p_bsmap, const void *p_key, void *p_value)
Search for a record associated with the key in the BSMAP and copy the associated value into p_value i...
void nrf_802154_bsmap_iterator_begin(nrf_802154_bsmap_t *p_bsmap, nrf_802154_bsmap_iterator_t *p_iter, bool forward)
Start iteration over the BSMAP.
bool nrf_802154_bsmap_rec_write(nrf_802154_bsmap_t *p_bsmap, const void *p_key, const void *p_value, void *p_aux_memory)
Write a record associated with a key into the BSMAP.
bool forward
Indicates if direction of iteration is forward.
Definition nrf_802154_bsmap.h:87
int32_t index
Index to an internal array.
Definition nrf_802154_bsmap.h:83
nrf_802154_bsmap_t * p_bsmap
Pointer to the BSMAP the iterator is iterating over.
Definition nrf_802154_bsmap.h:95
bool deleted
Indicates if entry at index has been deleted.
Definition nrf_802154_bsmap.h:91
Type of an iterator used to iterate over the BSMAP.
Definition nrf_802154_bsmap.h:79
nrfx_atomic_t entry_idx_in_aux
Index of the entry staged in p_aux_memory, or a sentinel when no entry is staged.
Definition nrf_802154_bsmap.h:138
uint16_t keys_count
Backing memory for all entries (each entry is key and value combined).
Definition nrf_802154_bsmap.h:128
uint16_t value_size
Size of each value associated with a key, in bytes.
Definition nrf_802154_bsmap.h:113
nrf_802154_bsmap_iterator_t * p_iter
Iterator registered for this map, or NULL when no iteration is active.
Definition nrf_802154_bsmap.h:148
uint16_t entry_size
Size of one stored entry (key and value combined), in bytes.
Definition nrf_802154_bsmap.h:118
void * p_memory
Pointer to a memory storage for entries.
Definition nrf_802154_bsmap.h:133
uint16_t key_size
Size of each key, in bytes.
Definition nrf_802154_bsmap.h:108
void * p_aux_memory
Pointer to a temporary buffer used while modifying entries.
Definition nrf_802154_bsmap.h:143
uint16_t capacity
Maximum number of entries the map can hold.
Definition nrf_802154_bsmap.h:123
Type of a structure holding the BSMAP object.
Definition nrf_802154_bsmap.h:104