|
Blender V5.0
|
#include <BLI_map.hh>
Classes | |
| struct | BaseIterator |
| class | BaseIteratorRange |
| class | KeyIterator |
| class | ValueIterator |
| class | MutableValueIterator |
| class | ItemIterator |
| class | MutableItemIterator |
Public Types | |
| using | size_type = int64_t |
| using | Item = MapItem<Key, Value> |
| using | MutableItem = MutableMapItem<Key, Value> |
Public Member Functions | |
| Map (Allocator allocator={}) noexcept | |
| Map (NoExceptConstructor, Allocator allocator={}) noexcept | |
| Map (const Map &other)=default | |
| Map (Map &&other) noexcept(std::is_nothrow_move_constructible_v< SlotArray >) | |
| Map (const Span< std::pair< Key, Value > > items, Allocator allocator={}) | |
| Map (const std::initializer_list< std::pair< Key, Value > > items, Allocator allocator={}) | |
| ~Map ()=default | |
| 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) |
| void | remove (const BaseIterator &iterator) |
| 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) |
| std::optional< Value > | lookup_try (const Key &key) const |
| template<typename ForwardKey> | |
| std::optional< Value > | lookup_try_as (const ForwardKey &key) const |
| 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 & |
| KeyIterator | keys () const &&=delete |
| ValueIterator | values () const & |
| MutableValueIterator | values () & |
| MutableValueIterator | values () &&=delete |
| ValueIterator | values () const &&=delete |
| ItemIterator | items () const & |
| MutableItemIterator | items () & |
| ItemIterator | items () const &&=delete |
| MutableItemIterator | items () &&=delete |
| template<typename Predicate> | |
| int64_t | remove_if (Predicate &&predicate) |
| void | print_stats (const char *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 () |
| void | clear_and_keep_capacity () |
| int64_t | count_collisions (const Key &key) const |
Friends | |
| bool | operator== (const Map &a, const Map &b) |
| bool | operator!= (const Map &a, const Map &b) |
| Key | Type of the keys stored in the map. Keys have to be movable. Furthermore, the hash and is-equal functions have to support it. |
| Value | Type of the value that is stored per key. It has to be movable as well. |
| InlineBufferCapacity | The minimum number of elements that can be stored in this Map without doing a heap allocation. This is useful when you expect to have many small maps. However, keep in mind that (unlike vector) initializing a map has a O(n) cost in the number of slots. |
| ProbingStrategy | The strategy used to deal with collisions. They are defined in BLI_probing_strategies.hh. |
| Hash | The hash function used to hash the keys. There is a default for many types. See BLI_hash.hh for examples on how to define a custom hash function. |
| IsEqual | The equality operator used to compare keys. By default it will simply compare keys using the == operator. |
| Slot | This is what will actually be stored in the hash table array. At a minimum a slot has to be able to hold a key, a value and information about whether the slot is empty, occupied or removed. Using a non-standard slot type can improve performance or reduce the memory footprint for some types. Slot types are defined in BLI_map_slots.hh |
| Allocator | The allocator used by this map. Should rarely be changed, except when you don't want that MEM_* is used internally. |
Definition at line 129 of file BLI_map.hh.
| using blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::Item = MapItem<Key, Value> |
Definition at line 132 of file BLI_map.hh.
| using blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::MutableItem = MutableMapItem<Key, Value> |
Definition at line 133 of file BLI_map.hh.
| using blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size_type = int64_t |
Definition at line 131 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 186 of file BLI_map.hh.
|
inlinenoexcept |
Definition at line 197 of file BLI_map.hh.
|
default |
|
inlinenoexcept |
Definition at line 203 of file BLI_map.hh.
|
inline |
Initializes the Map based on some key-value-pairs: Map<int, std::string> map = {{1, "where"}, {3, "when"}, {5, "why"}};
If the same key appears multiple times, only the first one is used and the others are ignored. Note that keys and values are copied. Use the add_* functions after the constructor to move keys and values into the map.
Definition at line 235 of file BLI_map.hh.
|
inline |
This is pretty much the same as the constructor with a Span above. It helps with type inferencing when initializer lists are used.
Definition at line 246 of file BLI_map.hh.
|
default |
|
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 295 of file BLI_map.hh.
Referenced by UniqueName_Map::add_name(), BKE_blendfile_link_append_context_item_newid_set(), BKE_main_library_weak_reference_add_item(), BKE_mesh_validate_arrays(), blf_glyph_cache_add_blank(), blf_glyph_cache_add_glyph(), blf_glyph_cache_add_svg(), blo_read_shared_impl(), BLO_write_shared(), BLO_write_shared_tag(), BM_log_face_removed(), BM_log_vert_removed(), blender::ed::transform::flushTransNodes(), blender::io::fbx::import_blend_shapes(), blender::bke::greasepencil::convert::legacy_gpencil_object(), blender::bke::greasepencil::convert::legacy_main(), new_id_to_item_mapping_add(), UniqueName_Map::populate(), prepare_stable_data_block_ids(), repair_node_link_node_pointers(), blender::bke::greasepencil::tests::TEST(), and version_geometry_nodes_extrude_smooth_propagation().
|
inline |
Definition at line 299 of file BLI_map.hh.
|
inline |
Definition at line 303 of file BLI_map.hh.
|
inline |
Definition at line 307 of file BLI_map.hh.
|
inline |
Definition at line 312 of file BLI_map.hh.
|
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 265 of file BLI_map.hh.
Referenced by blender::bke::greasepencil::Layer::add_frame(), blender::ed::space_node::add_node_group_interface_from_declaration_recursive(), blender::io::usd::utils::assign_materials(), BKE_main_mesh_legacy_convert_auto_smooth(), BLO_memfile_write_init(), blender::nodes::LazyFunctionForClosureZone::execute_impl(), blender::nodes::initialize_zone_wrapper(), blender::nodes::LazyFunctionForClosureZone::LazyFunctionForClosureZone(), blender::seq::media_presence_is_missing(), remove_triangulate_node_min_size_input(), Freestyle::BlenderStrokeRenderer::RenderStrokeRepBasic(), reorder_layer_data(), and version_geometry_nodes_replace_transfer_attribute_node().
|
inline |
Definition at line 269 of file BLI_map.hh.
|
inline |
Definition at line 273 of file BLI_map.hh.
|
inline |
Definition at line 277 of file BLI_map.hh.
|
inline |
Definition at line 282 of file BLI_map.hh.
|
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 481 of file BLI_map.hh.
Referenced by ED_image_paint_tile_push(), and IMB_colormanagement_working_space_convert().
|
inline |
Definition at line 488 of file BLI_map.hh.
|
inline |
Definition at line 494 of file BLI_map.hh.
|
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 325 of file BLI_map.hh.
Referenced by blender::ui::string_search::add_recent_search(), BKE_main_library_weak_reference_update_item(), blender::ed::transform::grease_pencil_layer_apply_trans_data(), blender::seq::media_presence_set_missing(), oldnewmap_insert(), and blender::ui::string_search::read_recent_searches_file().
|
inline |
Definition at line 329 of file BLI_map.hh.
|
inline |
Definition at line 333 of file BLI_map.hh.
|
inline |
Definition at line 337 of file BLI_map.hh.
|
inline |
Definition at line 342 of file BLI_map.hh.
|
inline |
Returns the number of available slots. This is mostly for debugging purposes.
Definition at line 994 of file BLI_map.hh.
|
inline |
Remove all elements. Under some circumstances clear_and_keep_capacity may be more efficient.
Definition at line 1038 of file BLI_map.hh.
Referenced by blender::draw::edit_select::Instance::begin_sync(), BLO_memfile_write_finalize(), BM_log_cleanup_entry(), direct_link_id(), DRW_view_data_reset(), blender::ed::transform::grease_pencil_layer_initialize_trans_data(), image_undosys_step_encode(), oldnewmap_clear(), and blender::ui::string_search::read_recent_searches_file().
|
inline |
Remove all elements, but don't free the underlying memory.
This can be more efficient than using clear if approximately the same or more elements are added again afterwards. If way fewer elements are added instead, the cost of maintaining a large hash table can lead to very bad worst-case performance.
Definition at line 1051 of file BLI_map.hh.
|
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 353 of file BLI_map.hh.
Referenced by BKE_blendfile_link_append_context_item_newid_set(), BKE_main_global_namemap_contain_name(), BKE_main_namemap_contain_name(), BKE_mesh_validate_arrays(), BM_log_face_removed(), BM_log_original_vert_data(), BM_log_vert_before_modified(), BM_log_vert_removed(), blender::ed::sculpt_paint::ensure_editable_drawings(), blender::ed::greasepencil::grease_pencil_paste_keyframes(), main_namemap_validate_and_fix(), namemap_get_name(), prepare_stable_data_block_ids(), remove_triangulate_node_min_size_input(), Freestyle::BlenderStrokeRenderer::RenderStrokeRepBasic(), reorder_layer_data(), blender::ed::vse::retime_key_draw(), and blender::ed::vse::sequencer_retiming_draw_continuity().
|
inline |
Definition at line 357 of file BLI_map.hh.
|
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 1066 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 687 of file BLI_map.hh.
Referenced by BKE_grease_pencil_point_coords_apply(), BKE_grease_pencil_point_coords_apply_with_mat4(), BKE_grease_pencil_point_coords_get(), BKE_grease_pencil_stroke_point_count(), and blender::io::usd::call_import_hooks().
|
inline |
Returns true if there are no elements in the map.
This is similar to std::unordered_map::empty.
Definition at line 986 of file BLI_map.hh.
Referenced by reorder_layer_data(), and blender::ui::string_search::write_recent_searches_file().
|
inline |
Returns an iterator over all key-value-pairs in the map. The key-value-pairs are stored in a #MutableMapItem. 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 913 of file BLI_map.hh.
|
delete |
|
inline |
Returns an iterator over all key-value-pairs in the map. The key-value-pairs are stored in a #MapItem. The iterator is invalidated, when the map is changed.
Definition at line 902 of file BLI_map.hh.
Referenced by blender::ed::object::apply_grease_pencil_for_modifier_all_keyframes(), BKE_cryptomatte_store_metadata(), blender::ed::transform::count_grease_pencil_frames(), blender::ed::greasepencil::create_keyframe_edit_data_selected_frames_list(), blender::ed::transform::createTransActionData(), DRW_select_buffer_elem_get(), blender::ed::greasepencil::duplicate_selected_frames(), Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh(), blender::ed::greasepencil::get_editable_frames_for_layer(), get_keyframe_extents(), blender::ed::greasepencil::get_selected_frame_number_bounds(), grease_pencil_cels_to_keylist(), blender::ed::greasepencil::grease_pencil_copy_keyframes(), blender::ed::transform::grease_pencil_layer_initialize_trans_data(), blender::ed::greasepencil::grease_pencil_remove_fill_guides_exec(), blender::ed::greasepencil::has_any_frame_selected(), IMB_colormanagement_working_space_convert(), blender::nodes::initialize_zone_wrapper(), blender::nodes::LazyFunctionForClosureZone::LazyFunctionForClosureZone(), blender::ed::greasepencil::merge_layers(), blender::ed::greasepencil::mirror_selected_frames(), blender::ed::greasepencil::remove_all_selected_frames(), blender::ed::greasepencil::retrieve_editable_drawings_grouped_per_frame(), blender::ed::greasepencil::select_all_frames(), blender::ed::greasepencil::select_frames_range(), blender::ed::greasepencil::select_frames_region(), blender::ed::greasepencil::snap_selected_frames(), blender::ed::transform::special_aftertrans_update__node(), and blender::ui::string_search::write_recent_searches_file().
|
delete |
|
inline |
Allows writing a range-for loop that iterates over all keys. The iterator is invalidated, when the map is changed.
Definition at line 875 of file BLI_map.hh.
Referenced by BM_log_cleanup_entry(), BM_log_entry_drop(), BM_log_from_existing_entries_create(), blender::ed::greasepencil::grease_pencil_paste_keyframes(), blender::ed::greasepencil::join_object_with_active(), and main_namemap_validate_and_fix().
|
delete |
Avoid common bug when trying to do something like this: for (auto key : get_map().keys()). This does not work, because the compiler does not extend the lifetime of the map for the duration of the loop.
|
inline |
Definition at line 549 of file BLI_map.hh.
|
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 545 of file BLI_map.hh.
Referenced by BKE_main_library_weak_reference_remove_item(), BKE_main_library_weak_reference_update_item(), BKE_mesh_validate_arrays(), BM_log_face_removed(), BM_log_original_vert_data(), BM_log_vert_before_modified(), BM_log_vert_removed(), blender::gpu::render_graph::VKRenderGraphLink::debug_print(), blender::ed::greasepencil::get_visible_frames_for_layer(), blender::ed::greasepencil::join_object_with_active(), blender::nodes::GeometryNodesEvalDependencies::merge(), pack_linked_id(), blender::bke::greasepencil::Layer::prepare_for_dna_write(), blender::bke::greasepencil::Layer::remove_frame(), repair_node_link_node_pointers(), blender::bke::greasepencil::tests::TEST(), blender::bke::greasepencil::tests::TEST(), blender::bke::greasepencil::tests::TEST(), blender::bke::greasepencil::tests::TEST(), blender::bke::greasepencil::tests::TEST(), blender::bke::greasepencil::tests::TEST(), blender::bke::greasepencil::tests::TEST(), blender::bke::greasepencil::tests::TEST(), blender::bke::greasepencil::tests::TEST(), blender::bke::greasepencil::tests::TEST(), and blender::deg::unregister_graph().
|
inline |
Definition at line 559 of file BLI_map.hh.
|
inline |
Definition at line 553 of file BLI_map.hh.
|
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 570 of file BLI_map.hh.
Referenced by BKE_blendfile_link_pack(), BKE_main_library_weak_reference_search_item(), BLO_write_shared_tag(), blender::bke::bNodeTreeZone::contains_node_recursively(), blender::io::fbx::create_transform_curve_data(), blender::io::fbx::create_transform_curve_desc(), DRW_select_buffer_context_offset_for_object_elem(), blender::io::fbx::gather_animated_properties(), Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh(), blender::io::fbx::get_skin_bone_name_set(), blender::io::fbx::import_blend_shape_full_weights(), blender::io::fbx::import_skin_vertex_groups(), blender::bke::greasepencil::convert::legacy_gpencil_object(), blender::bke::greasepencil::convert::legacy_main(), mywrite_id_begin(), blender::io::fbx::node_matrix_to_obj(), and version_geometry_nodes_extrude_smooth_propagation().
|
inline |
Definition at line 575 of file BLI_map.hh.
|
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 656 of file BLI_map.hh.
|
inline |
Definition at line 660 of file BLI_map.hh.
|
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 670 of file BLI_map.hh.
|
inline |
Definition at line 674 of file BLI_map.hh.
|
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 588 of file BLI_map.hh.
Referenced by blender::ed::space_node::all_nodes_preview_update(), blender::ed::space_node::node_preview_acquire_ibuf(), and blender::compositor::Profiler::set_node_evaluation_time().
|
inline |
Definition at line 592 of file BLI_map.hh.
|
inline |
Definition at line 596 of file BLI_map.hh.
|
inline |
Definition at line 600 of file BLI_map.hh.
|
inline |
Definition at line 605 of file BLI_map.hh.
Referenced by UniqueName_Map::add_name(), blender::memory_cache::invalidate_outdated_caches_if_necessary(), namemap_get_name(), and UniqueName_Map::populate().
|
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. The callback is called before the key is copied/moved into the map.
Definition at line 620 of file BLI_map.hh.
Referenced by BM_log_vert_before_modified(), DRW_viewport_pass_texture_get(), get_address_id_int(), blender::draw::edit_select::Instance::object_sync(), and blender::deg::register_graph().
|
inline |
Definition at line 625 of file BLI_map.hh.
|
inline |
Definition at line 630 of file BLI_map.hh.
|
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 639 of file BLI_map.hh.
|
inline |
Definition at line 643 of file BLI_map.hh.
|
inline |
Definition at line 647 of file BLI_map.hh.
|
inline |
Definition at line 512 of file BLI_map.hh.
|
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 508 of file BLI_map.hh.
Referenced by blender::bke::cryptomatte::BKE_cryptomatte_layer_get(), BKE_cryptomatte_material_hash(), BKE_cryptomatte_object_hash(), BKE_main_mesh_legacy_convert_auto_smooth(), blo_read_shared_impl(), blender::ed::space_node::compositor_accumulate_frame_node_execution_time(), blender::ed::space_node::compositor_node_get_execution_time(), ED_image_paint_tile_find(), blender::bke::greasepencil::Layer::frame_at(), blender::bke::greasepencil::Layer::frame_at(), blender::deg::get_all_registered_graphs(), blender::bke::greasepencil::Layer::get_frame_duration_at(), id_name_final_build(), blender::bke::greasepencil::convert::legacy_main(), blender::seq::media_presence_is_missing(), oldnewmap_lookup_and_inc(), UniqueName_Map::remove_full_name(), remove_triangulate_node_min_size_input(), blender::ed::greasepencil::select_frame_at(), and blender::ed::space_node::shader_preview_startjob().
|
inline |
Definition at line 521 of file BLI_map.hh.
|
inline |
Definition at line 516 of file BLI_map.hh.
Referenced by blf_glyph_cache_find_glyph().
|
inline |
Returns a copy of the value that corresponds to the given key, or std::nullopt if the key is not in the map. In some cases, one may not want a copy but an actual reference to the value. In that case it's better to use lookup_ptr instead.
Definition at line 531 of file BLI_map.hh.
Referenced by BM_log_find_original_vert_co(), BM_log_find_original_vert_mask(), BM_log_vert_removed(), blender::nodes::LazyFunctionForEvaluateClosureNode::initialize_execution_graph(), and blender::ed::space_node::node_group_make_from_node_declaration().
|
inline |
Definition at line 535 of file BLI_map.hh.
|
inline |
Definition at line 251 of file BLI_map.hh.
|
inline |
Definition at line 256 of file BLI_map.hh.
|
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 402 of file BLI_map.hh.
Referenced by reorder_layer_data().
|
inline |
Definition at line 406 of file BLI_map.hh.
|
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 439 of file BLI_map.hh.
|
inline |
Definition at line 443 of file BLI_map.hh.
|
inline |
Definition at line 448 of file BLI_map.hh.
|
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 419 of file BLI_map.hh.
|
inline |
Definition at line 423 of file BLI_map.hh.
|
inline |
Print common statistics like size and collision count. This is useful for debugging purposes.
Definition at line 967 of file BLI_map.hh.
|
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 934 of file BLI_map.hh.
|
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 368 of file BLI_map.hh.
Referenced by BKE_blendfile_link_append_context_item_newid_set(), BKE_main_library_weak_reference_remove_item(), BM_log_face_removed(), BM_log_vert_removed(), blender::seq::media_presence_invalidate_sound(), blender::seq::media_presence_invalidate_strip(), UniqueName_Map::remove_full_name(), and blender::deg::unregister_graph().
|
inline |
Definition at line 372 of file BLI_map.hh.
|
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 387 of file BLI_map.hh.
Referenced by blender::bke::greasepencil::Layer::remove_frame(), and UniqueName_Map::remove_full_name().
|
inline |
Definition at line 391 of file BLI_map.hh.
|
inline |
Remove all key-value-pairs for that the given predicate is true and return the number of removed pairs.
This is similar to std::erase_if.
Definition at line 948 of file BLI_map.hh.
|
inline |
Returns the amount of removed slots in the set. This is mostly for debugging purposes.
Definition at line 1002 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 1028 of file BLI_map.hh.
Referenced by BKE_mesh_validate_arrays(), laplacian_system_construct_end(), and reorder_layer_data().
|
inline |
Return the number of key-value-pairs that are stored in the map.
Definition at line 976 of file BLI_map.hh.
Referenced by BM_log_print_entry(), blender::io::usd::call_import_hooks(), Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh(), Freestyle::BlenderStrokeRenderer::RenderStrokeRepBasic(), reorder_layer_data(), blender::bke::greasepencil::tests::TEST(), blender::bke::greasepencil::tests::TEST(), blender::bke::greasepencil::tests::TEST(), blender::bke::greasepencil::tests::TEST(), blender::bke::greasepencil::tests::TEST(), blender::bke::greasepencil::tests::TEST(), blender::bke::greasepencil::tests::TEST(), blender::bke::greasepencil::tests::TEST(), blender::bke::greasepencil::tests::TEST(), and blender::ed::greasepencil::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 1019 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 1010 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 893 of file BLI_map.hh.
|
delete |
|
inline |
Returns an iterator over all values in the map. The iterator is invalidated, when the map is changed.
Definition at line 884 of file BLI_map.hh.
Referenced by change_ID_pointer_to_real_ID_pointer_fd(), change_link_placeholder_to_real_ID_pointer_fd(), DRW_view_data_reset(), image_undosys_step_encode(), blender::nodes::GeometryNodesEvalDependencies::merge(), oldnewmap_clear(), ptile_invalidate_map(), ptile_restore_runtime_map(), blender::ed::greasepencil::set_selected_frames_type(), and blender::update_depsgraph().
|
delete |
|
friend |
Definition at line 1093 of file BLI_map.hh.
|
friend |
True if both maps have the same key-value-pairs.
Definition at line 1074 of file BLI_map.hh.