Multi-ApplicationOnlineProfiling  2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Hash_Table.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "Chained_List.h"
#include "Spinlock.h"
#include "CRC64.h"
Include dependency graph for Hash_Table.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Hash_Table_Internal
 This is the structure used to store the clusters (items that have the same hash) More...
 
struct  Hash_Table
 This is the main hask table structure. More...
 

Functions

static void Hash_Table_use_lock (struct Hash_Table *ht)
 Indicates that the hashtable must use a lock for operations (get/push) More...
 
void Hash_Table_init (struct Hash_Table *ht, size_t sizeof_payload, uint64_t table_size, uint8_t coll_avoid)
 Hash_Table initialization. More...
 
void Hash_Table_release (struct Hash_Table *ht, void(*free_f)(void *))
 Hash_Table release. More...
 
void * Hash_Table_get (struct Hash_Table *ht, uint64_t key, void *extra_arg, int(*test_func)(void *, uint64_t, void *))
 retrieves an element from the hashtable More...
 
void * Hash_Table_push (struct Hash_Table *ht, void *payload, uint64_t key)
 adds an element to a hashtable More...
 
void * Hash_Table_get_an_entry (struct Hash_Table *ht)
 Retrieves the first found element of the hash table. More...
 
void * Hash_Table_push_unique (struct Hash_Table *ht, void *payload, uint64_t key, void *extra_arg, int(*test_func)(void *, uint64_t, void *))
 Adds an element into the hashtable. Replaces already existing element at key. More...
 
uint64_t Hash_Table_count_by_walk (struct Hash_Table *ht)
 counts the elements in the hashtable by walking through all the elements More...
 
void Hash_Table_walkthrought (struct Hash_Table *ht, void(*action)(void *))
 Executes a function on every stored elements. More...
 
void Hash_Table_walkthrought_2p (struct Hash_Table *ht, void *second_arg, void(*action)(void *, void *))
 Executes a function on every stored elements. More...
 
void Hash_Table_walkthrought_3p (struct Hash_Table *ht, void *second_arg, void *third_arg, void(*action)(void *, void *, void *))
 Executes a function on every stored elements. More...
 
void Hash_Table_walkthrought_cond (struct Hash_Table *ht, void(*action)(void *), int(*test_func)(void *, void *), void *test_value)
 Executes a function on every stored elements that satisfy a condition. More...
 
void Hash_Table_walkthrought_cond_2p (struct Hash_Table *ht, void *second_arg, void(*action)(void *, void *), int(*test_func)(void *, void *), void *test_value)
 Executes a function on every stored elements that satisfy a condition. More...
 
void Hash_Table_lock_cell (struct Hash_Table *ht, uint64_t key)
 Locks a cell at given key. More...
 
void Hash_Table_unlock_cell (struct Hash_Table *ht, uint64_t key)
 Unlocks a cell at given key. More...
 
void Hash_Table_init_Internal (void *phi, uint64_t coll_avoid, uint64_t intern_payload_size)
 Initializes internal hashtable data. More...
 
void Hash_Table_release_Internal (void *phi)
 Releases internal hashtable data. More...