A resize policy which delegates operations to size and trigger policies.
Defined in: hash_policy.hpp
Parameter | Description | Default Value |
class Size_Policy |
Size policy type. |
hash_exponential_size_policy |
class Trigger_Policy |
Trigger policy type. |
hash_load_check_resize_trigger |
bool External_Size_Access |
Indicates whether physical sizes can be accessed externally. |
false |
typename Size_Type |
Size type. |
size_t |
Class | Derivation Type |
Size_Policy |
public |
Trigger_Policy |
public |
Type | Definition | Description |
size_type |
Size_Type |
Size type. |
Type | Definition | Description |
trigger_policy |
Trigger_Policy |
Trigger policy type. |
size_policy |
Size_Policy |
Size policy type. |
external_size_access |
External_Size_Access |
Indicates whether sizes can be accessed externally. |
Method | Description |
hash_standard_resize_policy () |
Default constructor. |
hash_standard_resize_policy (const Size_Policy &r_size_policy) |
constructor taking some policies r_size_policy will be copied by the Size_Policy object of this object. |
hash_standard_resize_policy (const Size_Policy &r_size_policy, const Trigger_Policy &r_trigger_policy) |
constructor taking some policies. r_size_policy will be copied by the Size_Policy object of this object. r_trigger_policy will be copied by the Trigger_Policy object of this object. |
virtual ~hash_standard_resize_policy () |
Destructor. |
inline void
swap
(hash_standard_resize_policy &other)
|
Swaps content. |
Method | Description |
Size_Policy & get_size_policy () |
Access to the Size_Policy object used. |
const Size_Policy & get_size_policy () const |
Const access to the Size_Policy object used. |
Trigger_Policy & get_trigger_policy () |
Access to the Trigger_Policy object used. |
const Trigger_Policy & get_trigger_policy () const |
Access to the Trigger_Policy object used. |
These methods are available only if the external size parameter indicates that external size access is allowed.
Method | Description |
inline size_type get_actual_size () const |
Returns the actual size of the container. This method returns the number of entries (used and unused) in the container. It is different from the container's size method, which returns the number of used entries. Calling this method will not compile when External_Size_Access == false. |
void resize (size_type suggested_new_size) |
Resizes the container to suggested_new_size, a suggested size (the actual size will be determined by the Size_Policy object). Calling this method will not compile when External_Size_Access == false. |
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. |
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. |
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. |
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_type num_e) |
Notifies an element was inserted. |
inline void notify_erased (size_type num_e) |
Notifies an element was erased. |
void notify_cleared () |
Notifies the table was cleared. |
Notifications called when the table changes size.
Method | Description |
void notify_resized (size_type new_size) |
Notifies the table was resized to new_size. |
Called to query whether/how to resize.
Method | Description |
inline bool is_resize_needed () const |
Queries whether a resize is needed. |
size_type get_new_size (size_type size, size_type num_used_e) const |
Queries what the new size should be, when the container is resized naturally. The current size of the container is size, and the number of used entries within the container is num_used_e. |
Method | Description |
virtual void do_resize (size_type new_size) |
Resizes to new_size. |