|
Blender V5.3
|
#include <BLI_concurrent_set.hh>
Inherits blender::blender::NonCopyable.
Public Member Functions | |
| ConcurrentSet ()=default | |
| ConcurrentSet (ConcurrentSet &&other) noexcept | |
| ConcurrentSet & | operator= (ConcurrentSet &&other) noexcept |
| template<typename ForwardKey> | |
| const Key * | lookup_ptr (const ForwardKey &key) const |
| const Key & | lookup_key_or_add (const Key &key) |
| const Key & | lookup_key_or_add (Key &&key) |
| template<typename ForwardKey> | |
| const Key & | lookup_key_or_add_as (ForwardKey &&key) |
| int64_t | size () const |
| void | reserve (const int64_t n) |
A ConcurrentSet allows adding and looking up keys from multiple threads concurrently. Once a key has been added, a pointer to it remains valid for as long as the set exists (keys are never relocated by growth).
This is a thin wrapper around #tbb::concurrent_unordered_set that also has a fallback implementation if TBB is not available. The fallback implementation is not optimized.
Definition at line 34 of file BLI_concurrent_set.hh.
|
default |
|
inlinenoexcept |
Definition at line 141 of file BLI_concurrent_set.hh.
|
inline |
Add the key to the set if it does not exist yet. Either way, a reference to the key that is now stored in the set is returned (which might not be the passed in key, if another thread added an equal key first).
Definition at line 168 of file BLI_concurrent_set.hh.
Referenced by blender::detail::ustring_ensure_entry().
|
inline |
Definition at line 172 of file BLI_concurrent_set.hh.
|
inline |
Definition at line 176 of file BLI_concurrent_set.hh.
|
inline |
Look up a key without adding it. Returns null if the key does not exist yet. Does not require creating a Key first, unlike lookup_key_or_add.
Definition at line 156 of file BLI_concurrent_set.hh.
Referenced by blender::detail::ustring_ensure_entry().
|
inlinenoexcept |
Definition at line 145 of file BLI_concurrent_set.hh.
|
inline |
Potentially grow the set so that it can hold at least #n keys without rehashing again.
Definition at line 190 of file BLI_concurrent_set.hh.
Referenced by blender::global_string_table().
|
inline |
Returns the number of keys currently in the set.
Definition at line 183 of file BLI_concurrent_set.hh.