Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::DynMapHashTable< Key, Data, HashTable, Cmp > Class Template Reference

#include <tpl_dynSetHash.H>

Inheritance diagram for Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >:
[legend]
Collaboration diagram for Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >:
[legend]

Public Types

using Hash_Fct = std::function< size_t(const Key &)>
 
using Hash_Fct_Ptr = size_t(*)(const Key &)
 
using Value_Type = Data
 
using Iterator = typename Base::Iterator
 
- Public Types inherited from Aleph::DynHashTable< Key, HashTable, Cmp >
using Hash_Fct = typename Base::Hash_Fct
 Hash function type.
 
using Hash_Fct_Ptr = typename Base::Hash_Fct_Ptr
 
using Key_Type = Key
 
using Item_Type = Key
 
using Const_Iterator = Aleph::Const_Iterator< Iterator >
 Read-only iterator: the iterator of a constant table.
 
- Public Types inherited from StlAlephIterator< SetName >
using iterator = StlIterator< SetName >
 
using const_iterator = StlConstIterator< SetName >
 

Public Member Functions

 DynMapHashTable (size_t len=Primes::DefaultPrime, Hash_Fct_Ptr hash_fct=dft_hash_ptr_fct< Key >, Cmp cmp=Cmp(), float lower_alpha=hash_default_lower_alpha, float upper_alpha=hash_default_upper_alpha)
 
 DynMapHashTable (const DynMapHashTable &)=default
 Copy constructor: the same pairs and the same configuration.
 
 DynMapHashTable (DynMapHashTable &&) noexcept=default
 Move constructor: takes the pairs of the other map, which is left empty and keeps its configuration.
 
DynMapHashTable & operator= (const DynMapHashTable &)=default
 Copy assignment: the same pairs and the same configuration.
 
DynMapHashTable & operator= (DynMapHashTable &&other) noexcept
 Move assignment.
 
void swap (DynMapHashTable &other) noexcept
 Swaps this map with other in constant time.
 
void set_hash_fct (Hash_Fct_Ptr fct)
 Sets the hash function of the keys.
 
void set_hash_fct (typename Base::Hash_Fct fct)
 Sets a hash function of the pairs, as the table takes it.
 
void set_hash_fct (typename Base::Hash_Fct_Ptr fct)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
Pair * insert (const Key &key, const Data &data)
 Inserts into the hash map the pair (key, record) indexed by key.
 
Pair * insert (const Key &key, Data &&data)
 
Pair * insert (Key &&key, Data &&data)
 
Pair * insert (Key &&key, const Data &data)
 
Pair * search (const Key &key) noexcept(nothrow_search< const Key & >)
 Searches for the pair whose key is key.
 
const Pair * search (const Key &key) const noexcept(nothrow_search< const Key & >)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
Pair * search (Key &&key) noexcept(nothrow_search< Key >)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The pair that it builds after set_hash_fct() took a function of pairs moves key.
 
const Pair * search (Key &&key) const noexcept(nothrow_search< Key >)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool has (const Key &key) const noexcept(nothrow_search< const Key & >)
 Checks if a key exists in the map.
 
bool has (Key &&key) const noexcept(nothrow_search< Key >)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool contains (const Key &key) const noexcept(nothrow_search< const Key & >)
 Checks if a key exists in the map; an alias for has().
 
bool contains (Key &&key) const noexcept(nothrow_search< Key >)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
Data & find (const Key &key)
 Finds and returns a reference to the value associated with key.
 
const Data & find (const Key &key) const
 
Data & operator[] (const Key &key)
 Subscript operator for map access/insertion.
 
const Data & operator[] (const Key &key) const
 
Data & operator[] (Key &&key)
 
const Data & operator[] (Key &&key) const
 
void remove_by_data (Data &data)
 Removes from the table the key whose pointer must be the result of a prior insertion or search.
 
Data remove (const Key &key)
 Removes a key-value pair from the map and returns the value.
 
Data remove (Key &&key)
 
DynList< Key > keys () const
 
DynList< Data > values () const
 Returns the values of the map.
 
DynList< Data * > values_ptr ()
 
DynList< Pair * > items_ptr ()
 
Key * insert (const Key &key)
 Inserts key into the hash set.
 
Key * insert (Key &&key)
 
- Public Member Functions inherited from Aleph::DynHashTable< Key, HashTable, Cmp >
 DynHashTable (size_t len=Primes::DefaultPrime, Hash_Fct_Ptr hash_fct=Aleph::dft_hash_ptr_fct< Key >, Cmp cmp=Cmp(), float lower_alpha=hash_default_lower_alpha, float upper_alpha=hash_default_upper_alpha)
 Creates a dynamic linear hash table.
 
 DynHashTable (size_t len, Hash_Fct hash_fct, Cmp cmp, float lower_alpha, float upper_alpha)
 
 DynHashTable (const DynHashTable &other)
 Copy constructor.
 
 DynHashTable (DynHashTable &&other) noexcept
 Move constructor over a table that a move of its own takes, as the one of chained lists (DynSetLhash): takes the lists and the keys of other.
 
 DynHashTable (DynHashTable &&other) noexcept
 Move constructor over a table that no move of its own takes, as the linear one (DynSetLinHash): builds an empty table of the capacity of other and swaps them.
 
template<template< typename > class List>
 DynHashTable (const List< Key > &l)
 
template<class It >
requires (not std::is_arithmetic_v<It> and requires (It it) { *it; ++it; it != it; })
 DynHashTable (It b, It e)
 
 DynHashTable (std::initializer_list< Key > l)
 
 ~DynHashTable ()
 
void clear ()
 Empties the container.
 
bool contains (const Key &key) const noexcept
 Return true if the key exists in the table.
 
bool is_empty () const noexcept
 Checks if the container is empty.
 
DynHashTable & operator= (const DynHashTable &other)
 Copy assignment.
 
DynHashTable & operator= (DynHashTable &&other) noexcept
 
Key * insert (const Key &key)
 Inserts key into the hash set.
 
Key * insert (Key &&key)
 
Key * search_or_insert (const Key &key)
 
Key * search_or_insert (Key &&key)
 
std::pair< Key *, bool > contains_or_insert (const Key &key)
 
std::pair< Key *, bool > contains_or_insert (Key &&key)
 
Key * add (const Key &key)
 
Key * add (Key &&key)
 
Key * append (const Key &key)
 
Key * append (Key &&key)
 
Key * search (const Key &key) noexcept
 Searches for a key in the hash table.
 
const Key * search (const Key &key) const noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. A pointer to const.
 
bool has (const Key &key) const noexcept
 Checks if a key exists in the hash table.
 
const Key & find (const Key &key) const
 
Key & find (const Key &key)
 
void remove (Key *key)
 Removes a key from the hash table using its pointer.
 
Key remove (const Key &key)
 
const Key & get_first () const
 
Key & get_first ()
 
const Key & get_last () const
 
Key & get_last ()
 
- Public Member Functions inherited from GenericTraverse< Container >
template<class Operation >
requires Aleph::PredicateWith<Operation &, typename Aleph::concepts_detail::traverse_arg<Container, Operation>::type>
bool traverse (Operation &operation) noexcept(traverse_is_noexcept< Operation, typename Aleph::concepts_detail::traverse_arg< Container, Operation >::type, Container & >())
 Traverse the container via its iterator and performs a conditioned operation on each item.
 
template<class Operation >
requires Aleph::PredicateWith<Operation &, typename Aleph::concepts_detail::traverse_carg<Container, Operation>::type>
bool traverse (Operation &operation) const noexcept(traverse_is_noexcept< Operation, typename Aleph::concepts_detail::traverse_carg< Container, Operation >::type, const_source_t< Operation > >())
 Traverse a constant container; each item is handed out as a constant reference.
 
template<class Operation >
requires Aleph::PredicateWith<Operation &, typename Aleph::concepts_detail::traverse_carg<Container, Operation>::type>
bool traverse (Operation &&operation) const noexcept(traverse_is_noexcept< Operation, typename Aleph::concepts_detail::traverse_carg< Container, Operation >::type, const_source_t< Operation > >())
 Overload of traverse(Operation &) const that accepts rvalues.
 
template<class Operation >
requires Aleph::PredicateWith<Operation &, typename Aleph::concepts_detail::traverse_arg<Container, Operation>::type>
bool traverse (Operation &&operation) noexcept(traverse_is_noexcept< Operation, typename Aleph::concepts_detail::traverse_arg< Container, Operation >::type, Container & >())
 Overload of traverse(Operation &) that accepts rvalues.
 
- Public Member Functions inherited from LocateFunctions< Container, Type >
auto get_it ()
 Return a properly initialized iterator positioned at the first item on the container.
 
auto get_it () const
 Read-only iterator positioned at the first item.
 
auto get_it (const size_t pos)
 Return a properly initialized iterator positioned at the pos item on the container.
 
auto get_it (const size_t pos) const
 Read-only iterator positioned at the pos item.
 
auto get_itor ()
 Alias of get_it().
 
auto get_itor () const
 See get_itor().
 
template<class C = Container>
requires Aleph::dry_detail::MutablyTraversable<C, Type>
Type & nth_ne (const size_t n) noexcept(Aleph::dry_detail::mutable_traversal_is_noexcept< C, Type >)
 Return the n‑th element without bounds checking.
 
const Type & nth_ne (const size_t n) const noexcept(Aleph::dry_detail::const_traversal_is_noexcept< Container, Type >)
 Constant overload of nth_ne(size_t).
 
template<class C = Container>
requires Aleph::dry_detail::MutablyTraversable<C, Type>
Type & nth (const size_t n)
 Return the n-th item of the container.
 
const Type & nth (const size_t n) const
 Const overload of nth(size_t).
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, Type &>
and Aleph::dry_detail::MutablyTraversable< typename Aleph::concepts_detail::defer< Container, Operation >::type, Type > Type * find_ptr (Operation &operation) noexcept(mutable_search_is_noexcept< Operation >())
 Find a pointer to an item in the container according to a searching criterion.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const Type &>
const Type * find_ptr (Operation &operation) const noexcept(const_search_is_noexcept< Operation >())
 Const overload of find_ptr(Operation&).
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const Type &>
const Type * find_ptr (Operation &&operation) const noexcept(const_search_is_noexcept< Operation >())
 Overload of find_ptr() const that accepts rvalues.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, Type &>
and Aleph::dry_detail::MutablyTraversable< typename Aleph::concepts_detail::defer< Container, Operation >::type, Type > Type * find_ptr (Operation &&operation) noexcept(mutable_search_is_noexcept< Operation >())
 Overload of find_ptr() that accepts rvalues.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const Type &>
size_t find_index (Operation &operation) const noexcept(const_search_is_noexcept< Operation >())
 Find the position of an item in the container according to a searching criterion.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const Type &>
size_t find_index (Operation &&operation) const noexcept(const_search_is_noexcept< Operation >())
 Overload of find_index() that accepts rvalues.
 
template<class Operation , class T = Type>
requires Aleph::InvocablePredicateWith<Operation &, const Type &>
and std::default_initializable< T > and std::copy_constructible< T > std::tuple< bool, Type > find_item (Operation &operation) const noexcept(find_item_is_noexcept< Operation >())
 Safe sequential searching of an item matching a criterion.
 
template<class Operation , class T = Type>
requires Aleph::InvocablePredicateWith<Operation &, const Type &>
and std::default_initializable< T > and std::copy_constructible< T > std::tuple< bool, Type > find_item (Operation &&operation) const noexcept(find_item_is_noexcept< Operation >())
 Overload of find_item() that accepts rvalues.
 
template<class Operation , class T = Type>
requires Aleph::InvocablePredicateWith<Operation &, const Type &>
and std::copy_constructible< T > std::optional< Type > find_opt (Operation &operation) const
 Copy of the first item satisfying a criterion, if any.
 
template<class Operation , class T = Type>
requires Aleph::InvocablePredicateWith<Operation &, const Type &>
and std::copy_constructible< T > std::optional< Type > find_opt (Operation &&operation) const
 Overload of find_opt() that accepts rvalues.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const Type &>
bool contains_if (Operation &&operation) const noexcept(const_search_is_noexcept< Operation >())
 Test if an item satisfying a criterion is present in the container.
 
template<class T = Type>
requires requires(const T & a, const T & b) { { a == b } -> std::convertible_to<bool>; }
bool contains (const Type &item) const
 Test if an item is present in the container using equality.
 
- Public Member Functions inherited from FunctionalMethods< Container, T >
void emplace (Args &&... args)
 Appends a new element into the container by constructing it from the given args.
 
void emplace_end (Args &&... args)
 See emplace(Args && ... args).
 
void emplace_ins (Args &&... args)
 
template<typename... Args>
requires ((std::convertible_to<Args &&, T> and ...) and (Aleph::InsertableWith<typename Aleph::concepts_detail::defer<Container, std::tuple<Args...>>::type, Item_Arg<Args>> and ...))
size_t ninsert (Args &&... args)
 Insert n variadic items.
 
template<typename... Args>
requires ((std::convertible_to<Args &&, T> and ...) and (Aleph::AppendableWith<typename Aleph::concepts_detail::defer<Container, std::tuple<Args...>>::type, Item_Arg<Args>> and ...))
size_t nappend (Args &&... args)
 Append n variadic items.
 
template<class Operation >
requires Aleph::InvocableWith<Operation &, const T &>
void for_each (Operation &operation) const
 Traverse all the container and performs an operation on each element.
 
template<class Operation >
requires Aleph::InvocableWith<Operation &, const T &>
void for_each (Operation &&operation) const
 Overload of for_each() that accepts rvalues.
 
template<class Operation >
requires Aleph::InvocableWith<Operation &, const T &>
void each (Operation &operation) const
 Alias of for_each().
 
template<class Operation >
requires Aleph::InvocableWith<Operation &, const T &>
void each (Operation &&operation) const
 Alias of for_each() that accepts rvalues.
 
template<class Operation >
requires Aleph::InvocableWith<Operation &, const T &>
void each (const size_t pos, const size_t slice, Operation &operation) const
 Traverse the container starting at pos taking one item every slice, performing an operation on each visited element.
 
template<class Operation >
requires Aleph::InvocableWith<Operation &, const T &>
void each (const size_t pos, const size_t slice, Operation &&operation) const
 See each(size_t pos, size_t slice, Operation & operation) const.
 
template<class Operation >
requires Aleph::InvocableWith<Operation &, T &>
and Aleph::dry_detail::MutablyTraversable< typename Aleph::concepts_detail::defer< Container, Operation >::type, T > void each (const size_t pos, const size_t slice, Operation &operation)
 Traverse the container starting at pos taking one item every slice, performing an operation that may modify each visited item.
 
template<class Operation >
requires Aleph::InvocableWith<Operation &, T &>
and Aleph::dry_detail::MutablyTraversable< typename Aleph::concepts_detail::defer< Container, Operation >::type, T > void each (const size_t pos, const size_t slice, Operation &&operation)
 See each(size_t pos, size_t slice, Operation & operation).
 
template<class Operation >
requires Aleph::InvocableWith<Operation &, T &>
and Aleph::dry_detail::MutablyTraversable< typename Aleph::concepts_detail::defer< Container, Operation >::type, T > void mutable_for_each (Operation &operation)
 Apply a mutable operation to each element of the container.
 
template<class Operation >
requires Aleph::InvocableWith<Operation &, T &>
and Aleph::dry_detail::MutablyTraversable< typename Aleph::concepts_detail::defer< Container, Operation >::type, T > void mutable_for_each (Operation &&operation)
 See mutable_for_each(Operation & operation).
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const T &>
bool all (Operation &operation) const
 Check if all the elements of the container satisfy a condition.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const T &>
bool all (Operation &&operation) const
 Overload of all() that accepts rvalues.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const T &>
bool exists (Operation &op) const
 Test for existence in the container of an element satisfying a criterion.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const T &>
bool exists (Operation &&op) const
 Overload of exists() that accepts rvalues.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const T &>
bool none (Operation &op) const
 Test that no element satisfies a criterion.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const T &>
bool none (Operation &&op) const
 Overload of none() that accepts rvalues.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const T &>
size_t count_if (Operation &op) const
 Count the elements that satisfy a criterion.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const T &>
size_t count_if (Operation &&op) const
 Overload of count_if() that accepts rvalues.
 
Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, T > > maps (Operation &op) const
 
Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, T > > maps (Operation &&op) const
 
Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, T > > maps_if (Prop prop, Operation &op) const
 
Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, T > > maps_if (Prop prop, Operation &&op) const
 
Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, T > > map (Operation &op) const
 
Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, T > > map (Operation &&op) const
 
Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, T > > map_if (Prop prop, Operation &op) const
 
Aleph::DynList< Aleph::dry_detail::map_result_t< R, Operation &, T > > map_if (Prop prop, Operation &&op) const
 
template<class Operation >
requires Aleph::InvocableWith<Operation &, const T &>
auto flat_map (Operation &op) const
 Map each element to a container and concatenate the results.
 
template<class Operation >
requires Aleph::InvocableWith<Operation &, const T &>
auto flat_map (Operation &&op) const
 Overload of flat_map() that accepts rvalues.
 
Aleph::DynList< T > to_dynlist () const
 Convert container to DynList.
 
std::vector< T > to_vector () const
 Convert container to std::vector.
 
template<typename Acc = T, class Op >
requires Aleph::dry_detail::FoldOperation<Op, Acc, T>
Acc foldl (const Acc &init, Op &op) const
 Fold the elements of the container to a specific result.
 
template<typename Acc = T, class Op >
requires Aleph::dry_detail::FoldOperation<Op, Acc, T>
Acc foldl (const Acc &init, Op &&op) const
 Overload of foldl() that accepts rvalues.
 
template<typename Acc = T, class Op >
requires Aleph::dry_detail::FoldOperation<Op, Acc, T>
Acc fold_left (const Acc &init, Op &op) const
 Alias for foldl().
 
template<typename Acc = T, class Op >
requires Aleph::dry_detail::FoldOperation<Op, Acc, T>
Acc fold_left (const Acc &init, Op &&op) const
 Overload of fold_left() that accepts rvalues.
 
template<class Operation >
requires Aleph::dry_detail::FoldOperation<Operation, T, T>
T fold (const T &init, Operation &operation) const
 Simplified version of foldl() where the folded type is the same type of elements stored in the container.
 
template<class Operation >
requires Aleph::dry_detail::FoldOperation<Operation, T, T>
T fold (const T &init, Operation &&operation) const
 Overload of fold() that accepts rvalues.
 
template<typename Acc = T, class Op >
requires Aleph::dry_detail::FoldRightOperation<Op, Acc, T>
Acc foldr (const Acc &init, Op &op) const
 Fold the elements from the last to the first.
 
template<typename Acc = T, class Op >
requires Aleph::dry_detail::FoldRightOperation<Op, Acc, T>
Acc foldr (const Acc &init, Op &&op) const
 Overload of foldr() that accepts rvalues.
 
template<class Op , class U = T>
requires Aleph::dry_detail::FoldOperation<Op, T, T>
and std::copy_constructible< U > std::optional< T > reduce (Op &op) const
 Fold the elements with no initial value.
 
template<class Op , class U = T>
requires Aleph::dry_detail::FoldOperation<Op, T, T>
and std::copy_constructible< U > std::optional< T > reduce (Op &&op) const
 Overload of reduce() that accepts rvalues.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const T &>
Aleph::DynList< T > filter (Operation &operation) const
 Filter the elements of a container according to a matching criterion.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const T &>
Aleph::DynList< T > filter (Operation &&operation) const
 Overload of filter() that accepts rvalues.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const T &>
Aleph::DynList< const T * > ptr_filter (Operation &operation) const
 Filter the elements of a container according to a matching criterion and return a pointer to the matched items in the container.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const T &>
Aleph::DynList< const T * > ptr_filter (Operation &&operation) const
 Overload of ptr_filter() that accepts rvalues.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const T &>
Aleph::DynList< std::tuple< T, size_t > > pfilter (Operation &operation) const
 Filter the elements of a container according to a matching criterion and determine its positions respect to the traversal of container.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const T &>
Aleph::DynList< std::tuple< T, size_t > > pfilter (Operation &&operation) const
 Overload of pfilter() that accepts rvalues.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const T &>
std::pair< Aleph::DynList< T >, Aleph::DynList< T > > partition (Operation &op) const
 Exclusive partition of container according to a filter criterion.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const T &>
std::pair< Aleph::DynList< T >, Aleph::DynList< T > > partition (Operation &&op) const
 Overload of partition() that accepts rvalues.
 
std::pair< Aleph::DynList< T >, Aleph::DynList< T > > partition (size_t n) const
 Exclusive partition of container in the nth item.
 
std::pair< Aleph::DynList< T >, Aleph::DynList< T > > split_half () const
 Split the container into two halves by alternating elements.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const T &>
std::tuple< Aleph::DynList< T >, Aleph::DynList< T > > tpartition (Operation &op) const
 Exclusive partition of container according to a filter criterion.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const T &>
std::tuple< Aleph::DynList< T >, Aleph::DynList< T > > tpartition (Operation &&op) const
 Overload of tpartition() that accepts rvalues.
 
size_t length () const noexcept(Aleph::dry_detail::const_traversal_is_noexcept< Container, T >)
 Count the number of elements of a container.
 
Aleph::DynList< T > rev () const
 Return a list with the elements of container in reverse order respect to its traversal order.
 
Aleph::DynList< T > take (const size_t n) const
 Return a list with the first n elements seen in the container during its traversal.
 
Aleph::DynList< T > take (size_t i, const size_t j, const size_t step=1) const
 Return a list with the elements at positions i, i + step, i + 2 step, ... that are not greater than j, respect to the traversal order.
 
Aleph::DynList< T > drop (const size_t n) const
 Drop the first n elements seen in the container during its traversal.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const T &>
Aleph::DynList< T > take_while (Operation &op) const
 The longest prefix of elements that satisfy a criterion.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const T &>
Aleph::DynList< T > take_while (Operation &&op) const
 Overload of take_while() that accepts rvalues.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const T &>
Aleph::DynList< T > drop_while (Operation &op) const
 The elements after the longest prefix that satisfies a criterion.
 
template<class Operation >
requires Aleph::InvocablePredicateWith<Operation &, const T &>
Aleph::DynList< T > drop_while (Operation &&op) const
 Overload of drop_while() that accepts rvalues.
 
template<class C = Container>
requires requires (C & c) { c.remove(); }
void mutable_drop (const size_t n)
 Drop the first n elements seen from container.
 
- Public Member Functions inherited from GenericItems< Container, T >
Aleph::DynList< T > items () const
 Return a list of all the elements of a container sorted by traversal order.
 
Aleph::DynList< T > keys () const
 See items().
 
- Public Member Functions inherited from EqualToMethod< Container >
template<class C = Container>
requires Aleph::dry_detail::SetSearchable<C>
bool equal_to (const Container &r) const
 Test if elements of this are exactly contained in another container.
 
- Public Member Functions inherited from StlAlephIterator< SetName >
iterator begin () noexcept
 Return an STL-compatible iterator to the first element.
 
iterator end () noexcept
 Return an STL-compatible end iterator.
 
const_iterator begin () const noexcept
 Return a const iterator to the first element.
 
const_iterator end () const noexcept
 Return a const end iterator.
 
const_iterator cbegin () const noexcept
 Return a const iterator to the first element.
 
const_iterator cend () const noexcept
 Return a const end iterator.
 

Static Public Member Functions

static Data & get_data (const Key &key)
 
static const Key & get_key (Data *data_ptr)
 
template<typename... Items>
requires requires (Items &&... items) { DynMapHashTable ::template build_as< DynMapHashTable >(std::forward<Items>(items)...); }
static DynMapHashTable build (Items &&... items)
 
- Static Public Member Functions inherited from FunctionalMethods< Container, T >
template<typename... Items>
requires ((std::convertible_to<Items &&, T> and ...) and (Aleph::AppendableWith<typename Aleph::concepts_detail::defer<Container, std::tuple<Items...>>::type, Item_Arg<Items>> and ...))
static Container build (Items &&... items)
 Build a container that holds the given items.
 
template<class D , typename... Items>
requires (std::derived_from<D, typename Aleph::concepts_detail::defer<Container, D>::type> and std::default_initializable<D> and (std::convertible_to<Items &&, T> and ...) and (Aleph::AppendableWith<typename Aleph::concepts_detail::defer<Container, std::tuple<D, Items...>>::type, Item_Arg<Items>> and ...))
static D build_as (Items &&... items)
 Build a D, a class derived from the container, holding the given items.
 

Private Types

using Pair = std::pair< Key, Data >
 
using Base = DynHashTable< std::pair< Key, Data >, HashTable, Dft_Pair_Cmp< Key, Data, Cmp > >
 
using Bucket = typename Base::Bucket
 

Private Member Functions

template<typename K >
const Pair * search_by_pair (K &&key) const noexcept(nothrow_search< K >)
 

Static Private Member Functions

static size_t no_key_hash (const Key &) noexcept
 
static constexpr bool has_search_with_custom_hash () noexcept
 

Private Attributes

Hash_Fct_Ptr original_hash_fct
 

Static Private Attributes

template<typename K >
static constexpr bool nothrow_search
 

Additional Inherited Members

- Public Attributes inherited from FunctionalMethods< Container, T >
template<typename... Args>
requires (typename Aleph::concepts_detail::defer<Container, std::tuple<Args...>>::type & c, T && x)
 and { c.append(std::move(x))
 Insert a new element into the container by constructing it from the given args.
 
template<typename R = void, class Prop , class Operation >
requires (Aleph::DynList<Aleph::dry_detail::map_result_t<R, Operation &, T>> & l, Operation & op, const T & item)
and Aleph::InvocableWith< Operation &, const T & > and { l.append(std::invoke(op, item))
 Conditional mapping of the elements of the container.
 
- Protected Types inherited from Aleph::DynHashTable< Key, HashTable, Cmp >
using Base = HashTable< Key, Cmp >
 
using Bucket = typename HashTable< Key, Cmp >::Bucket
 
- Protected Member Functions inherited from Aleph::DynHashTable< Key, HashTable, Cmp >
Key * insert_bucket (Bucket *bucket)
 
std::pair< Key *, bool > search_or_insert_bucket (Bucket *bucket)
 
- Static Protected Member Functions inherited from Aleph::DynHashTable< Key, HashTable, Cmp >
static Bucket * key_to_bucket (Key *key)
 

Detailed Description

template<typename Key, typename Data, template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
requires EqualityComparator<Cmp, Key>
class Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >

Definition at line 576 of file tpl_dynSetHash.H.

Member Typedef Documentation

◆ Base

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
using Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::Base = DynHashTable<std::pair<Key, Data>, HashTable, Dft_Pair_Cmp<Key, Data, Cmp> >
private

Definition at line 582 of file tpl_dynSetHash.H.

◆ Bucket

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
using Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::Bucket = typename Base::Bucket
private

Definition at line 585 of file tpl_dynSetHash.H.

◆ Hash_Fct

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
using Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::Hash_Fct = std::function<size_t(const Key &)>

Definition at line 588 of file tpl_dynSetHash.H.

◆ Hash_Fct_Ptr

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
using Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::Hash_Fct_Ptr = size_t (*)(const Key &)

Definition at line 589 of file tpl_dynSetHash.H.

◆ Iterator

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
using Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::Iterator = typename Base::Iterator

Definition at line 652 of file tpl_dynSetHash.H.

◆ Pair

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
using Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::Pair = std::pair<Key, Data>
private

Definition at line 580 of file tpl_dynSetHash.H.

◆ Value_Type

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
using Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::Value_Type = Data

Definition at line 646 of file tpl_dynSetHash.H.

Constructor & Destructor Documentation

◆ DynMapHashTable() [1/3]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::DynMapHashTable ( size_t  len = Primes::DefaultPrime,
Hash_Fct_Ptr  hash_fct = dft_hash_ptr_fct<Key>,
Cmp  cmp = Cmp(),
float  lower_alpha = hash_default_lower_alpha,
float  upper_alpha = hash_default_upper_alpha 
)
inline

Definition at line 654 of file tpl_dynSetHash.H.

◆ DynMapHashTable() [2/3]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::DynMapHashTable ( const DynMapHashTable< Key, Data, HashTable, Cmp > &  )
default

Copy constructor: the same pairs and the same configuration.

◆ DynMapHashTable() [3/3]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::DynMapHashTable ( DynMapHashTable< Key, Data, HashTable, Cmp > &&  )
defaultnoexcept

Move constructor: takes the pairs of the other map, which is left empty and keeps its configuration.

Member Function Documentation

◆ build()

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
template<typename... Items>
requires requires (Items &&... items) { DynMapHashTable ::template build_as< DynMapHashTable >(std::forward<Items>(items)...); }
static DynMapHashTable Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::build ( Items &&...  items)
inlinestatic

Definition at line 651 of file tpl_dynSetHash.H.

Referenced by TEST(), and TEST().

◆ contains() [1/2]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
bool Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::contains ( const Key &  key) const
inlinenoexcept

Checks if a key exists in the map; an alias for has().

Parameters
[in]keyThe key to search for.
Returns
true if a pair has the key key, false otherwise.
Exceptions
Whatsearch() throws.

Definition at line 914 of file tpl_dynSetHash.H.

References Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::has().

Referenced by Aleph::ConcurrentHashMap< Key, T, Cmp, Shards >::contains(), TEST(), TEST(), and TEST().

◆ contains() [2/2]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
bool Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::contains ( Key &&  key) const
inlinenoexcept

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 920 of file tpl_dynSetHash.H.

References Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::has().

◆ find() [1/2]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
Data & Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::find ( const Key &  key)
inline

Finds and returns a reference to the value associated with key.

Parameters
[in]keythe key to search for
Returns
reference to the value associated with the key
Exceptions
std::domain_errorif the key is not found
Note
This method does NOT require Data to have a default constructor.

Definition at line 933 of file tpl_dynSetHash.H.

References ah_domain_error_if, and Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::search().

Referenced by brute_path_distinct(), brute_subtree_distinct(), Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::operator[](), Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::operator[](), TEST(), TEST(), TEST(), TEST(), and TEST().

◆ find() [2/2]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
const Data & Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::find ( const Key &  key) const
inline

◆ get_data()

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
static Data & Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::get_data ( const Key &  key)
inlinestatic

Definition at line 636 of file tpl_dynSetHash.H.

◆ get_key()

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
static const Key & Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::get_key ( Data *  data_ptr)
inlinestatic

Definition at line 641 of file tpl_dynSetHash.H.

◆ has() [1/2]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
bool Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::has ( const Key &  key) const
inlinenoexcept

Checks if a key exists in the map.

Parameters
[in]keyThe key to search for.
Returns
true if a pair has the key key, false otherwise.
Exceptions
Whatsearch() throws.

Definition at line 897 of file tpl_dynSetHash.H.

References Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::search().

Referenced by Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::contains(), and Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::contains().

◆ has() [2/2]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
bool Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::has ( Key &&  key) const
inlinenoexcept

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 903 of file tpl_dynSetHash.H.

References Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::search().

◆ has_search_with_custom_hash()

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
static constexpr bool Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::has_search_with_custom_hash ( )
inlinestaticconstexprprivatenoexcept

◆ insert() [1/6]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
Key * Aleph::DynHashTable< Key, HashTable, Cmp >::insert ( const Key &  key)
inline

Inserts key into the hash set.

Returns a pointer to the stored key if it was inserted, or nullptr if the key was not inserted.

Definition at line 329 of file tpl_dynSetHash.H.

◆ insert() [2/6]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
Pair * Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::insert ( const Key &  key,
const Data &  data 
)
inline

◆ insert() [3/6]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
Pair * Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::insert ( const Key &  key,
Data &&  data 
)
inline

◆ insert() [4/6]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
Key * Aleph::DynHashTable< Key, HashTable, Cmp >::insert ( Key &&  key)
inline

Definition at line 334 of file tpl_dynSetHash.H.

◆ insert() [5/6]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
Pair * Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::insert ( Key &&  key,
const Data &  data 
)
inline

◆ insert() [6/6]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
Pair * Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::insert ( Key &&  key,
Data &&  data 
)
inline

◆ items_ptr()

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
DynList< Pair * > Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::items_ptr ( )
inline

Definition at line 1033 of file tpl_dynSetHash.H.

References Aleph::DynList< T >::append().

Referenced by TEST().

◆ keys()

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
DynList< Key > Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::keys ( ) const
inline

Definition at line 1009 of file tpl_dynSetHash.H.

Referenced by TEST().

◆ no_key_hash()

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
static size_t Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::no_key_hash ( const Key &  )
inlinestaticprivatenoexcept

◆ operator=() [1/2]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
DynMapHashTable & Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::operator= ( const DynMapHashTable< Key, Data, HashTable, Cmp > &  )
default

Copy assignment: the same pairs and the same configuration.

◆ operator=() [2/2]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
DynMapHashTable & Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::operator= ( DynMapHashTable< Key, Data, HashTable, Cmp > &&  other)
inlinenoexcept

Move assignment.

Takes the pairs and the configuration of other.

Parameters
[in,out]otherMap to take the pairs from. It is left empty and with the configuration that this map had.
Returns
A reference to this map.

Definition at line 681 of file tpl_dynSetHash.H.

References Aleph::DynHashTable< Key, HashTable, Cmp >::operator=(), and Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::original_hash_fct.

◆ operator[]() [1/4]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
Data & Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::operator[] ( const Key &  key)
inline

Subscript operator for map access/insertion.

Note
This method REQUIRES Data to have a default constructor because it needs to insert a new element if the key doesn't exist. If Data is not default-constructible, use find() or search() instead.

Definition at line 953 of file tpl_dynSetHash.H.

References Aleph::DynHashTable< Key, HashTable, Cmp >::search_or_insert().

◆ operator[]() [2/4]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
const Data & Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::operator[] ( const Key &  key) const
inline

◆ operator[]() [3/4]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
Data & Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::operator[] ( Key &&  key)
inline

◆ operator[]() [4/4]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
const Data & Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::operator[] ( Key &&  key) const
inline

◆ remove() [1/2]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
Data Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::remove ( const Key &  key)
inline

Removes a key-value pair from the map and returns the value.

Parameters
[in]keythe key to remove
Returns
the value associated with the removed key
Exceptions
std::domain_errorif the key is not found
Note
Uses move semantics to return the value efficiently. If Data's move constructor is noexcept, this method provides strong exception safety.
This method does NOT require Data to have a default constructor. It uses heterogeneous search to find the key.

Definition at line 992 of file tpl_dynSetHash.H.

References ah_domain_error_if, Aleph::DynHashTable< Key, HashTable, Cmp >::key_to_bucket(), Aleph::DynHashTable< Key, HashTable, Cmp >::remove(), and Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::search().

Referenced by Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::remove(), and TEST().

◆ remove() [2/2]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
Data Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::remove ( Key &&  key)
inline

◆ remove_by_data()

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
void Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::remove_by_data ( Data &  data)
inline

Removes from the table the key whose pointer must be the result of a prior insertion or search.

Definition at line 975 of file tpl_dynSetHash.H.

References Aleph::DynHashTable< Key, HashTable, Cmp >::remove().

Referenced by Aleph::ConcurrentHashMap< Key, T, Cmp, Shards >::erase().

◆ search() [1/4]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
const Pair * Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::search ( const Key &  key) const
inlinenoexcept

◆ search() [2/4]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
Pair * Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::search ( const Key &  key)
inlinenoexcept

Searches for the pair whose key is key.

It finds the pair by the hash of the keys, so it builds nothing: no copy of the key and no Data, which then need not have a default constructor. After set_hash_fct() takes a function of pairs, which gives no hash of a key alone, it searches for a pair built from key and a Data built by default, as the table places them.

Parameters
[in]keyThe key to search for.
Returns
A pointer to the pair, or nullptr if there is none.
Exceptions
Onlyafter set_hash_fct() took a function of pairs, what building that pair throws: the copy of key or the default constructor of Data. As the search of the table, it requires that the hash function and the comparator do not throw.

Definition at line 811 of file tpl_dynSetHash.H.

References Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::has_search_with_custom_hash(), Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::no_key_hash(), Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::original_hash_fct, and Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::search_by_pair().

Referenced by Aleph::ConcurrentHashMap< Key, T, Cmp, Shards >::erase(), Aleph::Gen_Link_Cut_Tree_WithEdges< VT, ET, EdgeMonoid, LazyTag >::export_to_tree_node(), Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::find(), Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::find(), Aleph::ConcurrentHashMap< Key, T, Cmp, Shards >::find_copy(), Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::has(), Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::has(), Aleph::ConcurrentHashMap< Key, T, Cmp, Shards >::insert_or_assign(), Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::remove(), TEST(), TEST(), TEST(), TEST(), Aleph::ConcurrentHashMap< Key, T, Cmp, Shards >::with_value(), and Aleph::ConcurrentHashMap< Key, T, Cmp, Shards >::with_value_mut().

◆ search() [3/4]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
const Pair * Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::search ( Key &&  key) const
inlinenoexcept

◆ search() [4/4]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
Pair * Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::search ( Key &&  key)
inlinenoexcept

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The pair that it builds after set_hash_fct() took a function of pairs moves key.

Definition at line 853 of file tpl_dynSetHash.H.

References Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::has_search_with_custom_hash(), Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::no_key_hash(), Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::original_hash_fct, and Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::search_by_pair().

◆ search_by_pair()

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
template<typename K >
const Pair * Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::search_by_pair ( K &&  key) const
inlineprivatenoexcept

◆ set_hash_fct() [1/3]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
void Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::set_hash_fct ( Hash_Fct_Ptr  fct)
inline

Sets the hash function of the keys.

The map places and finds its pairs by the hash of their keys, as with the function given to the constructor, so search() goes on building nothing. On a map that is not empty, the table places the pairs again with it, or throws, as its set_hash_fct() does.

Parameters
[in]fctThe hash function of the keys.
Exceptions
std::domain_errorover a linear hash table (DynMapLinHash) that is not empty, which cannot place its pairs again, and std::bad_alloc if there is no memory for the function or to place the pairs again; the map then keeps its function and its pairs.

Definition at line 714 of file tpl_dynSetHash.H.

References Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::original_hash_fct.

◆ set_hash_fct() [2/3]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
void Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::set_hash_fct ( typename Base::Hash_Fct  fct)
inline

Sets a hash function of the pairs, as the table takes it.

A function of pairs gives no hash of a key alone, so from then on search() builds a pair from the key and a Data built by default, as the table places them; set_hash_fct() with a function of the keys searches again without building anything. On a map that is not empty, the table places the pairs again with it, or throws, as its set_hash_fct() does.

Parameters
[in]fctThe hash function of the pairs.
Exceptions
std::domain_errorover a linear hash table (DynMapLinHash) that is not empty, and std::bad_alloc if there is no memory to place the pairs again; the map then keeps its function and its pairs.

Definition at line 735 of file tpl_dynSetHash.H.

References Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::no_key_hash(), and Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::original_hash_fct.

◆ set_hash_fct() [3/3]

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
void Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::set_hash_fct ( typename Base::Hash_Fct_Ptr  fct)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 743 of file tpl_dynSetHash.H.

References Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::no_key_hash(), and Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::original_hash_fct.

◆ swap()

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
void Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::swap ( DynMapHashTable< Key, Data, HashTable, Cmp > &  other)
inlinenoexcept

Swaps this map with other in constant time.

The pairs travel with their hash function, so each map keeps finding its keys.

Parameters
[in,out]otherMap to swap with.

Definition at line 695 of file tpl_dynSetHash.H.

References Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::original_hash_fct.

◆ values()

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
DynList< Data > Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::values ( ) const
inline

Returns the values of the map.

Returns
A list with a copy of the value of every pair, in the order in which the table is traversed.
Exceptions
std::bad_allocIf there is no memory for the list.

Definition at line 1020 of file tpl_dynSetHash.H.

Referenced by TEST().

◆ values_ptr()

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
DynList< Data * > Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::values_ptr ( )
inline

Definition at line 1025 of file tpl_dynSetHash.H.

References Aleph::DynList< T >::append().

Referenced by TEST().

Member Data Documentation

◆ nothrow_search

template<typename Key , typename Data , template< class, class > class HashTable = LhashTable, class Cmp = Aleph::equal_to<Key>>
template<typename K >
constexpr bool Aleph::DynMapHashTable< Key, Data, HashTable, Cmp >::nothrow_search
staticconstexprprivate
Initial value:
=
not std::is_default_constructible_v<Data> or
(std::is_nothrow_constructible_v<Key, K> and
std::is_nothrow_default_constructible_v<Data> and
std::is_nothrow_move_constructible_v<Data>)
and
Insert a new element into the container by constructing it from the given args.
Definition ah-dry.H:1273

Definition at line 614 of file tpl_dynSetHash.H.

◆ original_hash_fct


The documentation for this class was generated from the following file: