Blender  V3.3
Public Member Functions | Protected Attributes | List of all members
blender::VArrayImpl< T > Class Template Referenceabstract

#include <BLI_virtual_array.hh>

Inheritance diagram for blender::VArrayImpl< T >:
blender::VMutableArrayImpl< ElemT > blender::VMutableArrayImpl< float3 > blender::VMutableArrayImpl< float > blender::VArrayImpl_For_Func< T, GetFunc > blender::VArrayImpl_For_GVArray< T > blender::VArrayImpl_For_Single< T > blender::VMutableArrayImpl< T > blender::bke::VArray_For_SplineToPoint< T >

Public Member Functions

 VArrayImpl (const int64_t size)
 
virtual ~VArrayImpl ()=default
 
int64_t size () const
 
virtual T get (int64_t index) const =0
 
virtual CommonVArrayInfo common_info () const
 
virtual void materialize (IndexMask mask, MutableSpan< T > r_span) const
 
virtual void materialize_to_uninitialized (IndexMask mask, MutableSpan< T > r_span) const
 
virtual void materialize_compressed (IndexMask mask, MutableSpan< T > r_span) const
 
virtual void materialize_compressed_to_uninitialized (IndexMask mask, MutableSpan< T > r_span) const
 
virtual bool try_assign_GVArray (GVArray &UNUSED(varray)) const
 
virtual bool is_same (const VArrayImpl< T > &UNUSED(other)) const
 

Protected Attributes

int64_t size_
 

Detailed Description

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

Implements the specifics of how the elements of a virtual array are accessed. It contains a bunch of virtual methods that are wrapped by #VArray.

Definition at line 71 of file BLI_virtual_array.hh.

Constructor & Destructor Documentation

◆ VArrayImpl()

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

Definition at line 80 of file BLI_virtual_array.hh.

References BLI_assert, and blender::VArrayImpl< T >::size_.

◆ ~VArrayImpl()

template<typename T >
virtual blender::VArrayImpl< T >::~VArrayImpl ( )
virtualdefault

Member Function Documentation

◆ common_info()

template<typename T >
virtual CommonVArrayInfo blender::VArrayImpl< T >::common_info ( ) const
inlinevirtual

◆ get()

template<typename T >
virtual T blender::VArrayImpl< T >::get ( int64_t  index) const
pure virtual

◆ is_same()

template<typename T >
virtual bool blender::VArrayImpl< T >::is_same ( const VArrayImpl< T > &  UNUSEDother) const
inlinevirtual

Return true when the other virtual array should be considered to be the same, e.g. because it shares the same underlying memory.

Definition at line 200 of file BLI_virtual_array.hh.

Referenced by blender::VArrayCommon< T >::is_same().

◆ materialize()

template<typename T >
virtual void blender::VArrayImpl< T >::materialize ( IndexMask  mask,
MutableSpan< T r_span 
) const
inlinevirtual

◆ materialize_compressed()

template<typename T >
virtual void blender::VArrayImpl< T >::materialize_compressed ( IndexMask  mask,
MutableSpan< T r_span 
) const
inlinevirtual

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 in blender::VArrayImpl_For_Single< T >, blender::VArrayImpl_For_Span< T >, and blender::VArrayImpl_For_GVArray< T >.

Definition at line 161 of file BLI_virtual_array.hh.

References BLI_assert, mask(), and blender::MutableSpan< T >::size().

Referenced by blender::VArrayCommon< T >::materialize_compressed().

◆ materialize_compressed_to_uninitialized()

template<typename T >
virtual void blender::VArrayImpl< T >::materialize_compressed_to_uninitialized ( IndexMask  mask,
MutableSpan< T r_span 
) const
inlinevirtual

◆ materialize_to_uninitialized()

template<typename T >
virtual void blender::VArrayImpl< T >::materialize_to_uninitialized ( IndexMask  mask,
MutableSpan< T r_span 
) const
inlinevirtual

◆ size()

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

◆ try_assign_GVArray()

template<typename T >
virtual bool blender::VArrayImpl< T >::try_assign_GVArray ( GVArray UNUSEDvarray) const
inlinevirtual

If this virtual wraps another #GVArray, this method should assign the wrapped array to the provided reference. This allows losslessly converting between generic and typed virtual arrays in all cases. Return true when the virtual array was assigned and false when nothing was done.

Definition at line 191 of file BLI_virtual_array.hh.

Referenced by blender::VArrayCommon< T >::try_assign_GVArray().

Member Data Documentation

◆ size_

template<typename T >
int64_t blender::VArrayImpl< T >::size_
protected

Number of elements in the virtual array. All virtual arrays have a size, but in some cases it may make sense to set it to the max value.

Definition at line 77 of file BLI_virtual_array.hh.

Referenced by blender::VMutableArrayImpl< T >::set_all(), blender::VArrayImpl< T >::size(), and blender::VArrayImpl< T >::VArrayImpl().


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