Blender  V3.3
Classes | Public Types | Public Member Functions | List of all members
blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator > Class Template Reference

#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 >)
 
Mapoperator= (const Map &other)
 
Mapoperator= (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 Keylookup_key (const Key &key) const
 
template<typename ForwardKey >
const Keylookup_key_as (const ForwardKey &key) const
 
const Keylookup_key_ptr (const Key &key) const
 
template<typename ForwardKey >
const Keylookup_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
 

Detailed Description

template<typename Key, typename Value, int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
class blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >

Definition at line 108 of file BLI_map.hh.

Member Typedef Documentation

◆ size_type

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
using blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size_type = int64_t

Definition at line 110 of file BLI_map.hh.

Constructor & Destructor Documentation

◆ Map() [1/4]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::Map ( Allocator  allocator = {})
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.

◆ Map() [2/4]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::Map ( NoExceptConstructor  ,
Allocator  allocator = {} 
)
inlinenoexcept

Definition at line 174 of file BLI_map.hh.

◆ ~Map()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::~Map ( )
default

◆ Map() [3/4]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::Map ( const Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator > &  other)
default

◆ Map() [4/4]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::Map ( Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator > &&  other)
inlinenoexcept

Definition at line 182 of file BLI_map.hh.

Member Function Documentation

◆ add() [1/4]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
bool blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add ( const Key key,
const Value &  value 
)
inline

◆ add() [2/4]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
bool blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add ( const Key key,
Value &&  value 
)
inline

◆ add() [3/4]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
bool blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add ( Key &&  key,
const Value &  value 
)
inline

◆ add() [4/4]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
bool blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add ( Key &&  key,
Value &&  value 
)
inline

◆ add_as()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey , typename... ForwardValue>
bool blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_as ( ForwardKey &&  key,
ForwardValue &&...  value 
)
inline

◆ add_new() [1/4]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
void blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new ( const Key key,
const Value &  value 
)
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.

References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new_as().

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().

◆ add_new() [2/4]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
void blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new ( const Key key,
Value &&  value 
)
inline

◆ add_new() [3/4]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
void blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new ( Key &&  key,
const Value &  value 
)
inline

◆ add_new() [4/4]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
void blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new ( Key &&  key,
Value &&  value 
)
inline

◆ add_new_as()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey , typename... ForwardValue>
void blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new_as ( ForwardKey &&  key,
ForwardValue &&...  value 
)
inline

◆ add_or_modify() [1/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename CreateValueF , typename ModifyValueF >
auto blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_or_modify ( const Key key,
const CreateValueF &  create_value,
const ModifyValueF &  modify_value 
) -> decltype(create_value(nullptr))
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.

References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_or_modify_as().

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().

◆ add_or_modify() [2/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename CreateValueF , typename ModifyValueF >
auto blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_or_modify ( Key &&  key,
const CreateValueF &  create_value,
const ModifyValueF &  modify_value 
) -> decltype(create_value(nullptr))
inline

◆ add_or_modify_as()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey , typename CreateValueF , typename ModifyValueF >
auto blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_or_modify_as ( ForwardKey &&  key,
const CreateValueF &  create_value,
const ModifyValueF &  modify_value 
) -> decltype(create_value(nullptr))
inline

◆ add_overwrite() [1/4]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
bool blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_overwrite ( const Key key,
const Value &  value 
)
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.

References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_overwrite_as().

Referenced by blender::dot::Attributes::set().

◆ add_overwrite() [2/4]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
bool blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_overwrite ( const Key key,
Value &&  value 
)
inline

◆ add_overwrite() [3/4]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
bool blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_overwrite ( Key &&  key,
const Value &  value 
)
inline

◆ add_overwrite() [4/4]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
bool blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_overwrite ( Key &&  key,
Value &&  value 
)
inline

◆ add_overwrite_as()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey , typename... ForwardValue>
bool blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_overwrite_as ( ForwardKey &&  key,
ForwardValue &&...  value 
)
inline

◆ capacity()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
int64_t blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::capacity ( ) const
inline

Returns the number of available slots. This is mostly for debugging purposes.

Definition at line 919 of file BLI_map.hh.

◆ clear()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
void blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::clear ( )
inline

◆ contains()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
bool blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains ( const Key key) const
inline

◆ contains_as()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
bool blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains_as ( const ForwardKey &  key) const
inline

◆ count_collisions()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
int64_t blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::count_collisions ( const Key key) const
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.

◆ foreach_item()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename FuncT >
void blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::foreach_item ( const FuncT &  func) const
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().

◆ is_empty()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
bool blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::is_empty ( ) const
inline

◆ items() [1/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
MutableItemIterator blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::items ( )
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.

◆ items() [2/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
ItemIterator blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::items ( ) const
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().

◆ keys()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
KeyIterator blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::keys ( ) const
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().

◆ lookup() [1/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
Value& blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup ( const Key key)
inline

◆ lookup() [2/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
const Value& blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup ( const Key key) const
inline

◆ lookup_as() [1/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
Value& blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_as ( const ForwardKey &  key)
inline

◆ lookup_as() [2/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
const Value& blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_as ( const ForwardKey &  key) const
inline

◆ lookup_default()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
Value blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default ( const Key key,
const Value &  default_value 
) const
inline

◆ lookup_default_as()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey , typename... ForwardValue>
Value blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default_as ( const ForwardKey &  key,
ForwardValue &&...  default_value 
) const
inline

◆ lookup_key()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
const Key& blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_key ( const Key key) const
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.

References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_key_as().

◆ lookup_key_as()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
const Key& blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_key_as ( const ForwardKey &  key) const
inline

◆ lookup_key_ptr()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
const Key* blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_key_ptr ( const Key key) const
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.

References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_key_ptr_as().

◆ lookup_key_ptr_as()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
const Key* blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_key_ptr_as ( const ForwardKey &  key) const
inline

◆ lookup_or_add() [1/4]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
Value& blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add ( const Key key,
const Value &  value 
)
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().

◆ lookup_or_add() [2/4]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
Value& blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add ( const Key key,
Value &&  value 
)
inline

◆ lookup_or_add() [3/4]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
Value& blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add ( Key &&  key,
const Value &  value 
)
inline

◆ lookup_or_add() [4/4]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
Value& blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add ( Key &&  key,
Value &&  value 
)
inline

◆ lookup_or_add_as()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey , typename... ForwardValue>
Value& blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add_as ( ForwardKey &&  key,
ForwardValue &&...  value 
)
inline

◆ lookup_or_add_cb() [1/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename CreateValueF >
Value& blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add_cb ( const Key key,
const CreateValueF &  create_value 
)
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().

◆ lookup_or_add_cb() [2/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename CreateValueF >
Value& blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add_cb ( Key &&  key,
const CreateValueF &  create_value 
)
inline

◆ lookup_or_add_cb_as()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey , typename CreateValueF >
Value& blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add_cb_as ( ForwardKey &&  key,
const CreateValueF &  create_value 
)
inline

◆ lookup_or_add_default() [1/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
Value& blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add_default ( const Key key)
inline

◆ lookup_or_add_default() [2/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
Value& blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add_default ( Key &&  key)
inline

◆ lookup_or_add_default_as()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
Value& blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add_default_as ( ForwardKey &&  key)
inline

◆ lookup_ptr() [1/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
Value* blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr ( const Key key)
inline

◆ lookup_ptr() [2/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
const Value* blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr ( const Key key) const
inline

◆ lookup_ptr_as() [1/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
Value* blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr_as ( const ForwardKey &  key)
inline

◆ lookup_ptr_as() [2/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
const Value* blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr_as ( const ForwardKey &  key) const
inline

◆ operator=() [1/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
Map& blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::operator= ( const Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator > &  other)
inline

Definition at line 206 of file BLI_map.hh.

References blender::copy_assign_container().

◆ operator=() [2/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
Map& blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::operator= ( Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator > &&  other)
inline

Definition at line 211 of file BLI_map.hh.

References blender::move_assign_container().

◆ pop()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
Value blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::pop ( const Key key)
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.

◆ pop_as()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
Value blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::pop_as ( const ForwardKey &  key)
inline

◆ pop_default() [1/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
Value blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::pop_default ( const Key key,
const Value &  default_value 
)
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().

◆ pop_default() [2/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
Value blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::pop_default ( const Key key,
Value &&  default_value 
)
inline

◆ pop_default_as()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey , typename... ForwardValue>
Value blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::pop_default_as ( const ForwardKey &  key,
ForwardValue &&...  default_value 
)
inline

◆ pop_try()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
std::optional<Value> blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::pop_try ( const Key key)
inline

◆ pop_try_as()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
std::optional<Value> blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::pop_try_as ( const ForwardKey &  key)
inline

◆ print_stats()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
void blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::print_stats ( StringRef  name = "") const
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().

◆ remove() [1/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
void blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove ( const BaseIterator iterator)
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().

◆ remove() [2/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
bool blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove ( const Key key)
inline

◆ remove_as()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
bool blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove_as ( const ForwardKey &  key)
inline

◆ remove_contained()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
void blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove_contained ( const Key key)
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.

References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove_contained_as().

◆ remove_contained_as()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
void blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove_contained_as ( const ForwardKey &  key)
inline

◆ removed_amount()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
int64_t blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::removed_amount ( ) const
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.

◆ reserve()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
void blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::reserve ( int64_t  n)
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().

◆ size()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
int64_t blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size ( ) const
inline

◆ size_in_bytes()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
int64_t blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size_in_bytes ( ) const
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().

◆ size_per_element()

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
int64_t blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size_per_element ( ) const
inline

Returns the bytes required per element. This is mostly for debugging purposes.

Definition at line 935 of file BLI_map.hh.

◆ values() [1/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
MutableValueIterator blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::values ( )
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.

◆ values() [2/2]

template<typename Key , typename Value , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key) + sizeof(Value)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
ValueIterator blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::values ( ) const
inline

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