Blender V4.3
blender::GMutableSpan Class Reference

#include <BLI_generic_span.hh>

Inherited by blender::GMutableVArraySpan.

Public Member Functions

 GMutableSpan ()=default
 
 GMutableSpan (const CPPType *type, void *buffer, int64_t size)
 
 GMutableSpan (const CPPType &type, void *buffer, int64_t size)
 
 GMutableSpan (const CPPType &type)
 
 GMutableSpan (const CPPType *type)
 
template<typename T >
 GMutableSpan (MutableSpan< T > array)
 
 operator GSpan () const
 
const CPPTypetype () const
 
const CPPTypetype_ptr () const
 
bool is_empty () const
 
int64_t size () const
 
int64_t size_in_bytes () const
 
void * data () const
 
void * operator[] (int64_t index) const
 
template<typename T >
MutableSpan< Ttyped () const
 
GMutableSpan slice (const int64_t start, int64_t size) const
 
GMutableSpan slice (IndexRange range) const
 
GMutableSpan drop_front (const int64_t n) const
 
GMutableSpan drop_back (const int64_t n) const
 
GMutableSpan take_front (const int64_t n) const
 
GMutableSpan take_back (const int64_t n) const
 
void copy_from (GSpan values)
 

Protected Attributes

const CPPTypetype_ = nullptr
 
void * data_ = nullptr
 
int64_t size_ = 0
 

Detailed Description

A generic mutable span. It behaves just like a blender::MutableSpan<T>, but the type is only known at run-time.

Definition at line 139 of file BLI_generic_span.hh.

Constructor & Destructor Documentation

◆ GMutableSpan() [1/6]

blender::GMutableSpan::GMutableSpan ( )
default

◆ GMutableSpan() [2/6]

blender::GMutableSpan::GMutableSpan ( const CPPType * type,
void * buffer,
int64_t size )
inline

Definition at line 148 of file BLI_generic_span.hh.

References BLI_assert.

◆ GMutableSpan() [3/6]

blender::GMutableSpan::GMutableSpan ( const CPPType & type,
void * buffer,
int64_t size )
inline

Definition at line 157 of file BLI_generic_span.hh.

◆ GMutableSpan() [4/6]

blender::GMutableSpan::GMutableSpan ( const CPPType & type)
inline

Definition at line 161 of file BLI_generic_span.hh.

◆ GMutableSpan() [5/6]

blender::GMutableSpan::GMutableSpan ( const CPPType * type)
inline

Definition at line 163 of file BLI_generic_span.hh.

◆ GMutableSpan() [6/6]

template<typename T >
blender::GMutableSpan::GMutableSpan ( MutableSpan< T > array)
inline

Definition at line 166 of file BLI_generic_span.hh.

Member Function Documentation

◆ copy_from()

void blender::GMutableSpan::copy_from ( GSpan values)
inline

Copy all values from another span into this span. This invokes undefined behavior when the destination contains uninitialized data and T is not trivially copy constructible. The size of both spans is expected to be the same.

Definition at line 268 of file BLI_generic_span.hh.

References BLI_assert, blender::CPPType::copy_assign_n(), data_, size_, and type_.

Referenced by blender::bke::evaluate_generic_data_for_curve(), blender::bke::curves::nurbs::interpolate_to_evaluated(), and blender::nodes::node_geo_dual_mesh_cc::transfer_attributes().

◆ data()

◆ drop_back()

GMutableSpan blender::GMutableSpan::drop_back ( const int64_t n) const
inline

Definition at line 241 of file BLI_generic_span.hh.

References BLI_assert, data_, GMutableSpan(), size_, and type_.

◆ drop_front()

GMutableSpan blender::GMutableSpan::drop_front ( const int64_t n) const
inline

◆ is_empty()

bool blender::GMutableSpan::is_empty ( ) const
inline

◆ operator GSpan()

blender::GMutableSpan::operator GSpan ( ) const
inline

Definition at line 171 of file BLI_generic_span.hh.

References data_, size_, and type_.

◆ operator[]()

void * blender::GMutableSpan::operator[] ( int64_t index) const
inline

Definition at line 207 of file BLI_generic_span.hh.

References BLI_assert, data_, POINTER_OFFSET, blender::CPPType::size(), size_, and type_.

◆ size()

◆ size_in_bytes()

int64_t blender::GMutableSpan::size_in_bytes ( ) const
inline

◆ slice() [1/2]

◆ slice() [2/2]

GMutableSpan blender::GMutableSpan::slice ( IndexRange range) const
inline

Definition at line 229 of file BLI_generic_span.hh.

References slice(), and blender::IndexRange::start().

◆ take_back()

GMutableSpan blender::GMutableSpan::take_back ( const int64_t n) const
inline

◆ take_front()

GMutableSpan blender::GMutableSpan::take_front ( const int64_t n) const
inline

◆ type()

const CPPType & blender::GMutableSpan::type ( ) const
inline

◆ type_ptr()

const CPPType * blender::GMutableSpan::type_ptr ( ) const
inline

Definition at line 182 of file BLI_generic_span.hh.

References type_.

◆ typed()

Member Data Documentation

◆ data_

◆ size_

◆ type_


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