![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qarraydatapointer.h>
Public Types | |
| enum | { pass_parameter_by_value } |
| typedef std::conditional< pass_parameter_by_value, T, constT & >::type | parameter_type |
Public Member Functions | |
| Q_NODISCARD_CTOR constexpr | QArrayDataPointer ()=default |
| Q_NODISCARD_CTOR Q_DECL_CONSTEXPR_DTOR | QArrayDataPointer (const QArrayDataPointer &other) noexcept |
| Q_NODISCARD_CTOR constexpr | QArrayDataPointer (Data *header, T *adata, qsizetype nn=0) noexcept |
| Q_NODISCARD_CTOR | QArrayDataPointer (QTypedArrayAllocationResult< T > adata, qsizetype nn=0) noexcept |
| Q_NODISCARD_CTOR | QArrayDataPointer (qsizetype alloc, qsizetype nn=0, QArrayData::AllocationOption optionoption=QArrayData::KeepSize) |
| Q_DECL_CONSTEXPR_DTOR QArrayDataPointer & | operator= (const QArrayDataPointer &other) noexcept |
| Q_NODISCARD_CTOR constexpr | QArrayDataPointer (QArrayDataPointer &&other) noexcept |
| Q_DECL_CONSTEXPR_DTOR DataOps | operator* () noexcept |
| DataOps | operator-> () noexcept |
| Q_DECL_CONSTEXPR_DTOR | ~QArrayDataPointer () |
| void | destroyAndDeallocate () |
| constexpr bool | isNull () const noexcept |
| T * | data () noexcept |
| constexpr const T * | data () const noexcept |
| T * | begin () noexcept |
| T * | end () noexcept |
| constexpr const T * | begin () const noexcept |
| constexpr const T * | end () const noexcept |
| constexpr const T * | constBegin () const noexcept |
| constexpr const T * | constEnd () const noexcept |
| constexpr void | swap (QArrayDataPointer &other) noexcept |
| void | clear () noexcept(std::is_nothrow_destructible< T >::value) |
| void | detach (QArrayDataPointer *old=nullptr) |
| template<typename X> | |
| QArrayDataPointer< X > | reinterpreted () && |
| void | detachAndGrow (QArrayData::GrowthPosition where, qsizetype nn, const T **datadata, QArrayDataPointer *old) |
| Q_NEVER_INLINE void | reallocateAndGrow (QArrayData::GrowthPosition where, qsizetype nn, QArrayDataPointer *old=nullptr) |
| bool | tryReadjustFreeSpace (QArrayData::GrowthPosition pos, qsizetype nn, const T **datadata=nullptr) |
| void | relocate (qsizetype offsetoffset, const T **datadata=nullptr) |
| QArrayDataPointer | sliced (qsizetype pos, qsizetype nn) const & |
| QArrayDataPointer | sliced (qsizetype pos, qsizetype nn) && |
| void | appendInitialize (qsizetype newSize) |
| constexpr qsizetype | allocatedCapacity () noexcept |
| constexpr qsizetype | constAllocatedCapacity () const noexcept |
| constexpr void | ref () noexcept |
| constexpr bool | deref () noexcept |
| constexpr bool | isMutable () const noexcept |
| constexpr bool | isShared () const noexcept |
| constexpr bool | isSharedWith (const QArrayDataPointer &other) const noexcept |
| constexpr bool | needsDetach () const noexcept |
| constexpr qsizetype | detachCapacity (qsizetype newSize) const noexcept |
| constexpr const Data::ArrayOptions | flags () const noexcept |
| void | setFlag (typename Data::ArrayOptions ff) noexcept |
| void | clearFlag (typename Data::ArrayOptions ff) noexcept |
| constexpr Data * | d_ptr () noexcept |
| constexpr void | setBegin (T *begin) noexcept |
| constexpr qsizetype | freeSpaceAtBegin () const noexcept |
| constexpr qsizetype | freeSpaceAtEnd () const noexcept |
Static Public Member Functions | |
| static Q_NODISCARD_CTOR QArrayDataPointer | fromRawData (const T *rawData, qsizetype lengthlength) noexcept |
| static QArrayDataPointer | allocateGrow (const QArrayDataPointer &from, qsizetype nn, QArrayData::GrowthPosition position) |
Public Attributes | |
| T * | ptr = nullptr |
| qsizetype | size = 0 |
| Data * | d = nullptr |
Friends | |
| bool | operator== (const QArrayDataPointer &lhs, const QArrayDataPointer &rhs) noexcept |
| bool | operator!= (const QArrayDataPointer &lhs, const QArrayDataPointer &rhs) noexcept |
Definition at line 16 of file qarraydatapointer.h.
| typedef std::conditional<pass_parameter_by_value,T,constT&>::type QArrayDataPointer< T >::parameter_type |
Definition at line 31 of file qarraydatapointer.h.
| anonymous enum |
| Enumerator | |
|---|---|
| pass_parameter_by_value | |
Definition at line 23 of file qarraydatapointer.h.
|
constexprdefault |
|
inlinenoexcept |
Definition at line 38 of file qarraydatapointer.h.
|
inlineconstexprnoexcept |
Definition at line 45 of file qarraydatapointer.h.
|
inlineexplicitnoexcept |
Definition at line 55 of file qarraydatapointer.h.
|
inlineexplicit |
Definition at line 63 of file qarraydatapointer.h.
|
inlineconstexprnoexcept |
Definition at line 86 of file qarraydatapointer.h.
|
inline |
Definition at line 107 of file qarraydatapointer.h.
|
inlineconstexprnoexcept |
Definition at line 367 of file qarraydatapointer.h.
|
inlinestatic |
Definition at line 403 of file qarraydatapointer.h.
|
inline |
Definition at line 353 of file qarraydatapointer.h.
|
inlineconstexprnoexcept |
Definition at line 131 of file qarraydatapointer.h.
|
inlinenoexcept |
Definition at line 128 of file qarraydatapointer.h.
|
inlinenoexcept |
Definition at line 146 of file qarraydatapointer.h.
|
inlinenoexcept |
Definition at line 383 of file qarraydatapointer.h.
|
inlineconstexprnoexcept |
Definition at line 369 of file qarraydatapointer.h.
|
inlineconstexprnoexcept |
Definition at line 135 of file qarraydatapointer.h.
|
inlineconstexprnoexcept |
Definition at line 137 of file qarraydatapointer.h.
|
inlineconstexprnoexcept |
Definition at line 385 of file qarraydatapointer.h.
|
inlineconstexprnoexcept |
Definition at line 126 of file qarraydatapointer.h.
|
inlinenoexcept |
Definition at line 125 of file qarraydatapointer.h.
|
inlineconstexprnoexcept |
Definition at line 371 of file qarraydatapointer.h.
|
inline |
Definition at line 114 of file qarraydatapointer.h.
|
inline |
Definition at line 152 of file qarraydatapointer.h.
|
inline |
Detaches this (optionally) and grows to accommodate the free space for n elements at the required side. The side is determined from pos.
data pointer can be provided when the caller knows that data points into range [this->begin(), this->end()). In case it is, *data would be updated so that it continues to point to the element it was pointing to before the data move. if data does not point into range, one can/should pass nullptr.
Similarly to data, old, pointer to a default-constructed QADP, can be provided when the caller expects to e.g. copy the data from this to itself:
The default rule would be: data and old must either both be valid pointers, or both equal to nullptr.
Definition at line 203 of file qarraydatapointer.h.
|
inlineconstexprnoexcept |
Definition at line 379 of file qarraydatapointer.h.
|
inlineconstexprnoexcept |
Definition at line 133 of file qarraydatapointer.h.
|
inlinenoexcept |
Definition at line 129 of file qarraydatapointer.h.
|
inlineconstexprnoexcept |
Definition at line 381 of file qarraydatapointer.h.
|
inlineconstexprnoexcept |
Definition at line 388 of file qarraydatapointer.h.
|
inlineconstexprnoexcept |
Definition at line 395 of file qarraydatapointer.h.
|
inlinestaticnoexcept |
Definition at line 70 of file qarraydatapointer.h.
|
inlineconstexprnoexcept |
Definition at line 373 of file qarraydatapointer.h.
|
inlineconstexprnoexcept |
Definition at line 120 of file qarraydatapointer.h.
|
inlineconstexprnoexcept |
Definition at line 374 of file qarraydatapointer.h.
|
inlineconstexprnoexcept |
Definition at line 376 of file qarraydatapointer.h.
|
inlineconstexprnoexcept |
Definition at line 377 of file qarraydatapointer.h.
|
inlinenoexcept |
Definition at line 96 of file qarraydatapointer.h.
|
inlinenoexcept |
Definition at line 101 of file qarraydatapointer.h.
|
inlinenoexcept |
Definition at line 77 of file qarraydatapointer.h.
|
inline |
Reallocates to accommodate the free space for n elements at the required side. The side is determined from pos. Might also shrink when n < 0.
Definition at line 228 of file qarraydatapointer.h.
|
inlineconstexprnoexcept |
Definition at line 370 of file qarraydatapointer.h.
|
inline |
Reinterprets the data of this QArrayDataPointer to type X. It's the caller's responsibility to ensure that the data contents are valid and properly aligned, particularly if T and X are not trivial types (i.e, don't do that). The current size is kept and the allocated capacity is updated to account for the difference in the element type's size.
This is used in QString::fromLatin1 to perform in-place conversion of QString to QByteArray.
Definition at line 169 of file qarraydatapointer.h.
|
inline |
|
inlineconstexprnoexcept |
Definition at line 386 of file qarraydatapointer.h.
|
inlinenoexcept |
Definition at line 382 of file qarraydatapointer.h.
|
inline |
Definition at line 341 of file qarraydatapointer.h.
|
inline |
Definition at line 333 of file qarraydatapointer.h.
|
inlineconstexprnoexcept |
Definition at line 139 of file qarraydatapointer.h.
|
inline |
Attempts to relocate [begin(), end()) to accommodate the free space for n elements at the required side. The side is determined from pos.
Returns true if the internal data is moved. Returns false when there is no point in moving the data or the move is impossible. If false is returned, it is the responsibility of the caller to figure out how to accommodate the free space for n elements at pos.
This function expects that certain preconditions are met, e.g. the detach is not needed, n > 0 and so on. This is intentional to reduce the number of if-statements when the caller knows that preconditions would be satisfied.
Definition at line 279 of file qarraydatapointer.h.
|
friend |
Definition at line 434 of file qarraydatapointer.h.
|
friend |
Definition at line 429 of file qarraydatapointer.h.
| Data* QArrayDataPointer< T >::d = nullptr |
Definition at line 445 of file qarraydatapointer.h.
| T* QArrayDataPointer< T >::ptr = nullptr |
Definition at line 442 of file qarraydatapointer.h.
| qsizetype QArrayDataPointer< T >::size = 0 |
Definition at line 443 of file qarraydatapointer.h.