13#if HX_USE_MACROS_WITH_MODULE
14#error Header does not provide macros alone.
26template<
typename key_t_>
38 m_hash_next_(
hxnull), m_key_(src_.m_key_), m_hash_(src_.m_hash_) { }
42 hxassertmsg(
this != &other_,
"self_assignment"); (void)other_;
53 const key_t_&
hash_key(
void)
const {
return m_key_; }
91template <hxsystem_allocator_t allocator_=hxsystem_allocator_heap>
hxhash_table_node_integer - node_t for use with hxhash_table for integer types.
Definition hxhash_table_nodes.hpp:27
hxhash_table_node_integer & operator=(const hxhash_table_node_integer &other_)
Assigns nothing. Hash table linkage of either node is not affected.
Definition hxhash_table_nodes.hpp:41
hxhash_t hash_value(void) const
Returns the cached hash value for the stored key.
Definition hxhash_table_nodes.hpp:55
static hxhash_t hash_value(key_t_ key_)
Returns the hash of a key without constructing a node.
Definition hxhash_table_nodes.hpp:58
hxhash_table_node_integer(const key_t_ &key_)
Constructs a node wrapping the key and caches its hash.
Definition hxhash_table_nodes.hpp:33
const key_t_ & hash_key(void) const
The key and hash identify the node_t and should not change once added.
Definition hxhash_table_nodes.hpp:53
key_t_ key_t
Definition hxhash_table_nodes.hpp:29
hxhash_table_node_integer(const hxhash_table_node_integer &src_)
Constructs an unlinked node with the same key.
Definition hxhash_table_nodes.hpp:37
void set_hash_next(hxhash_table_node_integer *next_)
Sets the next node in the table's embedded linked list.
Definition hxhash_table_nodes.hpp:50
hxhash_table_node_integer * hash_next(void) const
Returns the next node in the table's embedded linked list.
Definition hxhash_table_nodes.hpp:47
hxhash_table_node_string_literal * hash_next(void) const
Returns the next node in the table's embedded linked list.
Definition hxhash_table_nodes.hpp:81
hxhash_table_node_string_literal(const char *k_)
Constructor initializes the node with a string key and computes its hash.
Definition hxhash_table_nodes.hpp:77
hxhash_table_node_string - Subclass of hxhash_table_set_node for C strings.
Definition hxhash_table_nodes.hpp:92
hxhash_table_node_string * hash_next(void) const
Returns the next node in the table's embedded linked list.
Definition hxhash_table_nodes.hpp:104
hxhash_table_node_string(const char *k_)
Constructor allocates and duplicates the string key, then initializes the node.
Definition hxhash_table_nodes.hpp:97
~hxhash_table_node_string(void)
Destructor frees the allocated string key.
Definition hxhash_table_nodes.hpp:101
const const char *& hash_key(void) const
Definition hxhash_table.hpp:70
hxhash_table_set_node(ref_t_ &&key_)
Definition hxhash_table.hpp:55
hxhash_table_set_node * hash_next(void) const
Returns the next node in the table's embedded linked list.
Definition hxhash_table.hpp:63
A fixed-size hash table with embedded singly-linked list buckets.
hxhash_t hxkey_hash(T x_)
hxkey_hash(T) - Returns the xxhash32 of a numeric value cast to 32 bits.
Definition hxkey.hpp:165
void hxfree(void *ptr_) hxattr_noexcept hxattr_hot
hxfree - Frees memory previously allocated with hxmalloc or hxmalloc_ext.
char * hxstring_duplicate(const char *string_, hxsystem_allocator_t allocator_) hxattr_noexcept hxattr_allocator(hxfree) hxattr_nonnull(1) hxattr_hot
hxstring_duplicate - Allocates a copy of a string using the specified memory manager.
#define hxattr_nonnull(...)
hxattr_nonnull - Indicates that a function has args that should not be null.
Definition hxsettings.h:97
Provides core macros, memory management and feature detection.
#define hxassertmsg(x_,...)
hxassertmsg(bool x, ...) - Logs an error and terminates execution if x is false.
Definition libhatchet.h:101
#define hxnull
hxnull - The null pointer value for a given pointer type represented by the numeric constant 0.
Definition libhatchet.h:277
uint32_t hxhash_t
hxhash_t - Unsigned 32-bit hash value. Expect collisions.
Definition libhatchet.h:212