Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
hashDry.H File Reference

Common operations for open addressing hash tables (CRTP mixin). More...

#include <limits>
#include <type_traits>
#include <utility>
#include <aleph.H>
#include <primes.H>
#include <tpl_dynArray.H>
#include <ah-errors.H>
#include <ah-iterator.H>
Include dependency graph for hashDry.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  OhashCommon< HashTbl, Key >
 CRTP mixin providing common operations for open addressing hash tables. More...
 
class  OhashCommon< HashTbl, Key >::Iterator
 Bidirectional iterator for traversing hash table entries. More...
 
struct  OhashCommon< HashTbl, Key >::Stats
 Statistics about hash table performance. More...
 
class  HashStats< HashTbl >
 CRTP mixin providing statistics and configuration for chained hash tables. More...
 
struct  HashStats< HashTbl >::Stats
 Statistics about chain length distribution. More...
 

Namespaces

namespace  hash_dry_detail
 

Functions

template<class Bucket >
size_t hash_dry_detail::checked_table_len (const size_t len)
 Checks that the bytes of a table of buckets fit in a size_t.
 
template<class Bucket >
size_t hash_dry_detail::prime_table_len (const size_t len)
 The length of a table for a request of len buckets: the next prime.
 
template<class Bucket >
void hash_dry_detail::free_bucket_not_taken (Bucket *bucket) noexcept
 Frees a bucket that a hash table of lists was given and did not take.
 
template<class Cmp >
void hash_dry_detail::swap_compare (Cmp &a, Cmp &b) noexcept
 Swaps the comparators of two hash tables.
 

Detailed Description

Common operations for open addressing hash tables (CRTP mixin).

This file provides the OhashCommon class template, which implements shared functionality for open addressing hash tables using the Curiously Recurring Template Pattern (CRTP). Both ODhashTable and OLhashTable inherit from this class.

The mixin provides:

  • Insert operations (insert, search_or_insert, contains_or_insert)
  • Search and removal operations
  • Automatic resizing based on load factor
  • Iterator support
  • Functional programming methods (through inheritance)
See also
ODhashTable
OLhashTable
Author
Leandro Rabindranath León

Definition in file hashDry.H.