A resize trigger policy based on a load check. More...
#include <hash_policy.hpp>
Public Types | |
enum | { external_load_access = 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) | |
Default constructor, or constructor taking load_min and load_max load factors between which this policy will keep the actual load. More... | |
virtual | ~hash_load_check_resize_trigger () |
std::pair< float, float > | get_loads () const |
Returns a pair of the minimal and maximal loads, respectively. More... | |
void | set_loads (std::pair< float, float > load_pair) |
Sets the loads through a pair of the minimal and maximal loads, respectively. More... | |
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 () |
Notifies the table was cleared. More... | |
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) |
Notifies an element was inserted. More... | |
void | notify_resized (size_type new_size) |
Notifies the table was resized as a result of this object's signifying that a resize is needed. More... | |
Private Types | |
typedef detail::hash_load_check_resize_trigger_size_base< Size_Type, External_Load_Access > | size_base |
Private Member Functions | |
virtual void | do_resize (size_type new_size) |
Private Attributes | |
float | m_load_max |
float | m_load_min |
size_type | m_next_grow_size |
size_type | m_next_shrink_size |
bool | m_resize_needed |
A resize trigger policy based on a load check.
It keeps the load factor between some load factors load_min and load_max.
|
private |
typedef Size_Type __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::size_type |
anonymous enum |
__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.
|
virtual |
|
privatevirtual |
|
inline |
Returns a pair of the minimal and maximal loads, respectively.
|
inlineprotected |
|
inlineprotected |
|
protected |
Notifies the table was cleared.
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
protected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
Notifies an element was inserted.
The total number of entries in the table is num_entries.
|
protected |
Notifies the table was resized as a result of this object's signifying that a resize is needed.
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.
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 | ) |
|
private |
|
private |
|
private |
|
private |
|
private |