Blender V4.3
blender::GVArrayCommon Class Reference

#include <BLI_generic_virtual_array.hh>

Inherited by blender::GVArray, and blender::GVMutableArray.

Public Member Functions

bool may_have_ownership () const
 

Protected Types

using Storage = Any<detail::GVArrayAnyExtraInfo, 40, 8>
 

Protected Member Functions

 GVArrayCommon ()=default
 

Protected Attributes

const GVArrayImplimpl_ = nullptr
 
Storage storage_
 

#GVArrayCommon

 GVArrayCommon (const GVArrayCommon &other)
 
 GVArrayCommon (GVArrayCommon &&other) noexcept
 
 GVArrayCommon (const GVArrayImpl *impl)
 
 GVArrayCommon (std::shared_ptr< const GVArrayImpl > impl)
 
 ~GVArrayCommon ()
 
void copy_from (const GVArrayCommon &other)
 
void move_from (GVArrayCommon &&other) noexcept
 
const GVArrayImplimpl_from_storage () const
 
IndexRange index_range () const
 
void materialize (void *dst) const
 
void materialize (const IndexMask &mask, void *dst) const
 
void materialize_to_uninitialized (void *dst) const
 
void materialize_to_uninitialized (const IndexMask &mask, void *dst) const
 
void materialize_compressed (const IndexMask &mask, void *dst) const
 
void materialize_compressed_to_uninitialized (const IndexMask &mask, void *dst) const
 
bool is_span () const
 
GSpan get_internal_span () const
 
bool is_single () const
 
void get_internal_single (void *r_value) const
 
void get_internal_single_to_uninitialized (void *r_value) const
 

Inline methods for #GVArrayCommon.

template<typename ImplT , typename... Args>
void emplace (Args &&...args)
 
const CPPTypetype () const
 
 operator bool () const
 
int64_t size () const
 
bool is_empty () const
 
template<typename T >
bool try_assign_VArray (VArray< T > &varray) const
 
CommonVArrayInfo common_info () const
 
void get (int64_t index, void *r_value) const
 
template<typename T >
T get (int64_t index) const
 
void get_to_uninitialized (int64_t index, void *r_value) const
 

Detailed Description

Utility class to reduce code duplication between #GVArray and #GVMutableArray. It pretty much follows #VArrayCommon. Don't use this class outside of this header.

Definition at line 93 of file BLI_generic_virtual_array.hh.

Member Typedef Documentation

◆ Storage

See #VArrayCommon for more information. The inline buffer is a bit larger here, because generic virtual array implementations often require a bit more space than typed ones.

Definition at line 99 of file BLI_generic_virtual_array.hh.

Constructor & Destructor Documentation

◆ GVArrayCommon() [1/5]

blender::GVArrayCommon::GVArrayCommon ( )
protecteddefault

◆ GVArrayCommon() [2/5]

blender::GVArrayCommon::GVArrayCommon ( const GVArrayCommon & other)
protected

Definition at line 548 of file generic_virtual_array.cc.

References impl_, and impl_from_storage().

◆ GVArrayCommon() [3/5]

blender::GVArrayCommon::GVArrayCommon ( GVArrayCommon && other)
protectednoexcept

Definition at line 553 of file generic_virtual_array.cc.

◆ GVArrayCommon() [4/5]

blender::GVArrayCommon::GVArrayCommon ( const GVArrayImpl * impl)
protected

Definition at line 560 of file generic_virtual_array.cc.

References impl_, and storage_.

◆ GVArrayCommon() [5/5]

blender::GVArrayCommon::GVArrayCommon ( std::shared_ptr< const GVArrayImpl > impl)
protected

Definition at line 565 of file generic_virtual_array.cc.

References impl, and storage_.

◆ ~GVArrayCommon()

blender::GVArrayCommon::~GVArrayCommon ( )
protecteddefault

Member Function Documentation

◆ common_info()

◆ copy_from()

void blender::GVArrayCommon::copy_from ( const GVArrayCommon & other)
protected

◆ emplace()

template<typename ImplT , typename... Args>
void blender::GVArrayCommon::emplace ( Args &&... args)
inlineprotected

◆ get() [1/2]

template<typename T >
T blender::GVArrayCommon::get ( int64_t index) const
inline

Returns a copy of the value at the given index. Usually a typed virtual array should be used instead, but sometimes this is simpler when only a few indices are needed.

Definition at line 746 of file BLI_generic_virtual_array.hh.

References BLI_assert, blender::GVArrayImpl::get(), impl_, size(), and type().

◆ get() [2/2]

◆ get_internal_single()

void blender::GVArrayCommon::get_internal_single ( void * r_value) const

Copies the value that is used for every element into r_value, which is expected to point to initialized memory. This invokes undefined behavior if the virtual array would not return the same value for every index.

Definition at line 644 of file generic_virtual_array.cc.

References BLI_assert, blender::GVArrayImpl::common_info(), blender::CPPType::copy_assign(), blender::CommonVArrayInfo::data, impl_, is_single(), and type().

Referenced by blender::bke::CurvesGeometry::adapt_domain(), blender::bke::adapt_mesh_attribute_domain(), and get_internal_single_to_uninitialized().

◆ get_internal_single_to_uninitialized()

void blender::GVArrayCommon::get_internal_single_to_uninitialized ( void * r_value) const

Same as get_internal_single, but r_value points to initialized memory.

Definition at line 651 of file generic_virtual_array.cc.

References blender::CPPType::default_construct(), get_internal_single(), impl_, and blender::GVArrayImpl::type().

◆ get_internal_span()

◆ get_to_uninitialized()

◆ impl_from_storage()

◆ index_range()

IndexRange blender::GVArrayCommon::index_range ( ) const

◆ is_empty()

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

◆ is_single()

bool blender::GVArrayCommon::is_single ( ) const

◆ is_span()

◆ materialize() [1/2]

void blender::GVArrayCommon::materialize ( const IndexMask & mask,
void * dst ) const

Definition at line 579 of file generic_virtual_array.cc.

References impl_, and blender::GVArrayImpl::materialize().

◆ materialize() [2/2]

◆ materialize_compressed()

void blender::GVArrayCommon::materialize_compressed ( const IndexMask & mask,
void * dst ) const

◆ materialize_compressed_to_uninitialized()

void blender::GVArrayCommon::materialize_compressed_to_uninitialized ( const IndexMask & mask,
void * dst ) const

◆ materialize_to_uninitialized() [1/2]

void blender::GVArrayCommon::materialize_to_uninitialized ( const IndexMask & mask,
void * dst ) const

◆ materialize_to_uninitialized() [2/2]

◆ may_have_ownership()

bool blender::GVArrayCommon::may_have_ownership ( ) const

◆ move_from()

void blender::GVArrayCommon::move_from ( GVArrayCommon && other)
protectednoexcept

Definition at line 614 of file generic_virtual_array.cc.

Referenced by blender::GVMutableArray::operator GVArray().

◆ operator bool()

blender::GVArrayCommon::operator bool ( ) const
inline

Definition at line 775 of file BLI_generic_virtual_array.hh.

◆ size()

◆ try_assign_VArray()

template<typename T >
bool blender::GVArrayCommon::try_assign_VArray ( VArray< T > & varray) const
inline

◆ type()

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

Definition at line 770 of file BLI_generic_virtual_array.hh.

References impl_, and blender::GVArrayImpl::type().

Referenced by blender::bke::adapt_curve_domain_curve_to_point(), blender::bke::adapt_curve_domain_point_to_curve(), blender::bke::CurvesGeometry::adapt_domain(), blender::bke::adapt_mesh_attribute_domain(), blender::bke::adapt_mesh_domain_corner_to_edge(), blender::bke::adapt_mesh_domain_corner_to_face(), blender::bke::adapt_mesh_domain_corner_to_point(), blender::bke::adapt_mesh_domain_edge_to_corner(), blender::bke::adapt_mesh_domain_edge_to_face(), blender::bke::adapt_mesh_domain_edge_to_point(), blender::bke::adapt_mesh_domain_face_to_corner(), blender::bke::adapt_mesh_domain_face_to_edge(), blender::bke::adapt_mesh_domain_face_to_point(), blender::bke::adapt_mesh_domain_point_to_corner(), blender::bke::adapt_mesh_domain_point_to_edge(), blender::bke::adapt_mesh_domain_point_to_face(), blender::fn::multi_function::ParamsBuilder::add_readonly_single_input(), blender::ed::spreadsheet::apply_row_filter(), attr_create_generic(), attr_create_generic(), blender::ed::greasepencil::attributes_varrays_not_equal(), blender::bke::mesh_surface_sample::BaryWeightSampleFn::BaryWeightSampleFn(), bke_attribute_copy_if_exists(), BKE_attribute_duplicate(), blender::nodes::node_geo_curve_sample_cc::SampleCurveFunction::call(), blender::array_utils::copy(), blender::array_utils::copy(), copy_attributes(), blender::bke::copy_curve_domain_attribute_to_mesh(), blender::bke::copy_main_point_domain_attribute_to_mesh(), blender::bke::copy_with_checked_indices(), blender::ed::greasepencil::curves_geometry_is_equal(), ED_geometry_attribute_convert(), blender::bke::evaluate_attribute(), blender::fn::evaluate_fields(), blender::ed::curves::extrude_curves(), blender::GVMutableArray::fill(), blender::GVArray::ForSingle(), blender::GVArray::ForSingleRef(), blender::array_utils::gather(), blender::bke::attribute_math::gather(), get(), get_internal_single(), get_internal_span(), blender::GVMutableArray::get_internal_span(), blender::nodes::node_geo_accumulate_field_cc::AccumulateFieldInput::get_varray_for_context(), blender::nodes::node_geo_accumulate_field_cc::TotalFieldInput::get_varray_for_context(), blender::GVArray::GVArray(), blender::nodes::LazyFunctionForReduceForeachGeometryElement::handle_generation_items_group(), blender::geometry::point_merge_by_distance(), blender::bke::MutableAttributeAccessor::rename(), blender::geometry::retrieve_attribute_spans(), blender::geometry::retrieve_attribute_spans(), blender::bke::mesh_surface_sample::sample_corner_attribute(), blender::bke::mesh_surface_sample::sample_face_attribute(), blender::bke::mesh_surface_sample::sample_point_attribute(), blender::ed::greasepencil::select_set_mode_exec(), blender::GVArray::slice(), blender::bke::compare_meshes::sort_domain_using_attributes(), blender::nodes::node_geo_dual_mesh_cc::transfer_attributes(), transform_active_color_data(), blender::bke::DataTypeConversions::try_convert(), blender::bke::DataTypeConversions::try_convert(), blender::bke::try_sharing_point_data(), blender::ed::spreadsheet::ColumnValues::type(), blender::GVMutableArray::typed(), blender::VArrayImpl_For_GVArray< T >::VArrayImpl_For_GVArray(), blender::bke::compare_meshes::verify_attributes_compatible(), vertex_paint_from_weight(), and blender::VMutableArrayImpl_For_GVMutableArray< T >::VMutableArrayImpl_For_GVMutableArray().

Member Data Documentation

◆ impl_

◆ storage_

Storage blender::GVArrayCommon::storage_
protected

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