Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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 26 of file qarraydata.h.

Member Enumeration Documentation

◆ AllocationOption

Enumerator
Grow 
KeepSize 

Definition at line 28 of file qarraydata.h.

◆ ArrayOption

Enumerator
ArrayOptionDefault 
CapacityReserved 

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

Definition at line 38 of file qarraydata.h.

◆ GrowthPosition

Enumerator
GrowsAtEnd 
GrowsAtBeginning 

Definition at line 33 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 189 of file qarraydata.cpp.

◆ allocate1()

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

Definition at line 201 of file qarraydata.cpp.

◆ allocate2()

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

Definition at line 208 of file qarraydata.cpp.

◆ allocatedCapacity()

qsizetype QArrayData::allocatedCapacity ( )
inlinenoexcept

Definition at line 48 of file qarraydata.h.

◆ constAllocatedCapacity()

qsizetype QArrayData::constAllocatedCapacity ( ) const
inlinenoexcept

Definition at line 53 of file qarraydata.h.

◆ deallocate()

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

Definition at line 248 of file qarraydata.cpp.

◆ deref()

bool QArrayData::deref ( )
inlinenoexcept

Returns false if deallocation is necessary.

Definition at line 66 of file qarraydata.h.

◆ detachCapacity()

qsizetype QArrayData::detachCapacity ( qsizetype newSize) const
inlinenoexcept

Definition at line 84 of file qarraydata.h.

◆ isShared()

bool QArrayData::isShared ( ) const
inlinenoexcept

Definition at line 71 of file qarraydata.h.

◆ needsDetach()

bool QArrayData::needsDetach ( )
inlinenoexcept

Definition at line 79 of file qarraydata.h.

◆ reallocateUnaligned()

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

Definition at line 216 of file qarraydata.cpp.

◆ ref()

bool QArrayData::ref ( )
inlinenoexcept

Returns true if sharing took place.

Definition at line 59 of file qarraydata.h.

Member Data Documentation

◆ alloc

qsizetype QArrayData::alloc

Definition at line 46 of file qarraydata.h.

◆ flags

ArrayOptions QArrayData::flags

Definition at line 45 of file qarraydata.h.

◆ ref_

QBasicAtomicInt QArrayData::ref_

Definition at line 44 of file qarraydata.h.


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