Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QArrayData Struct Reference

#include <qarraydata.h>

+ Inheritance diagram for QArrayData:
+ Collaboration diagram for QArrayData:

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 () noexcept
 
qsizetype detachCapacity (qsizetype newSize) const noexcept
 

Static Public Member Functions

static Q_DECL_MALLOCLIKE Q_CORE_EXPORT voidallocate (QArrayData **pdata, qsizetype objectSize, qsizetype alignment, qsizetype capacity, AllocationOption option=QArrayData::KeepSize) noexcept
 
static Q_DECL_MALLOCLIKE Q_CORE_EXPORT voidallocate1 (QArrayData **pdata, qsizetype capacity, AllocationOption option=QArrayData::KeepSize) noexcept
 
static Q_DECL_MALLOCLIKE Q_CORE_EXPORT voidallocate2 (QArrayData **pdata, qsizetype capacity, AllocationOption option=QArrayData::KeepSize) noexcept
 
static Q_CORE_EXPORT std::pair< 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
 

Detailed Description

Definition at line 24 of file qarraydata.h.

Member Enumeration Documentation

◆ AllocationOption

Enumerator
Grow 
KeepSize 

Definition at line 26 of file qarraydata.h.

◆ ArrayOption

Enumerator
ArrayOptionDefault 
CapacityReserved 

the capacity was reserved by the user, try to keep it

Definition at line 36 of file qarraydata.h.

◆ GrowthPosition

Enumerator
GrowsAtEnd 
GrowsAtBeginning 

Definition at line 31 of file qarraydata.h.

Member Function Documentation

◆ allocate()

void * QArrayData::allocate ( QArrayData ** pdata,
qsizetype objectSize,
qsizetype alignment,
qsizetype capacity,
AllocationOption option = QArrayData::KeepSize )
staticnoexcept

Definition at line 193 of file qarraydata.cpp.

References alignment, allocateHelper(), capacity, and Q_ASSERT.

Referenced by QTypedArrayData< T >::allocate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ allocate1()

void * QArrayData::allocate1 ( QArrayData ** pdata,
qsizetype capacity,
AllocationOption option = QArrayData::KeepSize )
staticnoexcept

Definition at line 207 of file qarraydata.cpp.

References allocateHelper(), capacity, and Q_ASSERT.

+ Here is the call graph for this function:

◆ allocate2()

void * QArrayData::allocate2 ( QArrayData ** pdata,
qsizetype capacity,
AllocationOption option = QArrayData::KeepSize )
staticnoexcept

Definition at line 216 of file qarraydata.cpp.

References allocateHelper(), capacity, and Q_ASSERT.

+ Here is the call graph for this function:

◆ allocatedCapacity()

qsizetype QArrayData::allocatedCapacity ( )
inlinenoexcept

Definition at line 46 of file qarraydata.h.

References alloc.

◆ constAllocatedCapacity()

qsizetype QArrayData::constAllocatedCapacity ( ) const
inlinenoexcept

Definition at line 51 of file qarraydata.h.

References alloc.

Referenced by detachCapacity().

+ Here is the caller graph for this function:

◆ deallocate()

void QArrayData::deallocate ( QArrayData * data,
qsizetype objectSize,
qsizetype alignment )
staticnoexcept

Definition at line 254 of file qarraydata.cpp.

References alignment, Q_ASSERT, and Q_UNUSED.

Referenced by QTypedArrayData< T >::deallocate().

+ Here is the caller graph for this function:

◆ deref()

bool QArrayData::deref ( )
inlinenoexcept

Returns false if deallocation is necessary.

Definition at line 64 of file qarraydata.h.

References QBasicAtomicInteger< T >::deref(), and ref_.

Referenced by QStringHashNode::~QStringHashNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ detachCapacity()

qsizetype QArrayData::detachCapacity ( qsizetype newSize) const
inlinenoexcept

Definition at line 82 of file qarraydata.h.

References CapacityReserved, and constAllocatedCapacity().

+ Here is the call graph for this function:

◆ isShared()

bool QArrayData::isShared ( ) const
inlinenoexcept

Definition at line 69 of file qarraydata.h.

References QBasicAtomicInteger< T >::loadRelaxed(), and ref_.

+ Here is the call graph for this function:

◆ needsDetach()

bool QArrayData::needsDetach ( )
inlinenoexcept

Definition at line 77 of file qarraydata.h.

References QBasicAtomicInteger< T >::loadRelaxed(), and ref_.

+ Here is the call graph for this function:

◆ reallocateUnaligned()

std::pair< QArrayData *, void * > QArrayData::reallocateUnaligned ( QArrayData * data,
void * dataPointer,
qsizetype objectSize,
qsizetype newCapacity,
AllocationOption option )
staticnoexcept

Definition at line 226 of file qarraydata.cpp.

References calculateBlockSize(), capacity, header(), headerSize, Q_ASSERT, and Q_UNLIKELY.

Referenced by QTypedArrayData< T >::reallocateUnaligned().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ref()

bool QArrayData::ref ( )
inlinenoexcept

Returns true if sharing took place.

Definition at line 57 of file qarraydata.h.

References QBasicAtomicInteger< T >::ref(), and ref_.

Referenced by QStringHashNode::QStringHashNode(), QStringHashNode::QStringHashNode(), QStringHash< T >::initializeNode(), and QStringHashNode::key().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ alloc

qsizetype QArrayData::alloc

Definition at line 44 of file qarraydata.h.

Referenced by allocatedCapacity(), and constAllocatedCapacity().

◆ flags

ArrayOptions QArrayData::flags

Definition at line 43 of file qarraydata.h.

◆ ref_

QBasicAtomicInt QArrayData::ref_

Definition at line 42 of file qarraydata.h.

Referenced by deref(), isShared(), needsDetach(), and ref().


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