ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cloudViewer::core::SmallVectorTemplateCommon< T, typename > Class Template Reference

#include <SmallVector.h>

Inheritance diagram for cloudViewer::core::SmallVectorTemplateCommon< T, typename >:
Collaboration diagram for cloudViewer::core::SmallVectorTemplateCommon< T, typename >:

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
 
- Public Member Functions inherited from cloudViewer::core::SmallVectorBase< SmallVectorSizeType< T > >
size_t size () const
 
size_t capacity () const
 
bool empty () const
 

Protected Member Functions

 SmallVectorTemplateCommon (size_t Size)
 
void grow_pod (size_t MinSize, size_t TSize)
 
bool isSmall () const
 
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
 
bool isSafeToReferenceAfterResize (const void *Elt, size_t NewSize)
 
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)
 
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 cloudViewer::core::SmallVectorBase< SmallVectorSizeType< T > >
 SmallVectorBase ()=delete
 
 SmallVectorBase (void *FirstEl, size_t TotalCapacity)
 
void * mallocForGrow (size_t MinSize, size_t TSize, size_t &NewCapacity)
 
void grow_pod (void *FirstEl, size_t MinSize, size_t TSize)
 
void set_size (size_t N)
 

Static Protected Member Functions

template<class U >
static const T * reserveForParamAndGetAddressImpl (U *This, const T &Elt, size_t N)
 
- Static Protected Member Functions inherited from cloudViewer::core::SmallVectorBase< SmallVectorSizeType< T > >
static constexpr size_t SizeTypeMax ()
 The maximum value of the Size_T used. More...
 

Additional Inherited Members

- Protected Attributes inherited from cloudViewer::core::SmallVectorBase< SmallVectorSizeType< T > >
void * BeginX
 
SmallVectorSizeType< T > Size
 
SmallVectorSizeType< T > Capacity
 

Detailed Description

template<typename T, typename = void>
class cloudViewer::core::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 ArrayRef to avoid unnecessarily requiring T to be complete.

Definition at line 153 of file SmallVector.h.

Member Typedef Documentation

◆ const_iterator

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

Definition at line 286 of file SmallVector.h.

◆ const_pointer

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

Definition at line 294 of file SmallVector.h.

◆ const_reference

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

Definition at line 292 of file SmallVector.h.

◆ const_reverse_iterator

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

Definition at line 288 of file SmallVector.h.

◆ difference_type

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

Definition at line 283 of file SmallVector.h.

◆ iterator

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

Definition at line 285 of file SmallVector.h.

◆ pointer

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

Definition at line 293 of file SmallVector.h.

◆ reference

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

Definition at line 291 of file SmallVector.h.

◆ reverse_iterator

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

Definition at line 289 of file SmallVector.h.

◆ size_type

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

Definition at line 282 of file SmallVector.h.

◆ value_type

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

Definition at line 284 of file SmallVector.h.

Constructor & Destructor Documentation

◆ SmallVectorTemplateCommon()

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

Definition at line 169 of file SmallVector.h.

Member Function Documentation

◆ assertSafeToAdd()

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

◆ assertSafeToAddRange() [1/2]

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

◆ 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 cloudViewer::core::SmallVectorTemplateCommon< T, typename >::assertSafeToAddRange ( ItTy  ,
ItTy   
)
inlineprotected

Definition at line 258 of file SmallVector.h.

◆ assertSafeToReferenceAfterClear() [1/2]

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

◆ 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 cloudViewer::core::SmallVectorTemplateCommon< T, typename >::assertSafeToReferenceAfterClear ( ItTy  ,
ItTy   
)
inlineprotected

Definition at line 246 of file SmallVector.h.

◆ assertSafeToReferenceAfterResize()

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

◆ back() [1/2]

◆ back() [2/2]

◆ begin() [1/2]

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

Definition at line 301 of file SmallVector.h.

References cloudViewer::core::SmallVectorBase< SmallVectorSizeType< T > >::BeginX.

Referenced by cloudViewer::core::SmallVectorImpl< T >::append(), cloudViewer::core::SmallVectorImpl< T >::assign(), cloudViewer::core::SmallVectorImpl< T >::assignRemote(), cloudViewer::core::HashMap::CheckKeyCompatibility(), cloudViewer::core::HashMap::CheckValueCompatibility(), cloudViewer::core::SmallVectorImpl< T >::clear(), cloudViewer::core::shape_util::Concat(), cloudViewer::core::SmallVectorTemplateCommon< T, typename >::data(), cloudViewer::core::SmallVectorTemplateCommon< T, typename >::end(), cloudViewer::core::SmallVectorImpl< T >::erase(), cloudViewer::core::shape_util::ExpandFrontDims(), cloudViewer::core::TensorList::FromTensor(), cloudViewer::core::SmallVectorTemplateCommon< T, typename >::front(), cloudViewer::core::HashMap::GetKeyTensor(), cloudViewer::core::HashMap::GetValueTensor(), cloudViewer::core::HashMap::GetValueTensors(), cloudViewer::core::SmallVectorTemplateBase< T, bool >::growAndAssign(), cloudViewer::core::SmallVectorTemplateBase< T, true >::growAndAssign(), cloudViewer::core::Tensor::IndexExtract(), cloudViewer::core::SmallVectorImpl< T >::insert(), cloudViewer::core::shape_util::Iota(), cloudViewer::core::SmallVectorTemplateCommon< T, typename >::isRangeInStorage(), cloudViewer::core::SmallVectorTemplateCommon< T, typename >::isReferenceToStorage(), cloudViewer::core::SmallVectorTemplateCommon< T, typename >::isSafeToReferenceAfterResize(), cloudViewer::t::geometry::VoxelBlockGrid::Load(), cloudViewer::core::SizeVector::NumElements(), cloudViewer::core::SizeVector::operator std::vector< int64_t >(), cloudViewer::core::SmallVectorImpl< T >::operator<(), cloudViewer::core::SmallVectorImpl< T >::operator=(), cloudViewer::core::SmallVector< T, N >::operator=(), cloudViewer::core::SmallVectorImpl< T >::operator==(), cloudViewer::core::SmallVectorTemplateCommon< T, typename >::operator[](), cloudViewer::t::io::ReadHashMap(), cloudViewer::core::SmallVectorTemplateCommon< T, typename >::rend(), cloudViewer::core::AdvancedIndexPreprocessor::RestrideIndexTensor(), cloudViewer::core::AdvancedIndexPreprocessor::RestrideTensor(), cloudViewer::core::AdvancedIndexPreprocessor::RunPreprocess(), cloudViewer::core::SmallVectorImpl< T >::swap(), cloudViewer::core::DynamicSizeVector::ToSizeVector(), cloudViewer::core::Tensor::Transpose(), cloudViewer::core::SmallVectorImpl< T >::truncate(), cloudViewer::t::geometry::VoxelBlockGrid::VoxelBlockGrid(), cloudViewer::t::io::WriteNpzOneTensor(), cloudViewer::core::SmallVector< T, N >::~SmallVector(), and cloudViewer::core::SmallVectorImpl< T >::~SmallVectorImpl().

◆ begin() [2/2]

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

◆ capacity_in_bytes()

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

◆ data() [1/2]

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

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

Definition at line 324 of file SmallVector.h.

References cloudViewer::core::SmallVectorTemplateCommon< T, typename >::begin().

◆ data() [2/2]

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

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

Definition at line 326 of file SmallVector.h.

References cloudViewer::core::SmallVectorTemplateCommon< T, typename >::begin().

◆ end() [1/2]

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

Definition at line 303 of file SmallVector.h.

References cloudViewer::core::SmallVectorTemplateCommon< T, typename >::begin(), and cloudViewer::core::SmallVectorBase< SmallVectorSizeType< T > >::size().

Referenced by cloudViewer::core::SmallVectorImpl< T >::append(), cloudViewer::core::SmallVectorImpl< T >::assign(), cloudViewer::core::SmallVectorImpl< T >::assignRemote(), cloudViewer::core::SmallVectorTemplateCommon< T, typename >::back(), cloudViewer::core::SmallVectorImpl< T >::clear(), cloudViewer::core::shape_util::Concat(), cloudViewer::core::SmallVectorImpl< T >::emplace_back(), cloudViewer::core::SmallVectorImpl< T >::erase(), cloudViewer::core::shape_util::ExpandFrontDims(), cloudViewer::core::TensorList::FromTensor(), cloudViewer::core::SmallVectorTemplateBase< T, bool >::growAndAssign(), cloudViewer::core::SmallVectorImpl< T >::insert(), cloudViewer::core::shape_util::Iota(), cloudViewer::core::SmallVectorTemplateCommon< T, typename >::isRangeInStorage(), cloudViewer::core::SmallVectorTemplateCommon< T, typename >::isReferenceToStorage(), cloudViewer::core::SizeVector::NumElements(), cloudViewer::core::SizeVector::operator std::vector< int64_t >(), cloudViewer::core::SmallVectorImpl< T >::operator<(), cloudViewer::core::SmallVectorImpl< T >::operator=(), cloudViewer::core::SmallVector< T, N >::operator=(), cloudViewer::core::SmallVectorImpl< T >::operator==(), cloudViewer::core::SmallVectorTemplateBase< T, bool >::pop_back(), cloudViewer::core::SmallVectorTemplateBase< T, bool >::push_back(), cloudViewer::core::SmallVectorTemplateBase< T, true >::push_back(), cloudViewer::core::SmallVectorTemplateCommon< T, typename >::rbegin(), cloudViewer::t::io::ReadHashMap(), cloudViewer::core::AdvancedIndexPreprocessor::RestrideIndexTensor(), cloudViewer::core::AdvancedIndexPreprocessor::RestrideTensor(), cloudViewer::core::AdvancedIndexPreprocessor::RunPreprocess(), cloudViewer::core::SmallVectorImpl< T >::swap(), cloudViewer::core::DynamicSizeVector::ToSizeVector(), cloudViewer::core::Tensor::Transpose(), cloudViewer::core::SmallVectorImpl< T >::truncate(), cloudViewer::t::geometry::VoxelBlockGrid::VoxelBlockGrid(), cloudViewer::t::io::WriteNpzOneTensor(), and cloudViewer::core::SmallVector< T, N >::~SmallVector().

◆ end() [2/2]

◆ front() [1/2]

◆ front() [2/2]

◆ grow_pod()

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

◆ isRangeInStorage()

template<typename T , typename = void>
bool cloudViewer::core::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.

Definition at line 202 of file SmallVector.h.

References cloudViewer::core::SmallVectorTemplateCommon< T, typename >::begin(), and cloudViewer::core::SmallVectorTemplateCommon< T, typename >::end().

Referenced by cloudViewer::core::SmallVectorImpl< T >::erase().

◆ isReferenceToRange()

template<typename T , typename = void>
bool cloudViewer::core::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.

Definition at line 187 of file SmallVector.h.

Referenced by cloudViewer::core::SmallVectorTemplateCommon< T, typename >::isReferenceToStorage().

◆ isReferenceToStorage()

◆ isSafeToReferenceAfterResize()

◆ isSmall()

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

◆ max_size()

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

◆ operator[]() [1/2]

◆ operator[]() [2/2]

◆ rbegin() [1/2]

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

◆ rbegin() [2/2]

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

◆ rend() [1/2]

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

◆ rend() [2/2]

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

◆ reserveForParamAndGetAddressImpl()

template<typename T , typename = void>
template<class U >
static const T* cloudViewer::core::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.

Definition at line 263 of file SmallVector.h.

References cloudViewer::core::SmallVectorBase< SmallVectorSizeType< T > >::capacity(), LLVM_LIKELY, and LLVM_UNLIKELY.

Referenced by cloudViewer::core::SmallVectorTemplateBase< T, bool >::reserveForParamAndGetAddress(), and cloudViewer::core::SmallVectorTemplateBase< T, true >::reserveForParamAndGetAddress().

◆ resetToSmall()

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

◆ size_in_bytes()

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

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