hash map for UUIDs where the same key may be present multiple times More...
Go to the source code of this file.
Data Structures | |
| struct | BigMapEntry | 
| An entry in the hash map with the full key.  More... | |
| struct | SmallMapEntry | 
| An entry in the hash map with just a pointer to the key.  More... | |
| union | MapEntry | 
| Entry in the map.  More... | |
| struct | GNUNET_CONTAINER_MultiUuidmap | 
| Internal representation of the hash map.  More... | |
| struct | GNUNET_CONTAINER_MultiUuidmapIterator | 
| Cursor into a multiuuidmap.  More... | |
Macros | |
| #define | LOG(kind, ...) GNUNET_log_from (kind, "util-container-multiuuidmap", __VA_ARGS__) | 
| #define | NEXT_CACHE_SIZE 16 | 
| Maximum recursion depth for callbacks of GNUNET_CONTAINER_multihashmap_get_multiple() themselves s again calling GNUNET_CONTAINER_multihashmap_get_multiple().   | |
Functions | |
| struct GNUNET_CONTAINER_MultiUuidmap * | GNUNET_CONTAINER_multiuuidmap_create (unsigned int len, int do_not_copy_keys) | 
| Create a multi hash map.   | |
| void | GNUNET_CONTAINER_multiuuidmap_destroy (struct GNUNET_CONTAINER_MultiUuidmap *map) | 
| Destroy a hash map.   | |
| static unsigned int | idx_of (const struct GNUNET_CONTAINER_MultiUuidmap *map, const struct GNUNET_Uuid *key) | 
| Compute the index of the bucket for the given key.   | |
| unsigned int | GNUNET_CONTAINER_multiuuidmap_size (const struct GNUNET_CONTAINER_MultiUuidmap *map) | 
| Get the number of key-value pairs in the map.   | |
| void * | GNUNET_CONTAINER_multiuuidmap_get (const struct GNUNET_CONTAINER_MultiUuidmap *map, const struct GNUNET_Uuid *key) | 
| Given a key find a value in the map matching the key.   | |
| enum GNUNET_GenericReturnValue | GNUNET_CONTAINER_multiuuidmap_iterate (struct GNUNET_CONTAINER_MultiUuidmap *map, GNUNET_CONTAINER_MultiUuidmapIteratorCallback it, void *it_cls) | 
| Iterate over all entries in the map.   | |
| static void | update_next_cache_bme (struct GNUNET_CONTAINER_MultiUuidmap *map, const struct BigMapEntry *bme) | 
| We are about to free() the bme, make sure it is not in the list of next values for any iterator in the map's next_cache.   | |
| static void | update_next_cache_sme (struct GNUNET_CONTAINER_MultiUuidmap *map, const struct SmallMapEntry *sme) | 
| We are about to free() the sme, make sure it is not in the list of next values for any iterator in the map's next_cache.   | |
| enum GNUNET_GenericReturnValue | GNUNET_CONTAINER_multiuuidmap_remove (struct GNUNET_CONTAINER_MultiUuidmap *map, const struct GNUNET_Uuid *key, const void *value) | 
| Remove the given key-value pair from the map.   | |
| int | GNUNET_CONTAINER_multiuuidmap_remove_all (struct GNUNET_CONTAINER_MultiUuidmap *map, const struct GNUNET_Uuid *key) | 
| Remove all entries for the given key from the map.   | |
| enum GNUNET_GenericReturnValue | GNUNET_CONTAINER_multiuuidmap_contains (const struct GNUNET_CONTAINER_MultiUuidmap *map, const struct GNUNET_Uuid *key) | 
| Check if the map contains any value under the given key (including values that are NULL).   | |
| enum GNUNET_GenericReturnValue | GNUNET_CONTAINER_multiuuidmap_contains_value (const struct GNUNET_CONTAINER_MultiUuidmap *map, const struct GNUNET_Uuid *key, const void *value) | 
| Check if the map contains the given value under the given key.   | |
| static void | grow (struct GNUNET_CONTAINER_MultiUuidmap *map) | 
| Grow the given map to a more appropriate size.   | |
| enum GNUNET_GenericReturnValue | GNUNET_CONTAINER_multiuuidmap_put (struct GNUNET_CONTAINER_MultiUuidmap *map, const struct GNUNET_Uuid *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt) | 
| Store a key-value pair in the map.   | |
| int | GNUNET_CONTAINER_multiuuidmap_get_multiple (struct GNUNET_CONTAINER_MultiUuidmap *map, const struct GNUNET_Uuid *key, GNUNET_CONTAINER_MultiUuidmapIteratorCallback it, void *it_cls) | 
| Iterate over all entries in the map that match a particular key.   | |
| unsigned int | GNUNET_CONTAINER_multiuuidmap_get_random (const struct GNUNET_CONTAINER_MultiUuidmap *map, GNUNET_CONTAINER_MultiUuidmapIteratorCallback it, void *it_cls) | 
| Call it on a random value from the map, or not at all if the map is empty.   | |
| struct GNUNET_CONTAINER_MultiUuidmapIterator * | GNUNET_CONTAINER_multiuuidmap_iterator_create (const struct GNUNET_CONTAINER_MultiUuidmap *map) | 
| Create an iterator for a multihashmap.   | |
| enum GNUNET_GenericReturnValue | GNUNET_CONTAINER_multiuuidmap_iterator_next (struct GNUNET_CONTAINER_MultiUuidmapIterator *iter, struct GNUNET_Uuid *key, const void **value) | 
| Retrieve the next element from the hash map at the iterator's position.   | |
| void | GNUNET_CONTAINER_multiuuidmap_iterator_destroy (struct GNUNET_CONTAINER_MultiUuidmapIterator *iter) | 
| Destroy a multiuuidmap iterator.   | |
hash map for UUIDs where the same key may be present multiple times
Definition in file container_multiuuidmap.c.
| #define LOG | ( | kind, | |
| ... | |||
| ) | GNUNET_log_from (kind, "util-container-multiuuidmap", __VA_ARGS__) | 
Definition at line 30 of file container_multiuuidmap.c.
| #define NEXT_CACHE_SIZE 16 | 
Maximum recursion depth for callbacks of GNUNET_CONTAINER_multihashmap_get_multiple() themselves s again calling GNUNET_CONTAINER_multihashmap_get_multiple().
Should be totally excessive, but if violated we die.
Definition at line 39 of file container_multiuuidmap.c.
      
  | 
  static | 
Compute the index of the bucket for the given key.
| map | hash map for which to compute the index | 
| key | what key should the index be computed for | 
Definition at line 263 of file container_multiuuidmap.c.
References GNUNET_assert, GNUNET_memcpy, key, map, and GNUNET_CONTAINER_MultiPeerMap::map_length.
Referenced by GNUNET_CONTAINER_multiuuidmap_contains(), GNUNET_CONTAINER_multiuuidmap_contains_value(), GNUNET_CONTAINER_multiuuidmap_get(), GNUNET_CONTAINER_multiuuidmap_get_multiple(), GNUNET_CONTAINER_multiuuidmap_put(), GNUNET_CONTAINER_multiuuidmap_remove(), GNUNET_CONTAINER_multiuuidmap_remove_all(), and grow().
      
  | 
  static | 
We are about to free() the bme, make sure it is not in the list of next values for any iterator in the map's next_cache.
| map | the map to check | 
| bme | the entry that is about to be free'd | 
Definition at line 374 of file container_multiuuidmap.c.
References MapEntry::bme, map, BigMapEntry::next, GNUNET_CONTAINER_MultiPeerMap::next_cache, and GNUNET_CONTAINER_MultiPeerMap::next_cache_off.
Referenced by GNUNET_CONTAINER_multiuuidmap_remove(), and GNUNET_CONTAINER_multiuuidmap_remove_all().
      
  | 
  static | 
We are about to free() the sme, make sure it is not in the list of next values for any iterator in the map's next_cache.
| map | the map to check | 
| sme | the entry that is about to be free'd | 
Definition at line 391 of file container_multiuuidmap.c.
References map, SmallMapEntry::next, GNUNET_CONTAINER_MultiPeerMap::next_cache, GNUNET_CONTAINER_MultiPeerMap::next_cache_off, and MapEntry::sme.
Referenced by GNUNET_CONTAINER_multiuuidmap_remove(), and GNUNET_CONTAINER_multiuuidmap_remove_all().
      
  | 
  static | 
Grow the given map to a more appropriate size.
| map | the hash map to grow | 
Definition at line 590 of file container_multiuuidmap.c.
References MapEntry::bme, GNUNET_free, GNUNET_malloc_large, idx_of(), BigMapEntry::key, SmallMapEntry::key, GNUNET_CONTAINER_MultiPeerMap::map, map, GNUNET_CONTAINER_MultiPeerMap::map_length, GNUNET_CONTAINER_MultiPeerMap::modification_counter, BigMapEntry::next, SmallMapEntry::next, MapEntry::sme, and GNUNET_CONTAINER_MultiPeerMap::use_small_entries.
Referenced by GNUNET_CONTAINER_multiuuidmap_put().