template <typename Key, typename T, int BUCKETSLOG2 = 2, typename Map = std::unordered_map<Key, T>>
class unordered_map
Defined at line 53 of file ../../third_party/Vulkan-Utility-Libraries/src/include/vulkan/utility/vk_concurrent_unordered_map.hpp
Limited concurrent unordered_map that supports internally-synchronized
insert/erase/access. Splits locking across N buckets and uses shared_mutex
for read/write locking. Iterators are not supported. The following
operations are supported:
insert_or_assign: Insert a new element or update an existing element.
insert: Insert a new element and return whether it was inserted.
erase: Remove an element.
contains: Returns true if the key is in the map.
find: Returns != end() if found, value is in ret->second.
pop: Erases and returns the erased value if found.
find/end: find returns a vaguely iterator-like type that can be compared to
end and can use iter->second to retrieve the reference. This is to ease porting
for existing code that combines the existence check and lookup in a single
operation (and thus a single lock). i.e.:
auto iter = map.find(key);
if (iter != map.end()) {
T t = iter->second;
...
snapshot: Return an array of elements (key, value pairs) that satisfy an optional
predicate. This can be used as a substitute for iterators in exceptional cases.
Public Methods
template <typename... Args>
void insert_or_assign (const Key & key, Args &&... args)
Defined at line 62 of file ../../third_party/Vulkan-Utility-Libraries/src/include/vulkan/utility/vk_concurrent_unordered_map.hpp
template <typename... Args>
bool insert (const Key & key, Args &&... args)
Defined at line 69 of file ../../third_party/Vulkan-Utility-Libraries/src/include/vulkan/utility/vk_concurrent_unordered_map.hpp
size_t erase (const Key & key)
returns size_type
Defined at line 77 of file ../../third_party/Vulkan-Utility-Libraries/src/include/vulkan/utility/vk_concurrent_unordered_map.hpp
bool contains (const Key & key)
Defined at line 83 of file ../../third_party/Vulkan-Utility-Libraries/src/include/vulkan/utility/vk_concurrent_unordered_map.hpp
FindResult end ()
find()/end() return a FindResult containing a copy of the value. For end(),
return a default value.
Defined at line 114 of file ../../third_party/Vulkan-Utility-Libraries/src/include/vulkan/utility/vk_concurrent_unordered_map.hpp
FindResult cend ()
Defined at line 115 of file ../../third_party/Vulkan-Utility-Libraries/src/include/vulkan/utility/vk_concurrent_unordered_map.hpp
FindResult find (const Key & key)
Defined at line 117 of file ../../third_party/Vulkan-Utility-Libraries/src/include/vulkan/utility/vk_concurrent_unordered_map.hpp
FindResult pop (const Key & key)
Defined at line 131 of file ../../third_party/Vulkan-Utility-Libraries/src/include/vulkan/utility/vk_concurrent_unordered_map.hpp
std::vector<std::pair<const Key, T>> snapshot (std::function<bool (T)> f)
Defined at line 147 of file ../../third_party/Vulkan-Utility-Libraries/src/include/vulkan/utility/vk_concurrent_unordered_map.hpp
void clear ()
Defined at line 160 of file ../../third_party/Vulkan-Utility-Libraries/src/include/vulkan/utility/vk_concurrent_unordered_map.hpp
size_t size ()
Defined at line 167 of file ../../third_party/Vulkan-Utility-Libraries/src/include/vulkan/utility/vk_concurrent_unordered_map.hpp
bool empty ()
Defined at line 176 of file ../../third_party/Vulkan-Utility-Libraries/src/include/vulkan/utility/vk_concurrent_unordered_map.hpp