ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cloudViewer::core::SmallVectorBase< Size_T > Class Template Reference

#include <SmallVector.h>

Inheritance diagram for cloudViewer::core::SmallVectorBase< Size_T >:

Public Member Functions

size_t size () const
 
size_t capacity () const
 
bool empty () const
 

Protected Member Functions

 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

static constexpr size_t SizeTypeMax ()
 The maximum value of the Size_T used. More...
 

Protected Attributes

void * BeginX
 
Size_T Size = 0
 
Size_T Capacity
 

Detailed Description

template<class Size_T>
class cloudViewer::core::SmallVectorBase< Size_T >

This is all the stuff common to all SmallVectors.

The template parameter specifies the type which should be used to hold the Size and Capacity of the SmallVector, so it can be adjusted. Using 32 bit size is desirable to shrink the size of the SmallVector. Using 64 bit size is desirable for cases like SmallVector<char>, where a 32 bit size would limit the vector to ~4GB. SmallVectors are used for buffering bitcode output - which can exceed 4GB.

Definition at line 94 of file SmallVector.h.

Constructor & Destructor Documentation

◆ SmallVectorBase() [1/2]

template<class Size_T >
cloudViewer::core::SmallVectorBase< Size_T >::SmallVectorBase ( )
protecteddelete

◆ SmallVectorBase() [2/2]

template<class Size_T >
cloudViewer::core::SmallVectorBase< Size_T >::SmallVectorBase ( void *  FirstEl,
size_t  TotalCapacity 
)
inlineprotected

Definition at line 105 of file SmallVector.h.

Member Function Documentation

◆ capacity()

template<class Size_T >
size_t cloudViewer::core::SmallVectorBase< Size_T >::capacity ( ) const
inline

◆ empty()

template<class Size_T >
bool cloudViewer::core::SmallVectorBase< Size_T >::empty ( ) const
inline

◆ grow_pod()

template<class Size_T >
void cloudViewer::core::SmallVectorBase< Size_T >::grow_pod ( void *  FirstEl,
size_t  MinSize,
size_t  TSize 
)
protected

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. This function will report a fatal error if it cannot increase capacity.

Definition at line 134 of file SmallVector.cpp.

References cloudViewer::core::safe_malloc(), cloudViewer::core::safe_realloc(), and size.

◆ mallocForGrow()

template<class Size_T >
void * cloudViewer::core::SmallVectorBase< Size_T >::mallocForGrow ( size_t  MinSize,
size_t  TSize,
size_t &  NewCapacity 
)
protected

This is a helper for grow() that's out of line to reduce code duplication. This function will report a fatal error if it can't grow at least to MinSize.

Definition at line 125 of file SmallVector.cpp.

References cloudViewer::core::safe_malloc().

◆ set_size()

template<class Size_T >
void cloudViewer::core::SmallVectorBase< Size_T >::set_size ( size_t  N)
inlineprotected

Set the array size to N, which the current array must have enough capacity for.

This does not construct or destroy any elements in the vector.

Definition at line 129 of file SmallVector.h.

References cloudViewer::core::SmallVectorBase< Size_T >::capacity(), and cloudViewer::core::SmallVectorBase< Size_T >::Size.

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

◆ size()

template<class Size_T >
size_t cloudViewer::core::SmallVectorBase< Size_T >::size ( ) const
inline

Definition at line 119 of file SmallVector.h.

References cloudViewer::core::SmallVectorBase< Size_T >::Size.

Referenced by cloudViewer::core::AddMM(), cloudViewer::core::AdvancedIndexer::AdvancedIndexer(), cloudViewer::core::Tensor::AssignObject(), cloudViewer::core::shape_util::BroadcastedShape(), cloudViewer::core::CheckInput(), cloudViewer::t::pipelines::kernel::ComputeFPFHFeature(), cloudViewer::t::pipelines::registration::ComputeFPFHFeature(), cloudViewer::t::io::CreateNumpyHeader(), cloudViewer::core::shape_util::DefaultStrides(), cloudViewer::core::Tensor::Diag(), cloudViewer::core::Tensor::Expand(), cloudViewer::core::shape_util::ExpandFrontDims(), cloudViewer::core::TensorList::FromTensor(), cloudViewer::core::Indexer::Indexer(), cloudViewer::core::Tensor::IndexExtract(), cloudViewer::core::tensor_init::InferShape(), cloudViewer::core::shape_util::InferShape(), cloudViewer::core::Inverse(), cloudViewer::core::SizeVector::IsCompatible(), cloudViewer::core::shape_util::IsCompatibleBroadcastShape(), cloudViewer::core::LeastSquares(), cloudViewer::core::LUIpiv(), cloudViewer::core::Matmul(), cloudViewer::core::Tensor::NumDims(), cloudViewer::core::SmallVectorImpl< T >::operator=(), cloudViewer::core::SmallVectorImpl< T >::operator==(), cloudViewer::core::TensorRef::Permute(), cloudViewer::core::Tensor::Permute(), cloudViewer::core::PyArrayToTensor(), cloudViewer::t::geometry::pybind_image(), cloudViewer::core::kernel::Reduction(), cloudViewer::core::shape_util::ReductionShape(), cloudViewer::core::shape_util::Restride(), cloudViewer::core::AdvancedIndexPreprocessor::RestrideTensor(), cloudViewer::core::Tensor::Slice(), cloudViewer::core::Solve(), cloudViewer::core::SVD(), cloudViewer::core::SmallVectorImpl< T >::swap(), cloudViewer::t::geometry::kernel::TArrayIndexer< index_t >::TArrayIndexer(), cloudViewer::core::eigen_converter::TensorToEigenMatrix(), and cloudViewer::core::Tensor::ToString().

◆ SizeTypeMax()

template<class Size_T >
static constexpr size_t cloudViewer::core::SmallVectorBase< Size_T >::SizeTypeMax ( )
inlinestaticconstexprprotected

The maximum value of the Size_T used.

Definition at line 100 of file SmallVector.h.

References max().

Member Data Documentation

◆ BeginX

template<class Size_T >
void* cloudViewer::core::SmallVectorBase< Size_T >::BeginX
protected

Definition at line 96 of file SmallVector.h.

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

◆ Capacity

template<class Size_T >
Size_T cloudViewer::core::SmallVectorBase< Size_T >::Capacity
protected

◆ Size


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