QMap< Key, T > Class Template Reference
#include <audiodataoutput.h>
template<class Key, class T>
class QMap< Key, T >
Definition at line 34 of file audiodataoutput.h.
|
| QMap () |
|
| QMap (const QMap< Key, T > &other) |
|
| ~QMap () |
|
QMap< Key, T > & | operator= (const QMap< Key, T > &other) |
|
void | swap (QMap< Key, T > &other) |
|
| QMap (const typename std::map< Key, T > &other) |
|
std::map< Key, T > | toStdMap () const |
|
bool | operator== (const QMap< Key, T > &other) const |
|
bool | operator!= (const QMap< Key, T > &other) const |
|
int | size () const |
|
bool | isEmpty () const |
|
void | detach () |
|
bool | isDetached () const |
|
void | setSharable (bool sharable) |
|
bool | isSharedWith (const QMap< Key, T > &other) const |
|
void | setInsertInOrder (bool ordered) |
|
void | clear () |
|
int | remove (const Key &key) |
|
T | 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 | lowerBound (const Key &key) |
|
const_iterator | lowerBound (const Key &key) const |
|
iterator | upperBound (const Key &key) |
|
const_iterator | upperBound (const Key &key) const |
|
iterator | insert (const Key &key, const T &value) |
|
iterator | insertMulti (const Key &key, const T &value) |
|
QMap< Key, T > & | unite (const QMap< Key, T > &other) |
|
bool | empty () const |
|
Definition at line 182 of file qmap.h.
static QMapData shared_null
QMap |
( |
const typename std::map< Key, T > & |
other | ) |
|
|
explicit |
Q_INLINE_TEMPLATE QMap< Key, T > & operator= |
( |
const QMap< Key, T > & |
other | ) |
|
Definition at line 192 of file qmap.h.
Q_INLINE_TEMPLATE void qSwap(QScopedPointer< T, Cleanup > &p1, QScopedPointer< T, Cleanup > &p2)
Q_OUTOFLINE_TEMPLATE std::map< Key, T > toStdMap |
( |
| ) |
const |
Definition at line 959 of file qmap.h.
961 std::map<Key, T>
map;
963 while (it !=
begin()) {
965 map.insert(std::pair<Key, T>(it.key(), it.value()));
friend class const_iterator
QFuture< void > map(Sequence &sequence, MapFunctor map)
Q_OUTOFLINE_TEMPLATE bool operator== |
( |
const QMap< Key, T > & |
other | ) |
const |
Definition at line 925 of file qmap.h.
935 while (it1 !=
end()) {
friend class const_iterator
bool qMapLessThanKey(const Key &key1, const Key &key2)
bool operator!= |
( |
const QMap< Key, T > & |
other | ) |
const |
|
inline |
Definition at line 199 of file qmap.h.
199 {
return !(*
this == other); }
Definition at line 205 of file qmap.h.
205 {
if (
d->
ref != 1) detach_helper(); }
bool isDetached |
( |
| ) |
const |
|
inline |
Definition at line 206 of file qmap.h.
206 {
return d->
ref == 1; }
void setSharable |
( |
bool |
sharable | ) |
|
|
inline |
bool isSharedWith |
( |
const QMap< Key, T > & |
other | ) |
const |
|
inline |
Definition at line 208 of file qmap.h.
208 {
return d == other.
d; }
void setInsertInOrder |
( |
bool |
ordered | ) |
|
|
inline |
Q_INLINE_TEMPLATE void clear |
( |
| ) |
|
Q_OUTOFLINE_TEMPLATE int remove |
( |
const Key & |
key | ) |
|
Definition at line 662 of file qmap.h.
669 int oldSize =
d->
size;
672 while ((next = cur->
forward[i]) !=
e && qMapLessThanKey<Key>(concrete(next)->
key, akey))
677 if (next !=
e && !qMapLessThanKey<Key>(akey, concrete(next)->
key)) {
678 bool deleteNext =
true;
682 deleteNext = (next !=
e && !qMapLessThanKey<Key>(concrete(cur)->
key, concrete(next)->
key));
683 concrete(cur)->
key.~Key();
684 concrete(cur)->
value.~T();
686 }
while (deleteNext);
688 return oldSize -
d->
size;
const Key key(const T &value) const
void node_delete(Node *update[], int offset, Node *node)
Q_OUTOFLINE_TEMPLATE T take |
( |
const Key & |
key | ) |
|
Definition at line 692 of file qmap.h.
701 while ((next = cur->
forward[i]) !=
e && qMapLessThanKey<Key>(concrete(next)->
key, akey))
706 if (next !=
e && !qMapLessThanKey<Key>(akey, concrete(next)->
key)) {
707 T
t = concrete(next)->
value;
708 concrete(next)->
key.~Key();
709 concrete(next)->
value.~T();
const Key key(const T &value) const
void node_delete(Node *update[], int offset, Node *node)
Q_INLINE_TEMPLATE bool contains |
( |
const Key & |
key | ) |
const |
Definition at line 553 of file qmap.h.
555 return findNode(akey) !=
e;
Q_OUTOFLINE_TEMPLATE const Key key |
( |
const T & |
value | ) |
const |
Definition at line 844 of file qmap.h.
846 return key(avalue,
Key());
const Key key(const T &value) const
Q_OUTOFLINE_TEMPLATE const Key key |
( |
const T & |
value, |
|
|
const Key & |
defaultKey |
|
) |
| const |
Definition at line 850 of file qmap.h.
854 if (i.value() == avalue)
friend class const_iterator
Q_INLINE_TEMPLATE const T value |
( |
const Key & |
key | ) |
const |
Definition at line 499 of file qmap.h.
502 if (
d->
size == 0 || (node = findNode(akey)) ==
e) {
505 return concrete(node)->
value;
Q_INLINE_TEMPLATE const T value |
( |
const Key & |
key, |
|
|
const T & |
defaultValue |
|
) |
| const |
Definition at line 510 of file qmap.h.
513 if (
d->
size == 0 || (node = findNode(akey)) ==
e) {
514 return adefaultValue;
516 return concrete(node)->
value;
Q_INLINE_TEMPLATE T & operator[] |
( |
const Key & |
key | ) |
|
Definition at line 527 of file qmap.h.
534 node = node_create(
d, update, akey, T());
535 return concrete(node)->
value;
Q_INLINE_TEMPLATE const T operator[] |
( |
const Key & |
key | ) |
const |
Definition at line 521 of file qmap.h.
const T value(const Key &key) const
Q_OUTOFLINE_TEMPLATE QList< Key > uniqueKeys |
( |
| ) |
const |
Definition at line 798 of file qmap.h.
805 const Key &aKey = i.key();
809 goto break_out_of_outer_loop;
810 }
while (!(aKey < i.key()));
813 break_out_of_outer_loop:
friend class const_iterator
Q_OUTOFLINE_TEMPLATE QList< Key > keys |
( |
| ) |
const |
Definition at line 818 of file qmap.h.
friend class const_iterator
Q_OUTOFLINE_TEMPLATE QList< Key > keys |
( |
const T & |
value | ) |
const |
Definition at line 831 of file qmap.h.
836 if (i.value() == avalue)
friend class const_iterator
Definition at line 863 of file qmap.h.
friend class const_iterator
Q_OUTOFLINE_TEMPLATE QList< T > values |
( |
const Key & |
key | ) |
const |
Definition at line 876 of file qmap.h.
884 }
while (node !=
e && !qMapLessThanKey<Key>(akey, concrete(node)->
key));
const Key key(const T &value) const
GLsizei const GLfloat * value
Q_INLINE_TEMPLATE int count |
( |
const Key & |
key | ) |
const |
Definition at line 539 of file qmap.h.
547 }
while (node !=
e && !qMapLessThanKey<Key>(akey, concrete(node)->
key));
const Key key(const T &value) const
Definition at line 373 of file qmap.h.
friend class const_iterator
Definition at line 374 of file qmap.h.
friend class const_iterator
Definition at line 379 of file qmap.h.
friend class const_iterator
Definition at line 380 of file qmap.h.
friend class const_iterator
Definition at line 717 of file qmap.h.
727 while ((next = cur->
forward[i]) !=
e && qMapLessThanKey<Key>(concrete(next)->
key, it.key()))
736 concrete(cur)->
key.~Key();
737 concrete(cur)->
value.~T();
743 if (update[i]->forward[i] != cur)
const Key key(const T &value) const
void node_delete(Node *update[], int offset, Node *node)
Q_INLINE_TEMPLATE QMap< Key, T >::iterator find |
( |
const Key & |
key | ) |
|
Definition at line 606 of file qmap.h.
friend class const_iterator
Definition at line 612 of file qmap.h.
friend class const_iterator
Q_INLINE_TEMPLATE QMap< Key, T >::iterator lowerBound |
( |
const Key & |
key | ) |
|
Definition at line 899 of file qmap.h.
iterator lowerBound(const Key &key)
Definition at line 891 of file qmap.h.
894 mutableFindNode(update, akey);
friend class const_iterator
Q_INLINE_TEMPLATE QMap< Key, T >::iterator upperBound |
( |
const Key & |
key | ) |
|
Definition at line 918 of file qmap.h.
iterator upperBound(const Key &key)
Definition at line 907 of file qmap.h.
910 mutableFindNode(update, akey);
912 while (node !=
e && !qMapLessThanKey<Key>(akey, concrete(node)->
key))
friend class const_iterator
const Key key(const T &value) const
Q_INLINE_TEMPLATE QMap< Key, T >::iterator insert |
( |
const Key & |
key, |
|
|
const T & |
value |
|
) |
| |
Definition at line 559 of file qmap.h.
567 node = node_create(
d, update, akey, avalue);
569 concrete(node)->
value = avalue;
Q_INLINE_TEMPLATE QMap< Key, T >::iterator insertMulti |
( |
const Key & |
key, |
|
|
const T & |
value |
|
) |
| |
Definition at line 595 of file qmap.h.
601 mutableFindNode(update, akey);
602 return iterator(node_create(
d, update, akey, avalue));
Q_INLINE_TEMPLATE QMap< Key, T > & unite |
( |
const QMap< Key, T > & |
other | ) |
|
Definition at line 625 of file qmap.h.
friend class const_iterator
iterator insertMulti(const Key &key, const T &value)
The documentation for this class was generated from the following files: