QVectorData Struct Reference

#include <qvector.h>

Collaboration diagram for QVectorData:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 43 of file qvector.h.

Static Public Member Functions

static QVectorDatamalloc (int sizeofTypedData, int size, int sizeofT, QVectorData *init)
static int grow (int sizeofTypedData, int size, int sizeofT, bool excessive)

Public Attributes

QBasicAtomic ref
int alloc
int size
uint sharable: 1

Static Public Attributes

static QVectorData shared_null


Member Function Documentation

QVectorData * QVectorData::malloc ( int  sizeofTypedData,
int  size,
int  sizeofT,
QVectorData init 
) [static]

Definition at line 30 of file qvector.cpp.

References init(), p, qMalloc(), and qMin().

Referenced by QVector< T >::realloc().

00031 {
00032     QVectorData* p = (QVectorData *)qMalloc(sizeofTypedData + (size - 1) * sizeofT);
00033     ::memcpy(p, init, sizeofTypedData + (qMin(size, init->alloc) - 1) * sizeofT);
00034     return p;
00035 }

Here is the call graph for this function:

int QVectorData::grow ( int  sizeofTypedData,
int  size,
int  sizeofT,
bool  excessive 
) [static]

Definition at line 37 of file qvector.cpp.

References qAllocMore().

Referenced by QVector< T >::append(), QVector< T >::insert(), and QVector< T >::resize().

00038 {
00039     if (excessive)
00040         return size + size / 2;
00041     return qAllocMore(size * sizeofT, sizeofTypedData - sizeofT) / sizeofT;
00042 }

Here is the call graph for this function:


Member Data Documentation

QBasicAtomic QVectorData::ref

Definition at line 45 of file qvector.h.

int QVectorData::alloc

Definition at line 46 of file qvector.h.

int QVectorData::size

Definition at line 47 of file qvector.h.

Referenced by QVector< T >::value().

uint QVectorData::sharable

Definition at line 48 of file qvector.h.

QVectorData QVectorData::shared_null [static]

Definition at line 50 of file qvector.h.


The documentation for this struct was generated from the following files:
Generated on Thu Mar 15 19:45:29 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1