libstdc++
__gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type > Class Template Reference

#include <hash_policy.hpp>

Inheritance diagram for __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >:
[legend]

Public Types

enum  { external_load_access }
 
enum  { external_size_access }
 
typedef Size_Policy size_policy
 
typedef Size_Type size_type
 
typedef Trigger_Policy trigger_policy
 

Public Member Functions

 hash_standard_resize_policy ()
 
 hash_standard_resize_policy (const Size_Policy &r_size_policy)
 
 hash_standard_resize_policy (const Size_Policy &r_size_policy, const Trigger_Policy &r_trigger_policy)
 
size_type get_actual_size () const
 
std::pair< float, float > get_loads () const
 
Size_Policy & get_size_policy ()
 
const Size_Policy & get_size_policy () const
 
Trigger_Policy & get_trigger_policy ()
 
const Trigger_Policy & get_trigger_policy () const
 
void resize (size_type suggested_new_size)
 
void set_loads (std::pair< float, float > load_pair)
 
void swap (hash_exponential_size_policy< Size_Type > &other)
 
void swap (hash_load_check_resize_trigger &other)
 
void swap (hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type > &other)
 

Protected Member Functions

size_type get_nearest_larger_size (size_type size) const
 
size_type get_nearest_smaller_size (size_type size) const
 
size_type get_new_size (size_type size, size_type num_used_e) const
 
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_e)
 
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_e)
 
void notify_resized (size_type new_size)
 

Detailed Description

template<typename Size_Policy = hash_exponential_size_policy<>, typename Trigger_Policy = hash_load_check_resize_trigger<>, bool External_Size_Access = false, typename Size_Type = std::size_t>
class __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >

A resize policy which delegates operations to size and trigger policies.

Definition at line 489 of file hash_policy.hpp.

Member Typedef Documentation

◆ size_policy

template<typename Size_Policy = hash_exponential_size_policy<>, typename Trigger_Policy = hash_load_check_resize_trigger<>, bool External_Size_Access = false, typename Size_Type = std::size_t>
Size_Policy __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::size_policy

Definition at line 495 of file hash_policy.hpp.

◆ size_type

template<typename Size_Policy = hash_exponential_size_policy<>, typename Trigger_Policy = hash_load_check_resize_trigger<>, bool External_Size_Access = false, typename Size_Type = std::size_t>
Size_Type __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::size_type

Definition at line 493 of file hash_policy.hpp.

◆ trigger_policy

template<typename Size_Policy = hash_exponential_size_policy<>, typename Trigger_Policy = hash_load_check_resize_trigger<>, bool External_Size_Access = false, typename Size_Type = std::size_t>
Trigger_Policy __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::trigger_policy

Definition at line 494 of file hash_policy.hpp.

Member Enumeration Documentation

◆ anonymous enum

template<bool External_Load_Access = false, typename Size_Type = std::size_t>
anonymous enum
inherited
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.

◆ anonymous enum

template<typename Size_Policy = hash_exponential_size_policy<>, typename Trigger_Policy = hash_load_check_resize_trigger<>, bool External_Size_Access = false, typename Size_Type = std::size_t>
anonymous enum

Definition at line 497 of file hash_policy.hpp.

Constructor & Destructor Documentation

◆ hash_standard_resize_policy() [1/3]

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
__gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::hash_standard_resize_policy ( )

Default constructor.

Definition at line 45 of file hash_policy.hpp.

◆ hash_standard_resize_policy() [2/3]

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
__gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::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.

Definition at line 51 of file hash_policy.hpp.

◆ hash_standard_resize_policy() [3/3]

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
__gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::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.

Definition at line 57 of file hash_policy.hpp.

◆ ~hash_standard_resize_policy()

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
__gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::~hash_standard_resize_policy ( )
virtual

Definition at line 65 of file hash_policy.hpp.

Member Function Documentation

◆ get_actual_size()

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::size_type __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::get_actual_size ( ) const
inline

Returns the actual size of the container.

Definition at line 178 of file hash_policy.hpp.

References __gnu_pbds::hash_load_check_resize_trigger< External_Load_Access, Size_Type >::external_load_access.

◆ 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
inlineinherited

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

Definition at line 237 of file hash_policy.hpp.

◆ get_nearest_larger_size()

template<typename Size_Type >
hash_exponential_size_policy< Size_Type >::size_type __gnu_pbds::hash_exponential_size_policy< Size_Type >::get_nearest_larger_size ( size_type size) const
protectedinherited

Definition at line 62 of file hash_policy.hpp.

◆ get_nearest_smaller_size()

template<typename Size_Type >
hash_exponential_size_policy< Size_Type >::size_type __gnu_pbds::hash_exponential_size_policy< Size_Type >::get_nearest_smaller_size ( size_type size) const
protectedinherited

Definition at line 78 of file hash_policy.hpp.

◆ get_new_size()

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::size_type __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::get_new_size ( size_type size,
size_type num_used_e ) const
protected

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.

Definition at line 159 of file hash_policy.hpp.

◆ get_size_policy() [1/2]

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
Size_Policy & __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::get_size_policy ( )

Access to the Size_Policy object used.

Definition at line 243 of file hash_policy.hpp.

◆ get_size_policy() [2/2]

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
const Size_Policy & __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::get_size_policy ( ) const

Const access to the Size_Policy object used.

Definition at line 249 of file hash_policy.hpp.

◆ get_trigger_policy() [1/2]

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
Trigger_Policy & __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::get_trigger_policy ( )

Access to the Trigger_Policy object used.

Definition at line 231 of file hash_policy.hpp.

◆ get_trigger_policy() [2/2]

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
const Trigger_Policy & __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::get_trigger_policy ( ) const

Access to the Trigger_Policy object used.

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
inlineprotectedinherited

Definition at line 139 of file hash_policy.hpp.

◆ is_resize_needed()

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
bool __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::is_resize_needed ( ) const
inlineprotected

Definition at line 153 of file hash_policy.hpp.

◆ notify_cleared()

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
void __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::notify_cleared ( )
protected

Definition at line 147 of file hash_policy.hpp.

◆ notify_erase_search_collision()

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
void __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::notify_erase_search_collision ( )
inlineprotected

Definition at line 123 of file hash_policy.hpp.

◆ notify_erase_search_end()

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
void __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::notify_erase_search_end ( )
inlineprotected

Definition at line 129 of file hash_policy.hpp.

◆ notify_erase_search_start()

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
void __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::notify_erase_search_start ( )
inlineprotected

Definition at line 117 of file hash_policy.hpp.

◆ notify_erased()

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
void __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::notify_erased ( size_type num_e)
inlineprotected

Definition at line 141 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)
protectedinherited

Definition at line 173 of file hash_policy.hpp.

◆ notify_find_search_collision()

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
void __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::notify_find_search_collision ( )
inlineprotected

Definition at line 87 of file hash_policy.hpp.

◆ notify_find_search_end()

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
void __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::notify_find_search_end ( )
inlineprotected

Definition at line 93 of file hash_policy.hpp.

◆ notify_find_search_start()

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
void __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::notify_find_search_start ( )
inlineprotected

Definition at line 81 of file hash_policy.hpp.

◆ notify_insert_search_collision()

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
void __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::notify_insert_search_collision ( )
inlineprotected

Definition at line 105 of file hash_policy.hpp.

◆ notify_insert_search_end()

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
void __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::notify_insert_search_end ( )
inlineprotected

Definition at line 111 of file hash_policy.hpp.

◆ notify_insert_search_start()

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
void __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::notify_insert_search_start ( )
inlineprotected

Definition at line 99 of file hash_policy.hpp.

◆ notify_inserted()

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
void __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::notify_inserted ( size_type num_e)
inlineprotected

Definition at line 135 of file hash_policy.hpp.

◆ notify_resized()

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
void __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::notify_resized ( size_type new_size)
protected

Definition at line 169 of file hash_policy.hpp.

◆ resize()

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
void __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::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).

Definition at line 187 of file hash_policy.hpp.

◆ 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)
inherited

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

Definition at line 246 of file hash_policy.hpp.

◆ swap() [1/3]

template<typename Size_Type >
void __gnu_pbds::hash_exponential_size_policy< Size_Type >::swap ( hash_exponential_size_policy< Size_Type > & other)
inherited

Definition at line 53 of file hash_policy.hpp.

◆ swap() [2/3]

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)
inherited

Definition at line 218 of file hash_policy.hpp.

◆ swap() [3/3]

template<typename Size_Policy , typename Trigger_Policy , bool External_Size_Access, typename Size_Type >
void __gnu_pbds::hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type >::swap ( hash_standard_resize_policy< Size_Policy, Trigger_Policy, External_Size_Access, Size_Type > & other)
inline

Definition at line 71 of file hash_policy.hpp.


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