Blender  V3.3
Public Member Functions | List of all members
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
 
Value * value ()
 
const Value * value () 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 UNUSED(hash)) 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 UNUSED(hash))
 
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 232 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 240 of file BLI_map_slots.hh.

References blender::TypedBuffer< T, Size >::ref().

◆ 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 247 of file BLI_map_slots.hh.

References Value.

◆ 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 254 of file BLI_map_slots.hh.

References Value.

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   UNUSEDhash 
) const
inline

◆ 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

◆ is_empty()

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

Definition at line 286 of file BLI_map_slots.hh.

◆ is_occupied()

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

◆ key() [1/2]

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

◆ key() [2/2]

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

Definition at line 266 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

◆ 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   UNUSEDhash 
)
inline

◆ remove()

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

◆ value() [1/2]

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

Definition at line 271 of file BLI_map_slots.hh.

References Value.

Referenced by blender::IntrusiveMapSlot< Key, Value, KeyInfo >::occupy().

◆ value() [2/2]

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

Definition at line 276 of file BLI_map_slots.hh.

References Value.


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