Blender V5.0
blender::GroupedSpan< T > Struct Template Reference

#include <BLI_offset_indices.hh>

Public Member Functions

 GroupedSpan ()=default
 GroupedSpan (OffsetIndices< int > offsets, Span< T > data)
Span< Toperator[] (const int64_t index) const
int64_t size () const
IndexRange index_range () const
bool is_empty () const

Public Attributes

OffsetIndices< int > offsets
Span< Tdata

Detailed Description

template<typename T>
struct blender::GroupedSpan< T >

References many separate spans in a larger contiguous array. This gives a more efficient way to store many grouped arrays, without requiring many small allocations, giving the general benefits of using contiguous memory.

Note
If the offsets are shared between many GroupedSpan objects, it will be more efficient to retrieve the IndexRange only once and slice each span.

Definition at line 120 of file BLI_offset_indices.hh.

Constructor & Destructor Documentation

◆ GroupedSpan() [1/2]

template<typename T>
blender::offset_indices::GroupedSpan< T >::GroupedSpan ( )
default

◆ GroupedSpan() [2/2]

template<typename T>
blender::offset_indices::GroupedSpan< T >::GroupedSpan ( OffsetIndices< int > offsets,
Span< T > data )
inline

Definition at line 125 of file BLI_offset_indices.hh.

Member Function Documentation

◆ index_range()

template<typename T>
IndexRange blender::offset_indices::GroupedSpan< T >::index_range ( ) const
inline

Definition at line 140 of file BLI_offset_indices.hh.

◆ is_empty()

template<typename T>
bool blender::offset_indices::GroupedSpan< T >::is_empty ( ) const
inline

Definition at line 145 of file BLI_offset_indices.hh.

◆ operator[]()

template<typename T>
Span< T > blender::offset_indices::GroupedSpan< T >::operator[] ( const int64_t index) const
inline

Definition at line 130 of file BLI_offset_indices.hh.

◆ size()

template<typename T>
int64_t blender::offset_indices::GroupedSpan< T >::size ( ) const
inline

Definition at line 135 of file BLI_offset_indices.hh.

Member Data Documentation

◆ data

template<typename T>
Span<T> blender::offset_indices::GroupedSpan< T >::data

Definition at line 122 of file BLI_offset_indices.hh.

◆ offsets

template<typename T>
OffsetIndices<int> blender::offset_indices::GroupedSpan< T >::offsets

Definition at line 121 of file BLI_offset_indices.hh.


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