Blender V5.0
blender::VArraySpan< T > Class Template Referencefinal

#include <BLI_virtual_array.hh>

Inherits blender::Span< T >.

Public Member Functions

 VArraySpan ()=default
 VArraySpan (const VArray< T > &varray)
 VArraySpan (VArray< T > &&varray)
 VArraySpan (VArraySpan &&other)
VArraySpanoperator= (VArraySpan &&other)
Public Member Functions inherited from blender::Span< T >
constexpr Span ()=default
constexpr Span (const T *start, int64_t size)
template<typename U, BLI_ENABLE_IF((is_span_convertible_pointer_v< U, T >))>
constexpr Span (const U *start, int64_t size)
constexpr Span (const std::initializer_list< T > &list)
constexpr Span (const std::vector< T > &vector)
template<std::size_t N>
constexpr Span (const std::array< T, N > &array)
template<typename U, BLI_ENABLE_IF((is_span_convertible_pointer_v< U, T >))>
constexpr Span (Span< U > span)
constexpr Span slice (int64_t start, int64_t size) const
constexpr Span slice (IndexRange range) const
constexpr Span slice_safe (const int64_t start, const int64_t size) const
constexpr Span slice_safe (IndexRange range) const
constexpr Span drop_front (int64_t n) const
constexpr Span drop_back (int64_t n) const
constexpr Span take_front (int64_t n) const
constexpr Span take_back (int64_t n) const
constexpr const Tdata () const
constexpr const Tbegin () const
constexpr const Tend () const
constexpr std::reverse_iterator< const T * > rbegin () const
constexpr std::reverse_iterator< const T * > rend () const
constexpr const Toperator[] (int64_t index) const
constexpr int64_t size () const
constexpr bool is_empty () const
constexpr int64_t size_in_bytes () const
constexpr bool contains (const T &value) const
constexpr bool contains_ptr (const T *ptr) const
constexpr int64_t count (const T &value) const
constexpr const Tfirst () const
constexpr const Tlast (const int64_t n=0) const
constexpr bool has_duplicates__linear_search () const
constexpr bool intersects__linear_search (Span other) const
constexpr int64_t first_index (const T &search_value) const
constexpr int64_t first_index_try (const T &search_value) const
constexpr IndexRange index_range () const
constexpr uint64_t hash () const
template<typename NewT>
Span< NewT > constexpr cast () const

Additional Inherited Members

Public Types inherited from blender::Span< T >
using value_type = T
using pointer = T *
using const_pointer = const T *
using reference = T &
using const_reference = const T &
using iterator = const T *
using size_type = int64_t
Protected Attributes inherited from blender::Span< T >
const Tdata_ = nullptr
int64_t size_ = 0

Detailed Description

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

In many cases a virtual array is a span internally. In those cases, access to individual could be much more efficient than calling a virtual method. When the underlying virtual array is not a span, this class allocates a new array and copies the values over.

This should be used in those cases:

  • All elements in the virtual array are accessed multiple times.
  • In most cases, the underlying virtual array is a span, so no copy is necessary to benefit from faster access.
  • An API is called, that does not accept virtual arrays, but only spans.

Definition at line 1108 of file BLI_virtual_array.hh.

Constructor & Destructor Documentation

◆ VArraySpan() [1/4]

template<typename T>
blender::VArraySpan< T >::VArraySpan ( )
default

Referenced by operator=(), VArraySpan(), and VArraySpan().

◆ VArraySpan() [2/4]

template<typename T>
blender::VArraySpan< T >::VArraySpan ( const VArray< T > & varray)
inline

Definition at line 1116 of file BLI_virtual_array.hh.

References T, and VArraySpan().

◆ VArraySpan() [3/4]

◆ VArraySpan() [4/4]

template<typename T>
blender::VArraySpan< T >::VArraySpan ( VArraySpan< T > && other)
inline

Member Function Documentation

◆ operator=()

template<typename T>
VArraySpan & blender::VArraySpan< T >::operator= ( VArraySpan< T > && other)
inline

Definition at line 1154 of file BLI_virtual_array.hh.

References VArraySpan().


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