Blender
V3.3
|
#include <BLI_map.hh>
Classes | |
struct | BaseIterator |
class | BaseIteratorRange |
struct | Item |
class | ItemIterator |
class | KeyIterator |
struct | MutableItem |
class | MutableItemIterator |
class | MutableValueIterator |
class | ValueIterator |
Public Types | |
using | size_type = int64_t |
Public Member Functions | |
Map (Allocator allocator={}) noexcept | |
Map (NoExceptConstructor, Allocator allocator={}) noexcept | |
~Map ()=default | |
Map (const Map &other)=default | |
Map (Map &&other) noexcept(std::is_nothrow_move_constructible_v< SlotArray >) | |
Map & | operator= (const Map &other) |
Map & | operator= (Map &&other) |
void | add_new (const Key &key, const Value &value) |
void | add_new (const Key &key, Value &&value) |
void | add_new (Key &&key, const Value &value) |
void | add_new (Key &&key, Value &&value) |
template<typename ForwardKey , typename... ForwardValue> | |
void | add_new_as (ForwardKey &&key, ForwardValue &&...value) |
bool | add (const Key &key, const Value &value) |
bool | add (const Key &key, Value &&value) |
bool | add (Key &&key, const Value &value) |
bool | add (Key &&key, Value &&value) |
template<typename ForwardKey , typename... ForwardValue> | |
bool | add_as (ForwardKey &&key, ForwardValue &&...value) |
bool | add_overwrite (const Key &key, const Value &value) |
bool | add_overwrite (const Key &key, Value &&value) |
bool | add_overwrite (Key &&key, const Value &value) |
bool | add_overwrite (Key &&key, Value &&value) |
template<typename ForwardKey , typename... ForwardValue> | |
bool | add_overwrite_as (ForwardKey &&key, ForwardValue &&...value) |
bool | contains (const Key &key) const |
template<typename ForwardKey > | |
bool | contains_as (const ForwardKey &key) const |
bool | remove (const Key &key) |
template<typename ForwardKey > | |
bool | remove_as (const ForwardKey &key) |
void | remove_contained (const Key &key) |
template<typename ForwardKey > | |
void | remove_contained_as (const ForwardKey &key) |
Value | pop (const Key &key) |
template<typename ForwardKey > | |
Value | pop_as (const ForwardKey &key) |
std::optional< Value > | pop_try (const Key &key) |
template<typename ForwardKey > | |
std::optional< Value > | pop_try_as (const ForwardKey &key) |
Value | pop_default (const Key &key, const Value &default_value) |
Value | pop_default (const Key &key, Value &&default_value) |
template<typename ForwardKey , typename... ForwardValue> | |
Value | pop_default_as (const ForwardKey &key, ForwardValue &&...default_value) |
template<typename CreateValueF , typename ModifyValueF > | |
auto | add_or_modify (const Key &key, const CreateValueF &create_value, const ModifyValueF &modify_value) -> decltype(create_value(nullptr)) |
template<typename CreateValueF , typename ModifyValueF > | |
auto | add_or_modify (Key &&key, const CreateValueF &create_value, const ModifyValueF &modify_value) -> decltype(create_value(nullptr)) |
template<typename ForwardKey , typename CreateValueF , typename ModifyValueF > | |
auto | add_or_modify_as (ForwardKey &&key, const CreateValueF &create_value, const ModifyValueF &modify_value) -> decltype(create_value(nullptr)) |
const Value * | lookup_ptr (const Key &key) const |
Value * | lookup_ptr (const Key &key) |
template<typename ForwardKey > | |
const Value * | lookup_ptr_as (const ForwardKey &key) const |
template<typename ForwardKey > | |
Value * | lookup_ptr_as (const ForwardKey &key) |
const Value & | lookup (const Key &key) const |
Value & | lookup (const Key &key) |
template<typename ForwardKey > | |
const Value & | lookup_as (const ForwardKey &key) const |
template<typename ForwardKey > | |
Value & | lookup_as (const ForwardKey &key) |
Value | lookup_default (const Key &key, const Value &default_value) const |
template<typename ForwardKey , typename... ForwardValue> | |
Value | lookup_default_as (const ForwardKey &key, ForwardValue &&...default_value) const |
Value & | lookup_or_add (const Key &key, const Value &value) |
Value & | lookup_or_add (const Key &key, Value &&value) |
Value & | lookup_or_add (Key &&key, const Value &value) |
Value & | lookup_or_add (Key &&key, Value &&value) |
template<typename ForwardKey , typename... ForwardValue> | |
Value & | lookup_or_add_as (ForwardKey &&key, ForwardValue &&...value) |
template<typename CreateValueF > | |
Value & | lookup_or_add_cb (const Key &key, const CreateValueF &create_value) |
template<typename CreateValueF > | |
Value & | lookup_or_add_cb (Key &&key, const CreateValueF &create_value) |
template<typename ForwardKey , typename CreateValueF > | |
Value & | lookup_or_add_cb_as (ForwardKey &&key, const CreateValueF &create_value) |
Value & | lookup_or_add_default (const Key &key) |
Value & | lookup_or_add_default (Key &&key) |
template<typename ForwardKey > | |
Value & | lookup_or_add_default_as (ForwardKey &&key) |
const Key & | lookup_key (const Key &key) const |
template<typename ForwardKey > | |
const Key & | lookup_key_as (const ForwardKey &key) const |
const Key * | lookup_key_ptr (const Key &key) const |
template<typename ForwardKey > | |
const Key * | lookup_key_ptr_as (const ForwardKey &key) const |
template<typename FuncT > | |
void | foreach_item (const FuncT &func) const |
KeyIterator | keys () const |
ValueIterator | values () const |
MutableValueIterator | values () |
ItemIterator | items () const |
MutableItemIterator | items () |
void | remove (const BaseIterator &iterator) |
void | print_stats (StringRef name="") const |
int64_t | size () const |
bool | is_empty () const |
int64_t | capacity () const |
int64_t | removed_amount () const |
int64_t | size_per_element () const |
int64_t | size_in_bytes () const |
void | reserve (int64_t n) |
void | clear () |
int64_t | count_collisions (const Key &key) const |
Definition at line 108 of file BLI_map.hh.
using blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size_type = int64_t |
Definition at line 110 of file BLI_map.hh.
|
inlinenoexcept |
Initialize an empty map. This is a cheap operation no matter how large the inline buffer is. This is necessary to avoid a high cost when no elements are added at all. An optimized grow operation is performed on the first insertion.
Definition at line 163 of file BLI_map.hh.
|
inlinenoexcept |
Definition at line 174 of file BLI_map.hh.
|
default |
|
default |
|
inlinenoexcept |
Definition at line 182 of file BLI_map.hh.
|
inline |
Add a key-value-pair to the map. If the map contains the key already, nothing is changed. If you want to replace the currently stored value, use add_overwrite
. Returns true when the key has been newly added.
This is similar to std::unordered_map::insert.
Definition at line 250 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_as().
Referenced by blender::compositor::MetaData::add(), blender::bke::id::remapper::IDRemapper::add(), blender::ed::spreadsheet::ExtraColumns::add(), blender::deg::ObjectRuntimeBackup::backup_pose_channel_runtime_data(), blender::ed::spreadsheet::find_fields_to_evaluate(), blender::gpu::GPUSource::material_functions_parse(), blender::fn::procedure_optimization::move_destructs_up(), ntree_copy_data(), propagate_reroute_type_from_start_socket(), blender::ed::spreadsheet::spreadsheet_filter_rows(), blender::io::obj::OBJMesh::store_normal_coords_and_indices(), and blender::tests::TEST().
|
inline |
Definition at line 254 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_as().
|
inline |
Definition at line 258 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_as().
|
inline |
Definition at line 262 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_as().
|
inline |
Definition at line 267 of file BLI_map.hh.
Referenced by blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add().
|
inline |
Insert a new key-value-pair into the map. This invokes undefined behavior when the key is in the map already.
Definition at line 220 of file BLI_map.hh.
Referenced by blender::bke::DataTypeConversions::add(), blender::fn::MFContextBuilder::add_global_context(), blender::fn::build_multi_function_procedure_for_fields(), blender::bke::ComponentAttributeProviders::ComponentAttributeProviders(), compute_geometry(), blender::nodes::create_identifier_map(), blender::fn::MFProcedureDotExport::create_nodes(), blender::deg::RNANodeQueryIDData::ensure_constraint_to_pchan_map(), blender::bke::AssetLibraryService::get_asset_library_on_disk(), blender::nodes::get_or_create_identifier_map(), blender::io::obj::get_or_create_material(), blender::ed::space_node::node_clipboard_copy_exec(), blender::ed::space_node::node_clipboard_paste_exec(), blender::bke::node_copy_with_mapping(), blender::ed::space_node::node_duplicate_exec(), blender::ed::space_node::node_group_separate_selected(), blender::nodes::NodeTreeRef::NodeTreeRef(), blender::io::obj::OBJParser::parse(), Freestyle::BlenderStrokeRenderer::RenderStrokeRepBasic(), blender::bke::CustomDataAttributes::reorder(), snap_object_data_editmesh_get(), snap_object_data_mesh_get(), blender::tests::TEST(), blender::bke::tests::TEST_F(), blender::nodes::DerivedNodeTree::to_dot(), blender::nodes::NodeTreeRef::to_dot(), blender::CPPType::to_static_type(), and blender::bke::NodeTreeMainUpdater::update_rooted().
|
inline |
Definition at line 224 of file BLI_map.hh.
|
inline |
Definition at line 228 of file BLI_map.hh.
|
inline |
Definition at line 232 of file BLI_map.hh.
|
inline |
Definition at line 237 of file BLI_map.hh.
Referenced by blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new(), blender::GValueMap< Key >::add_new_by_copy(), blender::GValueMap< Key >::add_new_by_move(), and blender::GValueMap< Key >::add_new_direct().
|
inline |
This method can be used to implement more complex custom behavior without having to do multiple lookups
When the key did not yet exist in the map, the create_value function is called. Otherwise the modify_value function is called.
Both functions are expected to take a single parameter of type Value *
. In create_value, this pointer will point to uninitialized memory that has to be initialized by the function. In modify_value, it will point to an already initialized value.
The function returns whatever is returned from the create_value or modify_value callback. Therefore, both callbacks have to have the same return type.
In this example an integer is stored for every key. The initial value is five and we want to increase it every time the same key is used. map.add_or_modify(key, [](int *value) { *value = 5; }, [](int *value) { (*value)++; });
Definition at line 436 of file BLI_map.hh.
Referenced by DRW_mesh_batch_cache_create_requested(), ED_image_paint_tile_push(), GeometrySet::gather_attributes_for_propagation(), and blender::nodes::node_geo_join_geometry_cc::get_final_attribute_info().
|
inline |
Definition at line 443 of file BLI_map.hh.
|
inline |
Definition at line 449 of file BLI_map.hh.
Referenced by blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_or_modify().
|
inline |
Adds a key-value-pair to the map. If the map contained the key already, the corresponding value will be replaced. Returns true when the key has been newly added.
This is similar to std::unordered_map::insert_or_assign.
Definition at line 280 of file BLI_map.hh.
Referenced by blender::dot::Attributes::set().
|
inline |
Definition at line 284 of file BLI_map.hh.
|
inline |
Definition at line 288 of file BLI_map.hh.
|
inline |
Definition at line 292 of file BLI_map.hh.
|
inline |
Definition at line 297 of file BLI_map.hh.
Referenced by blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_overwrite().
|
inline |
Returns the number of available slots. This is mostly for debugging purposes.
Definition at line 919 of file BLI_map.hh.
|
inline |
Removes all key-value-pairs from the map.
Definition at line 963 of file BLI_map.hh.
Referenced by blender::bke::id::remapper::IDRemapper::clear(), blender::bke::calc_edges::clear_hash_tables(), image_undosys_step_encode(), and main_namemap_populate().
|
inline |
Returns true if there is a key in the map that compares equal to the given key.
This is similar to std::unordered_map::contains.
Definition at line 308 of file BLI_map.hh.
Referenced by blender::bke::id::remapper::IDRemapper::apply(), blender::fn::build_multi_function_procedure_for_fields(), blender::ed::outliner::OverrideRNAPathTreeBuilder::build_path(), blender::bke::id::remapper::IDRemapper::get_mapping_result(), gpu_shader_create_info_get(), blender::gpu::shader::gpu_shader_dependency_get_builtins(), blender::bke::DataTypeConversions::is_convertible(), blender::ed::space_node::node_clipboard_copy_exec(), blender::ed::space_node::node_clipboard_paste_exec(), Freestyle::BlenderStrokeRenderer::RenderStrokeRepBasic(), blender::ed::spreadsheet::spreadsheet_filter_rows(), blender::bke::tests::TEST_F(), and blender::bke::NodeTreeMainUpdater::update_rooted().
|
inline |
Definition at line 312 of file BLI_map.hh.
Referenced by blender::GValueMap< Key >::contains(), and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains().
|
inline |
Get the number of collisions that the probing strategy has to go through to find the key or determine that it is not in the map.
Definition at line 978 of file BLI_map.hh.
|
inline |
Calls the provided callback for every key-value-pair in the map. The callback is expected to take a const Key &
as first and a const Value &
as second parameter.
Definition at line 628 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size(), and Value.
Referenced by blender::dot::Attributes::export__as_bracket_list().
|
inline |
Returns true if there are no elements in the map.
This is similar to std::unordered_map::empty.
Definition at line 911 of file BLI_map.hh.
Referenced by internal_dependencies_panel_draw(), blender::bke::id::remapper::IDRemapper::is_empty(), blender::ed::space_node::node_get_accessed_attributes_row(), blender::io::obj::OBJParser::parse(), blender::tests::TEST(), and blender::bke::tests::TEST_F().
|
inline |
Returns an iterator over all key-value-pairs in the map. The key-value-pairs are stored in a temporary struct with a .key and a .value field. The iterator is invalidated, when the map is changed.
This iterator also allows you to modify the value (but not the key).
Definition at line 871 of file BLI_map.hh.
|
inline |
Returns an iterator over all key-value-pairs in the map. The key-value-pairs are stored in a temporary struct with a .key and a .value field.The iterator is invalidated, when the map is changed.
Definition at line 859 of file BLI_map.hh.
Referenced by blender::ed::spreadsheet::add_fields_as_extra_columns(), blender::compositor::MetaData::add_to_render_result(), BKE_cryptomatte_store_metadata(), blender::nodes::node_geo_instances_to_points_cc::convert_instances_to_points(), blender::nodes::node_geo_delete_geometry_cc::copy_attributes(), blender::nodes::node_geo_delete_geometry_cc::copy_attributes_based_on_map(), blender::nodes::node_geo_delete_geometry_cc::copy_attributes_based_on_mask(), blender::nodes::node_geo_duplicate_elements_cc::copy_attributes_without_id(), blender::nodes::node_geo_duplicate_elements_cc::copy_curve_attributes_without_id(), blender::nodes::node_geo_duplicate_elements_cc::copy_edge_attributes_without_id(), blender::nodes::node_geo_duplicate_elements_cc::copy_face_attributes_without_id(), blender::fn::MFProcedureDotExport::create_edges(), blender::geometry::gather_generic_curve_attributes_to_propagate(), blender::geometry::gather_generic_mesh_attributes_to_propagate(), blender::geometry::gather_generic_pointcloud_attributes_to_propagate(), Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh(), blender::nodes::node_geo_mesh_to_points_cc::geometry_set_mesh_to_points(), blender::nodes::node_geo_points_to_vertices_cc::geometry_set_points_to_vertices(), internal_dependencies_panel_draw(), blender::MultiValueMap< Key, Value >::items(), blender::bke::id::remapper::IDRemapper::iter(), blender::ed::space_node::named_attribute_tooltip(), ntree_update_reroute_nodes(), blender::bke::cryptomatte::CryptomatteLayer::operator[](), blender::nodes::node_geo_distribute_points_on_faces_cc::propagate_existing_attributes(), blender::bke::calc_edges::serialize_and_initialize_deduplicated_edges(), blender::tests::TEST(), blender::bke::cryptomatte::manifest::to_manifest(), blender::nodes::node_geo_dual_mesh_cc::transfer_attributes(), and blender::bke::NodeTreeMainUpdater::update_rooted().
|
inline |
Allows writing a range-for loop that iterates over all keys. The iterator is invalidated, when the map is changed.
Definition at line 831 of file BLI_map.hh.
Referenced by blender::MultiValueMap< Key, Value >::keys(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::print_stats(), and blender::gpu::MTLBufferPool::update_memory_pools().
|
inline |
Definition at line 489 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_as(), and Value.
|
inline |
Returns a reference to the value that corresponds to the given key. This invokes undefined behavior when the key is not in the map.
Definition at line 485 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_as(), and Value.
Referenced by blender::bke::id::remapper::IDRemapper::apply(), blender::ed::spreadsheet::apply_row_filter(), blender::fn::build_multi_function_procedure_for_fields(), blender::fn::MFProcedureDotExport::create_edges(), DRW_mesh_batch_cache_create_requested(), blender::bke::id::remapper::IDRemapper::get_mapping_result(), blender::nodes::node_geo_accumulate_field_cc::TotalFieldInput< T >::get_varray_for_context(), gpu_shader_create_info_get(), blender::gpu::shader::gpu_shader_dependency_get_builtins(), blender::gpu::GPUSource::material_functions_parse(), blender::ed::space_node::node_clipboard_copy_exec(), blender::ed::space_node::node_clipboard_paste_exec(), blender::bke::node_copy_with_mapping(), blender::ed::space_node::node_duplicate_exec(), blender::ed::space_node::node_duplicate_reparent_recursive(), blender::ed::space_node::node_group_separate_selected(), ntree_copy_data(), blender::bke::CustomDataAttributes::reorder(), snap_mesh_edge_verts_mixed(), snap_mesh_polygon(), blender::tests::TEST(), blender::bke::tests::TEST_F(), blender::nodes::NodeTreeRef::to_dot(), blender::deg::unregister_graph(), and blender::bke::NodeTreeMainUpdater::update_rooted().
|
inline |
Definition at line 499 of file BLI_map.hh.
References BLI_assert, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr_as(), ptr, and Value.
|
inline |
Definition at line 493 of file BLI_map.hh.
References BLI_assert, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr_as(), ptr, and Value.
Referenced by blender::nodes::NodeRef::input_by_identifier(), blender::GValueMap< Key >::lookup(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup(), and blender::nodes::NodeRef::output_by_identifier().
|
inline |
Returns a copy of the value that corresponds to the given key. If the key is not in the map, the provided default_value is returned.
Definition at line 510 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default_as(), and Value.
Referenced by blender::ed::space_node::count_multi_input_socket_links(), Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh(), blender::deg::RNANodeQueryIDData::get_pchan_for_constraint(), blender::deg::BuilderMap::getIDTag(), gpu_material_library_use_function(), blender::gpu::shader::gpu_shader_dependency_get_resolved_source(), blender::gpu::shader::gpu_shader_dependency_get_source(), blender::gpu::GPUSource::init_dependencies(), blender::io::obj::OBJMesh::store_normal_coords_and_indices(), and blender::CPPType::to_static_type().
|
inline |
Definition at line 515 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr_as(), ptr, and Value.
Referenced by blender::fn::MFContext::get_global_context(), and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default().
|
inline |
Returns the key that is stored in the set that compares equal to the given key. This invokes undefined behavior when the key is not in the map.
Definition at line 597 of file BLI_map.hh.
|
inline |
Definition at line 601 of file BLI_map.hh.
Referenced by blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_key().
|
inline |
Returns a pointer to the key that is stored in the map that compares equal to the given key. If the key is not in the map, null is returned.
Definition at line 611 of file BLI_map.hh.
|
inline |
Definition at line 615 of file BLI_map.hh.
Referenced by blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_key_ptr().
|
inline |
Returns a reference to the value corresponding to the given key. If the key is not in the map, a new key-value-pair is added and a reference to the value in the map is returned.
Definition at line 530 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add_as(), and Value.
Referenced by blender::deg::BuilderMap::checkIsBuiltAndTag(), blender::ed::space_node::count_multi_input_socket_links(), blender::io::obj::OBJParser::parse(), and blender::deg::BuilderMap::tagBuild().
|
inline |
Definition at line 534 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add_as(), and Value.
|
inline |
Definition at line 538 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add_as(), and Value.
|
inline |
Definition at line 542 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add_as(), and Value.
|
inline |
Definition at line 547 of file BLI_map.hh.
References Value.
Referenced by internal_dependencies_panel_draw(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add(), and blender::ed::space_node::node_get_accessed_attributes_row().
|
inline |
Returns a reference to the value that corresponds to the given key. If the key is not yet in the map, it will be newly added.
The create_value callback is only called when the key did not exist yet. It is expected to take no parameters and return the value to be inserted.
Definition at line 561 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add_cb_as(), and Value.
Referenced by BKE_main_namemap_get_name(), generate_unique_instance_ids(), blender::nodes::get_dot_cluster_for_context(), blender::nodes::get_or_create_identifier_map(), and blender::nodes::get_tree_ref_from_map().
|
inline |
Definition at line 566 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add_cb_as(), and Value.
|
inline |
Definition at line 571 of file BLI_map.hh.
References Value.
Referenced by blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add_cb(), and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add_default_as().
|
inline |
Returns a reference to the value that corresponds to the given key. If the key is not yet in the map, it will be newly added. The newly added value will be default constructed.
Definition at line 580 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add_default_as(), and Value.
Referenced by CryptomatteSession::add_layer(), blender::nodes::node_geo_accumulate_field_cc::AccumulateFieldInput< T >::get_varray_for_context(), blender::nodes::node_geo_accumulate_field_cc::TotalFieldInput< T >::get_varray_for_context(), OutlinerLibOverrideData::id_root_add(), OutlinerLibOverrideData::id_root_set(), main_namemap_populate(), blender::fn::ValueAllocator::obtain_OneSingle(), blender::deg::register_graph(), and blender::fn::ValueAllocator::release_value().
|
inline |
Definition at line 584 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add_default_as(), and Value.
|
inline |
Definition at line 588 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add_cb_as(), and Value.
Referenced by blender::MultiValueMap< Key, Value >::add_as(), blender::MultiValueMap< Key, Value >::add_multiple_as(), blender::MultiValueMap< Key, Value >::add_non_duplicates(), blender::deg::DepsgraphRelationBuilder::build_driver_relations(), and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add_default().
|
inline |
Definition at line 467 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr_as(), and Value.
|
inline |
Returns a pointer to the value that corresponds to the given key. If the key is not in the map, nullptr is returned.
This is similar to std::unordered_map::find.
Definition at line 463 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr_as(), and Value.
Referenced by blender::gpu::MTLBufferPool::allocate_aligned(), BKE_cryptomatte_material_hash(), BKE_cryptomatte_object_hash(), BKE_main_namemap_remove_name(), blender::bke::AssetCatalogDefinitionFile::copy_and_remap(), ED_image_paint_tile_find(), blender::deg::get_all_registered_graphs(), blender::bke::AssetLibraryService::get_asset_library_on_disk(), blender::bke::DataTypeConversions::get_conversion_functions(), blender::io::obj::get_or_create_material(), blender::ed::asset::index::AssetIndex::get_version(), blender::ed::asset::index::init_indexer_entries_from_value(), blender::ed::asset::AssetListStorage::lookup_list(), blender::fn::ValueAllocator::obtain_Span(), snap_mesh_edge_verts_mixed(), snap_mesh_polygon(), snap_object_data_editmesh_get(), snap_object_data_mesh_get(), and blender::tests::TEST().
|
inline |
Definition at line 476 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr_as(), and Value.
|
inline |
Definition at line 471 of file BLI_map.hh.
References Value.
Referenced by blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_as(), blender::MultiValueMap< Key, Value >::lookup_as(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default_as(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr(), and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr_as().
|
inline |
Definition at line 206 of file BLI_map.hh.
References blender::copy_assign_container().
|
inline |
Definition at line 211 of file BLI_map.hh.
References blender::move_assign_container().
|
inline |
Get the value that is stored for the given key and remove it from the map. This invokes undefined behavior when the key is not in the map.
Definition at line 357 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::pop_as(), and Value.
|
inline |
Definition at line 361 of file BLI_map.hh.
References Value.
Referenced by blender::GValueMap< Key >::extract(), and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::pop().
|
inline |
Get the value that corresponds to the given key and remove it from the map. If the key is not in the map, return the given default value instead.
Definition at line 394 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::pop_default_as(), and Value.
Referenced by blender::fn::procedure_optimization::move_destructs_up(), and blender::compositor::MetaData::replace_hash_neutral_cryptomatte_keys().
|
inline |
Definition at line 398 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::pop_default_as(), and Value.
|
inline |
Definition at line 403 of file BLI_map.hh.
References Value.
Referenced by blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::pop_default().
|
inline |
Get the value that is stored for the given key and remove it from the map. If the key is not in the map, a value-less optional is returned.
Definition at line 374 of file BLI_map.hh.
Referenced by blender::geometry::gather_generic_curve_attributes_to_propagate(), blender::geometry::gather_generic_mesh_attributes_to_propagate(), blender::geometry::gather_generic_pointcloud_attributes_to_propagate(), and blender::deg::ObjectRuntimeBackup::restore_pose_channel_runtime_data().
|
inline |
Definition at line 378 of file BLI_map.hh.
Referenced by blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::pop_try().
|
inline |
Print common statistics like size and collision count. This is useful for debugging purposes.
Definition at line 892 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::keys(), and blender::HashTableStats::print().
|
inline |
Remove the key-value-pair that the iterator is currently pointing at. It is valid to call this method while iterating over the map. However, after this method has been called, the removed element must not be accessed anymore.
Definition at line 881 of file BLI_map.hh.
References BLI_assert, and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::BaseIterator::current_slot().
|
inline |
Deletes the key-value-pair with the given key. Returns true when the key was contained and is now removed, otherwise false.
This is similar to std::unordered_map::erase.
Definition at line 323 of file BLI_map.hh.
Referenced by BKE_main_namemap_remove_name(), blender::fn::build_multi_function_procedure_for_fields(), blender::nodes::node_geo_instances_to_points_cc::convert_instances_to_points(), blender::nodes::node_geo_duplicate_elements_cc::gather_attributes_without_id(), blender::geometry::gather_generic_curve_attributes_to_propagate(), blender::geometry::gather_generic_mesh_attributes_to_propagate(), blender::geometry::gather_generic_pointcloud_attributes_to_propagate(), blender::nodes::node_geo_mesh_to_points_cc::geometry_set_mesh_to_points(), blender::nodes::node_geo_instance_on_points_cc::node_geo_exec(), snap_object_data_editmesh_get(), snap_object_data_mesh_get(), and blender::deg::unregister_graph().
|
inline |
Definition at line 327 of file BLI_map.hh.
Referenced by blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove().
|
inline |
Deletes the key-value-pair with the given key. This invokes undefined behavior when the key is not in the map.
Definition at line 342 of file BLI_map.hh.
|
inline |
Definition at line 346 of file BLI_map.hh.
Referenced by blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove_contained().
|
inline |
Returns the amount of removed slots in the set. This is mostly for debugging purposes.
Definition at line 927 of file BLI_map.hh.
|
inline |
Potentially resize the map such that the specified number of elements can be added without another grow operation.
Definition at line 953 of file BLI_map.hh.
Referenced by blender::bke::CustomDataAttributes::reorder(), blender::bke::calc_edges::reserve_hash_maps(), and blender::io::obj::OBJMesh::store_normal_coords_and_indices().
|
inline |
Return the number of key-value-pairs that are stored in the map.
Definition at line 901 of file BLI_map.hh.
Referenced by blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::foreach_item(), Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh(), blender::io::obj::OBJParser::parse(), Freestyle::BlenderStrokeRenderer::RenderStrokeRepBasic(), blender::ed::space_node::row_from_used_named_attribute(), blender::tests::TEST(), blender::bke::tests::TEST_F(), and blender::gpu::MTLBufferPool::update_memory_pools().
|
inline |
Returns the approximate memory requirements of the map in bytes. This becomes more exact the larger the map becomes.
Definition at line 944 of file BLI_map.hh.
Referenced by BKE_main_namemap_destroy().
|
inline |
Returns the bytes required per element. This is mostly for debugging purposes.
Definition at line 935 of file BLI_map.hh.
|
inline |
Returns an iterator over all values in the map and allows you to change the values. The iterator is invalidated, when the map is changed.
Definition at line 849 of file BLI_map.hh.
|
inline |
Returns an iterator over all values in the map. The iterator is invalidated, when the map is changed.
Definition at line 840 of file BLI_map.hh.
Referenced by blender::deg::DepsgraphRelationBuilder::build_driver_relations(), blender::fn::build_multi_function_procedure_for_fields(), blender::bke::AssetCatalogCollection::copy_catalog_map(), gpu_shader_create_info_compile_all(), gpu_shader_create_info_exit(), gpu_shader_create_info_init(), gpu_shader_dependency_exit(), blender::gpu::shader::gpu_shader_dependency_get_filename_from_source_string(), gpu_shader_dependency_init(), blender::bke::AssetLibraryService::has_any_unsaved_catalogs(), image_undosys_step_encode(), blender::ed::space_node::node_clipboard_copy_exec(), blender::ed::space_node::node_clipboard_paste_exec(), CryptomatteSession::operator[](), ptile_invalidate_map(), ptile_restore_runtime_map(), blender::deg::ObjectRuntimeBackup::restore_pose_channel_runtime_data(), blender::gpu::MTLBufferPool::update_memory_pools(), blender::MultiValueMap< Key, Value >::values(), blender::GValueMap< Key >::~GValueMap(), and PaintTileMap::~PaintTileMap().