Blender V5.0
Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator > Class Template Reference

#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
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)
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 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 &
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)

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<Key>, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
class Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >
Template Parameters
KeyType of the keys stored in the map. Keys have to be movable. Furthermore, the hash and is-equal functions have to support it.
ValueType of the value that is stored per key. It has to be movable as well.
InlineBufferCapacityThe 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.
ProbingStrategyThe strategy used to deal with collisions. They are defined in BLI_probing_strategies.hh.
HashThe 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.
IsEqualThe equality operator used to compare keys. By default it will simply compare keys using the == operator.
SlotThis 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
AllocatorThe 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.

Member Typedef Documentation

◆ 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<Key>, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
using blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::Item = MapItem<Key, Value>

Definition at line 132 of file BLI_map.hh.

◆ MutableItem

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<Key>, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
using blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::MutableItem = MutableMapItem<Key, Value>

Definition at line 133 of file BLI_map.hh.

◆ 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<Key>, 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 131 of file BLI_map.hh.

Constructor & Destructor Documentation

◆ Map() [1/6]

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<Key>, 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 186 of file BLI_map.hh.

◆ Map() [2/6]

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<Key>, 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 197 of file BLI_map.hh.

◆ Map() [3/6]

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<Key>, 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/6]

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<Key>, 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 203 of file BLI_map.hh.

◆ Map() [5/6]

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<Key>, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::Map ( const Span< std::pair< Key, Value > > items,
Allocator allocator = {} )
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.

◆ Map() [6/6]

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<Key>, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::Map ( const std::initializer_list< std::pair< Key, Value > > items,
Allocator allocator = {} )
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.

◆ ~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<Key>, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::~Map ( )
default

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<Key>, 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<Key>, 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

Definition at line 299 of file BLI_map.hh.

◆ 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<Key>, 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

Definition at line 303 of file BLI_map.hh.

◆ 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<Key>, 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

Definition at line 307 of file BLI_map.hh.

◆ 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<Key>, 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

Definition at line 312 of file BLI_map.hh.

◆ 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<Key>, 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

◆ 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<Key>, 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

Definition at line 269 of file BLI_map.hh.

◆ 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<Key>, 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

Definition at line 273 of file BLI_map.hh.

◆ 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<Key>, 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

Definition at line 277 of file BLI_map.hh.

◆ 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<Key>, 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

Definition at line 282 of file BLI_map.hh.

◆ 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<Key>, 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 481 of file BLI_map.hh.

Referenced by ED_image_paint_tile_push(), and IMB_colormanagement_working_space_convert().

◆ 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<Key>, 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

Definition at line 488 of file BLI_map.hh.

◆ 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<Key>, 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

Definition at line 494 of file BLI_map.hh.

◆ 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<Key>, 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 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().

◆ 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<Key>, 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

Definition at line 329 of file BLI_map.hh.

◆ 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<Key>, 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

Definition at line 333 of file BLI_map.hh.

◆ 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<Key>, 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

Definition at line 337 of file BLI_map.hh.

◆ 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<Key>, 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

Definition at line 342 of file BLI_map.hh.

◆ 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<Key>, 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 994 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<Key>, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
void blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::clear ( )
inline

◆ clear_and_keep_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<Key>, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
void blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::clear_and_keep_capacity ( )
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.

◆ 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<Key>, 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<Key>, 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

Definition at line 357 of file BLI_map.hh.

◆ 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<Key>, 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 1066 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<Key>, 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 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().

◆ 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<Key>, 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

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

◆ items() [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<Key>, 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 #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.

◆ items() [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<Key>, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
MutableItemIterator blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::items ( ) &&
delete

◆ items() [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<Key>, 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 #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().

◆ items() [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<Key>, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
ItemIterator blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::items ( ) const &&
delete

◆ keys() [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<Key>, 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 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().

◆ keys() [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<Key>, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
KeyIterator blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::keys ( ) const &&
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.

◆ 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<Key>, 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

Definition at line 549 of file BLI_map.hh.

◆ 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<Key>, 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<Key>, 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

Definition at line 559 of file BLI_map.hh.

◆ 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<Key>, 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

Definition at line 553 of file BLI_map.hh.

◆ 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<Key>, 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<Key>, 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

Definition at line 575 of file BLI_map.hh.

◆ 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<Key>, 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 656 of file BLI_map.hh.

◆ 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<Key>, 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

Definition at line 660 of file BLI_map.hh.

◆ 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<Key>, 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 670 of file BLI_map.hh.

◆ 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<Key>, 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

Definition at line 674 of file BLI_map.hh.

◆ 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<Key>, 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 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().

◆ 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<Key>, 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

Definition at line 592 of file BLI_map.hh.

◆ 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<Key>, 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

Definition at line 596 of file BLI_map.hh.

◆ 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<Key>, 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

Definition at line 600 of file BLI_map.hh.

◆ 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<Key>, 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<Key>, 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. 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().

◆ 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<Key>, 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

Definition at line 625 of file BLI_map.hh.

◆ 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<Key>, 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

Definition at line 630 of file BLI_map.hh.

◆ 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<Key>, 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

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.

◆ 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<Key>, 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

Definition at line 643 of file BLI_map.hh.

◆ 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<Key>, 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

Definition at line 647 of file BLI_map.hh.

◆ 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<Key>, 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

Definition at line 512 of file BLI_map.hh.

◆ 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<Key>, 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<Key>, 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

Definition at line 521 of file BLI_map.hh.

◆ 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<Key>, 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

Definition at line 516 of file BLI_map.hh.

Referenced by blf_glyph_cache_find_glyph().

◆ lookup_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<Key>, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
std::optional< Value > blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_try ( const Key & key) const
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().

◆ lookup_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<Key>, 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 >::lookup_try_as ( const ForwardKey & key) const
inline

Definition at line 535 of file BLI_map.hh.

◆ 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<Key>, 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 251 of file BLI_map.hh.

◆ 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<Key>, 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 256 of file BLI_map.hh.

◆ 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<Key>, 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 402 of file BLI_map.hh.

Referenced by reorder_layer_data().

◆ 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<Key>, 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

Definition at line 406 of file BLI_map.hh.

◆ 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<Key>, 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 439 of file BLI_map.hh.

◆ 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<Key>, 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

Definition at line 443 of file BLI_map.hh.

◆ 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<Key>, 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

Definition at line 448 of file BLI_map.hh.

◆ 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<Key>, 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

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.

◆ 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<Key>, 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

Definition at line 423 of file BLI_map.hh.

◆ 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<Key>, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
void blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::print_stats ( const char * name) const
inline

Print common statistics like size and collision count. This is useful for debugging purposes.

Definition at line 967 of file BLI_map.hh.

◆ 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<Key>, 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 934 of file BLI_map.hh.

◆ 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<Key>, 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

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

◆ 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<Key>, 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

Definition at line 372 of file BLI_map.hh.

◆ 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<Key>, 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 387 of file BLI_map.hh.

Referenced by blender::bke::greasepencil::Layer::remove_frame(), and UniqueName_Map::remove_full_name().

◆ 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<Key>, 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

Definition at line 391 of file BLI_map.hh.

◆ remove_if()

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<Key>, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
template<typename Predicate>
int64_t blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove_if ( Predicate && predicate)
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.

◆ 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<Key>, 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 1002 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<Key>, 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 1028 of file BLI_map.hh.

Referenced by BKE_mesh_validate_arrays(), laplacian_system_construct_end(), and reorder_layer_data().

◆ 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<Key>, 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<Key>, 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 1019 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<Key>, 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 1010 of file BLI_map.hh.

◆ values() [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<Key>, 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 893 of file BLI_map.hh.

◆ values() [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<Key>, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
MutableValueIterator blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::values ( ) &&
delete

◆ values() [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<Key>, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
ValueIterator blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::values ( ) const &
inline

◆ values() [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<Key>, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
ValueIterator blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::values ( ) const &&
delete

◆ operator!=

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<Key>, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
bool operator!= ( const Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator > & a,
const Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator > & b )
friend

Definition at line 1093 of file BLI_map.hh.

◆ operator==

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<Key>, typename Slot = typename DefaultMapSlot<Key, Value>::type, typename Allocator = GuardedAllocator>
bool operator== ( const Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator > & a,
const Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator > & b )
friend

True if both maps have the same key-value-pairs.

Definition at line 1074 of file BLI_map.hh.


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