gp_hash_table Interface (original) (raw)

A concrete general-probing hash-based associative container.

Defined in: assoc_container.hpp

Template Parameters

Parameter Description Default Value
typename Key Key type. -
typename Mapped Mapped type. -
class Hash_Fn Hash functor. __gnu_cxx::hash<Key> if using gcc;stdext::hash_value<Key> if using Visual C++ .net
class Eq_Fn Equivalence functor. std::equal_to<Key>
class Comb_Probe_Fn Combining probe functor. If Hash_Fn isnull_hash_fn, and Probe_Fn is null_probe_fn, then this is the ranged-probe functor; otherwise, this is the range-hashing functor. (See Design::Hash-Based Containers::Hash Policies.) direct_mask_range_hashing
class Probe_Fn Probe functor. If Comb_Probe_Fn is direct_mask_range_hashing, thenlinear_probe_fn< **typename** Comb_Probe_Fn::size_type> otherwise,quadratic_probe_fn< **typename** Comb_Probe_Fn::size_type>
class Resize_Policy Resize policy. If Comb_Probe_Fn is direct_mask_range_hashing, thenhash_standard_resize_policy< hash_exponential_size_policy< **typename** Comb_Probe_Fn::size_type>, hash_load_check_resize_trigger< **typename** Comb_Probe_Fn::size_type>, false, typename Comb_Probe_Fn::size_type> otherwise,hash_standard_resize_policy< hash_exponential_size_policy< **typename** Comb_Probe_Fn::size_type>, hash_load_check_resize_trigger< **typename** Comb_Probe_Fn::size_type>, false, typename Comb_Probe_Fn::size_type>
bool Store_Hash Indicates whether the hash value will be stored along with each key. If hash_fn is null_hash_fn, then the container will not compile if this value istrue false
class Allocator Allocator type. std::allocator<**char**>

Base Classes

Class Derivation Type
basic_hash_table public

Public Types and Constants

Policy Definitions

Type Definition Description
hash_fn Hash_Fn Hash functor type.
eq_fn Eq_Fn Equivalence functor type.
comb_probe_fn Comb_Probe_Fn Combining probe functor type.
probe_fn Probe_Fn Probe functor type.
resize_policy Resize_Policy Resize policy type.

Public Methods

Method Description
gp_hash_table () Default constructor.
gp_hash_table (const hash_fn &r_hash_fn) Constructor taking some policy objects. r_hash_fn will be copied by thehash_fn object of the container object.
gp_hash_table (const hash_fn &r_hash_fn, const eq_fn &r_eq_fn) Constructor taking some policy objects. r_hash_fn will be copied by thehash_fn object of the container object, and r_eq_fn will be copied by theeq_fn object of the container object.
gp_hash_table (const hash_fn &r_hash_fn, const eq_fn &r_eq_fn, const comb_probe_fn &r_comb_probe_fn) Constructor taking some policy objects. r_hash_fn will be copied by thehash_fn object of the container object, r_eq_fn will be copied by theeq_fn object of the container object, and r_comb_probe_fn will be copied by the comb_probe_fn object of the container object.
gp_hash_table (const hash_fn &r_hash_fn, const eq_fn &r_eq_fn, const comb_probe_fn &r_comb_probe_fn, const probe_fn &r_probe_fn) Constructor taking some policy objects. r_hash_fn will be copied by thehash_fn object of the container object, r_eq_fn will be copied by theeq_fn object of the container object, r_comb_probe_fn will be copied by the comb_probe_fn object of the container object, and r_probe_fn will be copied by theprobe_fn object of the container object.
gp_hash_table (const hash_fn &r_hash_fn, const eq_fn &r_eq_fn, const comb_probe_fn &r_comb_probe_fn, const probe_fn &r_probe_fn, const resize_policy &r_resize_policy) Constructor taking some policy objects. r_hash_fn will be copied by thehash_fn object of the container object, r_eq_fn will be copied by theeq_fn object of the container object, r_comb_probe_fn will be copied by the comb_probe_fn object of the container object, r_probe_fn will be copied by theprobe_fn object of the container object, and r_resize_policy will be copied by the Resize_Policy object of the container object.
template< **class** It> gp_hash_table (It first_it, It last_it) Constructor taking iterators to a range of value_types. The value_types between first_it and last_it will be inserted into the container object.
template< **class** It> gp_hash_table (It first_it, It last_it, const hash_fn &r_hash_fn) Constructor taking iterators to a range of value_types and some policy objects. The value_types betweenfirst_it andlast_it will be inserted into the container object. r_hash_fn will be copied by thehash_fn object of the container object.
template< **class** It> gp_hash_table (It first_it, It last_it, const hash_fn &r_hash_fn, const eq_fn &r_eq_fn) Constructor taking iterators to a range of value_types and some policy objects. The value_types betweenfirst_it andlast_it will be inserted into the container object. r_hash_fn will be copied by thehash_fn object of the container object, and r_eq_fn will be copied by theeq_fn object of the container object.
template< **class** It> gp_hash_table (It first_it, It last_it, const hash_fn &r_hash_fn, const eq_fn &r_eq_fn, const comb_probe_fn &r_comb_probe_fn) Constructor taking iterators to a range of value_types and some policy objects. The value_types betweenfirst_it andlast_it will be inserted into the container object. r_hash_fn will be copied by thehash_fn object of the container object, r_eq_fn will be copied by theeq_fn object of the container object, and r_comb_probe_fn will be copied by the comb_probe_fn object of the container object.
template< **class** It> gp_hash_table (It first_it, It last_it, const hash_fn &r_hash_fn, const eq_fn &r_eq_fn, const comb_probe_fn &r_comb_probe_fn, const probe_fn &r_probe_fn) Constructor taking iterators to a range of value_types and some policy objects. The value_types betweenfirst_it andlast_it will be inserted into the container object. r_hash_fn will be copied by thehash_fn object of the container object, r_eq_fn will be copied by theeq_fn object of the container object, r_comb_probe_fn will be copied by the comb_probe_fn object of the container object, and r_probe_fn will be copied by theprobe_fn object of the container object.
template< **class** It> gp_hash_table (It first_it, It last_it, const hash_fn &r_hash_fn, const eq_fn &r_eq_fn, const comb_probe_fn &r_comb_probe_fn, const probe_fn &r_probe_fn, const resize_policy &r_resize_policy) Constructor taking iterators to a range of value_types and some policy objects. The value_types betweenfirst_it andlast_it will be inserted into the container object. r_hash_fn will be copied by thehash_fn object of the container object, r_eq_fn will be copied by theeq_fn object of the container object, r_comb_probe_fn will be copied by the comb_probe_fn object of the container object, r_probe_fn will be copied by theprobe_fn object of the container object, and r_resize_policy will be copied by the resize_policy object of the container object.
gp_hash_table (const gp_hash_table &other) Copy constructor.
virtual ~gp_hash_table () Destructor.
gp_hash_table & operator= (const gp_hash_table &other) Assignment operator.
void swap (gp_hash_table &other) Swaps content.

Policy Access Methods

Method Description
comb_probe_fn & get_comb_probe_fn () Access to the comb_probe_fn object.
const comb_probe_fn & get_comb_probe_fn () const Const access to the comb_probe_fn object.
probe_fn & get_probe_fn () Access to the probe_fn object.
const probe_fn & get_probe_fn () const Const access to the probe_fn object.