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.
HashBucket Struct Reference

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...
 
HashBucketCreateHashBuckets (const uint32 num_buckets, const MEM_FLAG key_mem_flag, const MEM_FLAG value_mem_flag)
 Function for creating the HashBuckets. More...
 
HashBucketCreateDeepCopyHashBuckets (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...
 
HashBucketCreateShallowCopyHashBuckets (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...
 
HashBucketCreateShadowUseHashBuckets (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...
 
HashBucketCreateDeepCopyKeysShallowCopyValueHashBuckets (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...
 

Detailed Description

A datatype for holding a key-value pair along with the hashed value of the key.

Member Function Documentation

◆ FreeHashBucket()

void FreeHashBucket ( HashBucket *const  bucket_p)

Function for freeing a HashBucket.

Parameters
bucket_pThe HashBucket to free.

◆ CreateHashBuckets()

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.

Parameters
num_bucketsThe number of HashBuckets to create.
key_mem_flagHow the HashBuckets will deal with memory allocation of the keys.
value_mem_flagHow the HashBuckets will deal with memory allocation of the values.
Returns
Pointer to the HashBuckets or NULL upon error.

◆ CreateDeepCopyHashBuckets()

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.

Parameters
num_bucketsThe number of HashBuckets to allocate.
Returns
The array of HashBuckets or NULL upon error.
See also
MF_DEEP_COPY

◆ CreateShallowCopyHashBuckets()

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.

Parameters
num_bucketsThe number of HashBuckets to allocate.
Returns
The array of HashBuckets or NULL upon error.
See also
MF_SHALLOW_COPY

◆ CreateShadowUseHashBuckets()

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.

Parameters
num_bucketsThe number of HashBuckets to allocate.
Returns
The array of HashBuckets or NULL upon error.
See also
MF_SHADOW_USE

◆ CreateDeepCopyKeysShallowCopyValueHashBuckets()

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.

Parameters
num_bucketsThe number of HashBuckets to allocate.
Returns
The array of HashBuckets or NULL upon error.
See also
MF_SHALLOW_COPY
MF_DEEP_COPY

Field Documentation

◆ hb_hashed_key

uint32 hb_hashed_key

The hashed value of this HashBucket key.

◆ hb_key_p

const void* hb_key_p

The key.

◆ hb_value_p

const void* hb_value_p

The value.

◆ hb_owns_key

MEM_FLAG hb_owns_key

Can the HashBucket free its key or is the memory owned by another process?

◆ hb_owns_value

MEM_FLAG hb_owns_value

Can the HashBucket free its value or is the memory owned by another process?


The documentation for this struct was generated from the following file: