Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
hash_map_cxx.h File Reference

C++ Hashmap. More...

#include <stddef.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_CXX_DEFINE_ADVANCED(_name, _hash_func, _alloc_func, ...)
 Declare a C++ Hashmap (advanced)
 
#define SYS_HASHMAP_CXX_DEFINE_STATIC_ADVANCED(_name, _hash_func, _alloc_func, ...)
 Declare a C++ Hashmap (advanced)
 
#define SYS_HASHMAP_CXX_DEFINE_STATIC(_name)
 Declare a C++ Hashmap statically.
 
#define SYS_HASHMAP_CXX_DEFINE(_name)
 Declare a C++ Hashmap.
 

Variables

const struct sys_hashmap_api sys_hashmap_cxx_api
 

Detailed Description

C++ Hashmap.

This is a C wrapper around std::unordered_map. It is mainly used for benchmarking purposes.

Note
Enable with
CONFIG_SYS_HASH_MAP_CXX 

Macro Definition Documentation

◆ SYS_HASHMAP_CXX_DEFINE

#define SYS_HASHMAP_CXX_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_CXX_DEFINE_ADVANCED(_name, _hash_func, _alloc_func,...)
Declare a C++ Hashmap (advanced)
Definition hash_map_cxx.h:43
#define SIZE_MAX
Definition stdint.h:70

Declare a C++ Hashmap.

Declare a C++ Hashmap with default parameters.

Parameters
_nameName of the Hashmap.

◆ SYS_HASHMAP_CXX_DEFINE_ADVANCED

#define SYS_HASHMAP_CXX_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_cxx_api
Generic Hashmap configuration.
Definition hash_map_api.h:197
Generic Hashmap data.
Definition hash_map_api.h:225

Declare a C++ Hashmap (advanced)

Declare a C++ 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.
...Variant-specific details for sys_hashmap_config.

◆ SYS_HASHMAP_CXX_DEFINE_STATIC

#define SYS_HASHMAP_CXX_DEFINE_STATIC ( _name)
Value:
#define SYS_HASHMAP_CXX_DEFINE_STATIC_ADVANCED(_name, _hash_func, _alloc_func,...)
Declare a C++ Hashmap (advanced)
Definition hash_map_cxx.h:60

Declare a C++ Hashmap statically.

Declare a C++ Hashmap statically with default parameters.

Parameters
_nameName of the Hashmap.

◆ SYS_HASHMAP_CXX_DEFINE_STATIC_ADVANCED

#define SYS_HASHMAP_CXX_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 C++ Hashmap (advanced)

Declare a C++ 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_cxx_api

const struct sys_hashmap_api sys_hashmap_cxx_api
extern