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]

◆ 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, data_, size(), size_, type(), and type_.

◆ 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.

References GMutableSpan(), size(), and type().

◆ GMutableSpan() [4/6]

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

Definition at line 161 of file BLI_generic_span.hh.

References type(), and type_.

◆ GMutableSpan() [5/6]

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

Definition at line 163 of file BLI_generic_span.hh.

References type(), and type_.

◆ GMutableSpan() [6/6]

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

Definition at line 166 of file BLI_generic_span.hh.

References GMutableSpan(), size(), and T.

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::GSpan::data(), data_, blender::GSpan::size(), size_, blender::GSpan::type(), and type_.

Referenced by blender::array_utils::copy_group_to_group(), blender::bke::evaluate_generic_data_for_curve(), blender::bke::curves::nurbs::interpolate_to_evaluated(), blender::ed::curves::resize_curves(), 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

Definition at line 234 of file BLI_generic_span.hh.

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

◆ 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, 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

◆ take_back()

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

Definition at line 255 of file BLI_generic_span.hh.

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

◆ take_front()

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

◆ type()

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

Definition at line 176 of file BLI_generic_span.hh.

References BLI_assert, and type_.

Referenced by blender::ed::sculpt_paint::color::active_color_attribute_for_write(), blender::fn::multi_function::ParamsBuilder::add_single_mutable(), blender::fn::multi_function::ParamsBuilder::add_uninitialized_single_output(), blender::nodes::node_geo_blur_attribute_cc::blur_on_curves(), blender::nodes::node_geo_blur_attribute_cc::blur_on_mesh(), blender::fn::multi_function::CustomMF_DefaultOutput::call(), blender::ed::sculpt_paint::color::color_vert_set(), blender::bke::DataTypeConversions::convert_to_initialized_n(), blender::array_utils::copy(), blender::array_utils::copy(), blender::ed::sculpt_paint::greasepencil::create_blank_curve(), blender::ed::sculpt_paint::greasepencil::extend_curve(), blender::bke::curves::fill_points(), blender::array_utils::gather(), GMutableSpan(), GMutableSpan(), GMutableSpan(), GMutableSpan(), blender::GMutableVArraySpan::GMutableVArraySpan(), blender::geometry::interpolate_curves(), blender::geometry::merge_layers(), blender::geometry::mix(), blender::geometry::mix_arrays(), blender::geometry::mix_arrays(), blender::geometry::mix_with_indices(), blender::bke::bake::read_blob_simple_gspan(), blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_uniform(), blender::geometry::reverse_order(), blender::bke::mesh_surface_sample::sample_corner_attribute(), blender::geometry::sample_curve_attribute(), blender::bke::mesh_surface_sample::sample_face_attribute(), blender::bke::mesh_surface_sample::sample_point_attribute(), blender::geometry::smooth_curve_attribute(), blender::geometry::subdivide_attribute_linear(), blender::ed::sculpt_paint::color::swap_gathered_colors(), blender::geometry::threaded_copy(), blender::geometry::threaded_fill(), and blender::ed::sculpt_paint::greasepencil::trim_end_points().

◆ type_ptr()

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

Definition at line 182 of file BLI_generic_span.hh.

References type_.

Referenced by blender::GMutableVArraySpan::GMutableVArraySpan().

◆ typed()

Member Data Documentation

◆ data_

◆ size_

◆ type_


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