hash_load_check_resize_trigger
 Interface
A resize trigger policy based on a load check. It keeps the load factor between some load factors load_min and load_max.
../../../../include/ext/pb_assoc/hash_policy.hpphash_policy.hpp #link1Template parameters.
Public Types and Constants:
#link2General definitions.
Public Methods:
#link3Constructors, destructor, and related.
#link4Load access methods.
Protected Methods:
#link5Insert search notifications.
#link6Find search notifications.
#link7Erase search notifications.
#link8Content change notifications.
#link9Size change notifications.
#link10Queries.
Template parameters.
Parameter Description Default Value External_Load_Access Specifies whether the load factor can be accessed externally. The two options have different tradeoffs in terms of flexibility, genericity, and encapsulation.
false Size_Type Size type.
size_t
General definitions.
Type Definition Description size_type #Size_Type3735929483Size_Type Size type.
external_load_access #External_Load_Access3735929540External_Load_Access Indicates whether loads can be accessed externally
Constructors, destructor, and related.
Method Description   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.
It is the responsibility of the user to ensure that load_min is smaller than load_max.
void  swap
  (
hash_load_check_resize_trigger &r_other) Swaps content.
  virtual    ~hash_load_check_resize_trigger
    ()
Destructor.
Load access methods.
 These methods are only available if the external access parameter is set.
Method Description inline std::pair<float, float>
  get_loads
  () 
const Returns a pair of the minimal and maximal loads, respectively.
Calling this method will not compile when #External_Load_Access3735929540External_Load_Access  == false.
void  set_loads
  (std::pair<float, float> load_pair)
Sets the loads through a pair of the minimal and maximal loads, respectively.
Calling this method resizes the container, and might throw an exception. It is the responsibility of the user to pass appropriate loads to this function. Calling this method will not compile when #External_Load_Access3735929540External_Load_Access  == false.
Insert search notifications.
Notifications called during an insert operation.
Method Description inline void  notify_insert_search_start
  ()
Notifies a search started.
inline void  notify_insert_search_collision
  ()
Notifies a search encountered a collision.
inline void  notify_insert_search_end
  ()
Notifies a search ended.
Find search notifications.
Notifications called during a find operation.
Method Description inline void  notify_find_search_start
  ()
Notifies a search started.
inline void  notify_find_search_collision
  ()
Notifies a search encountered a collision.
inline void  notify_find_search_end
  ()
Notifies a search ended.
Erase search notifications.
Notifications called during an insert operation.
Method Description inline void  notify_erase_search_start
  ()
Notifies a search started.
inline void  notify_erase_search_collision
  ()
Notifies a search encountered a collision.
inline void  notify_erase_search_end
  ()
Notifies a search ended.
Content change notifications.
Notifications called when the content of the table changes in a way that can affect the resize policy.
Method Description inline void  notify_inserted
  (
#size_type3735929547size_type  num_entries) Notifies an element was inserted. the total number of entries in the table is num_entries.
inline void  notify_erased
  (
#size_type3735929547size_type  num_entries) Notifies an element was erased.
void  notify_cleared
  ()
Notifies the table was cleared.
Size change notifications.
Notifications called when the table changes size.
Method Description void  notify_resized
  (
#size_type3735929547size_type  new_size) Notifies the table was resized as a result of this object's signifying that a resize is needed.
void  notify_externally_resized
  (
#size_type3735929547size_type  new_size) Notifies the table was resized externally.
Queries.
Called to query whether/how to resize.
Method Description inline bool  is_resize_needed
  () 
const Queries whether a resize is needed.
inline bool  is_grow_needed
  (
#size_type3735929547size_type  size,
    
#size_type3735929547size_type  num_entries) const Queries whether a grow is needed.
This method is called only if this object indicated resize is needed. The actual size of the table is size, and the number of entries in it is num_entries.
inline bool  is_shrink_needed
  (
#size_type3735929547size_type  size,
    
#size_type3735929547size_type  num_entries) const Queries whether a shrink is needed.
This method is called only if this object indicated resize is needed. The actual size of the table is size, and the number of entries in it is num_entries.
