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
QVLABase< T > Class Template Reference

#include <qvarlengtharray.h>

Inheritance diagram for QVLABase< T >:
Collaboration diagram for QVLABase< T >:

Public Types

using iterator = T*
using const_iterator = const T*
using reverse_iterator = std::reverse_iterator<iterator>
using const_reverse_iterator = std::reverse_iterator<const_iterator>
using value_type = T
using reference = value_type&
using const_reference = const value_type&
using pointer = value_type*
using const_pointer = const value_type*
using difference_type = qptrdiff
Public Types inherited from QVLABaseBase
using size_type = qsizetype

Public Member Functions

T * data () noexcept
const T * data () const noexcept
iterator begin () noexcept
const_iterator begin () const noexcept
const_iterator cbegin () const noexcept
iterator end () noexcept
const_iterator end () const noexcept
const_iterator cend () const noexcept
reverse_iterator rbegin () noexcept
const_reverse_iterator rbegin () const noexcept
const_reverse_iterator crbegin () const noexcept
reverse_iterator rend () noexcept
const_reverse_iterator rend () const noexcept
const_reverse_iterator crend () const noexcept
reference front ()
const_reference front () const
reference back ()
const_reference back () const
void pop_back ()
template<typename AT = T>
qsizetype indexOf (const AT &t, qsizetype from=0) const
template<typename AT = T>
qsizetype lastIndexOf (const AT &t, qsizetype from=-1) const
template<typename AT = T>
bool contains (const AT &t) const
reference operator[] (qsizetype idx)
const_reference operator[] (qsizetype idx) const
value_type value (qsizetype i) const
value_type value (qsizetype i, const T &defaultValue) const
void replace (qsizetype i, const T &t)
void remove (qsizetype i, qsizetype n=1)
template<typename AT = T>
qsizetype removeAll (const AT &t)
template<typename AT = T>
bool removeOne (const AT &t)
template<typename Predicate>
qsizetype removeIf (Predicate pred)
void clear ()
iterator erase (const_iterator begin, const_iterator end)
iterator erase (const_iterator pos)
constexpr qsizetype max_size () const noexcept
size_t hash (size_t seed) const noexcept(QtPrivate::QNothrowHashable_v< T >)
template<typename AT>
Q_INLINE_TEMPLATE qsizetype indexOf (const AT &t, qsizetype from) const
template<typename AT>
Q_INLINE_TEMPLATE qsizetype lastIndexOf (const AT &t, qsizetype from) const
template<typename AT>
Q_INLINE_TEMPLATE bool contains (const AT &t) const
template<typename Iterator>
Q_OUTOFLINE_TEMPLATE void assign_impl (qsizetype prealloc, void *array, Iterator first, Iterator last, std::forward_iterator_tag)
template<typename Iterator>
Q_OUTOFLINE_TEMPLATE void assign_impl (qsizetype prealloc, void *array, Iterator first, Iterator last, std::input_iterator_tag)
template<typename Iterator>
Q_OUTOFLINE_TEMPLATE void assign_impl (qsizetype prealloc, void *array, Iterator first, Iterator last)
template<typename... Args>
Q_OUTOFLINE_TEMPLATE auto emplace_impl (qsizetype prealloc, void *array, const_iterator before, Args &&...args) -> iterator
Public Member Functions inherited from QVLABaseBase
constexpr size_type capacity () const noexcept
constexpr size_type size () const noexcept
constexpr bool empty () const noexcept

Static Public Member Functions

static constexpr qsizetype maxSize () noexcept

Protected Member Functions

 QVLABase ()=default
void growBy (qsizetype prealloc, void *array, qsizetype increment)
template<typename... Args>
reference emplace_back_impl (qsizetype prealloc, void *array, Args &&...args)
template<typename... Args>
iterator emplace_impl (qsizetype prealloc, void *array, const_iterator pos, Args &&...arg)
iterator insert_impl (qsizetype prealloc, void *array, const_iterator pos, qsizetype n, const T &t)
template<typename S>
bool equal (const QVLABase< S > &other) const
template<typename S>
bool less_than (const QVLABase< S > &other) const
void append_impl (qsizetype prealloc, void *array, const T *buf, qsizetype n)
void reallocate_impl (qsizetype prealloc, void *array, qsizetype size, qsizetype alloc)
void resize_impl (qsizetype prealloc, void *array, qsizetype sz, const T &v)
void resize_impl (qsizetype prealloc, void *array, qsizetype sz)
void assign_impl (qsizetype prealloc, void *array, qsizetype n, const T &t)
template<typename Iterator>
void assign_impl (qsizetype prealloc, void *array, Iterator first, Iterator last, std::forward_iterator_tag)
template<typename Iterator>
void assign_impl (qsizetype prealloc, void *array, Iterator first, Iterator last, std::input_iterator_tag)
template<typename Iterator>
void assign_impl (qsizetype prealloc, void *array, Iterator first, Iterator last)
bool isValidIterator (const const_iterator &i) const
Protected Member Functions inherited from QVLABaseBase
 QVLABaseBase ()=default
Q_ALWAYS_INLINE constexpr void verify (qsizetype pos=0, qsizetype n=1) const

Additional Inherited Members

Protected Types inherited from QVLABaseBase
using malloced_ptr = std::unique_ptr<void, free_deleter>
Protected Attributes inherited from QVLABaseBase
qsizetype a
qsizetype s
voidptr

Detailed Description

template<class T>
class QVLABase< T >

Definition at line 83 of file qvarlengtharray.h.

Member Typedef Documentation

◆ const_iterator

template<class T>
using QVLABase< T >::const_iterator = const T*

Definition at line 94 of file qvarlengtharray.h.

◆ const_pointer

template<class T>
using QVLABase< T >::const_pointer = const value_type*

Definition at line 117 of file qvarlengtharray.h.

◆ const_reference

template<class T>
using QVLABase< T >::const_reference = const value_type&

Definition at line 115 of file qvarlengtharray.h.

◆ const_reverse_iterator

template<class T>
using QVLABase< T >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Definition at line 104 of file qvarlengtharray.h.

◆ difference_type

template<class T>
using QVLABase< T >::difference_type = qptrdiff

Definition at line 118 of file qvarlengtharray.h.

◆ iterator

template<class T>
using QVLABase< T >::iterator = T*

Definition at line 93 of file qvarlengtharray.h.

◆ pointer

template<class T>
using QVLABase< T >::pointer = value_type*

Definition at line 116 of file qvarlengtharray.h.

◆ reference

template<class T>
using QVLABase< T >::reference = value_type&

Definition at line 114 of file qvarlengtharray.h.

◆ reverse_iterator

template<class T>
using QVLABase< T >::reverse_iterator = std::reverse_iterator<iterator>

Definition at line 103 of file qvarlengtharray.h.

◆ value_type

template<class T>
using QVLABase< T >::value_type = T

Definition at line 113 of file qvarlengtharray.h.

Constructor & Destructor Documentation

◆ QVLABase()

template<class T>
QVLABase< T >::QVLABase ( )
protecteddefault

Member Function Documentation

◆ append_impl()

template<class T>
Q_OUTOFLINE_TEMPLATE void QVLABase< T >::append_impl ( qsizetype prealloc,
void * array,
const T * buf,
qsizetype n )
protected

Definition at line 796 of file qvarlengtharray.h.

References end().

Here is the call graph for this function:

◆ assign_impl() [1/7]

template<class T>
template<typename Iterator>
void QVLABase< T >::assign_impl ( qsizetype prealloc,
void * array,
Iterator first,
Iterator last )
protected

◆ assign_impl() [2/7]

template<class T>
template<typename Iterator>
Q_OUTOFLINE_TEMPLATE void QVLABase< T >::assign_impl ( qsizetype prealloc,
void * array,
Iterator first,
Iterator last )

Definition at line 897 of file qvarlengtharray.h.

◆ assign_impl() [3/7]

template<class T>
template<typename Iterator>
void QVLABase< T >::assign_impl ( qsizetype prealloc,
void * array,
Iterator first,
Iterator last,
std::forward_iterator_tag  )
protected

◆ assign_impl() [4/7]

template<class T>
template<typename Iterator>
Q_OUTOFLINE_TEMPLATE void QVLABase< T >::assign_impl ( qsizetype prealloc,
void * array,
Iterator first,
Iterator last,
std::forward_iterator_tag  )

Definition at line 834 of file qvarlengtharray.h.

◆ assign_impl() [5/7]

template<class T>
template<typename Iterator>
void QVLABase< T >::assign_impl ( qsizetype prealloc,
void * array,
Iterator first,
Iterator last,
std::input_iterator_tag  )
protected

◆ assign_impl() [6/7]

template<class T>
template<typename Iterator>
Q_OUTOFLINE_TEMPLATE void QVLABase< T >::assign_impl ( qsizetype prealloc,
void * array,
Iterator first,
Iterator last,
std::input_iterator_tag  )

Definition at line 870 of file qvarlengtharray.h.

◆ assign_impl() [7/7]

template<class T>
Q_OUTOFLINE_TEMPLATE void QVLABase< T >::assign_impl ( qsizetype prealloc,
void * array,
qsizetype n,
const T & t )
protected

Definition at line 816 of file qvarlengtharray.h.

◆ back() [1/2]

template<class T>
reference QVLABase< T >::back ( )
inline

Definition at line 132 of file qvarlengtharray.h.

References rbegin().

Here is the call graph for this function:

◆ back() [2/2]

template<class T>
const_reference QVLABase< T >::back ( ) const
inline

Definition at line 138 of file qvarlengtharray.h.

References rbegin().

Here is the call graph for this function:

◆ begin() [1/2]

template<class T>
const_iterator QVLABase< T >::begin ( ) const
inlinenoexcept

Definition at line 97 of file qvarlengtharray.h.

Referenced by QVLABase< KeyValuePair >::assign_impl(), QVLABase< KeyValuePair >::assign_impl(), cbegin(), QVLABase< KeyValuePair >::contains(), QVLABase< KeyValuePair >::emplace_impl(), equal(), front(), front(), hash(), insert_impl(), less_than(), and rend().

Here is the caller graph for this function:

◆ begin() [2/2]

template<class T>
iterator QVLABase< T >::begin ( )
inlinenoexcept

Definition at line 96 of file qvarlengtharray.h.

◆ cbegin()

template<class T>
const_iterator QVLABase< T >::cbegin ( ) const
inlinenoexcept

Definition at line 98 of file qvarlengtharray.h.

References begin().

Referenced by QVLABase< KeyValuePair >::emplace_impl(), insert_impl(), and isValidIterator().

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

◆ cend()

template<class T>
const_iterator QVLABase< T >::cend ( ) const
inlinenoexcept

Definition at line 101 of file qvarlengtharray.h.

References end().

Referenced by isValidIterator().

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

◆ clear()

template<class T>
void QVLABase< T >::clear ( )
inline

Definition at line 182 of file qvarlengtharray.h.

◆ contains() [1/2]

template<class T>
template<typename AT = T>
bool QVLABase< T >::contains ( const AT & t) const

◆ contains() [2/2]

template<class T>
template<typename AT>
Q_INLINE_TEMPLATE bool QVLABase< T >::contains ( const AT & t) const

Definition at line 784 of file qvarlengtharray.h.

◆ crbegin()

template<class T>
const_reverse_iterator QVLABase< T >::crbegin ( ) const
inlinenoexcept

Definition at line 108 of file qvarlengtharray.h.

References rbegin().

Here is the call graph for this function:

◆ crend()

template<class T>
const_reverse_iterator QVLABase< T >::crend ( ) const
inlinenoexcept

Definition at line 111 of file qvarlengtharray.h.

References rend().

Here is the call graph for this function:

◆ data() [1/2]

template<class T>
const T * QVLABase< T >::data ( ) const
inlinenoexcept

Definition at line 91 of file qvarlengtharray.h.

◆ data() [2/2]

template<class T>
T * QVLABase< T >::data ( )
inlinenoexcept

Definition at line 90 of file qvarlengtharray.h.

◆ emplace_back_impl()

template<class T>
template<typename... Args>
reference QVLABase< T >::emplace_back_impl ( qsizetype prealloc,
void * array,
Args &&... args )
inlineprotected

Definition at line 210 of file qvarlengtharray.h.

◆ emplace_impl() [1/2]

template<class T>
template<typename... Args>
Q_OUTOFLINE_TEMPLATE auto QVLABase< T >::emplace_impl ( qsizetype prealloc,
void * array,
const_iterator before,
Args &&... args ) -> iterator

Definition at line 1007 of file qvarlengtharray.h.

◆ emplace_impl() [2/2]

template<class T>
template<typename... Args>
iterator QVLABase< T >::emplace_impl ( qsizetype prealloc,
void * array,
const_iterator pos,
Args &&... arg )
protected

◆ end() [1/2]

template<class T>
const_iterator QVLABase< T >::end ( ) const
inlinenoexcept

Definition at line 100 of file qvarlengtharray.h.

Referenced by append_impl(), QVLABase< KeyValuePair >::assign_impl(), QVLABase< KeyValuePair >::assign_impl(), cend(), QVLABase< KeyValuePair >::contains(), QVLABase< KeyValuePair >::emplace_impl(), equal(), hash(), insert_impl(), less_than(), and rbegin().

Here is the caller graph for this function:

◆ end() [2/2]

template<class T>
iterator QVLABase< T >::end ( )
inlinenoexcept

Definition at line 99 of file qvarlengtharray.h.

◆ equal()

template<class T>
template<typename S>
bool QVLABase< T >::equal ( const QVLABase< S > & other) const
inlineprotected

Definition at line 224 of file qvarlengtharray.h.

References begin(), and end().

Here is the call graph for this function:

◆ erase() [1/2]

template<class T>
Q_OUTOFLINE_TEMPLATE auto QVLABase< T >::erase ( const_iterator begin,
const_iterator end )

Definition at line 1035 of file qvarlengtharray.h.

References isValidIterator().

Here is the call graph for this function:

◆ erase() [2/2]

template<class T>
iterator QVLABase< T >::erase ( const_iterator pos)
inline

Definition at line 190 of file qvarlengtharray.h.

◆ front() [1/2]

template<class T>
reference QVLABase< T >::front ( )
inline

Definition at line 120 of file qvarlengtharray.h.

References begin().

Here is the call graph for this function:

◆ front() [2/2]

template<class T>
const_reference QVLABase< T >::front ( ) const
inline

Definition at line 126 of file qvarlengtharray.h.

References begin().

Here is the call graph for this function:

◆ growBy()

template<class T>
void QVLABase< T >::growBy ( qsizetype prealloc,
void * array,
qsizetype increment )
inlineprotected

Definition at line 207 of file qvarlengtharray.h.

◆ hash()

template<class T>
size_t QVLABase< T >::hash ( size_t seed) const
inlinenoexcept

Definition at line 202 of file qvarlengtharray.h.

References begin(), and end().

Here is the call graph for this function:

◆ indexOf() [1/2]

template<class T>
template<typename AT>
Q_INLINE_TEMPLATE qsizetype QVLABase< T >::indexOf ( const AT & t,
qsizetype from ) const

Definition at line 749 of file qvarlengtharray.h.

◆ indexOf() [2/2]

template<class T>
template<typename AT = T>
qsizetype QVLABase< T >::indexOf ( const AT & t,
qsizetype from = 0 ) const

◆ insert_impl()

template<class T>
Q_OUTOFLINE_TEMPLATE auto QVLABase< T >::insert_impl ( qsizetype prealloc,
void * array,
const_iterator pos,
qsizetype n,
const T & t )
protected

Definition at line 1022 of file qvarlengtharray.h.

References begin(), cbegin(), end(), and isValidIterator().

Here is the call graph for this function:

◆ isValidIterator()

template<class T>
bool QVLABase< T >::isValidIterator ( const const_iterator & i) const
inlineprotected

Definition at line 272 of file qvarlengtharray.h.

References cbegin(), and cend().

Referenced by QVLABase< KeyValuePair >::emplace_impl(), erase(), and insert_impl().

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

◆ lastIndexOf() [1/2]

template<class T>
template<typename AT>
Q_INLINE_TEMPLATE qsizetype QVLABase< T >::lastIndexOf ( const AT & t,
qsizetype from ) const

Definition at line 765 of file qvarlengtharray.h.

◆ lastIndexOf() [2/2]

template<class T>
template<typename AT = T>
qsizetype QVLABase< T >::lastIndexOf ( const AT & t,
qsizetype from = -1 ) const

◆ less_than()

template<class T>
template<typename S>
bool QVLABase< T >::less_than ( const QVLABase< S > & other) const
inlineprotected

Definition at line 229 of file qvarlengtharray.h.

References begin(), and end().

Here is the call graph for this function:

◆ max_size()

template<class T>
qsizetype QVLABase< T >::max_size ( ) const
inlineconstexprnoexcept

Definition at line 197 of file qvarlengtharray.h.

◆ maxSize()

template<class T>
constexpr qsizetype QVLABase< T >::maxSize ( )
inlinestaticconstexprnoexcept

Definition at line 192 of file qvarlengtharray.h.

◆ operator[]() [1/2]

template<class T>
reference QVLABase< T >::operator[] ( qsizetype idx)
inline

Definition at line 159 of file qvarlengtharray.h.

◆ operator[]() [2/2]

template<class T>
const_reference QVLABase< T >::operator[] ( qsizetype idx) const
inline

Definition at line 164 of file qvarlengtharray.h.

◆ pop_back()

template<class T>
void QVLABase< T >::pop_back ( )
inline

Definition at line 144 of file qvarlengtharray.h.

◆ rbegin() [1/2]

template<class T>
const_reverse_iterator QVLABase< T >::rbegin ( ) const
inlinenoexcept

Definition at line 107 of file qvarlengtharray.h.

References end().

Referenced by back(), back(), and crbegin().

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

◆ rbegin() [2/2]

template<class T>
reverse_iterator QVLABase< T >::rbegin ( )
inlinenoexcept

Definition at line 106 of file qvarlengtharray.h.

◆ reallocate_impl()

template<class T>
Q_OUTOFLINE_TEMPLATE void QVLABase< T >::reallocate_impl ( qsizetype prealloc,
void * array,
qsizetype size,
qsizetype alloc )
protected

Definition at line 904 of file qvarlengtharray.h.

References QVLABaseBase::ptr.

◆ remove()

template<class T>
void QVLABase< T >::remove ( qsizetype i,
qsizetype n = 1 )
inline

Definition at line 974 of file qvarlengtharray.h.

◆ removeAll()

template<class T>
template<typename AT>
qsizetype QVLABase< T >::removeAll ( const AT & t)
inline

Definition at line 979 of file qvarlengtharray.h.

◆ removeIf()

template<class T>
template<typename Predicate>
qsizetype QVLABase< T >::removeIf ( Predicate pred)
inline

Definition at line 987 of file qvarlengtharray.h.

◆ removeOne()

template<class T>
template<typename AT>
bool QVLABase< T >::removeOne ( const AT & t)
inline

Definition at line 983 of file qvarlengtharray.h.

◆ rend() [1/2]

template<class T>
const_reverse_iterator QVLABase< T >::rend ( ) const
inlinenoexcept

Definition at line 110 of file qvarlengtharray.h.

References begin().

Referenced by crend().

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

◆ rend() [2/2]

template<class T>
reverse_iterator QVLABase< T >::rend ( )
inlinenoexcept

Definition at line 109 of file qvarlengtharray.h.

◆ replace()

template<class T>
void QVLABase< T >::replace ( qsizetype i,
const T & t )
inline

Definition at line 999 of file qvarlengtharray.h.

◆ resize_impl() [1/2]

template<class T>
void QVLABase< T >::resize_impl ( qsizetype prealloc,
void * array,
qsizetype sz )
inlineprotected

Definition at line 248 of file qvarlengtharray.h.

◆ resize_impl() [2/2]

template<class T>
void QVLABase< T >::resize_impl ( qsizetype prealloc,
void * array,
qsizetype sz,
const T & v )
inlineprotected

Definition at line 236 of file qvarlengtharray.h.

◆ value() [1/2]

template<class T>
Q_OUTOFLINE_TEMPLATE T QVLABase< T >::value ( qsizetype i) const

Definition at line 949 of file qvarlengtharray.h.

◆ value() [2/2]

template<class T>
Q_OUTOFLINE_TEMPLATE T QVLABase< T >::value ( qsizetype i,
const T & defaultValue ) const

Definition at line 956 of file qvarlengtharray.h.


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