Blender  V3.3
Public Member Functions | Public Attributes | List of all members
blender::bke::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
 
eAttrDomain domain
 
std::function< void()> tag_modified_fn
 

Detailed Description

template<typename T>
struct blender::bke::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 194 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 210 of file BKE_attribute.hh.

Member Function Documentation

◆ finish()

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

◆ operator bool()

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

Definition at line 217 of file BKE_attribute.hh.

References blender::bke::SpanAttributeWriter< T >::span.

Member Data Documentation

◆ domain

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

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

Definition at line 202 of file BKE_attribute.hh.

◆ span

template<typename T >
MutableVArraySpan<T> blender::bke::SpanAttributeWriter< T >::span

◆ 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 206 of file BKE_attribute.hh.

Referenced by blender::bke::SpanAttributeWriter< T >::finish().


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