Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QtPrivate::QPodArrayOps< T > Struct Template Reference

#include <qarraydataops.h>

+ Inheritance diagram for QtPrivate::QPodArrayOps< T >:
+ Collaboration diagram for QtPrivate::QPodArrayOps< T >:

Classes

struct  Span
 

Public Types

typedef QArrayDataPointer< T >::parameter_type parameter_type
 
- Public Types inherited from QArrayDataPointer< T >
enum  { pass_parameter_by_value }
 
typedef std::conditional< pass_parameter_by_value, T, constT & >::type parameter_type
 

Public Member Functions

void appendInitialize (qsizetype newSize) noexcept
 
void copyAppend (const T *b, const T *e) noexcept
 
void copyAppend (qsizetype n, parameter_type t) noexcept
 
void moveAppend (T *b, T *e) noexcept
 
void truncate (size_t newSize) noexcept
 
void destroyAll () noexcept
 
T * createHole (QArrayData::GrowthPosition pos, qsizetype where, qsizetype n)
 
void insert (qsizetype i, const T *data, qsizetype n)
 
void insert (qsizetype i, qsizetype n, parameter_type t)
 
template<typename... Args>
void emplace (qsizetype i, Args &&... args)
 
void erase (T *b, qsizetype n)
 
void eraseFirst () noexcept
 
void eraseLast () noexcept
 
template<typename Predicate >
qsizetype eraseIf (Predicate pred)
 
void copyRanges (std::initializer_list< Span > ranges)
 
void assign (T *b, T *e, parameter_type t) noexcept
 
bool compare (const T *begin1, const T *begin2, size_t n) const
 
void reallocate (qsizetype alloc, QArrayData::AllocationOption option)
 
- Public Member Functions inherited from QArrayDataPointer< T >
Q_NODISCARD_CTOR constexpr QArrayDataPointer () noexcept
 
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 (QPair< QTypedArrayData< T > *, T * > adata, qsizetype n=0) noexcept
 
QArrayDataPointeroperator= (const QArrayDataPointer &other) noexcept
 
Q_NODISCARD_CTOR QArrayDataPointer (QArrayDataPointer &&other) noexcept
 
DataOpsoperator* () noexcept
 
DataOpsoperator-> () noexcept
 
const DataOpsoperator* () const noexcept
 
const DataOpsoperator-> () const noexcept
 
 ~QArrayDataPointer ()
 
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< Xreinterpreted () &&
 
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)
 
template<typename InputIterator , typename Projection = q20::identity>
void assign (InputIterator first, InputIterator last, Projection proj={})
 
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
 
Datad_ptr () noexcept
 
void setBegin (T *begin) noexcept
 
qsizetype freeSpaceAtBegin () const noexcept
 
qsizetype freeSpaceAtEnd () const noexcept
 

Protected Types

typedef QTypedArrayData< T > Data
 
using DataPointer = QArrayDataPointer< T >
 

Additional Inherited Members

- Static Public Member Functions inherited from QArrayDataPointer< T >
static Q_NODISCARD_CTOR QArrayDataPointer fromRawData (const T *rawData, qsizetype length) noexcept
 
static QArrayDataPointer allocateGrow (const QArrayDataPointer &from, qsizetype n, QArrayData::GrowthPosition position)
 
- Public Attributes inherited from QArrayDataPointer< T >
Datad
 
T * ptr
 
qsizetype size
 

Detailed Description

template<class T>
struct QtPrivate::QPodArrayOps< T >

Definition at line 26 of file qarraydataops.h.

Member Typedef Documentation

◆ Data

template<class T >
typedef QTypedArrayData<T> QtPrivate::QPodArrayOps< T >::Data
protected

Definition at line 32 of file qarraydataops.h.

◆ DataPointer

template<class T >
using QtPrivate::QPodArrayOps< T >::DataPointer = QArrayDataPointer<T>
protected

Definition at line 33 of file qarraydataops.h.

◆ parameter_type

template<class T >
typedef QArrayDataPointer<T>::parameter_type QtPrivate::QPodArrayOps< T >::parameter_type

Definition at line 36 of file qarraydataops.h.

Member Function Documentation

◆ appendInitialize()

template<class T >
void QtPrivate::QPodArrayOps< T >::appendInitialize ( qsizetype  newSize)
inlinenoexcept

Definition at line 40 of file qarraydataops.h.

References e, QArrayDataPointer< T >::end(), QArrayDataPointer< T >::freeSpaceAtEnd(), QArrayDataPointer< T >::isMutable(), QArrayDataPointer< T >::isShared(), and Q_ASSERT.

+ Here is the call graph for this function:

◆ assign()

template<class T >
void QtPrivate::QPodArrayOps< T >::assign ( T *  b,
T *  e,
parameter_type  t 
)
inlinenoexcept

Definition at line 263 of file qarraydataops.h.

References QArrayDataPointer< T >::begin(), e, QArrayDataPointer< T >::end(), and Q_ASSERT.

+ Here is the call graph for this function:

◆ compare()

template<class T >
bool QtPrivate::QPodArrayOps< T >::compare ( const T *  begin1,
const T *  begin2,
size_t  n 
) const
inline

Definition at line 272 of file qarraydataops.h.

◆ copyAppend() [1/2]

template<class T >
void QtPrivate::QPodArrayOps< T >::copyAppend ( const T *  b,
const T *  e 
)
inlinenoexcept

Definition at line 54 of file qarraydataops.h.

References e, QArrayDataPointer< T >::end(), QArrayDataPointer< T >::freeSpaceAtEnd(), QArrayDataPointer< T >::isMutable(), QArrayDataPointer< T >::isShared(), and Q_ASSERT.

Referenced by QtPrivate::QPodArrayOps< T >::moveAppend().

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

◆ copyAppend() [2/2]

template<class T >
void QtPrivate::QPodArrayOps< T >::copyAppend ( qsizetype  n,
parameter_type  t 
)
inlinenoexcept

Definition at line 68 of file qarraydataops.h.

References QArrayDataPointer< T >::end(), QArrayDataPointer< T >::freeSpaceAtEnd(), QArrayDataPointer< T >::isShared(), and Q_ASSERT.

+ Here is the call graph for this function:

◆ copyRanges()

template<class T >
void QtPrivate::QPodArrayOps< T >::copyRanges ( std::initializer_list< Span ranges)
inline

Definition at line 254 of file qarraydataops.h.

References QArrayDataPointer< T >::begin(), and it.

+ Here is the call graph for this function:

◆ createHole()

template<class T >
T * QtPrivate::QPodArrayOps< T >::createHole ( QArrayData::GrowthPosition  pos,
qsizetype  where,
qsizetype  n 
)
inline

Definition at line 104 of file qarraydataops.h.

References QArrayDataPointer< T >::freeSpaceAtBegin(), QArrayDataPointer< T >::freeSpaceAtEnd(), QArrayData::GrowsAtBeginning, QArrayData::GrowsAtEnd, pos, QArrayDataPointer< T >::ptr, and Q_ASSERT.

Referenced by QtPrivate::QPodArrayOps< T >::emplace(), QtPrivate::QPodArrayOps< T >::insert(), and QtPrivate::QPodArrayOps< T >::insert().

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

◆ destroyAll()

template<class T >
void QtPrivate::QPodArrayOps< T >::destroyAll ( )
inlinenoexcept

Definition at line 95 of file qarraydataops.h.

References QArrayDataPointer< T >::d, QBasicAtomicInteger< T >::loadRelaxed(), Q_ASSERT, and QArrayData::ref_.

+ Here is the call graph for this function:

◆ emplace()

template<class T >
template<typename... Args>
void QtPrivate::QPodArrayOps< T >::emplace ( qsizetype  i,
Args &&...  args 
)
inline

◆ erase()

template<class T >
void QtPrivate::QPodArrayOps< T >::erase ( T *  b,
qsizetype  n 
)
inline

Definition at line 182 of file qarraydataops.h.

References QArrayDataPointer< T >::begin(), e, QArrayDataPointer< T >::end(), QArrayDataPointer< T >::isMutable(), QArrayDataPointer< T >::ptr, and Q_ASSERT.

Referenced by QtPrivate::QPodArrayOps< T >::eraseIf().

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

◆ eraseFirst()

template<class T >
void QtPrivate::QPodArrayOps< T >::eraseFirst ( )
inlinenoexcept

Definition at line 203 of file qarraydataops.h.

References QArrayDataPointer< T >::isMutable(), QArrayDataPointer< T >::ptr, Q_ASSERT, and QArrayDataPointer< T >::size.

+ Here is the call graph for this function:

◆ eraseIf()

template<class T >
template<typename Predicate >
qsizetype QtPrivate::QPodArrayOps< T >::eraseIf ( Predicate  pred)
inline

Definition at line 219 of file qarraydataops.h.

References QTypedArrayData< T >::allocate(), QArrayDataPointer< T >::begin(), QArrayDataPointer< T >::end(), QtPrivate::QPodArrayOps< T >::erase(), it, QArrayDataPointer< T >::needsDetach(), other(), Q_CHECK_PTR(), QtPrivate::q_uninitialized_remove_copy_if(), and QArrayDataPointer< T >::swap().

+ Here is the call graph for this function:

◆ eraseLast()

template<class T >
void QtPrivate::QPodArrayOps< T >::eraseLast ( )
inlinenoexcept

Definition at line 211 of file qarraydataops.h.

References QArrayDataPointer< T >::isMutable(), Q_ASSERT, and QArrayDataPointer< T >::size.

+ Here is the call graph for this function:

◆ insert() [1/2]

template<class T >
void QtPrivate::QPodArrayOps< T >::insert ( qsizetype  i,
const T *  data,
qsizetype  n 
)
inline

Definition at line 122 of file qarraydataops.h.

References QtPrivate::QPodArrayOps< T >::createHole(), QArrayDataPointer< T >::detachAndGrow(), QArrayDataPointer< T >::freeSpaceAtBegin(), QArrayDataPointer< T >::freeSpaceAtEnd(), QArrayData::GrowsAtBeginning, QArrayData::GrowsAtEnd, i, pos, and Q_ASSERT.

+ Here is the call graph for this function:

◆ insert() [2/2]

template<class T >
void QtPrivate::QPodArrayOps< T >::insert ( qsizetype  i,
qsizetype  n,
parameter_type  t 
)
inline

Definition at line 137 of file qarraydataops.h.

References copy(), QtPrivate::QPodArrayOps< T >::createHole(), QArrayDataPointer< T >::detachAndGrow(), QArrayDataPointer< T >::freeSpaceAtBegin(), QArrayDataPointer< T >::freeSpaceAtEnd(), QArrayData::GrowsAtBeginning, QArrayData::GrowsAtEnd, i, pos, and Q_ASSERT.

+ Here is the call graph for this function:

◆ moveAppend()

template<class T >
void QtPrivate::QPodArrayOps< T >::moveAppend ( T *  b,
T *  e 
)
inlinenoexcept

Definition at line 81 of file qarraydataops.h.

References QtPrivate::QPodArrayOps< T >::copyAppend(), and e.

+ Here is the call graph for this function:

◆ reallocate()

template<class T >
void QtPrivate::QPodArrayOps< T >::reallocate ( qsizetype  alloc,
QArrayData::AllocationOption  option 
)
inline

Definition at line 293 of file qarraydataops.h.

References QArrayDataPointer< T >::d, QArrayDataPointer< T >::ptr, Q_ASSERT, Q_CHECK_PTR(), and QTypedArrayData< T >::reallocateUnaligned().

+ Here is the call graph for this function:

◆ truncate()

template<class T >
void QtPrivate::QPodArrayOps< T >::truncate ( size_t  newSize)
inlinenoexcept

Definition at line 86 of file qarraydataops.h.

References QArrayDataPointer< T >::isMutable(), QArrayDataPointer< T >::isShared(), and Q_ASSERT.

+ Here is the call graph for this function:

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