Blender V4.5
blender::bke::AttributeStorage Class Reference

#include <BKE_attribute_storage.hh>

Inherits AttributeStorage.

Classes

struct  BlendWriteData

Public Member Functions

 AttributeStorage ()
 AttributeStorage (const AttributeStorage &other)
 AttributeStorage (AttributeStorage &&other)
AttributeStorageoperator= (const AttributeStorage &other)
AttributeStorageoperator= (AttributeStorage &&other)
 ~AttributeStorage ()
void foreach (FunctionRef< void(Attribute &)> fn)
void foreach (FunctionRef< void(const Attribute &)> fn) const
Attributelookup (StringRef name)
const Attributelookup (StringRef name) const
bool remove (StringRef name)
Attributeadd (std::string name, bke::AttrDomain domain, bke::AttrType data_type, Attribute::DataVariant data)
std::string unique_name_calc (StringRef name)
void blend_read (BlendDataReader &reader)
void blend_write (BlendWriter &writer, const BlendWriteData &write_data)
void count_memory (MemoryCounter &memory) const

Additional Inherited Members

Public Attributes inherited from AttributeStorage
struct Attributedna_attributes
int dna_attributes_num
char _pad [4]
AttributeStorageRuntimeHandleruntime

Detailed Description

Definition at line 121 of file BKE_attribute_storage.hh.

Constructor & Destructor Documentation

◆ AttributeStorage() [1/3]

AttributeStorage::AttributeStorage ( )

◆ AttributeStorage() [2/3]

AttributeStorage::AttributeStorage ( const AttributeStorage & other)

◆ AttributeStorage() [3/3]

AttributeStorage::AttributeStorage ( AttributeStorage && other)

◆ ~AttributeStorage()

AttributeStorage::~AttributeStorage ( )

Definition at line 161 of file attribute_storage.cc.

References AttributeStorage::runtime.

Member Function Documentation

◆ add()

Attribute & AttributeStorage::add ( std::string name,
bke::AttrDomain domain,
bke::AttrType data_type,
Attribute::DataVariant data )

Add an attribute with the given name, which must not already be used by an existing attribute or this will invoke undefined behavior.

Definition at line 186 of file attribute_storage.cc.

References BLI_assert, data, lookup(), ptr, and AttributeStorage::runtime.

Referenced by blender::bke::attribute_legacy_convert_customdata_to_storage(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), and blender::bke::tests::TEST().

◆ blend_read()

void AttributeStorage::blend_read ( BlendDataReader & reader)

◆ blend_write()

◆ count_memory()

void AttributeStorage::count_memory ( MemoryCounter & memory) const

◆ foreach() [1/2]

void AttributeStorage::foreach ( FunctionRef< void(Attribute &)> fn)

Iterate over all attributes, with the order defined by the order of insertion. It is not safe to add or remove attributes while iterating.

Definition at line 60 of file attribute_storage.cc.

References AttributeStorage::runtime.

Referenced by AttributeStorage(), blender::bke::convert_storage_to_customdata(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), and blender::bke::tests::TEST().

◆ foreach() [2/2]

void AttributeStorage::foreach ( FunctionRef< void(const Attribute &)> fn) const

Definition at line 66 of file attribute_storage.cc.

References AttributeStorage::runtime.

◆ lookup() [1/2]

Attribute * AttributeStorage::lookup ( StringRef name)

Try to find the attribute with a given name. The non-const overload does not make the attribute data itself mutable.

Definition at line 176 of file attribute_storage.cc.

References AttributeStorage::runtime.

Referenced by add(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), and unique_name_calc().

◆ lookup() [2/2]

const Attribute * AttributeStorage::lookup ( StringRef name) const

Definition at line 166 of file attribute_storage.cc.

References AttributeStorage::runtime.

◆ operator=() [1/2]

AttributeStorage & AttributeStorage::operator= ( AttributeStorage && other)

Definition at line 151 of file attribute_storage.cc.

References AttributeStorage().

◆ operator=() [2/2]

AttributeStorage & AttributeStorage::operator= ( const AttributeStorage & other)

Definition at line 134 of file attribute_storage.cc.

References AttributeStorage().

◆ remove()

bool AttributeStorage::remove ( StringRef name)

Attempt to remove the attribute with the given name, returning true if successful. Should not be called while iterating over attributes.

Definition at line 202 of file attribute_storage.cc.

References AttributeStorage::runtime.

◆ unique_name_calc()

std::string AttributeStorage::unique_name_calc ( StringRef name)

Return a possibly changed version of the input name that is unique within existing names.

Definition at line 207 of file attribute_storage.cc.

References BLI_uniquename_cb(), and lookup().

Referenced by blender::bke::attribute_legacy_convert_customdata_to_storage(), and blender::bke::tests::TEST().


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