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
QStringHash< T > Class Template Reference

#include <qstringhash_p.h>

+ Inheritance diagram for QStringHash< T >:
+ Collaboration diagram for QStringHash< T >:

Classes

class  Iterator
 
struct  NewedNode
 
struct  Node
 
struct  ReservedNodePool
 

Public Types

typedef QHashedString key_type
 
typedef T mapped_type
 
using MutableIteratorData = QStringHashData::IteratorData<QStringHash<T>>
 
using ConstIteratorData = QStringHashData::IteratorData<const QStringHash<T>>
 
using MutableIterator = Iterator<MutableIteratorData, T>
 
using ConstIterator = Iterator<ConstIteratorData, const T>
 

Public Member Functions

template<typename K >
NodefindNode (const K &) const
 
NodecreateNode (const Node &o)
 
template<typename K >
NodecreateNode (const K &, const T &)
 
NodeinsertNode (Node *, quint32)
 
void initializeNode (Node *, const QHashedString &key)
 
void initializeNode (Node *, const QHashedCStringRef &key)
 
template<typename K >
NodetakeNode (const K &key, const T &value)
 
NodetakeNode (const Node &o)
 
void copy (const QStringHash< T > &)
 
void copyNode (const QStringHashNode *otherNode)
 
 QStringHash ()
 
 QStringHash (const QStringHash &)
 
 ~QStringHash ()
 
QStringHashoperator= (const QStringHash< T > &)
 
void copyAndReserve (const QStringHash< T > &other, int additionalReserve)
 
bool isEmpty () const
 
void clear ()
 
int count () const
 
int numBuckets () const
 
template<typename K >
void insert (const K &, const T &)
 
void insert (const MutableIterator &)
 
void insert (const ConstIterator &)
 
template<typename K >
T * value (const K &) const
 
T * value (const QV4::String *string) const
 
T * value (const MutableIterator &) const
 
T * value (const ConstIterator &) const
 
template<typename K >
bool contains (const K &) const
 
template<typename K >
T & operator[] (const K &)
 
MutableIterator begin ()
 
ConstIterator begin () const
 
ConstIterator constBegin () const
 
MutableIterator end ()
 
ConstIterator end () const
 
ConstIterator constEnd () const
 
template<typename K >
MutableIterator find (const K &)
 
template<typename K >
ConstIterator find (const K &) const
 
void reserve (int)
 

Static Public Member Functions

template<typename StringHash , typename Data >
static Data iterateFirst (StringHash *self)
 
template<typename Data >
static Data iterateNext (const Data &)
 
- Static Public Member Functions inherited from QStringHashBase
static HashedForm< QString >::Type hashedString (const QString &s)
 
static HashedForm< QStringView >::Type hashedString (QStringView s)
 
static HashedForm< QHashedString >::Type hashedString (const QHashedString &s)
 
static HashedForm< QV4::String * >::Type hashedString (QV4::String *s)
 
static HashedForm< constQV4::String * >::Type hashedString (const QV4::String *s)
 
static HashedForm< QHashedStringRef >::Type hashedString (const QHashedStringRef &s)
 
static HashedForm< QLatin1StringView >::Type hashedString (QLatin1StringView s)
 
static HashedForm< QHashedCStringRef >::Type hashedString (const QHashedCStringRef &s)
 
static const QStringtoQString (const QString &s)
 
static const QStringtoQString (const QHashedString &s)
 
static QString toQString (const QV4::String *s)
 
static QString toQString (const QHashedStringRef &s)
 
static QString toQString (const QLatin1String &s)
 
static QString toQString (const QHashedCStringRef &s)
 
static quint32 hashOf (const QHashedStringRef &s)
 
static quint32 hashOf (QV4::String *s)
 
static quint32 hashOf (const QV4::String *s)
 
template<typename K >
static quint32 hashOf (const K &key)
 

Public Attributes

QStringHashData data
 
NewedNodenewedNodes
 
ReservedNodePoolnodePool
 

Detailed Description

template<class T>
class QStringHash< T >

Definition at line 270 of file qstringhash_p.h.

Member Typedef Documentation

◆ ConstIterator

template<class T >
using QStringHash< T >::ConstIterator = Iterator<ConstIteratorData, const T>

Definition at line 376 of file qstringhash_p.h.

◆ ConstIteratorData

template<class T >
using QStringHash< T >::ConstIteratorData = QStringHashData::IteratorData<const QStringHash<T>>

Definition at line 277 of file qstringhash_p.h.

◆ key_type

template<class T >
typedef QHashedString QStringHash< T >::key_type

Definition at line 273 of file qstringhash_p.h.

◆ mapped_type

template<class T >
typedef T QStringHash< T >::mapped_type

Definition at line 274 of file qstringhash_p.h.

◆ MutableIterator

template<class T >
using QStringHash< T >::MutableIterator = Iterator<MutableIteratorData, T>

Definition at line 375 of file qstringhash_p.h.

◆ MutableIteratorData

template<class T >
using QStringHash< T >::MutableIteratorData = QStringHashData::IteratorData<QStringHash<T>>

Definition at line 276 of file qstringhash_p.h.

Constructor & Destructor Documentation

◆ QStringHash() [1/2]

template<class T >
QStringHash< T >::QStringHash ( )
inline

Definition at line 413 of file qstringhash_p.h.

◆ QStringHash() [2/2]

template<class T >
QStringHash< T >::QStringHash ( const QStringHash< T > & other)
inline

Definition at line 419 of file qstringhash_p.h.

References QStringHash< T >::copy(), other(), and QStringHash< T >::reserve().

+ Here is the call graph for this function:

◆ ~QStringHash()

template<class T >
QStringHash< T >::~QStringHash ( )
inline

Definition at line 454 of file qstringhash_p.h.

References clear().

+ Here is the call graph for this function:

Member Function Documentation

◆ begin() [1/2]

template<class T >
QStringHash< T >::MutableIterator QStringHash< T >::begin ( )
inline

Definition at line 762 of file qstringhash_p.h.

Referenced by QStringHash< T >::constBegin(), QQmlTypeModule::remove(), and QQmlTypeModule::walkCompositeSingletons().

+ Here is the caller graph for this function:

◆ begin() [2/2]

template<class T >
QStringHash< T >::ConstIterator QStringHash< T >::begin ( ) const
inline

Definition at line 768 of file qstringhash_p.h.

◆ clear()

template<class T >
void QStringHash< T >::clear ( )
inline

Definition at line 460 of file qstringhash_p.h.

References QStringHash< T >::NewedNode::nextNewed.

Referenced by QLinkedStringHash< T >::clear(), and QQmlTypeLoader::clearCache().

+ Here is the caller graph for this function:

◆ constBegin()

template<class T >
ConstIterator QStringHash< T >::constBegin ( ) const
inline

Definition at line 397 of file qstringhash_p.h.

References QStringHash< T >::begin().

+ Here is the call graph for this function:

◆ constEnd()

template<class T >
ConstIterator QStringHash< T >::constEnd ( ) const
inline

Definition at line 401 of file qstringhash_p.h.

References QStringHash< T >::end().

+ Here is the call graph for this function:

◆ contains()

template<class T >
template<class K >
bool QStringHash< T >::contains ( const K & key) const
inline

Definition at line 733 of file qstringhash_p.h.

Referenced by QQmlTypeNameCache::add(), and QQmlTypeNameCache::add().

+ Here is the caller graph for this function:

◆ copy()

template<class T >
void QStringHash< T >::copy ( const QStringHash< T > & other)
inline

Definition at line 579 of file qstringhash_p.h.

References i, other(), and Q_ASSERT.

Referenced by QStringHash< T >::QStringHash(), and QLinkedStringHash< T >::linkAndReserve().

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

◆ copyAndReserve()

template<class T >
void QStringHash< T >::copyAndReserve ( const QStringHash< T > & other,
int additionalReserve )

Definition at line 445 of file qstringhash_p.h.

References clear(), copy(), other(), and reserve().

+ Here is the call graph for this function:

◆ copyNode()

template<class T >
void QStringHash< T >::copyNode ( const QStringHashNode * otherNode)

Definition at line 565 of file qstringhash_p.h.

References next.

◆ count()

template<class T >
int QStringHash< T >::count ( ) const
inline

Definition at line 489 of file qstringhash_p.h.

◆ createNode() [1/2]

template<class T >
template<class K >
QStringHash< T >::Node * QStringHash< T >::createNode ( const K & key,
const T & value )
inline

Definition at line 647 of file qstringhash_p.h.

◆ createNode() [2/2]

template<class T >
QStringHash< T >::Node * QStringHash< T >::createNode ( const Node & o)
inline

Definition at line 639 of file qstringhash_p.h.

References o.

Referenced by QLinkedStringMultiHash< T >::insert(), QLinkedStringHash< T >::insert(), and QLinkedStringMultiHash< T >::insert().

+ Here is the caller graph for this function:

◆ end() [1/2]

template<class T >
QStringHash< T >::MutableIterator QStringHash< T >::end ( )
inline

Definition at line 774 of file qstringhash_p.h.

Referenced by QStringHash< T >::constEnd(), QQmlTypeModule::remove(), and QQmlTypeModule::walkCompositeSingletons().

+ Here is the caller graph for this function:

◆ end() [2/2]

template<class T >
QStringHash< T >::ConstIterator QStringHash< T >::end ( ) const
inline

Definition at line 780 of file qstringhash_p.h.

◆ find() [1/2]

template<class T >
template<class K >
QStringHash< T >::MutableIterator QStringHash< T >::find ( const K & key)
inline

Definition at line 787 of file qstringhash_p.h.

◆ find() [2/2]

template<class T >
template<class K >
QStringHash< T >::ConstIterator QStringHash< T >::find ( const K & key) const
inline

Definition at line 795 of file qstringhash_p.h.

◆ findNode()

template<class T >
template<class K >
QStringHash< T >::Node * QStringHash< T >::findNode ( const K & key) const
inline

Definition at line 693 of file qstringhash_p.h.

References QTaggedPointer< T, Tag >::data(), QStringHashNode::equals(), and QStringHashNode::next.

Referenced by QLinkedStringHash< T >::insert().

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

◆ initializeNode() [1/2]

template<class T >
void QStringHash< T >::initializeNode ( Node * node,
const QHashedCStringRef & key )
inline

◆ initializeNode() [2/2]

template<class T >
void QStringHash< T >::initializeNode ( Node * node,
const QHashedString & key )
inline

Definition at line 501 of file qstringhash_p.h.

References QStringHashNode::arrayData, QStringHashNode::hash, QStringHashNode::length, mutableStringData(), QArrayData::ref(), QStringHashNode::setQString(), and QStringHashNode::strData.

+ Here is the call graph for this function:

◆ insert() [1/3]

template<class T >
void QStringHash< T >::insert ( const ConstIterator & iter)
inline

Definition at line 686 of file qstringhash_p.h.

References insert(), and iter.

+ Here is the call graph for this function:

◆ insert() [2/3]

template<class T >
template<class K >
void QStringHash< T >::insert ( const K & key,
const T & value )
inline

Definition at line 670 of file qstringhash_p.h.

Referenced by QQmlTypeNameCache::add(), QQmlTypeNameCache::add(), QQmlImportDatabase::locateLocalQmldir(), QQmlTypeLoader::qmldirContent(), and QQmlTypeLoader::setQmldirContent().

+ Here is the caller graph for this function:

◆ insert() [3/3]

template<class T >
void QStringHash< T >::insert ( const MutableIterator & iter)
inline

Definition at line 680 of file qstringhash_p.h.

References insert(), and iter.

+ Here is the call graph for this function:

◆ insertNode()

template<class T >
QStringHash< T >::Node * QStringHash< T >::insertNode ( Node * n,
quint32 hash )
inline

Definition at line 654 of file qstringhash_p.h.

References hash.

◆ isEmpty()

template<class T >
bool QStringHash< T >::isEmpty ( ) const
inline

Definition at line 483 of file qstringhash_p.h.

Referenced by QQmlTypeNameCache::isEmpty().

+ Here is the caller graph for this function:

◆ iterateFirst()

template<class T >
template<typename StringHash , typename Data >
Data QStringHash< T >::iterateFirst ( StringHash * self)
inlinestatic

Definition at line 624 of file qstringhash_p.h.

References Data.

◆ iterateNext()

template<class T >
template<typename Data >
Data QStringHash< T >::iterateNext ( const Data & d)
inlinestatic

Definition at line 598 of file qstringhash_p.h.

References d, and Data.

Referenced by QLinkedStringHash< T >::iterateNext(), and QStringHash< T >::Iterator< Data, Value >::operator++().

+ Here is the caller graph for this function:

◆ numBuckets()

template<class T >
int QStringHash< T >::numBuckets ( ) const
inline

Definition at line 495 of file qstringhash_p.h.

◆ operator=()

template<class T >
QStringHash< T > & QStringHash< T >::operator= ( const QStringHash< T > & other)

Definition at line 429 of file qstringhash_p.h.

References clear(), copy(), other(), and reserve().

+ Here is the call graph for this function:

◆ operator[]()

template<class T >
template<class K >
T & QStringHash< T >::operator[] ( const K & key)
inline

Definition at line 740 of file qstringhash_p.h.

◆ reserve()

template<class T >
void QStringHash< T >::reserve ( int n)
inline

Definition at line 748 of file qstringhash_p.h.

References QStringHash< T >::ReservedNodePool::count.

Referenced by QStringHash< T >::QStringHash(), and QLinkedStringHash< T >::linkAndReserve().

+ Here is the caller graph for this function:

◆ takeNode() [1/2]

template<class T >
template<class K >
QStringHash< T >::Node * QStringHash< T >::takeNode ( const K & key,
const T & value )
inline

Definition at line 522 of file qstringhash_p.h.

◆ takeNode() [2/2]

template<class T >
QStringHash< T >::Node * QStringHash< T >::takeNode ( const Node & o)
inline

Definition at line 538 of file qstringhash_p.h.

References QStringHashNode::length, and o.

◆ value() [1/4]

template<class T >
T * QStringHash< T >::value ( const ConstIterator & iter) const
inline

Definition at line 719 of file qstringhash_p.h.

References iter.

◆ value() [2/4]

template<class T >
template<class K >
T * QStringHash< T >::value ( const K & key) const
inline

◆ value() [3/4]

template<typename T >
T * QStringHash< T >::value ( const MutableIterator & iter) const
inline

Definition at line 713 of file qstringhash_p.h.

References iter.

◆ value() [4/4]

template<class T >
T * QStringHash< T >::value ( const QV4::String * string) const
inline

Definition at line 725 of file qstringhash_p.h.

Member Data Documentation

◆ data

template<class T >
QStringHashData QStringHash< T >::data

Definition at line 301 of file qstringhash_p.h.

◆ newedNodes

template<class T >
NewedNode* QStringHash< T >::newedNodes

Definition at line 302 of file qstringhash_p.h.

◆ nodePool

template<class T >
ReservedNodePool* QStringHash< T >::nodePool

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