|
JH-Toolkit v1.4.1
An engineering-oriented C++20 toolkit with duck-typed concepts, static design, async coroutines, and semantic containers — header-only, RTTI-free, and concurrency-friendly.
|
User-facing aliases for jh::conc::flat_pool with deduced hashing.
More...
#include "jh/concurrent/flat_pool.h"Go to the source code of this file.
Typedefs | |
| template<typename Key, typename Value = jh::typed::monostate, typename Alloc = std::allocator<jh::conc::detail::value_t<Key, Value>>> | |
| using | jh::resource_pool = jh::conc::flat_pool<Key, Value, jh::hash<Key>, Alloc> |
Convenience alias of jh::conc::flat_pool with behaviorally deduced hashing. | |
| template<typename Key, typename Alloc = std::allocator<Key>> | |
| using | jh::resource_pool_set = jh::conc::flat_pool<Key, jh::typed::monostate, jh::hash<Key>, Alloc> |
Set-style specialization of jh::resource_pool. | |
User-facing aliases for jh::conc::flat_pool with deduced hashing.
jh::resource_pool provides a simplified, user-facing entry point to jh::conc::flat_pool by fixing the hash policy to jh::hash<Key> and exposing only the most commonly varied parameters: key, value, and allocator.
Unlike flat_pool, which allows arbitrary hash functor substitution, resource_pool assumes that jh::hash<Key> is a valid hashing strategy for the given key type. This removes the need for explicit hash specification while still preserving extensibility via allocator replacement.
The resource_pool_set variant further specializes this pattern by fixing the value type to jh::typed::monostate, providing a set-like abstraction over keys with pool-managed storage and concurrency semantics.
The pool manages object lifetimes directly and owns all stored elements. Logical identity is defined exclusively by the external key, independent of object address or construction history. Internally, elements are stored in contiguous memory and relocated as needed, enabling fragmentation-free storage and cache-efficient access under concurrent workloads.
These aliases do not introduce additional constraints, ownership semantics, or behavioral indirection. All concurrency control, lifetime management, and resizing behavior is defined exclusively by jh::conc::flat_pool.
As user-facing facilities under the jh namespace, they are available via:
<jh/pool> <jh/concurrency> 1.4.x
2025