|
Blender V5.0
|
#include <BLI_vector_set_slots.hh>
Public Member Functions | |
| bool | is_occupied () const |
| bool | is_empty () const |
| IndexT | index () const |
| template<typename ForwardKey, typename IsEqual> | |
| bool | contains (const ForwardKey &key, const IsEqual &is_equal, uint64_t, const Key *keys) const |
| void | occupy (IndexT index, uint64_t) |
| void | update_index (IndexT index) |
| void | remove () |
| bool | has_index (IndexT index) const |
| template<typename Hash> | |
| uint64_t | get_hash (const Key &key, const Hash &hash) const |
The simplest possible vector set slot. It stores the index and state in a signed integer. If the value is negative, it represents empty or occupied state. Otherwise it represents the index.
Definition at line 36 of file BLI_vector_set_slots.hh.
|
inline |
Return true if the slot contains the given key, i.e. its index points to a key that compares equal to it. The hash can be used by other implementations to determine inequality faster.
Definition at line 79 of file BLI_vector_set_slots.hh.
|
inline |
Return the hash of the currently stored key. In this simple set slot implementation, we just compute the hash here. Other implementations might store the hash in the slot instead.
Definition at line 131 of file BLI_vector_set_slots.hh.
References BLI_assert, hash, and is_occupied().
|
inline |
Return true if this slot is currently occupied and its corresponding key has the given index.
Definition at line 122 of file BLI_vector_set_slots.hh.
References index().
|
inline |
Return the stored index. It is assumed that the slot is occupied.
Definition at line 68 of file BLI_vector_set_slots.hh.
References BLI_assert, and is_occupied().
Referenced by has_index(), occupy(), and update_index().
|
inline |
Return true if the slot is empty, i.e. it does not contain an index.
Definition at line 60 of file BLI_vector_set_slots.hh.
References s_is_empty.
|
inline |
Return true if this slot contains an index to a key.
Definition at line 52 of file BLI_vector_set_slots.hh.
Referenced by get_hash(), index(), occupy(), remove(), and update_index().
|
inline |
Change the state of this slot from empty/removed to occupied. The hash can be used by other slot implementations.
Definition at line 94 of file BLI_vector_set_slots.hh.
References BLI_assert, index(), and is_occupied().
|
inline |
Change the state of this slot from occupied to removed.
Definition at line 113 of file BLI_vector_set_slots.hh.
References BLI_assert, is_occupied(), and s_is_removed.
|
inline |
The key has changed its position in the vector, so the index has to be updated. This method can assume that the slot is currently occupied.
Definition at line 104 of file BLI_vector_set_slots.hh.
References BLI_assert, index(), and is_occupied().