Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
|
A datatype for holding a key-value pair along with the hashed value of the key. More...
#include <hash_table.h>
Public Member Functions | |
void | FreeHashBucket (HashBucket *const bucket_p) |
Function for freeing a HashBucket. More... | |
HashBucket * | CreateHashBuckets (const uint32 num_buckets, const MEM_FLAG key_mem_flag, const MEM_FLAG value_mem_flag) |
Function for creating the HashBuckets. More... | |
HashBucket * | CreateDeepCopyHashBuckets (const uint32 num_buckets) |
Create an array of HashBuckets where each one will make a deep copy of the key and value when they are put into the HashTable. More... | |
HashBucket * | CreateShallowCopyHashBuckets (const uint32 num_buckets) |
Create an array of HashBuckets where each one will make a shallow copy of the key and value when they are put into the HashTable. More... | |
HashBucket * | CreateShadowUseHashBuckets (const uint32 num_buckets) |
Create an array of HashBuckets where each one will make shadow use the key and value when they are put into the HashTable. More... | |
HashBucket * | CreateDeepCopyKeysShallowCopyValueHashBuckets (const uint32 num_buckets) |
Create an array of HashBuckets where each one will make a deep copy of the key and a shallow copy of the value when they are put into the HashTable. More... | |
Data Fields | |
uint32 | hb_hashed_key |
The hashed value of this HashBucket key. More... | |
const void * | hb_key_p |
The key. More... | |
const void * | hb_value_p |
The value. More... | |
MEM_FLAG | hb_owns_key |
Can the HashBucket free its key or is the memory owned by another process? More... | |
MEM_FLAG | hb_owns_value |
Can the HashBucket free its value or is the memory owned by another process? More... | |
A datatype for holding a key-value pair along with the hashed value of the key.
void FreeHashBucket | ( | HashBucket *const | bucket_p | ) |
Function for freeing a HashBucket.
bucket_p | The HashBucket to free. |
HashBucket * CreateHashBuckets | ( | const uint32 | num_buckets, |
const MEM_FLAG | key_mem_flag, | ||
const MEM_FLAG | value_mem_flag | ||
) |
Function for creating the HashBuckets.
The allocated memory is all set to 0/NULL
.
num_buckets | The number of HashBuckets to create. |
key_mem_flag | How the HashBuckets will deal with memory allocation of the keys. |
value_mem_flag | How the HashBuckets will deal with memory allocation of the values. |
NULL
upon error. HashBucket * CreateDeepCopyHashBuckets | ( | const uint32 | num_buckets | ) |
Create an array of HashBuckets where each one will make a deep copy of the key and value when they are put into the HashTable.
num_buckets | The number of HashBuckets to allocate. |
NULL
upon error.HashBucket * CreateShallowCopyHashBuckets | ( | const uint32 | num_buckets | ) |
Create an array of HashBuckets where each one will make a shallow copy of the key and value when they are put into the HashTable.
num_buckets | The number of HashBuckets to allocate. |
NULL
upon error.HashBucket * CreateShadowUseHashBuckets | ( | const uint32 | num_buckets | ) |
Create an array of HashBuckets where each one will make shadow use the key and value when they are put into the HashTable.
num_buckets | The number of HashBuckets to allocate. |
NULL
upon error.HashBucket * CreateDeepCopyKeysShallowCopyValueHashBuckets | ( | const uint32 | num_buckets | ) |
Create an array of HashBuckets where each one will make a deep copy of the key and a shallow copy of the value when they are put into the HashTable.
num_buckets | The number of HashBuckets to allocate. |
NULL
upon error.uint32 hb_hashed_key |
The hashed value of this HashBucket key.
const void* hb_key_p |
The key.
const void* hb_value_p |
The value.
MEM_FLAG hb_owns_key |
Can the HashBucket free its key or is the memory owned by another process?
MEM_FLAG hb_owns_value |
Can the HashBucket free its value or is the memory owned by another process?