...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::intrusive::hashdata_internal
// In header: <boost/intrusive/hashtable.hpp> template<typename ValueTraits, typename VoidOrKeyOfValue, typename VoidOrKeyHash, typename VoidOrKeyEqual, typename BucketTraits, typename SizeType, std::size_t BoolFlags> struct hashdata_internal : public boost::intrusive::hashtable_size_wrapper< DeriveFrom, SizeType, bool > { // types typedef get_hashtable_size_wrapper_bucket< ValueTraits, VoidOrKeyOfValue, VoidOrKeyHash, VoidOrKeyEqual, BucketTraits, SizeType, BoolFlags >::type split_bucket_hash_equal_t; typedef split_bucket_hash_equal_t::key_equal key_equal; typedef split_bucket_hash_equal_t::hasher hasher; typedef bucket_plus_vtraits< ValueTraits, BucketTraits, linear_buckets > bucket_plus_vtraits_t; typedef SizeType size_type; typedef split_bucket_hash_equal_t::size_traits split_traits; typedef bucket_plus_vtraits_t::bucket_ptr bucket_ptr; typedef bucket_plus_vtraits_t::const_value_traits_ptr const_value_traits_ptr; typedef bucket_plus_vtraits_t::siterator siterator; typedef bucket_plus_vtraits_t::bucket_traits bucket_traits; typedef bucket_plus_vtraits_t::value_traits value_traits; typedef bucket_plus_vtraits_t::bucket_type bucket_type; typedef value_traits::value_type value_type; typedef value_traits::pointer pointer; typedef value_traits::const_pointer const_pointer; typedef pointer_traits< pointer >::reference reference; typedef pointer_traits< const_pointer >::reference const_reference; typedef value_traits::node_traits node_traits; typedef node_traits::node node; typedef node_traits::node_ptr node_ptr; typedef node_traits::const_node_ptr const_node_ptr; typedef bucket_plus_vtraits_t::slist_node_algorithms slist_node_algorithms; typedef bucket_plus_vtraits_t::slist_node_ptr slist_node_ptr; typedef hash_key_types_base< typename ValueTraits::value_type, VoidOrKeyOfValue > hash_types_base; typedef hash_types_base::key_of_value key_of_value; typedef unspecified store_hash_t; typedef unspecified local_iterator; typedef unspecified const_local_iterator; typedef unspecified linear_buckets_t; typedef bucket_plus_vtraits_t::iterator iterator; typedef bucket_plus_vtraits_t::const_iterator const_iterator; typedef unspecified fastmod_buckets_t; // construct/copy/destruct hashdata_internal(const ValueTraits &, const bucket_traits &, const hasher &, const key_equal &); hashdata_internal(hashdata_internal &&); ~hashdata_internal(); // public member functions split_bucket_hash_equal_t::size_traits_t priv_split_traits(); void priv_clear_buckets(); void priv_clear_buckets_and_cache(); void priv_init_buckets_and_cache(); SizeType split_count() const noexcept; void split_count(SizeType) noexcept; void inc_split_count() noexcept; void dec_split_count() noexcept; iterator iterator_to(reference) noexcept(!linear_buckets); const_iterator iterator_to(const_reference) const noexcept(!linear_buckets); iterator iterator_to(reference, unspecified); const_iterator iterator_to(const_reference, unspecified) const; bucket_type & priv_hash_to_bucket(std::size_t) const; bucket_ptr priv_hash_to_bucket_ptr(std::size_t) const; size_type priv_hash_to_nbucket(std::size_t) const; size_type priv_hash_to_nbucket(std::size_t, unspecified) const; size_type priv_hash_to_nbucket(std::size_t, unspecified) const; iterator iterator_to(reference, unspecified) noexcept; const_iterator iterator_to(const_reference, unspecified) const noexcept; local_iterator local_iterator_to(reference) noexcept; const_local_iterator local_iterator_to(const_reference) const noexcept; size_type bucket_count() const noexcept; size_type bucket_size(size_type) const noexcept; bucket_ptr bucket_pointer() const noexcept; local_iterator begin(size_type) noexcept; const_local_iterator begin(size_type) const noexcept; const_local_iterator cbegin(size_type) const noexcept; local_iterator end(size_type) noexcept; const_local_iterator end(size_type) const noexcept; const_local_iterator cend(size_type) const noexcept; iterator begin() noexcept; const_iterator begin() const noexcept; const_iterator cbegin() const noexcept; hasher hash_function() const; key_equal key_eq() const; // public static functions static SizeType initial_split_from_bucket_count(SizeType) noexcept; static SizeType rehash_split_from_bucket_count(SizeType) noexcept; static local_iterator s_local_iterator_to(reference) noexcept; static const_local_iterator s_local_iterator_to(const_reference) noexcept; static size_type suggested_upper_bucket_count(size_type) noexcept; static size_type suggested_lower_bucket_count(size_type) noexcept; // public data members static const bool linear_buckets; static const bool store_hash; static const bool safemode_or_autounlink; static const bool stateful_value_traits; static const bool incremental; static const bool power_2_buckets; static const bool fastmod_buckets; };
hashdata_internal
public member functionssplit_bucket_hash_equal_t::size_traits_t priv_split_traits();
void priv_clear_buckets();
void priv_clear_buckets_and_cache();
void priv_init_buckets_and_cache();
SizeType split_count() const noexcept;
void split_count(SizeType s) noexcept;
void inc_split_count() noexcept;
void dec_split_count() noexcept;
iterator iterator_to(reference value) noexcept(!linear_buckets);
const_iterator iterator_to(const_reference value) const noexcept(!linear_buckets);
iterator iterator_to(reference value, unspecified);
const_iterator iterator_to(const_reference value, unspecified) const;
bucket_type & priv_hash_to_bucket(std::size_t hash_value) const;
bucket_ptr priv_hash_to_bucket_ptr(std::size_t hash_value) const;
size_type priv_hash_to_nbucket(std::size_t hash_value) const;
size_type priv_hash_to_nbucket(std::size_t hash_value, unspecified) const;
size_type priv_hash_to_nbucket(std::size_t hash_value, unspecified) const;fastmod_buckets_t
iterator iterator_to(reference value, unspecified) noexcept;
const_iterator iterator_to(const_reference value, unspecified) const noexcept;
local_iterator local_iterator_to(reference value) noexcept;
const_local_iterator local_iterator_to(const_reference value) const noexcept;
size_type bucket_count() const noexcept;
size_type bucket_size(size_type n) const noexcept;
bucket_ptr bucket_pointer() const noexcept;
local_iterator begin(size_type n) noexcept;
const_local_iterator begin(size_type n) const noexcept;
const_local_iterator cbegin(size_type n) const noexcept;
local_iterator end(size_type n) noexcept;
const_local_iterator end(size_type n) const noexcept;
const_local_iterator cend(size_type n) const noexcept;
iterator begin() noexcept;
const_iterator begin() const noexcept;
const_iterator cbegin() const noexcept;
hasher hash_function() const;
key_equal key_eq() const;
hashdata_internal
public static functionsstatic SizeType initial_split_from_bucket_count(SizeType bc) noexcept;
static SizeType rehash_split_from_bucket_count(SizeType bc) noexcept;
static local_iterator s_local_iterator_to(reference value) noexcept;
static const_local_iterator s_local_iterator_to(const_reference value) noexcept;
static size_type suggested_upper_bucket_count(size_type n) noexcept;
static size_type suggested_lower_bucket_count(size_type n) noexcept;