Blender V4.3
blender::IntrusiveMapSlot< Key, Value, KeyInfo > Class Template Reference

#include <BLI_map_slots.hh>

Public Member Functions

 IntrusiveMapSlot ()=default
 ~IntrusiveMapSlot ()
 IntrusiveMapSlot (const IntrusiveMapSlot &other)
 IntrusiveMapSlot (IntrusiveMapSlot &&other) noexcept
Keykey ()
const Keykey () const
Valuevalue ()
const Valuevalue () const
bool is_occupied () const
bool is_empty () const
template<typename Hash>
uint64_t get_hash (const Hash &hash)
template<typename ForwardKey, typename IsEqual>
bool contains (const ForwardKey &key, const IsEqual &is_equal, uint64_t) const
template<typename ForwardKey, typename... ForwardValue>
void occupy (ForwardKey &&key, uint64_t hash, ForwardValue &&...value)
template<typename ForwardKey>
void occupy_no_value (ForwardKey &&key, uint64_t)
void remove ()

Detailed Description

template<typename Key, typename Value, typename KeyInfo>
class blender::IntrusiveMapSlot< Key, Value, KeyInfo >

An IntrusiveMapSlot uses two special values of the key to indicate whether the slot is empty or removed. This saves some memory in all cases and is more efficient in many cases. The KeyInfo type indicates which specific values are used. An example for a KeyInfo implementation is PointerKeyInfo.

The special key values are expected to be trivially destructible.

Definition at line 234 of file BLI_map_slots.hh.

Constructor & Destructor Documentation

◆ IntrusiveMapSlot() [1/3]

template<typename Key, typename Value, typename KeyInfo>
blender::IntrusiveMapSlot< Key, Value, KeyInfo >::IntrusiveMapSlot ( )
default

◆ ~IntrusiveMapSlot()

template<typename Key, typename Value, typename KeyInfo>
blender::IntrusiveMapSlot< Key, Value, KeyInfo >::~IntrusiveMapSlot ( )
inline

Definition at line 242 of file BLI_map_slots.hh.

◆ IntrusiveMapSlot() [2/3]

template<typename Key, typename Value, typename KeyInfo>
blender::IntrusiveMapSlot< Key, Value, KeyInfo >::IntrusiveMapSlot ( const IntrusiveMapSlot< Key, Value, KeyInfo > & other)
inline

Definition at line 249 of file BLI_map_slots.hh.

◆ IntrusiveMapSlot() [3/3]

template<typename Key, typename Value, typename KeyInfo>
blender::IntrusiveMapSlot< Key, Value, KeyInfo >::IntrusiveMapSlot ( IntrusiveMapSlot< Key, Value, KeyInfo > && other)
inlinenoexcept

Definition at line 256 of file BLI_map_slots.hh.

Member Function Documentation

◆ contains()

template<typename Key, typename Value, typename KeyInfo>
template<typename ForwardKey, typename IsEqual>
bool blender::IntrusiveMapSlot< Key, Value, KeyInfo >::contains ( const ForwardKey & key,
const IsEqual & is_equal,
uint64_t  ) const
inline

Definition at line 300 of file BLI_map_slots.hh.

◆ get_hash()

template<typename Key, typename Value, typename KeyInfo>
template<typename Hash>
uint64_t blender::IntrusiveMapSlot< Key, Value, KeyInfo >::get_hash ( const Hash & hash)
inline

Definition at line 293 of file BLI_map_slots.hh.

◆ is_empty()

template<typename Key, typename Value, typename KeyInfo>
bool blender::IntrusiveMapSlot< Key, Value, KeyInfo >::is_empty ( ) const
inline

Definition at line 288 of file BLI_map_slots.hh.

◆ is_occupied()

◆ key() [1/2]

template<typename Key, typename Value, typename KeyInfo>
Key * blender::IntrusiveMapSlot< Key, Value, KeyInfo >::key ( )
inline

Definition at line 263 of file BLI_map_slots.hh.

◆ key() [2/2]

template<typename Key, typename Value, typename KeyInfo>
const Key * blender::IntrusiveMapSlot< Key, Value, KeyInfo >::key ( ) const
inline

Definition at line 268 of file BLI_map_slots.hh.

◆ occupy()

template<typename Key, typename Value, typename KeyInfo>
template<typename ForwardKey, typename... ForwardValue>
void blender::IntrusiveMapSlot< Key, Value, KeyInfo >::occupy ( ForwardKey && key,
uint64_t hash,
ForwardValue &&... value )
inline

Definition at line 307 of file BLI_map_slots.hh.

◆ occupy_no_value()

template<typename Key, typename Value, typename KeyInfo>
template<typename ForwardKey>
void blender::IntrusiveMapSlot< Key, Value, KeyInfo >::occupy_no_value ( ForwardKey && key,
uint64_t  )
inline

◆ remove()

template<typename Key, typename Value, typename KeyInfo>
void blender::IntrusiveMapSlot< Key, Value, KeyInfo >::remove ( )
inline

Definition at line 328 of file BLI_map_slots.hh.

◆ value() [1/2]

template<typename Key, typename Value, typename KeyInfo>
Value * blender::IntrusiveMapSlot< Key, Value, KeyInfo >::value ( )
inline

Definition at line 273 of file BLI_map_slots.hh.

◆ value() [2/2]

template<typename Key, typename Value, typename KeyInfo>
const Value * blender::IntrusiveMapSlot< Key, Value, KeyInfo >::value ( ) const
inline

Definition at line 278 of file BLI_map_slots.hh.


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