cdcontainers  0.1.1
Library of data containers and collections for C programming language.
Functions
Hash policy

Functions

static float cdc_hash_table_load_factor (struct cdc_hash_table *t)
 Returns average number of elements per bucket. More...
 
static float cdc_hash_table_max_load_factor (struct cdc_hash_table *t)
 Returns current maximum load factor. More...
 
static void cdc_hash_table_set_max_load_factor (struct cdc_hash_table *t, float load_factor)
 Sets the maximum load factor. More...
 
enum cdc_stat cdc_hash_table_rehash (struct cdc_hash_table *t, size_t count)
 Reserves at least the specified number of buckets. This regenerates the hash table. More...
 
enum cdc_stat cdc_hash_table_reserve (struct cdc_hash_table *t, size_t count)
 Reserves space for at least the specified number of elements. This regenerates the hash table. More...
 

Detailed Description

Function Documentation

◆ cdc_hash_table_load_factor()

static float cdc_hash_table_load_factor ( struct cdc_hash_table t)
inlinestatic

Returns average number of elements per bucket.

Parameters
[in]t- cdc_hash_table
Returns
average number of elements per bucket.

◆ cdc_hash_table_max_load_factor()

static float cdc_hash_table_max_load_factor ( struct cdc_hash_table t)
inlinestatic

Returns current maximum load factor.

Parameters
[in]t- cdc_hash_table
Returns
current maximum load factor.

◆ cdc_hash_table_set_max_load_factor()

static void cdc_hash_table_set_max_load_factor ( struct cdc_hash_table t,
float  load_factor 
)
inlinestatic

Sets the maximum load factor.

Parameters
[in]t- cdc_hash_table
[in]load_factor- new maximum load factor

◆ cdc_hash_table_rehash()

enum cdc_stat cdc_hash_table_rehash ( struct cdc_hash_table t,
size_t  count 
)

Reserves at least the specified number of buckets. This regenerates the hash table.

Parameters
[in]t- cdc_hash_table
[in]count- new number of buckets
Returns
CDC_STATUS_OK in a successful case or other value indicating an error.

◆ cdc_hash_table_reserve()

enum cdc_stat cdc_hash_table_reserve ( struct cdc_hash_table t,
size_t  count 
)

Reserves space for at least the specified number of elements. This regenerates the hash table.

Parameters
[in]t- cdc_hash_table
[in]count- new capacity of the container
Returns
CDC_STATUS_OK in a successful case or other value indicating an error.