WPILibC++ 2024.1.1-beta-4
wpi::SmallVectorTemplateCommon< T, typename > Class Template Reference

This is the part of SmallVectorTemplateBase which does not depend on whether the type T is a POD. More...

#include </home/runner/work/allwpilib/allwpilib/wpiutil/src/main/native/thirdparty/llvm/include/wpi/SmallVector.h>

Inheritance diagram for wpi::SmallVectorTemplateCommon< T, typename >:
wpi::SmallVectorBase wpi::SmallVectorTemplateBase< T, bool > wpi::SmallVectorTemplateBase< T, true > wpi::SmallVectorImpl< T > wpi::SmallVector< T, N > wpi::SmallVector< T, N >

Public Types

using size_type = size_t
 
using difference_type = ptrdiff_t
 
using value_type = T
 
using iterator = T *
 
using const_iterator = const T *
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 
using reverse_iterator = std::reverse_iterator< iterator >
 
using reference = T &
 
using const_reference = const T &
 
using pointer = T *
 
using const_pointer = const T *
 

Public Member Functions

iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
size_type size_in_bytes () const
 
size_type max_size () const
 
size_t capacity_in_bytes () const
 
pointer data ()
 Return a pointer to the vector's buffer, even if empty(). More...
 
const_pointer data () const
 Return a pointer to the vector's buffer, even if empty(). More...
 
reference operator[] (size_type idx)
 
const_reference operator[] (size_type idx) const
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
size_t capacity () const
 
bool empty () const
 
size_t size () const
 
- Public Member Functions inherited from wpi::SmallVectorBase
size_t size () const
 
size_t capacity () const
 
bool empty () const
 

Protected Member Functions

void * getFirstEl () const
 Find the address of the first element. More...
 
 SmallVectorTemplateCommon (size_t Size)
 
void grow_pod (size_t MinSize, size_t TSize)
 
bool isSmall () const
 Return true if this is a smallvector which has not had dynamic memory allocated for it. More...
 
void resetToSmall ()
 Put this vector in a state of being small. More...
 
bool isReferenceToRange (const void *V, const void *First, const void *Last) const
 Return true if V is an internal reference to the given range. More...
 
bool isReferenceToStorage (const void *V) const
 Return true if V is an internal reference to this vector. More...
 
bool isRangeInStorage (const void *First, const void *Last) const
 Return true if First and Last form a valid (possibly empty) range in this vector's storage. More...
 
bool isSafeToReferenceAfterResize (const void *Elt, size_t NewSize)
 Return true unless Elt will be invalidated by resizing the vector to NewSize. More...
 
void assertSafeToReferenceAfterResize (const void *Elt, size_t NewSize)
 Check whether Elt will be invalidated by resizing the vector to NewSize. More...
 
void assertSafeToAdd (const void *Elt, size_t N=1)
 Check whether Elt will be invalidated by increasing the size of the vector by N. More...
 
void assertSafeToReferenceAfterClear (const T *From, const T *To)
 Check whether any part of the range will be invalidated by clearing. More...
 
template<class ItTy , std::enable_if_t<!std::is_same< std::remove_const_t< ItTy >, T * >::value, bool > = false>
void assertSafeToReferenceAfterClear (ItTy, ItTy)
 
void assertSafeToAddRange (const T *From, const T *To)
 Check whether any part of the range will be invalidated by growing. More...
 
template<class ItTy , std::enable_if_t<!std::is_same< std::remove_const_t< ItTy >, T * >::value, bool > = false>
void assertSafeToAddRange (ItTy, ItTy)
 
- Protected Member Functions inherited from wpi::SmallVectorBase
 SmallVectorBase ()=delete
 
 SmallVectorBase (void *FirstEl, size_t TotalCapacity)
 
void * mallocForGrow (void *FirstEl, size_t MinSize, size_t TSize, size_t &NewCapacity)
 This is a helper for grow() that's out of line to reduce code duplication. More...
 
void grow_pod (void *FirstEl, size_t MinSize, size_t TSize)
 This is an implementation of the grow() method which only works on POD-like data types and is out of line to reduce code duplication. More...
 
void * replaceAllocation (void *NewElts, size_t TSize, size_t NewCapacity, size_t VSize=0)
 If vector was first created with capacity 0, getFirstEl() points to the memory right after, an area unallocated. More...
 
void set_size (size_t N)
 Set the array size to N, which the current array must have enough capacity for. More...
 

Static Protected Member Functions

template<class U >
static const T * reserveForParamAndGetAddressImpl (U *This, const T &Elt, size_t N)
 Reserve enough space to add one element, and return the updated element pointer in case it was a reference to the storage. More...
 
- Static Protected Member Functions inherited from wpi::SmallVectorBase
static constexpr size_t SizeTypeMax ()
 The maximum value of the Size_T used. More...
 

Additional Inherited Members

- Protected Attributes inherited from wpi::SmallVectorBase
void * BeginX
 
unsigned Size = 0
 
unsigned Capacity
 

Detailed Description

template<typename T, typename = void>
class wpi::SmallVectorTemplateCommon< T, typename >

This is the part of SmallVectorTemplateBase which does not depend on whether the type T is a POD.

The extra dummy template argument is used by std::span to avoid unnecessarily requiring T to be complete.

Member Typedef Documentation

◆ const_iterator

template<typename T , typename = void>
using wpi::SmallVectorTemplateCommon< T, typename >::const_iterator = const T *

◆ const_pointer

template<typename T , typename = void>
using wpi::SmallVectorTemplateCommon< T, typename >::const_pointer = const T *

◆ const_reference

template<typename T , typename = void>
using wpi::SmallVectorTemplateCommon< T, typename >::const_reference = const T &

◆ const_reverse_iterator

template<typename T , typename = void>
using wpi::SmallVectorTemplateCommon< T, typename >::const_reverse_iterator = std::reverse_iterator<const_iterator>

◆ difference_type

template<typename T , typename = void>
using wpi::SmallVectorTemplateCommon< T, typename >::difference_type = ptrdiff_t

◆ iterator

template<typename T , typename = void>
using wpi::SmallVectorTemplateCommon< T, typename >::iterator = T *

◆ pointer

template<typename T , typename = void>
using wpi::SmallVectorTemplateCommon< T, typename >::pointer = T *

◆ reference

template<typename T , typename = void>
using wpi::SmallVectorTemplateCommon< T, typename >::reference = T &

◆ reverse_iterator

template<typename T , typename = void>
using wpi::SmallVectorTemplateCommon< T, typename >::reverse_iterator = std::reverse_iterator<iterator>

◆ size_type

template<typename T , typename = void>
using wpi::SmallVectorTemplateCommon< T, typename >::size_type = size_t

◆ value_type

template<typename T , typename = void>
using wpi::SmallVectorTemplateCommon< T, typename >::value_type = T

Constructor & Destructor Documentation

◆ SmallVectorTemplateCommon()

template<typename T , typename = void>
wpi::SmallVectorTemplateCommon< T, typename >::SmallVectorTemplateCommon ( size_t  Size)
inlineprotected

Member Function Documentation

◆ assertSafeToAdd()

template<typename T , typename = void>
void wpi::SmallVectorTemplateCommon< T, typename >::assertSafeToAdd ( const void *  Elt,
size_t  N = 1 
)
inlineprotected

Check whether Elt will be invalidated by increasing the size of the vector by N.

◆ assertSafeToAddRange() [1/2]

template<typename T , typename = void>
void wpi::SmallVectorTemplateCommon< T, typename >::assertSafeToAddRange ( const T *  From,
const T *  To 
)
inlineprotected

Check whether any part of the range will be invalidated by growing.

◆ assertSafeToAddRange() [2/2]

template<typename T , typename = void>
template<class ItTy , std::enable_if_t<!std::is_same< std::remove_const_t< ItTy >, T * >::value, bool > = false>
void wpi::SmallVectorTemplateCommon< T, typename >::assertSafeToAddRange ( ItTy  ,
ItTy   
)
inlineprotected

◆ assertSafeToReferenceAfterClear() [1/2]

template<typename T , typename = void>
void wpi::SmallVectorTemplateCommon< T, typename >::assertSafeToReferenceAfterClear ( const T *  From,
const T *  To 
)
inlineprotected

Check whether any part of the range will be invalidated by clearing.

◆ assertSafeToReferenceAfterClear() [2/2]

template<typename T , typename = void>
template<class ItTy , std::enable_if_t<!std::is_same< std::remove_const_t< ItTy >, T * >::value, bool > = false>
void wpi::SmallVectorTemplateCommon< T, typename >::assertSafeToReferenceAfterClear ( ItTy  ,
ItTy   
)
inlineprotected

◆ assertSafeToReferenceAfterResize()

template<typename T , typename = void>
void wpi::SmallVectorTemplateCommon< T, typename >::assertSafeToReferenceAfterResize ( const void *  Elt,
size_t  NewSize 
)
inlineprotected

Check whether Elt will be invalidated by resizing the vector to NewSize.

◆ back() [1/2]

template<typename T , typename = void>
reference wpi::SmallVectorTemplateCommon< T, typename >::back ( )
inline

◆ back() [2/2]

template<typename T , typename = void>
const_reference wpi::SmallVectorTemplateCommon< T, typename >::back ( ) const
inline

◆ begin() [1/2]

template<typename T , typename = void>
iterator wpi::SmallVectorTemplateCommon< T, typename >::begin ( )
inline

◆ begin() [2/2]

template<typename T , typename = void>
const_iterator wpi::SmallVectorTemplateCommon< T, typename >::begin ( ) const
inline

◆ capacity()

template<typename T , typename = void>
size_t wpi::SmallVectorBase::capacity ( ) const
inline

◆ capacity_in_bytes()

template<typename T , typename = void>
size_t wpi::SmallVectorTemplateCommon< T, typename >::capacity_in_bytes ( ) const
inline

◆ data() [1/2]

template<typename T , typename = void>
pointer wpi::SmallVectorTemplateCommon< T, typename >::data ( )
inline

Return a pointer to the vector's buffer, even if empty().

◆ data() [2/2]

template<typename T , typename = void>
const_pointer wpi::SmallVectorTemplateCommon< T, typename >::data ( ) const
inline

Return a pointer to the vector's buffer, even if empty().

◆ empty()

template<typename T , typename = void>
bool wpi::SmallVectorBase::empty ( ) const
inline

◆ end() [1/2]

template<typename T , typename = void>
iterator wpi::SmallVectorTemplateCommon< T, typename >::end ( )
inline

◆ end() [2/2]

template<typename T , typename = void>
const_iterator wpi::SmallVectorTemplateCommon< T, typename >::end ( ) const
inline

◆ front() [1/2]

template<typename T , typename = void>
reference wpi::SmallVectorTemplateCommon< T, typename >::front ( )
inline

◆ front() [2/2]

template<typename T , typename = void>
const_reference wpi::SmallVectorTemplateCommon< T, typename >::front ( ) const
inline

◆ getFirstEl()

template<typename T , typename = void>
void * wpi::SmallVectorTemplateCommon< T, typename >::getFirstEl ( ) const
inlineprotected

Find the address of the first element.

For this pointer math to be valid with small-size of 0 for T with lots of alignment, it's important that SmallVectorStorage is properly-aligned even for small-size of 0.

◆ grow_pod()

template<typename T , typename = void>
void wpi::SmallVectorTemplateCommon< T, typename >::grow_pod ( size_t  MinSize,
size_t  TSize 
)
inlineprotected

◆ isRangeInStorage()

template<typename T , typename = void>
bool wpi::SmallVectorTemplateCommon< T, typename >::isRangeInStorage ( const void *  First,
const void *  Last 
) const
inlineprotected

Return true if First and Last form a valid (possibly empty) range in this vector's storage.

◆ isReferenceToRange()

template<typename T , typename = void>
bool wpi::SmallVectorTemplateCommon< T, typename >::isReferenceToRange ( const void *  V,
const void *  First,
const void *  Last 
) const
inlineprotected

Return true if V is an internal reference to the given range.

◆ isReferenceToStorage()

template<typename T , typename = void>
bool wpi::SmallVectorTemplateCommon< T, typename >::isReferenceToStorage ( const void *  V) const
inlineprotected

Return true if V is an internal reference to this vector.

◆ isSafeToReferenceAfterResize()

template<typename T , typename = void>
bool wpi::SmallVectorTemplateCommon< T, typename >::isSafeToReferenceAfterResize ( const void *  Elt,
size_t  NewSize 
)
inlineprotected

Return true unless Elt will be invalidated by resizing the vector to NewSize.

◆ isSmall()

template<typename T , typename = void>
bool wpi::SmallVectorTemplateCommon< T, typename >::isSmall ( ) const
inlineprotected

Return true if this is a smallvector which has not had dynamic memory allocated for it.

◆ max_size()

template<typename T , typename = void>
size_type wpi::SmallVectorTemplateCommon< T, typename >::max_size ( ) const
inline

◆ operator[]() [1/2]

template<typename T , typename = void>
reference wpi::SmallVectorTemplateCommon< T, typename >::operator[] ( size_type  idx)
inline

◆ operator[]() [2/2]

template<typename T , typename = void>
const_reference wpi::SmallVectorTemplateCommon< T, typename >::operator[] ( size_type  idx) const
inline

◆ rbegin() [1/2]

template<typename T , typename = void>
reverse_iterator wpi::SmallVectorTemplateCommon< T, typename >::rbegin ( )
inline

◆ rbegin() [2/2]

template<typename T , typename = void>
const_reverse_iterator wpi::SmallVectorTemplateCommon< T, typename >::rbegin ( ) const
inline

◆ rend() [1/2]

template<typename T , typename = void>
reverse_iterator wpi::SmallVectorTemplateCommon< T, typename >::rend ( )
inline

◆ rend() [2/2]

template<typename T , typename = void>
const_reverse_iterator wpi::SmallVectorTemplateCommon< T, typename >::rend ( ) const
inline

◆ reserveForParamAndGetAddressImpl()

template<typename T , typename = void>
template<class U >
static const T * wpi::SmallVectorTemplateCommon< T, typename >::reserveForParamAndGetAddressImpl ( U *  This,
const T &  Elt,
size_t  N 
)
inlinestaticprotected

Reserve enough space to add one element, and return the updated element pointer in case it was a reference to the storage.

◆ resetToSmall()

template<typename T , typename = void>
void wpi::SmallVectorTemplateCommon< T, typename >::resetToSmall ( )
inlineprotected

Put this vector in a state of being small.

◆ size()

template<typename T , typename = void>
size_t wpi::SmallVectorBase::size ( ) const
inline

◆ size_in_bytes()

template<typename T , typename = void>
size_type wpi::SmallVectorTemplateCommon< T, typename >::size_in_bytes ( ) const
inline

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