Blender  V3.3
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator > Class Template Reference

#include <BLI_set.hh>

Classes

class  Iterator
 

Public Types

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

Public Member Functions

 Set (Allocator allocator={}) noexcept
 
 Set (NoExceptConstructor, Allocator allocator={}) noexcept
 
 Set (Span< Key > values, Allocator allocator={})
 
 Set (const std::initializer_list< Key > &values)
 
 ~Set ()=default
 
 Set (const Set &other)=default
 
 Set (Set &&other) noexcept(std::is_nothrow_move_constructible_v< SlotArray >)
 
Setoperator= (const Set &other)
 
Setoperator= (Set &&other)
 
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)
 
void add_multiple_new (Span< Key > keys)
 
bool contains (const Key &key) const
 
template<typename ForwardKey >
bool contains_as (const ForwardKey &key) const
 
const Keylookup_key (const Key &key) const
 
template<typename ForwardKey >
const Keylookup_key_as (const ForwardKey &key) const
 
const Keylookup_key_default (const Key &key, const Key &default_value) const
 
template<typename ForwardKey >
const Keylookup_key_default_as (const ForwardKey &key, const Key &default_key) const
 
const Keylookup_key_ptr (const Key &key) const
 
template<typename ForwardKey >
const Keylookup_key_ptr_as (const ForwardKey &key) const
 
const Keylookup_key_or_add (const Key &key)
 
const Keylookup_key_or_add (Key &&key)
 
template<typename ForwardKey >
const Keylookup_key_or_add_as (ForwardKey &&key)
 
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)
 
Iterator begin () const
 
Iterator end () const
 
void remove (const Iterator &it)
 
void print_stats (StringRef name="") const
 
int64_t count_collisions (const Key &key) const
 
void clear ()
 
void rehash ()
 
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)
 

Static Public Member Functions

static bool Intersects (const Set &a, const Set &b)
 
static bool Disjoint (const Set &a, const Set &b)
 

Detailed Description

template<typename Key, int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
class blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >

Definition at line 107 of file BLI_set.hh.

Member Typedef Documentation

◆ const_pointer

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
using blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::const_pointer = const Key *

Definition at line 112 of file BLI_set.hh.

◆ const_reference

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
using blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::const_reference = const Key &

Definition at line 114 of file BLI_set.hh.

◆ iterator

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
using blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::iterator = Iterator

Definition at line 115 of file BLI_set.hh.

◆ pointer

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
using blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::pointer = Key *

Definition at line 111 of file BLI_set.hh.

◆ reference

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
using blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::reference = Key &

Definition at line 113 of file BLI_set.hh.

◆ size_type

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
using blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size_type = int64_t

Definition at line 116 of file BLI_set.hh.

◆ value_type

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
using blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::value_type = Key

Definition at line 110 of file BLI_set.hh.

Constructor & Destructor Documentation

◆ Set() [1/6]

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::Set ( Allocator  allocator = {})
inlinenoexcept

Initialize an empty set. This is a cheap operation no matter how large the inline buffer is. 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 169 of file BLI_set.hh.

◆ Set() [2/6]

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::Set ( NoExceptConstructor  ,
Allocator  allocator = {} 
)
inlinenoexcept

Definition at line 178 of file BLI_set.hh.

◆ Set() [3/6]

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::Set ( Span< Key values,
Allocator  allocator = {} 
)
inline

Definition at line 182 of file BLI_set.hh.

◆ Set() [4/6]

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::Set ( const std::initializer_list< Key > &  values)
inline

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

Definition at line 190 of file BLI_set.hh.

◆ ~Set()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::~Set ( )
default

◆ Set() [5/6]

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::Set ( const Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator > &  other)
default

◆ Set() [6/6]

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::Set ( Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator > &&  other)
inlinenoexcept

Definition at line 198 of file BLI_set.hh.

Member Function Documentation

◆ add() [1/2]

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
bool blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add ( const Key key)
inline

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

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

Definition at line 253 of file BLI_set.hh.

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

Referenced by add_list_to_input_ids(), blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_multiple(), add_to_input_ids(), add_used_ids_from_sockets(), blender::bke::AttributeAccessor::all_ids(), blender::bke::BKE_armature_find_selected_bone_names(), BKE_main_namemap_get_name(), blender::fn::build_multi_function_procedure_for_fields(), check_tree_for_time_node(), blender::bke::AssetCatalogService::create_catalog_filter(), external_file_check_callback(), blender::gpu::shader::ShaderCreateInfo::finalize(), blender::compositor::find_constant_foldable_operations(), blender::bke::node_field_inferencing::find_group_output_dependencies(), find_sockets_to_preview_for_spreadsheet(), blender::fn::find_varying_fields(), blender::bke::attribute_accessor_functions::for_all(), generate_unique_instance_ids(), blender::nodes::node_geo_input_mesh_island_cc::IslandCountFieldInput::get_varray_for_context(), blender::deg::is_reachable(), main_namemap_populate(), main_namemap_validate_and_fix(), ntree_update_reroute_nodes(), blender::bke::AssetCatalogService::parse_catalog_file(), blender::fn::preprocess_field_tree(), process_nodes_for_depsgraph(), blender::bke::AssetCatalogService::prune_catalogs_by_path(), blender::bke::AssetCatalogService::purge_catalogs_not_listed(), blender::bke::AssetCatalogService::reload_catalogs(), blender::nodes::search_link_ops_for_declarations(), blender::nodes::search_link_ops_for_socket_templates(), blender::deg::AnimatedPropertyStorage::tagPropertyAsAnimated(), blender::bke::tests::TEST(), blender::tests::TEST(), blender::io::obj::Geometry::track_all_vertices(), blender::io::obj::Geometry::track_vertex_index(), update_visible_columns(), updateDepsgraph(), and blender::gpu::shader::ShaderCreateInfo::validate_merge().

◆ add() [2/2]

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
bool blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add ( Key &&  key)
inline

◆ add_as()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
bool blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_as ( ForwardKey &&  key)
inline

◆ add_multiple()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
void blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_multiple ( Span< Key keys)
inline

Convenience function to add many keys to the 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 273 of file BLI_set.hh.

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

◆ add_multiple_new()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
void blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_multiple_new ( Span< Key keys)
inline

Convenience function to add many new keys to the set at once. The keys must not exist in the set before and there must not be duplicates in the array.

Definition at line 284 of file BLI_set.hh.

References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new().

◆ add_new() [1/2]

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
void blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new ( const Key key)
inline

Add a new key to the 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 238 of file BLI_set.hh.

Referenced by blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_multiple_new(), blender::fn::MFProcedureDotExport::create_nodes(), blender::bke::curve_to_mesh_sweep(), blender::bke::attribute_accessor_functions::for_all(), pose_backup_create(), and blender::tests::TEST().

◆ add_new() [2/2]

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
void blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new ( Key &&  key)
inline

Definition at line 242 of file BLI_set.hh.

◆ begin()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
Iterator blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::begin ( ) const
inline

◆ capacity()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
int64_t blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::capacity ( ) const
inline

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

Definition at line 555 of file BLI_set.hh.

◆ clear()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
void blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::clear ( )
inline

Remove all elements from the set.

Definition at line 516 of file BLI_set.hh.

Referenced by blender::tests::TEST(), and blender::meshintersect::CDTArrangement< Arith_t >::~CDTArrangement().

◆ contains()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
bool blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains ( const Key key) const
inline

◆ contains_as()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
bool blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains_as ( const ForwardKey &  key) const
inline

◆ count_collisions()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
int64_t blender::Set< Key, InlineBufferCapacity, 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 508 of file BLI_set.hh.

◆ Disjoint()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
static bool blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::Disjoint ( const Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator > &  a,
const Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator > &  b 
)
inlinestatic

Returns true if no key from a is also in b and vice versa.

Definition at line 617 of file BLI_set.hh.

References Freestyle::a, usdtokens::b(), and blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::Intersects().

◆ end()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
Iterator blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::end ( ) const
inline

◆ Intersects()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
static bool blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::Intersects ( const Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator > &  a,
const Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator > &  b 
)
inlinestatic

Returns true if there is a key that exists in both sets.

Definition at line 599 of file BLI_set.hh.

References Freestyle::a, and usdtokens::b().

Referenced by blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::Disjoint(), and blender::deg::RootPChanMap::has_common_root().

◆ is_empty()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
bool blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::is_empty ( ) const
inline

Returns true if no keys are stored.

Definition at line 547 of file BLI_set.hh.

Referenced by has_external_files(), pose_backup_create(), blender::tests::TEST(), and blender::gpu::GLContext::~GLContext().

◆ lookup_key()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
const Key& blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_key ( const Key key) const
inline

Returns the key that is stored in the set that compares equal to the given key. This invokes undefined behavior when the key is not in the set.

Definition at line 309 of file BLI_set.hh.

References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_key_as().

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

◆ lookup_key_as()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
const Key& blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_key_as ( const ForwardKey &  key) const
inline

◆ lookup_key_default()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
const Key& blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_key_default ( const Key key,
const Key default_value 
) const
inline

Returns the key that is stored in the set that compares equal to the given key. If the key is not in the set, the given default value is returned instead.

Definition at line 322 of file BLI_set.hh.

References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_key_default_as().

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

◆ lookup_key_default_as()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
const Key& blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_key_default_as ( const ForwardKey &  key,
const Key default_key 
) const
inline

◆ lookup_key_or_add() [1/2]

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
const Key& blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_key_or_add ( const Key key)
inline

Returns the key in the set that compares equal to the given key. If it does not exist, the key is newly added.

Definition at line 353 of file BLI_set.hh.

References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_key_or_add_as().

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

◆ lookup_key_or_add() [2/2]

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
const Key& blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_key_or_add ( Key &&  key)
inline

◆ lookup_key_or_add_as()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
const Key& blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_key_or_add_as ( ForwardKey &&  key)
inline

◆ lookup_key_ptr()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
const Key* blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_key_ptr ( const Key key) const
inline

Returns a pointer to the key that is stored in the set that compares equal to the given key. If the key is not in the set, nullptr is returned instead.

Definition at line 340 of file BLI_set.hh.

References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_key_ptr_as().

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

◆ lookup_key_ptr_as()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
const Key* blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_key_ptr_as ( const ForwardKey &  key) const
inline

◆ operator=() [1/2]

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
Set& blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::operator= ( const Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator > &  other)
inline

Definition at line 223 of file BLI_set.hh.

References blender::copy_assign_container().

◆ operator=() [2/2]

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
Set& blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::operator= ( Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator > &&  other)
inline

Definition at line 228 of file BLI_set.hh.

References blender::move_assign_container().

◆ print_stats()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
void blender::Set< Key, InlineBufferCapacity, 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 498 of file BLI_set.hh.

References blender::HashTableStats::print().

◆ rehash()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
void blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::rehash ( )
inline

Creates a new slot array and reinserts all keys inside of that. This method can be used to get rid of removed slots. Also this is useful for benchmarking the grow function.

Definition at line 531 of file BLI_set.hh.

References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size().

◆ remove() [1/2]

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
void blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove ( const Iterator it)
inline

Remove the key that the iterator is currently pointing at. It is valid to call this method while iterating over the set. However, after this method has been called, the removed element must not be accessed anymore.

Definition at line 486 of file BLI_set.hh.

References BLI_assert, and blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::Iterator::current_slot().

◆ remove() [2/2]

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
bool blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove ( const Key key)
inline

Deletes the key from the set. Returns true when the key did exist beforehand, otherwise false.

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

Definition at line 371 of file BLI_set.hh.

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

Referenced by BKE_main_namemap_remove_name(), blender::ed::asset::index::AssetLibraryIndex::mark_as_used(), and blender::tests::TEST().

◆ remove_as()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
bool blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove_as ( const ForwardKey &  key)
inline

◆ remove_contained()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
void blender::Set< Key, InlineBufferCapacity, 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 map.

Definition at line 383 of file BLI_set.hh.

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

Referenced by blender::geometry::point_merge_by_distance(), and blender::tests::TEST().

◆ remove_contained_as()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
template<typename ForwardKey >
void blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove_contained_as ( const ForwardKey &  key)
inline

◆ removed_amount()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
int64_t blender::Set< Key, InlineBufferCapacity, 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 563 of file BLI_set.hh.

◆ reserve()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
void blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::reserve ( const int64_t  n)
inline

Potentially resize the set such that it can hold the specified number of keys without another grow operation.

Definition at line 589 of file BLI_set.hh.

Referenced by generate_unique_instance_ids(), and blender::io::obj::Geometry::track_all_vertices().

◆ size()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
int64_t blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size ( ) const
inline

◆ size_in_bytes()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
int64_t blender::Set< Key, InlineBufferCapacity, 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 580 of file BLI_set.hh.

Referenced by BKE_main_namemap_destroy().

◆ size_per_element()

template<typename Key , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(Key)), typename ProbingStrategy = DefaultProbingStrategy, typename Hash = DefaultHash<Key>, typename IsEqual = DefaultEquality, typename Slot = typename DefaultSetSlot<Key>::type, typename Allocator = GuardedAllocator>
int64_t blender::Set< Key, InlineBufferCapacity, 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 571 of file BLI_set.hh.


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