Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
hash_map_cxx.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Meta
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
18#ifndef ZEPHYR_INCLUDE_SYS_HASH_MAP_CXX_H_
19#define ZEPHYR_INCLUDE_SYS_HASH_MAP_CXX_H_
20
21#include <stddef.h>
22
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
43#define SYS_HASHMAP_CXX_DEFINE_ADVANCED(_name, _hash_func, _alloc_func, ...) \
44 SYS_HASHMAP_DEFINE_ADVANCED(_name, &sys_hashmap_cxx_api, sys_hashmap_config, \
45 sys_hashmap_data, _hash_func, _alloc_func, __VA_ARGS__)
46
60#define SYS_HASHMAP_CXX_DEFINE_STATIC_ADVANCED(_name, _hash_func, _alloc_func, ...) \
61 SYS_HASHMAP_DEFINE_STATIC_ADVANCED(_name, &sys_hashmap_cxx_api, sys_hashmap_config, \
62 sys_hashmap_data, _hash_func, _alloc_func, __VA_ARGS__)
63
71#define SYS_HASHMAP_CXX_DEFINE_STATIC(_name) \
72 SYS_HASHMAP_CXX_DEFINE_STATIC_ADVANCED( \
73 _name, sys_hash32, SYS_HASHMAP_DEFAULT_ALLOCATOR, \
74 SYS_HASHMAP_CONFIG(SIZE_MAX, SYS_HASHMAP_DEFAULT_LOAD_FACTOR))
75
83#define SYS_HASHMAP_CXX_DEFINE(_name) \
84 SYS_HASHMAP_CXX_DEFINE_ADVANCED( \
85 _name, sys_hash32, SYS_HASHMAP_DEFAULT_ALLOCATOR, \
86 SYS_HASHMAP_CONFIG(SIZE_MAX, SYS_HASHMAP_DEFAULT_LOAD_FACTOR))
87
88#ifdef CONFIG_SYS_HASH_MAP_CHOICE_CXX
89#define SYS_HASHMAP_DEFAULT_DEFINE(_name) SYS_HASHMAP_CXX_DEFINE(_name)
90#define SYS_HASHMAP_DEFAULT_DEFINE_STATIC(_name) SYS_HASHMAP_CXX_DEFINE_STATIC(_name)
91#define SYS_HASHMAP_DEFAULT_DEFINE_ADVANCED(_name, _hash_func, _alloc_func, ...) \
92 SYS_HASHMAP_CXX_DEFINE_ADVANCED(_name, _hash_func, _alloc_func, __VA_ARGS__)
93#define SYS_HASHMAP_DEFAULT_DEFINE_STATIC_ADVANCED(_name, _hash_func, _alloc_func, ...) \
94 SYS_HASHMAP_CXX_DEFINE_STATIC_ADVANCED(_name, _hash_func, _alloc_func, __VA_ARGS__)
95#endif
96
97extern const struct sys_hashmap_api sys_hashmap_cxx_api;
98
99#ifdef __cplusplus
100}
101#endif
102
103#endif /* ZEPHYR_INCLUDE_SYS_HASH_MAP_CXX_H_ */
const struct sys_hashmap_api sys_hashmap_cxx_api
Generic Hashmap API.
Definition hash_map_api.h:168