cc_hash_max_collision_check_resize_trigger Interface

A resize trigger policy based on collision checks. It keeps the simulated load factor lower than some given load factor.

  1. hash_policy.hpp
  2. Template parameters.
  3. Public Types and Constants:
    1. General definitions.
  4. Public Methods:
    1. Constructors, destructor, and related.
    2. Load access methods.
  5. Protected Methods:
    1. Insert search notifications.
    2. Find search notifications.
    3. Erase search notifications.
    4. Content change notifications.
    5. Size change notifications.
    6. Queries.

Template parameters.

ParameterDescriptionDefault 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.

TypeDefinitionDescription
size_type
Size_Type

Size type.

external_load_access
External_Load_Access

Indicates whether loads can be accessed externally

Constructors, destructor, and related.

MethodDescription
  cc_hash_max_collision_check_resize_trigger
  (float load = 0.5)

Default constructor, or constructor taking load, a load factor which it will attempt to maintain.

void
  swap
  (cc_hash_max_collision_check_resize_trigger &r_other)

Swaps content.

Load access methods.

These methods are only available if the external access parameter is set.

MethodDescription
inline float
  get_load
  () const

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

Calling this method will not compile when External_Load_Access == false.

Insert search notifications.

Notifications called during an insert operation.

MethodDescription
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.

MethodDescription
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.

MethodDescription
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.

MethodDescription
inline void
  notify_inserted
  (size_type num_entries)

Notifies an element was inserted.

inline void
  notify_erased
  (size_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.

MethodDescription
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.

void
  notify_externally_resized
  (size_type new_size)

Notifies the table was resized externally.

Queries.

Called to query whether/how to resize.

MethodDescription
inline bool
  is_resize_needed
  () const

Queries whether a resize is needed.

inline bool
  is_grow_needed
  (size_type size, size_type num_entries) const

Queries whether a grow is needed.

This method is called only if this object indicated is needed.

inline bool
  is_shrink_needed
  (size_type size, size_type num_entries) const

Queries whether a shrink is needed.

This method is called only if this object indicated is needed.