Blender V5.0
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 145 of file BLI_generic_span.hh.

Constructor & Destructor Documentation

◆ GMutableSpan() [1/6]

◆ GMutableSpan() [2/6]

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

Definition at line 154 of file BLI_generic_span.hh.

◆ GMutableSpan() [3/6]

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

Definition at line 163 of file BLI_generic_span.hh.

◆ GMutableSpan() [4/6]

Definition at line 167 of file BLI_generic_span.hh.

◆ GMutableSpan() [5/6]

Definition at line 169 of file BLI_generic_span.hh.

◆ GMutableSpan() [6/6]

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

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

◆ data()

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

Definition at line 208 of file BLI_generic_span.hh.

◆ drop_back()

Definition at line 247 of file BLI_generic_span.hh.

◆ drop_front()

Definition at line 240 of file BLI_generic_span.hh.

◆ is_empty()

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

Definition at line 193 of file BLI_generic_span.hh.

◆ operator GSpan()

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

Definition at line 177 of file BLI_generic_span.hh.

◆ operator[]()

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

Definition at line 213 of file BLI_generic_span.hh.

◆ size()

Definition at line 198 of file BLI_generic_span.hh.

◆ size_in_bytes()

Definition at line 203 of file BLI_generic_span.hh.

◆ slice() [1/2]

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

Definition at line 227 of file BLI_generic_span.hh.

◆ slice() [2/2]

Definition at line 235 of file BLI_generic_span.hh.

◆ take_back()

Definition at line 261 of file BLI_generic_span.hh.

◆ take_front()

Definition at line 254 of file BLI_generic_span.hh.

◆ type()

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

Definition at line 182 of file BLI_generic_span.hh.

◆ type_ptr()

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

Definition at line 188 of file BLI_generic_span.hh.

◆ typed()

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

Definition at line 220 of file BLI_generic_span.hh.

Member Data Documentation

◆ data_

Definition at line 148 of file BLI_generic_span.hh.

◆ size_

Definition at line 149 of file BLI_generic_span.hh.

◆ type_

Definition at line 147 of file BLI_generic_span.hh.


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