|
| Q_NODISCARD_CTOR constexpr | QArrayDataPointer ()=default |
| Q_NODISCARD_CTOR | QArrayDataPointer (const QArrayDataPointer &other) noexcept |
| Q_NODISCARD_CTOR constexpr | QArrayDataPointer (Data *header, T *adata, qsizetype n=0) noexcept |
| Q_NODISCARD_CTOR | QArrayDataPointer (QTypedArrayAllocationResult< T > adata, qsizetype n=0) noexcept |
| Q_NODISCARD_CTOR | QArrayDataPointer (qsizetype alloc, qsizetype n=0, QArrayData::AllocationOption option=QArrayData::KeepSize) |
| QArrayDataPointer & | operator= (const QArrayDataPointer &other) noexcept |
| Q_NODISCARD_CTOR | QArrayDataPointer (QArrayDataPointer &&other) noexcept |
| DataOps & | operator* () noexcept |
| DataOps * | operator-> () noexcept |
| const DataOps & | operator* () const noexcept |
| const DataOps * | operator-> () const noexcept |
| | ~QArrayDataPointer () |
| constexpr bool | isNull () const noexcept |
| T * | data () noexcept |
| const T * | data () const noexcept |
| T * | begin () noexcept |
| T * | end () noexcept |
| const T * | begin () const noexcept |
| const T * | end () const noexcept |
| const T * | constBegin () const noexcept |
| const T * | constEnd () const noexcept |
| 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 n, const T **data, QArrayDataPointer *old) |
| Q_NEVER_INLINE void | reallocateAndGrow (QArrayData::GrowthPosition where, qsizetype n, QArrayDataPointer *old=nullptr) |
| bool | tryReadjustFreeSpace (QArrayData::GrowthPosition pos, qsizetype n, const T **data=nullptr) |
| void | relocate (qsizetype offset, const T **data=nullptr) |
| QArrayDataPointer | sliced (qsizetype pos, qsizetype n) const & |
| QArrayDataPointer | sliced (qsizetype pos, qsizetype n) && |
| void | appendInitialize (qsizetype newSize) |
| qsizetype | allocatedCapacity () noexcept |
| qsizetype | constAllocatedCapacity () const noexcept |
| void | ref () noexcept |
| bool | deref () noexcept |
| bool | isMutable () const noexcept |
| bool | isShared () const noexcept |
| bool | isSharedWith (const QArrayDataPointer &other) const noexcept |
| bool | needsDetach () const noexcept |
| qsizetype | detachCapacity (qsizetype newSize) const noexcept |
| const Data::ArrayOptions | flags () const noexcept |
| void | setFlag (typename Data::ArrayOptions f) noexcept |
| void | clearFlag (typename Data::ArrayOptions f) noexcept |
| Data * | d_ptr () noexcept |
| void | setBegin (T *begin) noexcept |
| qsizetype | freeSpaceAtBegin () const noexcept |
| qsizetype | freeSpaceAtEnd () const noexcept |
template<class T>
struct QArrayDataPointer< T >
Definition at line 14 of file qarraydatapointer.h.
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 192 of file qarraydatapointer.h.
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.
- See also
- reallocateAndGrow
Definition at line 268 of file qarraydatapointer.h.