#include <qhash.h>
Classes |
|
| struct | Node |
Public Member Functions |
|
| void * | allocateNode () |
| void * | allocateNode (int nodeAlign) |
| void | freeNode (void *node) |
| QHashData * | detach_helper (void(*node_duplicate)(Node *, void *), int nodeSize) |
| QHashData * | detach_helper2 (void(*node_duplicate)(Node *, void *), void(*node_delete)(Node *), int nodeSize, int nodeAlign) |
| void | mightGrow () |
| bool | willGrow () |
| void | hasShrunk () |
| void | rehash (int hint) |
| void | free_helper (void(*node_delete)(Node *)) |
| void | destroyAndFree () |
| Node * | firstNode () |
Static Public Member Functions |
|
| static Node * | nextNode (Node *node) |
| static Node * | previousNode (Node *node) |
Public Attributes |
|
| Node * | fakeNext |
| Node ** | buckets |
| QBasicAtomicInt | ref |
| int | size |
| int | nodeSize |
| short | userNumBits |
| short | numBits |
| int | numBuckets |
| uint | sharable: 1 |
| uint | strictAlignment: 1 |
| uint | reserved: 30 |
Static Public Attributes |
|
| static QHashData | shared_null |
| void* allocateNode | ( | ) |
| void* allocateNode | ( | int | nodeAlign | ) |
| void freeNode | ( | void * | node | ) |
| void mightGrow | ( | ) | [inline] |
| bool willGrow | ( | ) | [inline] |
| void hasShrunk | ( | ) | [inline] |
Definition at line 170 of file qhash.h.
{
if (size <= (numBuckets >> 3) && numBits > userNumBits) {
QT_TRY {
rehash(qMax(int(numBits) - 2, int(userNumBits)));
} QT_CATCH(const std::bad_alloc &) {
// ignore bad allocs - shrinking shouldn't throw. rehash is exception safe.
}
}
}
| void rehash | ( | int | hint | ) |
| void free_helper | ( | void(*)(Node *) | node_delete | ) |
| void destroyAndFree | ( | ) |
| QHashData::Node * firstNode | ( | ) | [inline] |
Definition at line 181 of file qhash.h.
{
Node *e = reinterpret_cast<Node *>(this);
Node **bucket = buckets;
int n = numBuckets;
while (n--) {
if (*bucket != e)
return *bucket;
++bucket;
}
return e;
}
| int size |
| int nodeSize |
| short userNumBits |
| short numBits |
| int numBuckets |
| uint sharable |
| uint strictAlignment |
| uint reserved |
QHashData shared_null
[static] |