Blender V5.0
blender::nodes::SpanAttributeWriter< T > Struct Template Reference

#include <BKE_attribute.hh>

Public Member Functions

 SpanAttributeWriter ()=default
 SpanAttributeWriter (AttributeWriter< T > &&other, const bool copy_values_to_span)
 operator bool () const
void finish ()

Public Attributes

MutableVArraySpan< Tspan
AttrDomain domain
std::function< void()> tag_modified_fn

Detailed Description

template<typename T>
struct blender::nodes::SpanAttributeWriter< T >

A version of AttributeWriter for the common case when the user of the attribute wants to write to a span instead of a virtual array. Since most attributes are spans internally, this can result in better performance and also simplifies code.

Definition at line 285 of file BKE_attribute.hh.

Constructor & Destructor Documentation

◆ SpanAttributeWriter() [1/2]

template<typename T>
blender::bke::SpanAttributeWriter< T >::SpanAttributeWriter ( )
default

◆ SpanAttributeWriter() [2/2]

template<typename T>
blender::bke::SpanAttributeWriter< T >::SpanAttributeWriter ( AttributeWriter< T > && other,
const bool copy_values_to_span )
inline

Definition at line 301 of file BKE_attribute.hh.

Member Function Documentation

◆ finish()

template<typename T>
void blender::bke::SpanAttributeWriter< T >::finish ( )
inline

Has to be called when done writing to the attribute. This makes sure that the data is copied to the underlying attribute if it was not stored as an array. Furthermore, this may invalidate other data depending on the modified attribute.

Definition at line 318 of file BKE_attribute.hh.

◆ operator bool()

template<typename T>
blender::bke::SpanAttributeWriter< T >::operator bool ( ) const
inline

Definition at line 308 of file BKE_attribute.hh.

Member Data Documentation

◆ domain

template<typename T>
AttrDomain blender::bke::SpanAttributeWriter< T >::domain

Domain of the attribute. Also determines the size of the span.

Definition at line 293 of file BKE_attribute.hh.

◆ span

A span based on the virtual array that contains the attribute data. This may be empty.

Definition at line 289 of file BKE_attribute.hh.

◆ tag_modified_fn

template<typename T>
std::function<void()> blender::bke::SpanAttributeWriter< T >::tag_modified_fn

Has to be called after writing to the span.

Definition at line 297 of file BKE_attribute.hh.


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