Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QHashPrivate::Data< Node > Struct Template Reference

#include <qhash.h>

+ Collaboration diagram for QHashPrivate::Data< Node >:

Classes

struct  Bucket
 
struct  InsertionResult
 

Public Types

using Key = typename Node::KeyType
 
using T = typename Node::ValueType
 
using Span = QHashPrivate::Span<Node>
 
using iterator = QHashPrivate::iterator<Node>
 

Public Member Functions

 Data (size_t reserve=0)
 
void reallocationHelper (const Data &other, size_t nSpans, bool resized)
 
 Data (const Data &other)
 
 Data (const Data &other, size_t reserved)
 
void clear ()
 
iterator detachedIterator (iterator other) const noexcept
 
iterator begin () const noexcept
 
constexpr iterator end () const noexcept
 
void rehash (size_t sizeHint=0)
 
size_t nextBucket (size_t bucket) const noexcept
 
float loadFactor () const noexcept
 
bool shouldGrow () const noexcept
 
template<typename K >
Bucket findBucket (const K &key) const noexcept
 
template<typename K >
NodefindNode (const K &key) const noexcept
 
template<typename K >
InsertionResult findOrInsert (const K &key) noexcept
 
void erase (Bucket bucket) noexcept(std::is_nothrow_destructible< Node >::value)
 
 ~Data ()
 

Static Public Member Functions

static constexpr size_t maxNumBuckets () noexcept
 
static auto allocateSpans (size_t numBuckets)
 
static Datadetached (Data *d)
 
static Datadetached (Data *d, size_t size)
 

Public Attributes

QtPrivate::RefCount ref = {{1}}
 
size_t size = 0
 
size_t numBuckets = 0
 
size_t seed = 0
 
Spanspans = nullptr
 

Detailed Description

template<typename Node>
struct QHashPrivate::Data< Node >

Definition at line 447 of file qhash.h.

Member Typedef Documentation

◆ iterator

template<typename Node >
using QHashPrivate::Data< Node >::iterator = QHashPrivate::iterator<Node>

Definition at line 452 of file qhash.h.

◆ Key

template<typename Node >
using QHashPrivate::Data< Node >::Key = typename Node::KeyType

Definition at line 449 of file qhash.h.

◆ Span

template<typename Node >
using QHashPrivate::Data< Node >::Span = QHashPrivate::Span<Node>

Definition at line 451 of file qhash.h.

◆ T

template<typename Node >
using QHashPrivate::Data< Node >::T = typename Node::ValueType

Definition at line 450 of file qhash.h.

Constructor & Destructor Documentation

◆ Data() [1/3]

template<typename Node >
QHashPrivate::Data< Node >::Data ( size_t reserve = 0)
inline

Definition at line 553 of file qhash.h.

References QHashPrivate::Data< Node >::allocateSpans(), QHashPrivate::GrowthPolicy::bucketsForCapacity(), QHashSeed::globalSeed(), QHashPrivate::Data< Node >::numBuckets, reserve(), QHashPrivate::Data< Node >::seed, and QHashPrivate::Data< Node >::spans.

+ Here is the call graph for this function:

◆ Data() [2/3]

template<typename Node >
QHashPrivate::Data< Node >::Data ( const Data< Node > & other)
inline

Definition at line 576 of file qhash.h.

References QHashPrivate::Data< Node >::allocateSpans(), QHashPrivate::Data< Node >::numBuckets, other(), QHashPrivate::Data< Node >::reallocationHelper(), and QHashPrivate::Data< Node >::spans.

+ Here is the call graph for this function:

◆ Data() [3/3]

template<typename Node >
QHashPrivate::Data< Node >::Data ( const Data< Node > & other,
size_t reserved )
inline

Definition at line 582 of file qhash.h.

References QHashPrivate::Data< Node >::allocateSpans(), QHashPrivate::GrowthPolicy::bucketsForCapacity(), QHashPrivate::Data< Node >::numBuckets, other(), qMax(), QHashPrivate::Data< Node >::reallocationHelper(), QHashPrivate::Data< Node >::spans, and QHashPrivate::SpanConstants::SpanShift.

+ Here is the call graph for this function:

◆ ~Data()

template<typename Node >
QHashPrivate::Data< Node >::~Data ( )
inline

Definition at line 770 of file qhash.h.

References QHashPrivate::Data< Node >::spans.

Member Function Documentation

◆ allocateSpans()

template<typename Node >
static auto QHashPrivate::Data< Node >::allocateSpans ( size_t numBuckets)
inlinestatic

Definition at line 534 of file qhash.h.

References QHashPrivate::Data< Node >::numBuckets, Q_CHECK_PTR(), R, and QHashPrivate::SpanConstants::SpanShift.

Referenced by QHashPrivate::Data< Node >::Data(), QHashPrivate::Data< Node >::Data(), QHashPrivate::Data< Node >::Data(), and QHashPrivate::Data< Node >::rehash().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ begin()

template<typename Node >
iterator QHashPrivate::Data< Node >::begin ( ) const
inlinenoexcept

Definition at line 622 of file qhash.h.

References it.

◆ clear()

template<typename Node >
void QHashPrivate::Data< Node >::clear ( )
inline

◆ detached() [1/2]

template<typename Node >
static Data * QHashPrivate::Data< Node >::detached ( Data< Node > * d)
inlinestatic

Definition at line 590 of file qhash.h.

References d, and Data.

Referenced by QHash< Key, T >::detach(), QMultiHash< Key, T >::detach(), QHash< Key, T >::reserve(), and QMultiHash< Key, T >::reserve().

+ Here is the caller graph for this function:

◆ detached() [2/2]

template<typename Node >
static Data * QHashPrivate::Data< Node >::detached ( Data< Node > * d,
size_t size )
inlinestatic

Definition at line 599 of file qhash.h.

References d, and Data.

◆ detachedIterator()

template<typename Node >
iterator QHashPrivate::Data< Node >::detachedIterator ( iterator other) const
inlinenoexcept

Definition at line 617 of file qhash.h.

References other().

+ Here is the call graph for this function:

◆ end()

template<typename Node >
constexpr iterator QHashPrivate::Data< Node >::end ( ) const
inlineconstexprnoexcept

Definition at line 630 of file qhash.h.

◆ erase()

template<typename Node >
void QHashPrivate::Data< Node >::erase ( Bucket bucket)
inlinenoexcept

Definition at line 735 of file qhash.h.

References QHashPrivate::GrowthPolicy::bucketForHash(), QHashPrivate::calculateHash(), hash, next, QHashPrivate::Data< Node >::numBuckets, Q_ASSERT, QHashPrivate::Data< Node >::seed, QHashPrivate::Data< Node >::size, and QHashPrivate::SpanConstants::UnusedEntry.

+ Here is the call graph for this function:

◆ findBucket()

template<typename Node >
template<typename K >
Bucket QHashPrivate::Data< Node >::findBucket ( const K & key) const
inlinenoexcept

Definition at line 680 of file qhash.h.

References QHashPrivate::Data< Node >::Bucket::advanceWrapped(), QHashPrivate::GrowthPolicy::bucketForHash(), QHashPrivate::calculateHash(), hash, QHashPrivate::Data< Node >::Bucket::nodeAtOffset(), QHashPrivate::Data< Node >::numBuckets, QHashPrivate::Data< Node >::Bucket::offset(), Q_ASSERT, qHashEquals(), QHashPrivate::Data< Node >::seed, and QHashPrivate::SpanConstants::UnusedEntry.

Referenced by QHashPrivate::Data< Node >::findNode(), QHashPrivate::Data< Node >::findOrInsert(), QHashPrivate::Data< Node >::reallocationHelper(), and QHashPrivate::Data< Node >::rehash().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findNode()

template<typename Node >
template<typename K >
Node * QHashPrivate::Data< Node >::findNode ( const K & key) const
inlinenoexcept

Definition at line 702 of file qhash.h.

References QHashPrivate::Data< Node >::findBucket().

+ Here is the call graph for this function:

◆ findOrInsert()

template<typename Node >
template<typename K >
InsertionResult QHashPrivate::Data< Node >::findOrInsert ( const K & key)
inlinenoexcept

Definition at line 716 of file qhash.h.

References QHashPrivate::Data< Node >::findBucket(), QSet< T >::insert(), it, QHashPrivate::Data< Node >::numBuckets, Q_ASSERT, QHashPrivate::Data< Node >::rehash(), QHashPrivate::Data< Node >::shouldGrow(), and QHashPrivate::Data< Node >::size.

+ Here is the call graph for this function:

◆ loadFactor()

template<typename Node >
float QHashPrivate::Data< Node >::loadFactor ( ) const
inlinenoexcept

Definition at line 671 of file qhash.h.

References QHashPrivate::Data< Node >::numBuckets.

◆ maxNumBuckets()

template<typename Node >
static constexpr size_t QHashPrivate::Data< Node >::maxNumBuckets ( )
inlinestaticconstexprnoexcept

Definition at line 460 of file qhash.h.

Referenced by QHash< Key, T >::max_bucket_count(), and QMultiHash< Key, T >::max_bucket_count().

+ Here is the caller graph for this function:

◆ nextBucket()

template<typename Node >
size_t QHashPrivate::Data< Node >::nextBucket ( size_t bucket) const
inlinenoexcept

Definition at line 663 of file qhash.h.

References QHashPrivate::Data< Node >::numBuckets.

◆ reallocationHelper()

template<typename Node >
void QHashPrivate::Data< Node >::reallocationHelper ( const Data< Node > & other,
size_t nSpans,
bool resized )
inline

Definition at line 560 of file qhash.h.

References QHashPrivate::Data< Node >::findBucket(), QSet< T >::insert(), it, QHashPrivate::SpanConstants::NEntries, other(), Q_ASSERT, and QHashPrivate::Data< Node >::spans.

Referenced by QHashPrivate::Data< Node >::Data(), and QHashPrivate::Data< Node >::Data().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rehash()

template<typename Node >
void QHashPrivate::Data< Node >::rehash ( size_t sizeHint = 0)
inline

Definition at line 635 of file qhash.h.

References QHashPrivate::Data< Node >::allocateSpans(), QHashPrivate::GrowthPolicy::bucketsForCapacity(), QHashPrivate::Data< Node >::findBucket(), QSet< T >::insert(), it, QHashPrivate::SpanConstants::NEntries, QHashPrivate::Data< Node >::numBuckets, Q_ASSERT, QHashPrivate::Data< Node >::size, QHashPrivate::Data< Node >::spans, and QHashPrivate::SpanConstants::SpanShift.

Referenced by QHashPrivate::Data< Node >::findOrInsert().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shouldGrow()

template<typename Node >
bool QHashPrivate::Data< Node >::shouldGrow ( ) const
inlinenoexcept

Definition at line 675 of file qhash.h.

References QHashPrivate::Data< Node >::numBuckets.

Referenced by QHashPrivate::Data< Node >::findOrInsert().

+ Here is the caller graph for this function:

Member Data Documentation

◆ numBuckets

◆ ref

template<typename Node >
QtPrivate::RefCount QHashPrivate::Data< Node >::ref = {{1}}

Definition at line 454 of file qhash.h.

◆ seed

template<typename Node >
size_t QHashPrivate::Data< Node >::seed = 0

◆ size

◆ spans


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