|
Blender
V2.93
|
#include <BLI_map.hh>
Classes | |
| struct | BaseIterator |
| 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) |
| template<typename FuncT > | |
| void | foreach_item (const FuncT &func) const |
| KeyIterator | keys () const |
| ValueIterator | values () const |
| MutableValueIterator | values () |
| ItemIterator | items () const |
| MutableItemIterator | items () |
| 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 122 of file BLI_map.hh.
| using blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size_type = int64_t |
Definition at line 124 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 177 of file BLI_map.hh.
|
inlinenoexcept |
Definition at line 188 of file BLI_map.hh.
|
default |
|
default |
|
inlinenoexcept |
Definition at line 196 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 264 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::PersistentDataHandleMap::add(), blender::deg::ObjectRuntimeBackup::backup_pose_channel_runtime_data(), MeshComponent::copy_vertex_group_names_from_object(), and blender::tests::TEST().
|
inline |
Definition at line 268 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_as().
|
inline |
Definition at line 272 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_as().
|
inline |
Definition at line 276 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_as().
|
inline |
Definition at line 281 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 234 of file BLI_map.hh.
Referenced by blender::nodes::DataTypeConversions::add(), blender::fn::MFContextBuilder::add_global_context(), blender::bke::ComponentAttributeProviders::ComponentAttributeProviders(), compute_geometry(), blender::deg::RNANodeQueryIDData::ensure_constraint_to_pchan_map(), blender::nodes::get_multi_function_per_node(), blender::nodes::NodeTreeRef::NodeTreeRef(), Freestyle::BlenderStrokeRenderer::RenderStrokeRepBasic(), blender::tests::TEST(), blender::nodes::DerivedNodeTree::to_dot(), blender::nodes::NodeTreeRef::to_dot(), and blender::fn::MFNetwork::to_dot().
|
inline |
Definition at line 238 of file BLI_map.hh.
|
inline |
Definition at line 242 of file BLI_map.hh.
|
inline |
Definition at line 246 of file BLI_map.hh.
|
inline |
Definition at line 251 of file BLI_map.hh.
Referenced by blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new(), blender::fn::GValueMap< Key >::add_new_by_copy(), blender::fn::GValueMap< Key >::add_new_by_move(), and blender::fn::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 450 of file BLI_map.hh.
Referenced by blender::bke::geometry_set_gather_instances_attribute_info(), and blender::tests::TEST().
|
inline |
Definition at line 457 of file BLI_map.hh.
|
inline |
Definition at line 463 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 294 of file BLI_map.hh.
Referenced by blender::dot::Attributes::set(), and blender::tests::TEST().
|
inline |
Definition at line 298 of file BLI_map.hh.
|
inline |
Definition at line 302 of file BLI_map.hh.
|
inline |
Definition at line 306 of file BLI_map.hh.
|
inline |
Definition at line 311 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 872 of file BLI_map.hh.
|
inline |
Removes all key-value-pairs from the map.
Definition at line 916 of file BLI_map.hh.
Referenced by MeshComponent::clear(), blender::bke::calc_edges::clear_hash_tables(), MeshComponent::copy_vertex_group_names_from_object(), and blender::tests::TEST().
|
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 322 of file BLI_map.hh.
Referenced by blender::nodes::DataTypeConversions::is_convertible(), Freestyle::BlenderStrokeRenderer::RenderStrokeRepBasic(), and blender::tests::TEST().
|
inline |
Definition at line 326 of file BLI_map.hh.
Referenced by blender::fn::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 925 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 611 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(), and blender::tests::TEST().
|
inline |
Returns true if there are no elements in the map.
This is similar to std::unordered_map::empty.
Definition at line 864 of file BLI_map.hh.
Referenced by blender::tests::TEST().
|
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 837 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 825 of file BLI_map.hh.
Referenced by blender::compositor::MetaData::addToRenderResult(), BKE_cryptomatte_store_metadata(), blender::bke::VertexGroupsAttributeProvider::foreach_attribute(), Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh(), GeometryNodesEvaluator::GeometryNodesEvaluator(), blender::nodes::interpolate_existing_attributes(), blender::MultiValueMap< Key, Value >::items(), blender::bke::join_attributes(), blender::bke::cryptomatte::CryptomatteLayer::operator[](), blender::bke::calc_edges::serialize_and_initialize_deduplicated_edges(), blender::tests::TEST(), and blender::bke::cryptomatte::manifest::to_manifest().
|
inline |
Allows writing a range-for loop that iterates over all keys. The iterator is invalidated, when the map is changed.
Definition at line 797 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::tests::TEST().
|
inline |
Definition at line 503 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 499 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_as(), and Value.
Referenced by blender::tests::TEST(), blender::nodes::NodeTreeRef::to_dot(), blender::fn::MFNetwork::to_dot(), and blender::deg::unregister_graph().
|
inline |
Definition at line 513 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 507 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::fn::GValueMap< Key >::lookup(), and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup().
|
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 524 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default_as(), and Value.
Referenced by count_mutli_input_socket_links(), Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh(), blender::deg::RNANodeQueryIDData::get_pchan_for_constraint(), blender::deg::BuilderMap::getIDTag(), and blender::bke::PersistentDataHandleMap::lookup().
|
inline |
Definition at line 529 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(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default(), blender::bke::VertexGroupsAttributeProvider::try_get_for_read(), and blender::bke::VertexGroupsAttributeProvider::try_get_for_write().
|
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 544 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(), count_mutli_input_socket_links(), blender::deg::BuilderMap::tagBuild(), and blender::tests::TEST().
|
inline |
Definition at line 548 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 552 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 556 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 561 of file BLI_map.hh.
References Value.
Referenced by blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add().
|
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 575 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 generate_unique_instance_ids(), blender::nodes::get_dot_cluster_for_context(), blender::nodes::get_tree_ref_from_map(), and blender::tests::TEST().
|
inline |
Definition at line 580 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 585 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 594 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(), node_ui_storage_ensure(), blender::deg::register_graph(), and blender::tests::TEST().
|
inline |
Definition at line 598 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 602 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(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add_default(), and node_ui_storage_ensure().
|
inline |
Definition at line 481 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 477 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr_as(), and Value.
Referenced by BKE_cryptomatte_material_hash(), BKE_cryptomatte_object_hash(), BKE_node_tree_ui_storage_get_from_context(), blender::deg::get_all_registered_graphs(), blender::nodes::DataTypeConversions::get_conversion_functions(), and blender::tests::TEST().
|
inline |
Definition at line 490 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 485 of file BLI_map.hh.
References Value.
Referenced by BKE_node_tree_ui_storage_get_from_context(), 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 220 of file BLI_map.hh.
References blender::copy_assign_container().
|
inline |
Definition at line 225 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 371 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::pop_as(), and Value.
Referenced by blender::tests::TEST().
|
inline |
Definition at line 375 of file BLI_map.hh.
References Value.
Referenced by blender::fn::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 408 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::pop_default_as(), and Value.
Referenced by blender::compositor::MetaData::replaceHashNeutralCryptomatteKeys(), and blender::tests::TEST().
|
inline |
Definition at line 412 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 417 of file BLI_map.hh.
References Value.
Referenced by blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::pop_default(), and blender::bke::VertexGroupsAttributeProvider::try_delete().
|
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 388 of file BLI_map.hh.
Referenced by blender::deg::ObjectRuntimeBackup::restore_pose_channel_runtime_data(), and blender::tests::TEST().
|
inline |
Definition at line 392 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 845 of file BLI_map.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::keys(), and blender::HashTableStats::print().
|
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 337 of file BLI_map.hh.
Referenced by BKE_nodetree_ui_storage_free_for_context(), blender::tests::TEST(), and blender::deg::unregister_graph().
|
inline |
Definition at line 341 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 356 of file BLI_map.hh.
|
inline |
Definition at line 360 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 880 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 906 of file BLI_map.hh.
Referenced by blender::bke::calc_edges::reserve_hash_maps(), and blender::tests::TEST().
|
inline |
Return the number of key-value-pairs that are stored in the map.
Definition at line 854 of file BLI_map.hh.
Referenced by blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::foreach_item(), Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh(), Freestyle::BlenderStrokeRenderer::RenderStrokeRepBasic(), and blender::tests::TEST().
|
inline |
Returns the approximate memory requirements of the map in bytes. This becomes more exact the larger the map becomes.
Definition at line 897 of file BLI_map.hh.
|
inline |
Returns the bytes required per element. This is mostly for debugging purposes.
Definition at line 888 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 815 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 806 of file BLI_map.hh.
Referenced by blender::deg::DepsgraphRelationBuilder::build_driver_relations(), GeometryNodesEvaluator::execute(), CryptomatteSession::operator[](), blender::deg::ObjectRuntimeBackup::restore_pose_channel_runtime_data(), blender::tests::TEST(), blender::MultiValueMap< Key, Value >::values(), and blender::fn::GValueMap< Key >::~GValueMap().