Blender  V2.93
Public Types | Public Member Functions | List of all members
blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator > Class Template Reference

#include <BLI_vector_set.hh>

Public Types

using value_type = Key
 
using pointer = Key *
 
using const_pointer = const Key *
 
using reference = Key &
 
using const_reference = const Key &
 
using iterator = Key *
 
using const_iterator = const Key *
 
using size_type = int64_t
 

Public Member Functions

 VectorSet (Allocator allocator={}) noexcept
 
 VectorSet (NoExceptConstructor, Allocator allocator={})
 
 VectorSet (Span< Key > keys, Allocator allocator={})
 
 VectorSet (const std::initializer_list< Key > &keys, Allocator allocator={})
 
 ~VectorSet ()
 
 VectorSet (const VectorSet &other)
 
 VectorSet (VectorSet &&other) noexcept
 
VectorSetoperator= (const VectorSet &other)
 
VectorSetoperator= (VectorSet &&other)
 
const Keyoperator[] (const int64_t index) const
 
 operator Span< Key > () const
 
Span< Keyas_span () const
 
void add_new (const Key &key)
 
void add_new (Key &&key)
 
bool add (const Key &key)
 
bool add (Key &&key)
 
template<typename ForwardKey >
bool add_as (ForwardKey &&key)
 
void add_multiple (Span< Key > keys)
 
bool contains (const Key &key) const
 
template<typename ForwardKey >
bool contains_as (const ForwardKey &key) const
 
bool remove (const Key &key)
 
template<typename ForwardKey >
bool remove_as (const ForwardKey &key)
 
void remove_contained (const Key &key)
 
template<typename ForwardKey >
void remove_contained_as (const ForwardKey &key)
 
Key pop ()
 
int64_t index_of (const Key &key) const
 
template<typename ForwardKey >
int64_t index_of_as (const ForwardKey &key) const
 
int64_t index_of_try (const Key &key) const
 
template<typename ForwardKey >
int64_t index_of_try_as (const ForwardKey &key) const
 
const Keydata () const
 
const Keybegin () const
 
const Keyend () const
 
void print_stats (StringRef name="") const
 
int64_t size () const
 
bool is_empty () const
 
int64_t capacity () const
 
int64_t removed_amount () const
 
int64_t size_per_element () const
 
int64_t size_in_bytes () const
 
void reserve (const int64_t n)
 
int64_t count_collisions (const Key &key) const
 

Detailed Description

template<typename Key, typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
class blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >

Definition at line 102 of file BLI_vector_set.hh.

Member Typedef Documentation

◆ const_iterator

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
using blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::const_iterator = const Key *

Definition at line 110 of file BLI_vector_set.hh.

◆ const_pointer

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
using blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::const_pointer = const Key *

Definition at line 106 of file BLI_vector_set.hh.

◆ const_reference

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
using blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::const_reference = const Key &

Definition at line 108 of file BLI_vector_set.hh.

◆ iterator

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
using blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::iterator = Key *

Definition at line 109 of file BLI_vector_set.hh.

◆ pointer

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
using blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::pointer = Key *

Definition at line 105 of file BLI_vector_set.hh.

◆ reference

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
using blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::reference = Key &

Definition at line 107 of file BLI_vector_set.hh.

◆ size_type

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
using blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size_type = int64_t

Definition at line 111 of file BLI_vector_set.hh.

◆ value_type

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
using blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::value_type = Key

Definition at line 104 of file BLI_vector_set.hh.

Constructor & Destructor Documentation

◆ VectorSet() [1/6]

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::VectorSet ( Allocator  allocator = {})
inlinenoexcept

Initialize an empty vector set. This is a cheap operation and won't do an allocation. This is necessary to avoid a high cost when no elements are added at all. An optimized grow operation is performed on the first insertion.

Definition at line 170 of file BLI_vector_set.hh.

◆ VectorSet() [2/6]

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::VectorSet ( NoExceptConstructor  ,
Allocator  allocator = {} 
)
inline

Definition at line 180 of file BLI_vector_set.hh.

◆ VectorSet() [3/6]

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::VectorSet ( Span< Key keys,
Allocator  allocator = {} 
)
inline

Definition at line 184 of file BLI_vector_set.hh.

◆ VectorSet() [4/6]

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::VectorSet ( const std::initializer_list< Key > &  keys,
Allocator  allocator = {} 
)
inline

Construct a vector set that contains the given keys. Duplicates will be removed automatically.

Definition at line 192 of file BLI_vector_set.hh.

◆ ~VectorSet()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::~VectorSet ( )
inline

◆ VectorSet() [5/6]

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::VectorSet ( const VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator > &  other)
inline

◆ VectorSet() [6/6]

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::VectorSet ( VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator > &&  other)
inlinenoexcept

Definition at line 224 of file BLI_vector_set.hh.

Member Function Documentation

◆ add() [1/2]

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
bool blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add ( const Key key)
inline

Add a key to the vector set. If the key exists in the set already, nothing is done. The return value is true if the key was newly added.

This is similar to std::unordered_set::insert.

Definition at line 296 of file BLI_vector_set.hh.

References blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_as().

Referenced by blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_multiple(), blender::bke::ComponentAttributeProviders::ComponentAttributeProviders(), blender::fn::MFNetwork::find_dependencies(), and blender::tests::TEST().

◆ add() [2/2]

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
bool blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add ( Key &&  key)
inline

◆ add_as()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
bool blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_as ( ForwardKey &&  key)
inline

◆ add_multiple()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
void blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_multiple ( Span< Key keys)
inline

Convenience function to add many keys to the vector set at once. Duplicates are removed automatically.

We might be able to make this faster than sequentially adding all keys, but that is not implemented yet.

Definition at line 316 of file BLI_vector_set.hh.

References blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add().

Referenced by blender::tests::TEST().

◆ add_new() [1/2]

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
void blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new ( const Key key)
inline

Add a new key to the vector set. This invokes undefined behavior when the key is in the set already. When you know for certain that a key is not in the set yet, use this method for better performance. This also expresses the intent better.

Definition at line 281 of file BLI_vector_set.hh.

Referenced by blender::tests::TEST().

◆ add_new() [2/2]

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
void blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new ( Key &&  key)
inline

Definition at line 285 of file BLI_vector_set.hh.

◆ as_span()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
Span<Key> blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::as_span ( ) const
inline

Get an Span referencing the keys vector. The referenced memory buffer is only valid as long as the vector set is not changed.

The keys must not be changed, because this would change their hash value.

Definition at line 271 of file BLI_vector_set.hh.

Referenced by blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::print_stats(), and blender::tests::TEST().

◆ begin()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
const Key* blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::begin ( ) const
inline

Definition at line 408 of file BLI_vector_set.hh.

◆ capacity()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
int64_t blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::capacity ( ) const
inline

Returns the number of available slots. This is mostly for debugging purposes.

Definition at line 446 of file BLI_vector_set.hh.

◆ contains()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
bool blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains ( const Key key) const
inline

Returns true if the key is in the vector set.

This is similar to std::unordered_set::find() != std::unordered_set::end().

Definition at line 328 of file BLI_vector_set.hh.

References blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains_as().

Referenced by blender::tests::TEST().

◆ contains_as()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
bool blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains_as ( const ForwardKey &  key) const
inline

◆ count_collisions()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
int64_t blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::count_collisions ( const Key key) const
inline

Get the number of collisions that the probing strategy has to go through to find the key or determine that it is not in the set.

Definition at line 490 of file BLI_vector_set.hh.

◆ data()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
const Key* blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::data ( ) const
inline

Get a pointer to the beginning of the array containing all keys.

Definition at line 403 of file BLI_vector_set.hh.

◆ end()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
const Key* blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::end ( ) const
inline

◆ index_of()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
int64_t blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::index_of ( const Key key) const
inline

Return the location of the key in the vector. It is assumed, that the key is in the vector set. If this is not necessarily the case, use index_of_try.

Definition at line 378 of file BLI_vector_set.hh.

References blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::index_of_as().

Referenced by blender::tests::TEST().

◆ index_of_as()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
int64_t blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::index_of_as ( const ForwardKey &  key) const
inline

◆ index_of_try()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
int64_t blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::index_of_try ( const Key key) const
inline

Return the location of the key in the vector. If the key is not in the set, -1 is returned. If you know for sure that the key is in the set, it is better to use index_of instead.

Definition at line 391 of file BLI_vector_set.hh.

References blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::index_of_try_as().

Referenced by blender::tests::TEST().

◆ index_of_try_as()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
int64_t blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::index_of_try_as ( const ForwardKey &  key) const
inline

◆ is_empty()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
bool blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::is_empty ( ) const
inline

Returns true if no keys are stored.

Definition at line 438 of file BLI_vector_set.hh.

Referenced by blender::tests::TEST(), and blender::deg::unregister_graph().

◆ operator Span< Key >()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::operator Span< Key > ( ) const
inline

Definition at line 260 of file BLI_vector_set.hh.

◆ operator=() [1/2]

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
VectorSet& blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::operator= ( const VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator > &  other)
inline

Definition at line 240 of file BLI_vector_set.hh.

References blender::copy_assign_container().

◆ operator=() [2/2]

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
VectorSet& blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::operator= ( VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator > &&  other)
inline

Definition at line 245 of file BLI_vector_set.hh.

References blender::move_assign_container().

◆ operator[]()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
const Key& blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::operator[] ( const int64_t  index) const
inline

Get the key stored at the given position in the vector.

Definition at line 253 of file BLI_vector_set.hh.

References BLI_assert, and blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size().

◆ pop()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
Key blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::pop ( )
inline

Delete and return a key from the set. This will remove the last element in the vector. The order of the remaining elements in the set is not changed.

Definition at line 369 of file BLI_vector_set.hh.

Referenced by blender::tests::TEST().

◆ print_stats()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
void blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::print_stats ( StringRef  name = "") const
inline

Print common statistics like size and collision count. This is useful for debugging purposes.

Definition at line 421 of file BLI_vector_set.hh.

References blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::as_span(), and blender::HashTableStats::print().

◆ remove()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
bool blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove ( const Key key)
inline

Deletes the key from the set. Returns true when the key existed in the set and is now removed. This might change the order of elements in the vector.

This is similar to std::unordered_set::erase.

Definition at line 343 of file BLI_vector_set.hh.

References blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove_as().

Referenced by blender::tests::TEST(), and blender::deg::unregister_graph().

◆ remove_as()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
bool blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove_as ( const ForwardKey &  key)
inline

◆ remove_contained()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
void blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove_contained ( const Key key)
inline

Deletes the key from the set. This invokes undefined behavior when the key is not in the set. It might change the order of elements in the vector.

Definition at line 356 of file BLI_vector_set.hh.

References blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove_contained_as().

Referenced by blender::tests::TEST().

◆ remove_contained_as()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
void blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove_contained_as ( const ForwardKey &  key)
inline

◆ removed_amount()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
int64_t blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::removed_amount ( ) const
inline

Returns the amount of removed slots in the set. This is mostly for debugging purposes.

Definition at line 454 of file BLI_vector_set.hh.

◆ reserve()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
void blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::reserve ( const int64_t  n)
inline

Potentially resize the vector set such that it can hold n elements without doing another grow.

Definition at line 479 of file BLI_vector_set.hh.

Referenced by blender::tests::TEST().

◆ size()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
int64_t blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size ( ) const
inline

◆ size_in_bytes()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
int64_t blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size_in_bytes ( ) const
inline

Returns the approximate memory requirements of the set in bytes. This is more correct for larger sets.

Definition at line 471 of file BLI_vector_set.hh.

◆ size_per_element()

template<typename Key , typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultVectorSetSlot<Key>::type, typename Allocator = GuardedAllocator>
int64_t blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size_per_element ( ) const
inline

Returns the bytes required per element. This is mostly for debugging purposes.

Definition at line 462 of file BLI_vector_set.hh.


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