Public Member Functions

QMultiHash< Key, T > Class Template Reference

Search for all occurrences

Detailed Description

template<class Key, class T>
class QMultiHash< Key, T >

Definition at line 922 of file qhash.h.

#include <qhash.h>

Inheritance diagram for QMultiHash< Key, T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  QMultiHash ()
  QMultiHash (const QHash< Key, T > &other)
QHash< Key, T >::iterator  replace (const Key &key, const T &value)
QHash< Key, T >::iterator  insert (const Key &key, const T &value)
QMultiHash operator+= (const QMultiHash &other)
QMultiHash  operator+ (const QMultiHash &other) const
bool  contains (const Key &key, const T &value) const
int  remove (const Key &key, const T &value)
int  count (const Key &key, const T &value) const
QHash< Key, T >::iterator  find (const Key &key, const T &value)
QHash< Key, T >::const_iterator  find (const Key &key, const T &value) const
QHash< Key, T >::const_iterator  constFind (const Key &key, const T &value) const

Constructor & Destructor Documentation

QMultiHash ( ) [inline]

Definition at line 925 of file qhash.h.

{}
QMultiHash ( const QHash< Key, T > &  other ) [inline]

Definition at line 926 of file qhash.h.

: QHash<Key, T>(other) {}

Member Function Documentation

QHash<Key, T>::iterator replace ( const Key &  key,
const T &  value 
) [inline]

Definition at line 928 of file qhash.h.

QHash<Key, T>::iterator insert ( const Key &  key,
const T &  value 
) [inline]

Reimplemented from QHash< Key, T >.

Definition at line 931 of file qhash.h.

QMultiHash& operator+= ( const QMultiHash< Key, T > &  other ) [inline]

Definition at line 934 of file qhash.h.

    { this->unite(other); return *this; }
QMultiHash operator+ ( const QMultiHash< Key, T > &  other ) const [inline]

Definition at line 936 of file qhash.h.

    { QMultiHash result = *this; result += other; return result; }
Q_INLINE_TEMPLATE bool contains ( const Key &  key,
const T &  value 
) const

Definition at line 997 of file qhash.h.

Q_INLINE_TEMPLATE int remove ( const Key &  key,
const T &  value 
)

Definition at line 1003 of file qhash.h.

{
    int n = 0;
    typename QHash<Key, T>::iterator i(find(key));
    typename QHash<Key, T>::iterator end(QHash<Key, T>::end());
    while (i != end && i.key() == key) {
        if (i.value() == value) {
            i = this->erase(i);
            ++n;
        } else {
            ++i;
        }
    }
    return n;
}
Q_INLINE_TEMPLATE int count ( const Key &  key,
const T &  value 
) const

Definition at line 1020 of file qhash.h.

{
    int n = 0;
    typename QHash<Key, T>::const_iterator i(constFind(key));
    typename QHash<Key, T>::const_iterator end(QHash<Key, T>::constEnd());
    while (i != end && i.key() == key) {
        if (i.value() == value)
            ++n;
        ++i;
    }
    return n;
}
QHash<Key, T>::iterator find ( const Key &  key,
const T &  value 
) [inline]

Definition at line 969 of file qhash.h.

                                                                        {
        typename QHash<Key, T>::iterator i(find(key));
        typename QHash<Key, T>::iterator end(this->end());
        while (i != end && i.key() == key) {
            if (i.value() == value)
                return i;
            ++i;
        }
        return end;
    }
QHash<Key, T>::const_iterator find ( const Key &  key,
const T &  value 
) const [inline]

Definition at line 979 of file qhash.h.

                                                                                    {
        typename QHash<Key, T>::const_iterator i(constFind(key));
        typename QHash<Key, T>::const_iterator end(QHash<Key, T>::constEnd());
        while (i != end && i.key() == key) {
            if (i.value() == value)
                return i;
            ++i;
        }
        return end;
    }
QHash<Key, T>::const_iterator constFind ( const Key &  key,
const T &  value 
) const [inline]

Definition at line 989 of file qhash.h.

        { return find(key, value); }

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