|
Blender V4.5
|
#include <BKE_attribute_storage.hh>
Inherits AttributeStorage.
Classes | |
| struct | BlendWriteData |
Public Member Functions | |
| AttributeStorage () | |
| AttributeStorage (const AttributeStorage &other) | |
| AttributeStorage (AttributeStorage &&other) | |
| AttributeStorage & | operator= (const AttributeStorage &other) |
| AttributeStorage & | operator= (AttributeStorage &&other) |
| ~AttributeStorage () | |
| void | foreach (FunctionRef< void(Attribute &)> fn) |
| void | foreach (FunctionRef< void(const Attribute &)> fn) const |
| Attribute * | lookup (StringRef name) |
| const Attribute * | lookup (StringRef name) const |
| bool | remove (StringRef name) |
| Attribute & | add (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 Attribute * | dna_attributes |
| int | dna_attributes_num |
| char | _pad [4] |
| AttributeStorageRuntimeHandle * | runtime |
Definition at line 121 of file BKE_attribute_storage.hh.
| AttributeStorage::AttributeStorage | ( | ) |
Definition at line 116 of file attribute_storage.cc.
References AttributeStorage::dna_attributes, AttributeStorage::dna_attributes_num, and AttributeStorage::runtime.
Referenced by AttributeStorage(), AttributeStorage(), operator=(), and operator=().
| AttributeStorage::AttributeStorage | ( | const AttributeStorage & | other | ) |
Definition at line 123 of file attribute_storage.cc.
References AttributeStorage(), AttributeStorage::dna_attributes, AttributeStorage::dna_attributes_num, foreach(), and AttributeStorage::runtime.
| AttributeStorage::AttributeStorage | ( | AttributeStorage && | other | ) |
Definition at line 144 of file attribute_storage.cc.
References AttributeStorage(), AttributeStorage::dna_attributes, AttributeStorage::dna_attributes_num, and AttributeStorage::runtime.
| AttributeStorage::~AttributeStorage | ( | ) |
Definition at line 161 of file attribute_storage.cc.
References AttributeStorage::runtime.
| 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().
| void AttributeStorage::blend_read | ( | BlendDataReader & | reader | ) |
Read data owned by the AttributeStorage struct. This works by converting the DNA-specific types stored in the files to the runtime data structures.
Definition at line 344 of file attribute_storage.cc.
References BLI_SCOPED_DEFER, BLO_read_string(), BLO_read_struct_array, CLOG_ERROR, Attribute::data, data, Attribute::data_type, AttributeStorage::dna_attributes, AttributeStorage::dna_attributes_num, Attribute::domain, i, LOG, MEM_SAFE_FREE, Attribute::name, blender::bke::read_attr_data(), blender::bke::read_attr_domain(), AttributeStorage::runtime, and Attribute::storage_type.
| void AttributeStorage::blend_write | ( | BlendWriter & | writer, |
| const BlendWriteData & | write_data ) |
Write the prepared data and the data stored in the DNA fields in the AttributeStorage struct.
Definition at line 527 of file attribute_storage.cc.
References blender::bke::Array, blender::bke::AttributeStorage::BlendWriteData::attributes, BLO_write_string(), BLO_write_struct, BLO_write_struct_array_by_name(), AttributeArray::data, AttributeSingle::data, AttributeStorage::dna_attributes, AttributeStorage::dna_attributes_num, AttributeArray::sharing_info, AttributeSingle::sharing_info, blender::bke::Single, AttributeArray::size, and blender::bke::write_shared_array().
| void AttributeStorage::count_memory | ( | MemoryCounter & | memory | ) | const |
Definition at line 312 of file attribute_storage.cc.
References blender::memory_counter::MemoryCounter::add_shared(), blender::bke::attribute_type_to_cpp_type(), data, and AttributeStorage::runtime.
| 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().
| void AttributeStorage::foreach | ( | FunctionRef< void(const Attribute &)> | fn | ) | const |
Definition at line 66 of file attribute_storage.cc.
References AttributeStorage::runtime.
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().
Definition at line 166 of file attribute_storage.cc.
References AttributeStorage::runtime.
| AttributeStorage & AttributeStorage::operator= | ( | AttributeStorage && | other | ) |
Definition at line 151 of file attribute_storage.cc.
References AttributeStorage().
| AttributeStorage & AttributeStorage::operator= | ( | const AttributeStorage & | other | ) |
Definition at line 134 of file attribute_storage.cc.
References AttributeStorage().
| 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.
| 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().