Blender  V3.3
Public Member Functions | Protected Attributes | List of all members
blender::GMutableSpan Class Reference

#include <BLI_generic_span.hh>

Inheritance diagram for blender::GMutableSpan:
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
 
voiddata () const
 
voidoperator[] (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
 
void copy_from (GSpan values)
 

Protected Attributes

const CPPTypetype_ = nullptr
 
voiddata_ = 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 109 of file BLI_generic_span.hh.

Constructor & Destructor Documentation

◆ GMutableSpan() [1/6]

blender::GMutableSpan::GMutableSpan ( )
default

Referenced by slice().

◆ GMutableSpan() [2/6]

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

◆ GMutableSpan() [3/6]

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

Definition at line 127 of file BLI_generic_span.hh.

◆ GMutableSpan() [4/6]

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

Definition at line 131 of file BLI_generic_span.hh.

◆ GMutableSpan() [5/6]

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

Definition at line 135 of file BLI_generic_span.hh.

◆ GMutableSpan() [6/6]

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

Definition at line 140 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 207 of file BLI_generic_span.hh.

References BLI_assert, blender::CPPType::copy_assign_n(), blender::GSpan::data(), data_, blender::GSpan::size(), size_, blender::GSpan::type(), and type_.

Referenced by blender::bke::curves::nurbs::interpolate_to_evaluated(), and blender::bke::CurvesGeometry::interpolate_to_evaluated().

◆ data()

void* blender::GMutableSpan::data ( ) const
inline

◆ is_empty()

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

◆ operator GSpan()

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

Definition at line 145 of file BLI_generic_span.hh.

References data_, size_, and type_.

◆ operator[]()

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

Definition at line 176 of file BLI_generic_span.hh.

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

◆ size()

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

◆ slice() [1/2]

GMutableSpan blender::GMutableSpan::slice ( const int64_t  start,
int64_t  size 
) const
inline

◆ slice() [2/2]

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

◆ type()

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

◆ type_ptr()

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

Definition at line 156 of file BLI_generic_span.hh.

References type_.

◆ typed()

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

Member Data Documentation

◆ data_

void* blender::GMutableSpan::data_ = nullptr
protected

◆ size_

int64_t blender::GMutableSpan::size_ = 0
protected

◆ type_

const CPPType* blender::GMutableSpan::type_ = nullptr
protected

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