QMultiHash< Key, T > Class Template Reference

QMultiHash< Key, T > Class Template Reference

#include <qcontainerfwd.h>

Class Description

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

Definition at line 58 of file qcontainerfwd.h.

+ Inheritance diagram for QMultiHash< Key, T >:

Public Member Functions

 QMultiHash ()
 
 QMultiHash (const QHash< Key, T > &other)
 
void swap (QMultiHash< 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)
 
QMultiHashoperator+= (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
 
- Public Member Functions inherited from QHash< Key, T >
 QHash ()
 
 QHash (const QHash< Key, T > &other)
 
 ~QHash ()
 
QHash< Key, T > & operator= (const QHash< Key, T > &other)
 
void swap (QHash< Key, T > &other)
 
bool operator== (const QHash< Key, T > &other) const
 
bool operator!= (const QHash< Key, T > &other) const
 
int size () const
 
bool isEmpty () const
 
int capacity () const
 
void reserve (int size)
 
void squeeze ()
 
void detach ()
 
bool isDetached () const
 
void setSharable (bool sharable)
 
bool isSharedWith (const QHash< Key, T > &other) const
 
void clear ()
 
int remove (const Key &key)
 
take (const Key &key)
 
bool contains (const Key &key) const
 
const Key key (const T &value) const
 
const Key key (const T &value, const Key &defaultKey) const
 
const T value (const Key &key) const
 
const T value (const Key &key, const T &defaultValue) const
 
T & operator[] (const Key &key)
 
const T operator[] (const Key &key) const
 
QList< Key > uniqueKeys () const
 
QList< Key > keys () const
 
QList< Key > keys (const T &value) const
 
QList< T > values () const
 
QList< T > values (const Key &key) const
 
int count (const Key &key) const
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator constBegin () const
 
iterator end ()
 
const_iterator end () const
 
const_iterator constEnd () const
 
iterator erase (iterator it)
 
int count () const
 
iterator find (const Key &key)
 
const_iterator find (const Key &key) const
 
const_iterator constFind (const Key &key) const
 
iterator insert (const Key &key, const T &value)
 
iterator insertMulti (const Key &key, const T &value)
 
QHash< Key, T > & unite (const QHash< Key, T > &other)
 
bool empty () const
 

Additional Inherited Members

- Public Types inherited from QHash< Key, T >
typedef iterator Iterator
 
typedef const_iterator ConstIterator
 
typedef T mapped_type
 
typedef Key key_type
 
typedef qptrdiff difference_type
 
typedef int size_type
 

Constructor & Destructor Documentation

QMultiHash ( )
inline

Definition at line 927 of file qhash.h.

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

Definition at line 928 of file qhash.h.

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

Member Function Documentation

void swap ( QMultiHash< Key, T > &  other)
inline

Definition at line 929 of file qhash.h.

929 { QHash<Key, T>::swap(other); } // prevent QMultiHash<->QHash swaps
void swap(QHash< Key, T > &other)
Definition: qhash.h:290
QHash<Key, T>::iterator replace ( const Key &  key,
const T &  value 
)
inline

Definition at line 931 of file qhash.h.

932  { return QHash<Key, T>::insert(key, value); }
GLsizei const GLfloat * value
Definition: GLee.h:1742
iterator insert(const Key &key, const T &value)
Definition: qhash.h:753
const Key key(const T &value) const
Definition: qhash.h:674
QHash<Key, T>::iterator insert ( const Key &  key,
const T &  value 
)
inline

Definition at line 934 of file qhash.h.

935  { return QHash<Key, T>::insertMulti(key, value); }
GLsizei const GLfloat * value
Definition: GLee.h:1742
iterator insertMulti(const Key &key, const T &value)
Definition: qhash.h:772
const Key key(const T &value) const
Definition: qhash.h:674
QMultiHash& operator+= ( const QMultiHash< Key, T > &  other)
inline

Definition at line 937 of file qhash.h.

938  { this->unite(other); return *this; }
QHash< Key, T > & unite(const QHash< Key, T > &other)
Definition: qhash.h:556
QMultiHash operator+ ( const QMultiHash< Key, T > &  other) const
inline

Definition at line 939 of file qhash.h.

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

Definition at line 1000 of file qhash.h.

1001 {
1003 }
QHash< Key, T >::const_iterator constFind(const Key &key, const T &value) const
Definition: qhash.h:992
GLsizei const GLfloat * value
Definition: GLee.h:1742
const_iterator constEnd() const
Definition: qhash.h:469
const Key key(const T &value) const
Definition: qhash.h:674
Q_INLINE_TEMPLATE int remove ( const Key &  key,
const T &  value 
)

Definition at line 1006 of file qhash.h.

1007 {
1008  int n = 0;
1009  typename QHash<Key, T>::iterator i(find(key));
1011  while (i != end && i.key() == key) {
1012  if (i.value() == value) {
1013  i = this->erase(i);
1014  ++n;
1015  } else {
1016  ++i;
1017  }
1018  }
1019  return n;
1020 }
iterator erase(iterator it)
Definition: qhash.h:827
iterator end()
Definition: qhash.h:467
const T value(const Key &key) const
Definition: qhash.h:606
GLenum GLsizei n
Definition: GLee.h:3432
GLuint GLuint end
Definition: GLee.h:872
QHash< Key, T >::iterator find(const Key &key, const T &value)
Definition: qhash.h:972
const Key key(const T &value) const
Definition: qhash.h:674
Q_INLINE_TEMPLATE int count ( const Key &  key,
const T &  value 
) const

Definition at line 1023 of file qhash.h.

1024 {
1025  int n = 0;
1028  while (i != end && i.key() == key) {
1029  if (i.value() == value)
1030  ++n;
1031  ++i;
1032  }
1033  return n;
1034 }
iterator end()
Definition: qhash.h:467
QHash< Key, T >::const_iterator constFind(const Key &key, const T &value) const
Definition: qhash.h:992
const T value(const Key &key) const
Definition: qhash.h:606
GLenum GLsizei n
Definition: GLee.h:3432
GLuint GLuint end
Definition: GLee.h:872
const Key key(const T &value) const
Definition: qhash.h:674
QHash<Key, T>::iterator find ( const Key &  key,
const T &  value 
)
inline

Definition at line 972 of file qhash.h.

972  {
973  typename QHash<Key, T>::iterator i(find(key));
974  typename QHash<Key, T>::iterator end(this->end());
975  while (i != end && i.key() == key) {
976  if (i.value() == value)
977  return i;
978  ++i;
979  }
980  return end;
981  }
iterator end()
Definition: qhash.h:467
const T value(const Key &key) const
Definition: qhash.h:606
GLuint GLuint end
Definition: GLee.h:872
QHash< Key, T >::iterator find(const Key &key, const T &value)
Definition: qhash.h:972
const Key key(const T &value) const
Definition: qhash.h:674
QHash<Key, T>::const_iterator find ( const Key &  key,
const T &  value 
) const
inline

Definition at line 982 of file qhash.h.

982  {
985  while (i != end && i.key() == key) {
986  if (i.value() == value)
987  return i;
988  ++i;
989  }
990  return end;
991  }
iterator end()
Definition: qhash.h:467
QHash< Key, T >::const_iterator constFind(const Key &key, const T &value) const
Definition: qhash.h:992
const T value(const Key &key) const
Definition: qhash.h:606
GLuint GLuint end
Definition: GLee.h:872
const Key key(const T &value) const
Definition: qhash.h:674
QHash<Key, T>::const_iterator constFind ( const Key &  key,
const T &  value 
) const
inline

Definition at line 992 of file qhash.h.

993  { return find(key, value); }
GLsizei const GLfloat * value
Definition: GLee.h:1742
QHash< Key, T >::iterator find(const Key &key, const T &value)
Definition: qhash.h:972
const Key key(const T &value) const
Definition: qhash.h:674

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