Zephyr API 3.6.99
Loading...
Searching...
No Matches
hash_map_sc.h File Reference

Separate Chaining Hashmap Implementation. More...

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <zephyr/sys/hash_function.h>
#include <zephyr/sys/hash_map_api.h>

Go to the source code of this file.

Macros

#define SYS_HASHMAP_SC_DEFINE_ADVANCED(_name, _hash_func, _alloc_func, ...)
 Declare a Separate Chaining Hashmap (advanced)
 
#define SYS_HASHMAP_SC_DEFINE_STATIC_ADVANCED(_name, _hash_func, _alloc_func, ...)
 Declare a Separate Chaining Hashmap (advanced)
 
#define SYS_HASHMAP_SC_DEFINE_STATIC(_name)
 Declare a Separate Chaining Hashmap statically.
 
#define SYS_HASHMAP_SC_DEFINE(_name)
 Declare a Separate Chaining Hashmap.
 

Variables

const struct sys_hashmap_api sys_hashmap_sc_api
 

Detailed Description

Separate Chaining Hashmap Implementation.

Note
Enable with
CONFIG_SYS_HASH_MAP_SC 

Macro Definition Documentation

◆ SYS_HASHMAP_SC_DEFINE

#define SYS_HASHMAP_SC_DEFINE ( _name)
Value:
static uint32_t sys_hash32(const void *str, size_t n)
System default 32-bit hash function.
Definition hash_function.h:119
#define SYS_HASHMAP_DEFAULT_LOAD_FACTOR
The default Hashmap load factor (in hundredths)
Definition hash_map.h:122
#define SYS_HASHMAP_CONFIG(_max_size, _load_factor)
Initializer for sys_hashmap_config.
Definition hash_map_api.h:214
#define SYS_HASHMAP_DEFAULT_ALLOCATOR
The default Hashmap allocator.
Definition hash_map.h:119
#define SYS_HASHMAP_SC_DEFINE_ADVANCED(_name, _hash_func, _alloc_func,...)
Declare a Separate Chaining Hashmap (advanced)
Definition hash_map_sc.h:43
#define SIZE_MAX
Definition stdint.h:70

Declare a Separate Chaining Hashmap.

Declare a Separate Chaining Hashmap with default parameters.

Parameters
_nameName of the Hashmap.

◆ SYS_HASHMAP_SC_DEFINE_ADVANCED

#define SYS_HASHMAP_SC_DEFINE_ADVANCED ( _name,
_hash_func,
_alloc_func,
... )
Value:
sys_hashmap_data, _hash_func, _alloc_func, __VA_ARGS__)
#define SYS_HASHMAP_DEFINE_ADVANCED(_name, _api, _config_type, _data_type, _hash_func, _alloc_func,...)
Declare a Hashmap (advanced)
Definition hash_map.h:47
const struct sys_hashmap_api sys_hashmap_sc_api
Generic Hashmap configuration.
Definition hash_map_api.h:197
Generic Hashmap data.
Definition hash_map_api.h:225

Declare a Separate Chaining Hashmap (advanced)

Declare a Separate Chaining Hashmap with control over advanced parameters.

Note
The allocator _alloc_func is used for allocating internal Hashmap entries and does not interact with any user-provided keys or values.
Parameters
_nameName of the Hashmap.
_hash_funcHash function pointer of type sys_hash_func32_t.
_alloc_funcAllocator function pointer of type sys_hashmap_allocator_t.
...Details for sys_hashmap_config.

◆ SYS_HASHMAP_SC_DEFINE_STATIC

#define SYS_HASHMAP_SC_DEFINE_STATIC ( _name)
Value:
#define SYS_HASHMAP_SC_DEFINE_STATIC_ADVANCED(_name, _hash_func, _alloc_func,...)
Declare a Separate Chaining Hashmap (advanced)
Definition hash_map_sc.h:60

Declare a Separate Chaining Hashmap statically.

Declare a Separate Chaining Hashmap statically with default parameters.

Parameters
_nameName of the Hashmap.

◆ SYS_HASHMAP_SC_DEFINE_STATIC_ADVANCED

#define SYS_HASHMAP_SC_DEFINE_STATIC_ADVANCED ( _name,
_hash_func,
_alloc_func,
... )
Value:
sys_hashmap_data, _hash_func, _alloc_func, __VA_ARGS__)
#define SYS_HASHMAP_DEFINE_STATIC_ADVANCED(_name, _api, _config_type, _data_type, _hash_func, _alloc_func,...)
Declare a Hashmap statically (advanced)
Definition hash_map.h:75

Declare a Separate Chaining Hashmap (advanced)

Declare a Separate Chaining Hashmap with control over advanced parameters.

Note
The allocator _alloc is used for allocating internal Hashmap entries and does not interact with any user-provided keys or values.
Parameters
_nameName of the Hashmap.
_hash_funcHash function pointer of type sys_hash_func32_t.
_alloc_funcAllocator function pointer of type sys_hashmap_allocator_t.
...Details for sys_hashmap_config.

Variable Documentation

◆ sys_hashmap_sc_api

const struct sys_hashmap_api sys_hashmap_sc_api
extern