- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes

# QHashData Struct Reference

Search for all occurrences

## Detailed Description

Definition at line 112 of file qhash.h.

`#include <qhash.h>`

List of all members.

## 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

## Member Function Documentation

void* allocateNode | ( |  | ) |

Search for all occurrences

void* allocateNode | ( | int | nodeAlign | ) |

Search for all occurrences

void freeNode | ( | void * | node | ) |

Search for all occurrences

QHashData* detach_helper | ( | void(*)(Node *, void *) | node_duplicate,
|  | int | nodeSize
| ) |  |

Search for all occurrences

QHashData* detach_helper2 | ( | void(*)(Node *, void *) | node_duplicate,
|  | void(*)(Node *) | node_delete,
|  | int | nodeSize,
|  | int | nodeAlign
| ) |  |

Search for all occurrences

void mightGrow | ( |  | ) | `[inline]`

Search for all occurrences

Definition at line 154 of file qhash.h.

    {
        if (size >= numBuckets)
            rehash(numBits + 1);
    }

bool willGrow | ( |  | ) | `[inline]`

Search for all occurrences

Definition at line 160 of file qhash.h.

    {
        if (size >= numBuckets) {
            rehash(numBits + 1);
            return true;
        } else {
            return false;
        }
    }

void hasShrunk | ( |  | ) | `[inline]`

Search for all occurrences

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 | ) |

Search for all occurrences

void free_helper | ( | void(*)(Node *) | node_delete | ) |

Search for all occurrences

void destroyAndFree | ( |  | ) |

Search for all occurrences

QHashData::Node * firstNode | ( |  | ) | `[inline]`

Search for all occurrences

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;
    }

static Node* nextNode | ( | Node * | node | ) | `[static]`

Search for all occurrences

static Node* previousNode | ( | Node * | node | ) | `[static]`

Search for all occurrences

## Member Data Documentation

Node* fakeNext

Search for all occurrences

Definition at line 119 of file qhash.h.

Node** buckets

Search for all occurrences

Definition at line 120 of file qhash.h.

QBasicAtomicInt ref

Search for all occurrences

Definition at line 121 of file qhash.h.

int size

Search for all occurrences

Definition at line 122 of file qhash.h.

int nodeSize

Search for all occurrences

Definition at line 123 of file qhash.h.

short userNumBits

Search for all occurrences

Definition at line 124 of file qhash.h.

short numBits

Search for all occurrences

Definition at line 125 of file qhash.h.

int numBuckets

Search for all occurrences

Definition at line 126 of file qhash.h.

uint sharable

Search for all occurrences

Definition at line 127 of file qhash.h.

uint strictAlignment

Search for all occurrences

Definition at line 128 of file qhash.h.

uint reserved

Search for all occurrences

Definition at line 129 of file qhash.h.

QHashData shared_null `[static]`

Search for all occurrences

Definition at line 151 of file qhash.h.

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

- QtCore/qhash.h