libstdc++: __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type > Class Template Reference

libstdc++

__gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type > Class Template Reference

`#include <hash_policy.hpp>`

Inheritance diagram for __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >:
[legend]

## Public Types
enum | { external_load_access }
typedef Size_Type | size_type

## Public Member Functions
| hash_load_check_resize_trigger (float load_min=0.125, float load_max=0.5)
std::pair< float, float > | get_loads () const
void | set_loads (std::pair< float, float > load_pair)
void | swap (hash_load_check_resize_trigger &other)

## Protected Member Functions
bool | is_grow_needed (size_type size, size_type num_entries) const
bool | is_resize_needed () const
void | notify_cleared ()
void | notify_erase_search_collision ()
void | notify_erase_search_end ()
void | notify_erase_search_start ()
void | notify_erased (size_type num_entries)
void | notify_externally_resized (size_type new_size)
void | notify_find_search_collision ()
void | notify_find_search_end ()
void | notify_find_search_start ()
void | notify_insert_search_collision ()
void | notify_insert_search_end ()
void | notify_insert_search_start ()
void | notify_inserted (size_type num_entries)
void | notify_resized (size_type new_size)

## Detailed Description

template<bool External_Load_Access = false, typename Size_Type = std::size_t>
class __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >

A resize trigger policy based on a load check. It keeps the load factor between some load factors load_min and load_max.

Definition at line 175 of file hash_policy.hpp.

## Member Typedef Documentation

## ◆ size_type

template<bool External_Load_Access = false, typename Size_Type = std::size_t>

typedef Size_Type __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::size_type

Definition at line 178 of file hash_policy.hpp.

## Member Enumeration Documentation

## ◆ anonymous enum

template<bool External_Load_Access = false, typename Size_Type = std::size_t>

anonymous enum

Enumerator
external_load_access | Specifies whether the load factor can be accessed externally. The two options have different trade-offs in terms of flexibility, genericity, and encapsulation.

Definition at line 180 of file hash_policy.hpp.

## Constructor & Destructor Documentation

## ◆ hash_load_check_resize_trigger()

template<bool External_Load_Access, typename Size_Type>

__gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::hash_load_check_resize_trigger | ( | float | load_min = 0.125,
|  | float | load_max = 0.5 )

Default constructor, or constructor taking load_min and load_max load factors between which this policy will keep the actual load.

Definition at line 48 of file hash_policy.hpp.

## ◆ ~hash_load_check_resize_trigger()

template<bool External_Load_Access, typename Size_Type>

__gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::~hash_load_check_resize_trigger | ( |  | ) |
| virtual

Definition at line 147 of file hash_policy.hpp.

## Member Function Documentation

## ◆ get_loads()

template<bool External_Load_Access, typename Size_Type>

std::pair< float, float > __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::get_loads | ( |  | ) | const
| inline

Returns a pair of the minimal and maximal loads, respectively.

Definition at line 237 of file hash_policy.hpp.

## ◆ is_grow_needed()

template<bool External_Load_Access, typename Size_Type>

bool __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::is_grow_needed | ( | size_type | size,
|  | size_type | num_entries ) const
| inlineprotected

Definition at line 139 of file hash_policy.hpp.

## ◆ is_resize_needed()

template<bool External_Load_Access, typename Size_Type>

bool __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::is_resize_needed | ( |  | ) | const
| inlineprotected

Definition at line 130 of file hash_policy.hpp.

## ◆ notify_cleared()

template<bool External_Load_Access, typename Size_Type>

void __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::notify_cleared | ( |  | ) |
| protected

Notifies the table was cleared.

Definition at line 207 of file hash_policy.hpp.

## ◆ notify_erase_search_collision()

template<bool External_Load_Access, typename Size_Type>

void __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::notify_erase_search_collision | ( |  | ) |
| inlineprotected

Definition at line 98 of file hash_policy.hpp.

## ◆ notify_erase_search_end()

template<bool External_Load_Access, typename Size_Type>

void __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::notify_erase_search_end | ( |  | ) |
| inlineprotected

Definition at line 104 of file hash_policy.hpp.

## ◆ notify_erase_search_start()

template<bool External_Load_Access, typename Size_Type>

void __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::notify_erase_search_start | ( |  | ) |
| inlineprotected

Definition at line 92 of file hash_policy.hpp.

## ◆ notify_erased()

template<bool External_Load_Access, typename Size_Type>

void __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::notify_erased | ( | size_type | num_entries | ) |
| inlineprotected

Definition at line 120 of file hash_policy.hpp.

## ◆ notify_externally_resized()

template<bool External_Load_Access, typename Size_Type>

void __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::notify_externally_resized | ( | size_type | new_size | ) |
| protected

Definition at line 173 of file hash_policy.hpp.

## ◆ notify_find_search_collision()

template<bool External_Load_Access, typename Size_Type>

void __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::notify_find_search_collision | ( |  | ) |
| inlineprotected

Definition at line 62 of file hash_policy.hpp.

## ◆ notify_find_search_end()

template<bool External_Load_Access, typename Size_Type>

void __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::notify_find_search_end | ( |  | ) |
| inlineprotected

Definition at line 68 of file hash_policy.hpp.

## ◆ notify_find_search_start()

template<bool External_Load_Access, typename Size_Type>

void __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::notify_find_search_start | ( |  | ) |
| inlineprotected

Definition at line 56 of file hash_policy.hpp.

## ◆ notify_insert_search_collision()

template<bool External_Load_Access, typename Size_Type>

void __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::notify_insert_search_collision | ( |  | ) |
| inlineprotected

Definition at line 80 of file hash_policy.hpp.

## ◆ notify_insert_search_end()

template<bool External_Load_Access, typename Size_Type>

void __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::notify_insert_search_end | ( |  | ) |
| inlineprotected

Definition at line 86 of file hash_policy.hpp.

## ◆ notify_insert_search_start()

template<bool External_Load_Access, typename Size_Type>

void __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::notify_insert_search_start | ( |  | ) |
| inlineprotected

Definition at line 74 of file hash_policy.hpp.

## ◆ notify_inserted()

template<bool External_Load_Access, typename Size_Type>

void __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::notify_inserted | ( | size_type | num_entries | ) |
| inlineprotected

Notifies an element was inserted. The total number of entries in the table is num_entries.

Definition at line 110 of file hash_policy.hpp.

## ◆ notify_resized()

template<bool External_Load_Access, typename Size_Type>

void __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::notify_resized | ( | size_type | new_size | ) |
| protected

Notifies the table was resized as a result of this object's signifying that a resize is needed.

Definition at line 152 of file hash_policy.hpp.

References notify_resized().

Referenced by notify_resized().

## ◆ set_loads()

template<bool External_Load_Access, typename Size_Type>

void __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::set_loads | ( | std::pair< float, float > | load_pair | ) |

Sets the loads through a pair of the minimal and maximal loads, respectively.

Definition at line 246 of file hash_policy.hpp.

## ◆ swap()

template<bool External_Load_Access, typename Size_Type>

void __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::swap | ( | hash_load_check_resize_trigger< External_Load_Access, Size_Type > & | other | ) |

Definition at line 218 of file hash_policy.hpp.

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

- hash_policy.hpp