Public Member Functions

QMultiMap< Key, T > Class Template Reference

Search for all occurrences

Detailed Description

template<class Key, class T>
class QMultiMap< Key, T >

Definition at line 969 of file qmap.h.

#include <qmap.h>

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

List of all members.

Public Member Functions

  QMultiMap ()
  QMultiMap (const QMap< Key, T > &other)
QMap< Key, T >::iterator  replace (const Key &key, const T &value)
QMap< Key, T >::iterator  insert (const Key &key, const T &value)
QMultiMap operator+= (const QMultiMap &other)
QMultiMap  operator+ (const QMultiMap &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
QMap< Key, T >::iterator  find (const Key &key, const T &value)
QMap< Key, T >::const_iterator  find (const Key &key, const T &value) const
QMap< Key, T >::const_iterator  constFind (const Key &key, const T &value) const

Constructor & Destructor Documentation

QMultiMap ( ) [inline]

Definition at line 972 of file qmap.h.

{}
QMultiMap ( const QMap< Key, T > &  other ) [inline]

Definition at line 973 of file qmap.h.

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

Member Function Documentation

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

Definition at line 975 of file qmap.h.

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

Reimplemented from QMap< Key, T >.

Definition at line 977 of file qmap.h.

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

Definition at line 980 of file qmap.h.

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

Definition at line 982 of file qmap.h.

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

Definition at line 1043 of file qmap.h.

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

Definition at line 1049 of file qmap.h.

{
    int n = 0;
    typename QMap<Key, T>::iterator i(find(key));
    typename QMap<Key, T>::iterator end(QMap<Key, T>::end());
    while (i != end && !qMapLessThanKey<Key>(key, i.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 1066 of file qmap.h.

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

Definition at line 1015 of file qmap.h.

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

Definition at line 1025 of file qmap.h.

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

Definition at line 1035 of file qmap.h.

        { return find(key, value); }

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