Blender V4.3
blender::VArrayImpl_For_Span< T > Class Template Reference

#include <BLI_virtual_array.hh>

Inherits blender::VMutableArrayImpl< T >.

Inherited by blender::VArrayImpl_For_Span_final< T >.

Public Member Functions

 VArrayImpl_For_Span (const MutableSpan< T > data)
 
- Public Member Functions inherited from blender::VMutableArrayImpl< T >
virtual void set_all (Span< T > src)
 
virtual bool try_assign_GVMutableArray (GVMutableArray &) const
 
- Public Member Functions inherited from blender::VArrayImpl< T >
 VArrayImpl (const int64_t size)
 
virtual ~VArrayImpl ()=default
 
int64_t size () const
 
virtual bool try_assign_GVArray (GVArray &) const
 

Protected Member Functions

 VArrayImpl_For_Span (const int64_t size)
 
T get (const int64_t index) const final
 
void set (const int64_t index, T value) final
 
CommonVArrayInfo common_info () const override
 
void materialize (const IndexMask &mask, T *dst) const override
 
void materialize_to_uninitialized (const IndexMask &mask, T *dst) const override
 
void materialize_compressed (const IndexMask &mask, T *dst) const override
 
void materialize_compressed_to_uninitialized (const IndexMask &mask, T *dst) const override
 

Protected Attributes

Tdata_ = nullptr
 
- Protected Attributes inherited from blender::VArrayImpl< T >
int64_t size_
 

Detailed Description

template<typename T>
class blender::VArrayImpl_For_Span< T >

A virtual array implementation that references that wraps a span. This implementation is used by mutable and immutable spans to avoid code duplication.

Definition at line 197 of file BLI_virtual_array.hh.

Constructor & Destructor Documentation

◆ VArrayImpl_For_Span() [1/2]

template<typename T >
blender::VArrayImpl_For_Span< T >::VArrayImpl_For_Span ( const MutableSpan< T > data)
inline

Definition at line 202 of file BLI_virtual_array.hh.

◆ VArrayImpl_For_Span() [2/2]

template<typename T >
blender::VArrayImpl_For_Span< T >::VArrayImpl_For_Span ( const int64_t size)
inlineprotected

Definition at line 208 of file BLI_virtual_array.hh.

Member Function Documentation

◆ common_info()

template<typename T >
CommonVArrayInfo blender::VArrayImpl_For_Span< T >::common_info ( ) const
inlineoverrideprotectedvirtual

◆ get()

template<typename T >
T blender::VArrayImpl_For_Span< T >::get ( const int64_t index) const
inlinefinalprotectedvirtual

Get the element at #index. This does not return a reference, because the value may be computed on the fly.

Implements blender::VArrayImpl< T >.

Definition at line 210 of file BLI_virtual_array.hh.

References blender::VArrayImpl_For_Span< T >::data_.

◆ materialize()

template<typename T >
void blender::VArrayImpl_For_Span< T >::materialize ( const IndexMask & mask,
T * dst ) const
inlineoverrideprotectedvirtual

Copy values from the virtual array into the provided span. The index of the value in the virtual array is the same as the index in the span.

Reimplemented from blender::VArrayImpl< T >.

Definition at line 225 of file BLI_virtual_array.hh.

References blender::VArrayImpl_For_Span< T >::data_.

◆ materialize_compressed()

template<typename T >
void blender::VArrayImpl_For_Span< T >::materialize_compressed ( const IndexMask & mask,
T * dst ) const
inlineoverrideprotectedvirtual

Copy values from the virtual array into the provided span. Contrary to materialize, the index in virtual array is not the same as the index in the output span. Instead, the span is filled without gaps.

Reimplemented from blender::VArrayImpl< T >.

Definition at line 235 of file BLI_virtual_array.hh.

References blender::VArrayImpl_For_Span< T >::data_, and pos.

◆ materialize_compressed_to_uninitialized()

template<typename T >
void blender::VArrayImpl_For_Span< T >::materialize_compressed_to_uninitialized ( const IndexMask & mask,
T * dst ) const
inlineoverrideprotectedvirtual

Same as materialize_compressed but #r_span is expected to be uninitialized.

Reimplemented from blender::VArrayImpl< T >.

Definition at line 241 of file BLI_virtual_array.hh.

References blender::VArrayImpl_For_Span< T >::data_, pos, and T.

◆ materialize_to_uninitialized()

template<typename T >
void blender::VArrayImpl_For_Span< T >::materialize_to_uninitialized ( const IndexMask & mask,
T * dst ) const
inlineoverrideprotectedvirtual

Same as materialize but #r_span is expected to be uninitialized.

Reimplemented from blender::VArrayImpl< T >.

Definition at line 230 of file BLI_virtual_array.hh.

References blender::VArrayImpl_For_Span< T >::data_, and T.

◆ set()

template<typename T >
void blender::VArrayImpl_For_Span< T >::set ( const int64_t index,
T value )
inlinefinalprotectedvirtual

Assign the provided #value to the #index.

Implements blender::VMutableArrayImpl< T >.

Definition at line 215 of file BLI_virtual_array.hh.

References blender::VArrayImpl_For_Span< T >::data_.

Member Data Documentation

◆ data_


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