![]() |
Qt 6.x
The Qt SDK
|
#include <qarraydata.h>
Public Types | |
enum | AllocationOption { Grow , KeepSize } |
enum | GrowthPosition { GrowsAtEnd , GrowsAtBeginning } |
enum | ArrayOption { ArrayOptionDefault = 0 , CapacityReserved = 0x1 } |
Public Member Functions | |
qsizetype | allocatedCapacity () noexcept |
qsizetype | constAllocatedCapacity () const noexcept |
bool | ref () noexcept |
Returns true if sharing took place. | |
bool | deref () noexcept |
Returns false if deallocation is necessary. | |
bool | isShared () const noexcept |
bool | needsDetach () const noexcept |
qsizetype | detachCapacity (qsizetype newSize) const noexcept |
Static Public Member Functions | |
static Q_CORE_EXPORT void * | allocate (QArrayData **pdata, qsizetype objectSize, qsizetype alignment, qsizetype capacity, AllocationOption option=QArrayData::KeepSize) noexcept |
static Q_CORE_EXPORT QPair< QArrayData *, void * > | reallocateUnaligned (QArrayData *data, void *dataPointer, qsizetype objectSize, qsizetype newCapacity, AllocationOption option) noexcept |
static Q_CORE_EXPORT void | deallocate (QArrayData *data, qsizetype objectSize, qsizetype alignment) noexcept |
Public Attributes | |
QBasicAtomicInt | ref_ |
ArrayOptions | flags |
qsizetype | alloc |
Definition at line 16 of file qarraydata.h.
Enumerator | |
---|---|
Grow | |
KeepSize |
Definition at line 18 of file qarraydata.h.
Enumerator | |
---|---|
ArrayOptionDefault | |
CapacityReserved | the capacity was reserved by the user, try to keep it |
Definition at line 28 of file qarraydata.h.
Enumerator | |
---|---|
GrowsAtEnd | |
GrowsAtBeginning |
Definition at line 23 of file qarraydata.h.
|
staticnoexcept |
Definition at line 160 of file qarraydata.cpp.
References alignment, allocateData(), calculateBlockSize(), capacity, QTypedArrayData< T >::dataStart(), header(), headerSize, Q_ASSERT, Q_UNLIKELY, and reserveExtraBytes().
Referenced by QTypedArrayData< T >::allocate().
|
inlinenoexcept |
Definition at line 38 of file qarraydata.h.
References alloc.
Referenced by QArrayDataPointer< T >::allocatedCapacity().
|
inlinenoexcept |
Definition at line 43 of file qarraydata.h.
References alloc.
Referenced by QArrayDataPointer< T >::constAllocatedCapacity(), detachCapacity(), and QArrayDataPointer< T >::freeSpaceAtEnd().
|
staticnoexcept |
Definition at line 234 of file qarraydata.cpp.
References alignment, Q_ASSERT, and Q_UNUSED.
Referenced by QTypedArrayData< T >::deallocate().
|
inlinenoexcept |
Returns false if deallocation is necessary.
Definition at line 56 of file qarraydata.h.
References QBasicAtomicInteger< T >::deref(), and ref_.
Referenced by QStringHashNode::~QStringHashNode(), and QArrayDataPointer< T >::deref().
Definition at line 74 of file qarraydata.h.
References CapacityReserved, and constAllocatedCapacity().
Referenced by QArrayDataPointer< T >::detachCapacity().
|
inlinenoexcept |
Definition at line 61 of file qarraydata.h.
References QBasicAtomicInteger< T >::loadRelaxed(), and ref_.
Referenced by QArrayDataPointer< T >::isShared(), and QArrayDataPointer< T >::reinterpreted().
|
inlinenoexcept |
Definition at line 69 of file qarraydata.h.
References QBasicAtomicInteger< T >::loadRelaxed(), and ref_.
Referenced by QArrayDataPointer< T >::needsDetach().
|
staticnoexcept |
Definition at line 204 of file qarraydata.cpp.
References calculateBlockSize(), capacity, header(), headerSize, Q_ASSERT, Q_UNLIKELY, qMakePair(), and reserveExtraBytes().
Referenced by QTypedArrayData< T >::reallocateUnaligned().
|
inlinenoexcept |
Returns true if sharing took place.
Definition at line 49 of file qarraydata.h.
References QBasicAtomicInteger< T >::ref(), and ref_.
Referenced by QStringHashNode::QStringHashNode(), QStringHashNode::QStringHashNode(), QStringHash< T >::initializeNode(), QStringHashNode::key(), QArrayDataPointer< T >::ref(), and QStringHash< T >::takeNode().
qsizetype QArrayData::alloc |
Definition at line 36 of file qarraydata.h.
Referenced by allocatedCapacity(), constAllocatedCapacity(), and QArrayDataPointer< T >::reinterpreted().
ArrayOptions QArrayData::flags |
Definition at line 35 of file qarraydata.h.
Referenced by QArrayDataPointer< T >::clearFlag(), QArrayDataPointer< T >::flags(), and QArrayDataPointer< T >::setFlag().
QBasicAtomicInt QArrayData::ref_ |
Definition at line 34 of file qarraydata.h.
Referenced by deref(), QtPrivate::QGenericArrayOps< T >::destroyAll(), QtPrivate::QPodArrayOps< T >::destroyAll(), isShared(), needsDetach(), and ref().