Blender V4.3
blender::VectorList< T, CapacityStart, CapacitySoftLimit > Class Template Reference

#include <BLI_vector_list.hh>

Public Types

using UsedVector = Vector<T, 0>
 

Public Member Functions

 VectorList ()
 
void append (const T &value)
 
void append (T &&value)
 
template<typename ForwardT >
void append_as (ForwardT &&value)
 
UsedVectorbegin ()
 
UsedVectorend ()
 
const UsedVectorbegin () const
 
const UsedVectorend () const
 
Tlast ()
 
int64_t size () const
 

Detailed Description

template<typename T, int64_t CapacityStart = 32, int64_t CapacitySoftLimit = 4096>
class blender::VectorList< T, CapacityStart, CapacitySoftLimit >

A VectorList is a vector of vectors.

VectorList can be used when:

1) Don't know up front the number of elements that will be added to the list. Use array or vector.reserve when known up front.

2) Number of reads/writes doesn't require sequential access of the whole list. A vector ensures memory is sequential which is fast when reading, writing can have overhead when the reserved memory is full.

When a VectorList reserved memory is full it will allocate memory for the new items, breaking the sequential access. Within each allocated memory block the elements are ordered sequentially.

Definition at line 29 of file BLI_vector_list.hh.

Member Typedef Documentation

◆ UsedVector

template<typename T , int64_t CapacityStart = 32, int64_t CapacitySoftLimit = 4096>
using blender::VectorList< T, CapacityStart, CapacitySoftLimit >::UsedVector = Vector<T, 0>

Definition at line 31 of file BLI_vector_list.hh.

Constructor & Destructor Documentation

◆ VectorList()

template<typename T , int64_t CapacityStart = 32, int64_t CapacitySoftLimit = 4096>
blender::VectorList< T, CapacityStart, CapacitySoftLimit >::VectorList ( )
inline

Definition at line 40 of file BLI_vector_list.hh.

Member Function Documentation

◆ append() [1/2]

template<typename T , int64_t CapacityStart = 32, int64_t CapacitySoftLimit = 4096>
void blender::VectorList< T, CapacityStart, CapacitySoftLimit >::append ( const T & value)
inline

◆ append() [2/2]

template<typename T , int64_t CapacityStart = 32, int64_t CapacitySoftLimit = 4096>
void blender::VectorList< T, CapacityStart, CapacitySoftLimit >::append ( T && value)
inline

◆ append_as()

template<typename T , int64_t CapacityStart = 32, int64_t CapacitySoftLimit = 4096>
template<typename ForwardT >
void blender::VectorList< T, CapacityStart, CapacitySoftLimit >::append_as ( ForwardT && value)
inline

◆ begin() [1/2]

template<typename T , int64_t CapacityStart = 32, int64_t CapacitySoftLimit = 4096>
UsedVector * blender::VectorList< T, CapacityStart, CapacitySoftLimit >::begin ( )
inline

◆ begin() [2/2]

template<typename T , int64_t CapacityStart = 32, int64_t CapacitySoftLimit = 4096>
const UsedVector * blender::VectorList< T, CapacityStart, CapacitySoftLimit >::begin ( ) const
inline

◆ end() [1/2]

template<typename T , int64_t CapacityStart = 32, int64_t CapacitySoftLimit = 4096>
UsedVector * blender::VectorList< T, CapacityStart, CapacitySoftLimit >::end ( )
inline

◆ end() [2/2]

template<typename T , int64_t CapacityStart = 32, int64_t CapacitySoftLimit = 4096>
const UsedVector * blender::VectorList< T, CapacityStart, CapacitySoftLimit >::end ( ) const
inline

◆ last()

template<typename T , int64_t CapacityStart = 32, int64_t CapacitySoftLimit = 4096>
T & blender::VectorList< T, CapacityStart, CapacitySoftLimit >::last ( )
inline

◆ size()

template<typename T , int64_t CapacityStart = 32, int64_t CapacitySoftLimit = 4096>
int64_t blender::VectorList< T, CapacityStart, CapacitySoftLimit >::size ( ) const
inline

Definition at line 86 of file BLI_vector_list.hh.

References result.


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