Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
Unordered map from Key to T. More...
#include <concurrent_hash_map.h>
Classes | |
class | accessor |
Allows write access to elements and combines data access, locking, and garbage collection. More... | |
struct | accessor_not_used |
class | bucket_accessor |
bucket accessor is to find, rehash, acquire a lock, and access a bucket More... | |
struct | call_clear_on_leave |
class | const_accessor |
Combines data access, locking, and garbage collection. More... | |
class | node |
struct | node_scoped_guard |
Public Types | |
typedef Key | key_type |
typedef T | mapped_type |
typedef std::pair< const Key, T > | value_type |
typedef hash_map_base::size_type | size_type |
typedef ptrdiff_t | difference_type |
typedef value_type * | pointer |
typedef const value_type * | const_pointer |
typedef value_type & | reference |
typedef const value_type & | const_reference |
typedef internal::hash_map_iterator< concurrent_hash_map, value_type > | iterator |
typedef internal::hash_map_iterator< concurrent_hash_map, const value_type > | const_iterator |
typedef internal::hash_map_range< iterator > | range_type |
typedef internal::hash_map_range< const_iterator > | const_range_type |
typedef Allocator | allocator_type |
Public Member Functions | |
concurrent_hash_map (const allocator_type &a=allocator_type()) | |
Construct empty table. More... | |
concurrent_hash_map (const HashCompare &compare, const allocator_type &a=allocator_type()) | |
concurrent_hash_map (size_type n, const allocator_type &a=allocator_type()) | |
Construct empty table with n preallocated buckets. This number serves also as initial concurrency level. More... | |
concurrent_hash_map (size_type n, const HashCompare &compare, const allocator_type &a=allocator_type()) | |
concurrent_hash_map (const concurrent_hash_map &table) | |
Copy constructor. More... | |
concurrent_hash_map (const concurrent_hash_map &table, const allocator_type &a) | |
concurrent_hash_map (concurrent_hash_map &&table) | |
Move constructor. More... | |
concurrent_hash_map (concurrent_hash_map &&table, const allocator_type &a) | |
Move constructor. More... | |
template<typename I > | |
concurrent_hash_map (I first, I last, const allocator_type &a=allocator_type()) | |
Construction with copying iteration range and given allocator instance. More... | |
template<typename I > | |
concurrent_hash_map (I first, I last, const HashCompare &compare, const allocator_type &a=allocator_type()) | |
concurrent_hash_map (std::initializer_list< value_type > il, const allocator_type &a=allocator_type()) | |
Construct empty table with n preallocated buckets. This number serves also as initial concurrency level. More... | |
concurrent_hash_map (std::initializer_list< value_type > il, const HashCompare &compare, const allocator_type &a=allocator_type()) | |
concurrent_hash_map & | operator= (const concurrent_hash_map &table) |
Assignment. More... | |
concurrent_hash_map & | operator= (concurrent_hash_map &&table) |
Move Assignment. More... | |
concurrent_hash_map & | operator= (std::initializer_list< value_type > il) |
Assignment. More... | |
void | rehash (size_type n=0) |
Rehashes and optionally resizes the whole table. More... | |
void | clear () |
Clear table. More... | |
~concurrent_hash_map () | |
Clear table and destroy it. More... | |
range_type | range (size_type grainsize=1) |
const_range_type | range (size_type grainsize=1) const |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
std::pair< iterator, iterator > | equal_range (const Key &key) |
std::pair< const_iterator, const_iterator > | equal_range (const Key &key) const |
size_type | size () const |
Number of items in table. More... | |
bool | empty () const |
True if size()==0. More... | |
size_type | max_size () const |
Upper bound on size. More... | |
size_type | bucket_count () const |
Returns the current number of buckets. More... | |
allocator_type | get_allocator () const |
return allocator object More... | |
void | swap (concurrent_hash_map &table) |
swap two instances. Iterators are invalidated More... | |
size_type | count (const Key &key) const |
Return count of items (0 or 1) More... | |
bool | find (const_accessor &result, const Key &key) const |
Find item and acquire a read lock on the item. More... | |
bool | find (accessor &result, const Key &key) |
Find item and acquire a write lock on the item. More... | |
bool | insert (const_accessor &result, const Key &key) |
Insert item (if not already present) and acquire a read lock on the item. More... | |
bool | insert (accessor &result, const Key &key) |
Insert item (if not already present) and acquire a write lock on the item. More... | |
bool | insert (const_accessor &result, const value_type &value) |
Insert item by copying if there is no such key present already and acquire a read lock on the item. More... | |
bool | insert (accessor &result, const value_type &value) |
Insert item by copying if there is no such key present already and acquire a write lock on the item. More... | |
bool | insert (const value_type &value) |
Insert item by copying if there is no such key present already. More... | |
bool | insert (const_accessor &result, value_type &&value) |
Insert item by copying if there is no such key present already and acquire a read lock on the item. More... | |
bool | insert (accessor &result, value_type &&value) |
Insert item by copying if there is no such key present already and acquire a write lock on the item. More... | |
bool | insert (value_type &&value) |
Insert item by copying if there is no such key present already. More... | |
template<typename... Args> | |
bool | emplace (const_accessor &result, Args &&... args) |
Insert item by copying if there is no such key present already and acquire a read lock on the item. More... | |
template<typename... Args> | |
bool | emplace (accessor &result, Args &&... args) |
Insert item by copying if there is no such key present already and acquire a write lock on the item. More... | |
template<typename... Args> | |
bool | emplace (Args &&... args) |
Insert item by copying if there is no such key present already. More... | |
template<typename I > | |
void | insert (I first, I last) |
Insert range [first, last) More... | |
void | insert (std::initializer_list< value_type > il) |
Insert initializer list. More... | |
bool | erase (const Key &key) |
Erase item. More... | |
bool | erase (const_accessor &item_accessor) |
Erase item by const_accessor. More... | |
bool | erase (accessor &item_accessor) |
Erase item by accessor. More... | |
Protected Types | |
typedef tbb::internal::allocator_rebind< Allocator, node >::type | node_allocator_type |
typedef tbb::internal::allocator_traits< node_allocator_type > | node_allocator_traits |
![]() | |
typedef size_t | size_type |
Size type. More... | |
typedef size_t | hashcode_t |
Type of a hash code. More... | |
typedef size_t | segment_index_t |
Segment index type. More... | |
typedef hash_map_node_base | node_base |
Node base type. More... | |
typedef bucket * | segment_ptr_t |
Segment pointer. More... | |
typedef segment_ptr_t | segments_table_t[pointers_per_table] |
Segment pointers table type. More... | |
Protected Member Functions | |
void | delete_node (node_base *n) |
node * | search_bucket (const key_type &key, bucket *b) const |
void | rehash_bucket (bucket *b_new, const hashcode_t h) |
bool | lookup (bool op_insert, const Key &key, const T *t, const_accessor *result, bool write, node *(*allocate_node)(node_allocator_type &, const Key &, const T *), node *tmp_n=0) |
Insert or find item and optionally acquire a lock on the item. More... | |
template<typename Accessor > | |
bool | generic_move_insert (Accessor &&result, value_type &&value) |
template<typename Accessor , typename... Args> | |
bool | generic_emplace (Accessor &&result, Args &&... args) |
bool | exclude (const_accessor &item_accessor) |
delete item by accessor More... | |
template<typename I > | |
std::pair< I, I > | internal_equal_range (const Key &key, I end) const |
Returns an iterator for an item defined by the key, or for the next item after it (if upper==true) More... | |
void | internal_copy (const concurrent_hash_map &source) |
Copy "source" to *this, where *this must start out empty. More... | |
template<typename I > | |
void | internal_copy (I first, I last, size_type reserve_size) |
void | internal_move_assign (concurrent_hash_map &&other, tbb::internal::traits_true_type) |
void | internal_move_assign (concurrent_hash_map &&other, tbb::internal::traits_false_type) |
const_pointer | internal_fast_find (const Key &key) const |
Fast find when no concurrent erasure is used. For internal use inside TBB only! More... | |
![]() | |
hash_map_base () | |
Constructor. More... | |
template<typename Allocator > | |
void | enable_segment (segment_index_t k, const Allocator &allocator, bool is_initial=false) |
Enable segment. More... | |
template<typename Allocator > | |
void | delete_segment (segment_index_t s, const Allocator &allocator) |
bucket * | get_bucket (hashcode_t h) const throw () |
Get bucket by (masked) hashcode. More... | |
void | mark_rehashed_levels (hashcode_t h) throw () |
bool | check_mask_race (const hashcode_t h, hashcode_t &m) const |
Check for mask race. More... | |
bool | check_rehashing_collision (const hashcode_t h, hashcode_t m_old, hashcode_t m) const |
Process mask race, check for rehashing collision. More... | |
segment_index_t | insert_new_node (bucket *b, node_base *n, hashcode_t mask) |
Insert a node and check for load factor. More... | |
template<typename Allocator > | |
void | reserve (size_type buckets, const Allocator &allocator) |
Prepare enough segments for number of buckets. More... | |
void | internal_swap (hash_map_base &table) |
Swap hash_map_bases. More... | |
void | internal_move (hash_map_base &&other) |
Static Protected Member Functions | |
template<typename... Args> | |
static node * | create_node (node_allocator_type &allocator, Args &&... args) |
static node * | allocate_node_copy_construct (node_allocator_type &allocator, const Key &key, const T *t) |
static node * | allocate_node_move_construct (node_allocator_type &allocator, const Key &key, const T *t) |
static node * | allocate_node_default_construct (node_allocator_type &allocator, const Key &key, const T *) |
static node * | do_not_allocate_node (node_allocator_type &, const Key &, const T *) |
![]() | |
static segment_index_t | segment_index_of (size_type index) |
static segment_index_t | segment_base (segment_index_t k) |
static size_type | segment_size (segment_index_t k) |
static bool | is_valid (void *ptr) |
static void | init_buckets (segment_ptr_t ptr, size_type sz, bool is_initial) |
Initialize buckets. More... | |
static void | add_to_bucket (bucket *b, node_base *n) |
Add node. More... | |
Protected Attributes | |
node_allocator_type | my_allocator |
HashCompare | my_hash_compare |
![]() | |
atomic< hashcode_t > | my_mask |
Hash mask = sum of allocated segment sizes - 1. More... | |
segments_table_t | my_table |
Segment pointers table. Also prevents false sharing between my_mask and my_size. More... | |
atomic< size_type > | my_size |
Size of container in stored items. More... | |
bucket | my_embedded_segment [embedded_buckets] |
Zero segment. More... | |
Friends | |
template<typename Container , typename Value > | |
class | internal::hash_map_iterator |
template<typename I > | |
class | internal::hash_map_range |
class | const_accessor |
const_accessor * | accessor_location (accessor_not_used const &) |
const_accessor * | accessor_location (const_accessor &a) |
bool | is_write_access_needed (accessor const &) |
bool | is_write_access_needed (const_accessor const &) |
bool | is_write_access_needed (accessor_not_used const &) |
Additional Inherited Members | |
![]() | |
static size_type const | embedded_block = 1 |
Count of segments in the first block. More... | |
static size_type const | embedded_buckets = 1<<embedded_block |
Count of segments in the first block. More... | |
static size_type const | first_block = 8 |
Count of segments in the first block. More... | |
static size_type const | pointers_per_table = sizeof(segment_index_t) * 8 |
Size of a pointer / table size. More... | |
Unordered map from Key to T.
concurrent_hash_map is associative container with concurrent access.
Definition at line 58 of file concurrent_hash_map.h.
typedef Allocator tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::allocator_type |
Definition at line 606 of file concurrent_hash_map.h.
typedef internal::hash_map_iterator<concurrent_hash_map,const value_type> tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_iterator |
Definition at line 603 of file concurrent_hash_map.h.
typedef const value_type* tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_pointer |
Definition at line 599 of file concurrent_hash_map.h.
typedef internal::hash_map_range<const_iterator> tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_range_type |
Definition at line 605 of file concurrent_hash_map.h.
typedef const value_type& tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_reference |
Definition at line 601 of file concurrent_hash_map.h.
typedef ptrdiff_t tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::difference_type |
Definition at line 597 of file concurrent_hash_map.h.
typedef internal::hash_map_iterator<concurrent_hash_map,value_type> tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::iterator |
Definition at line 602 of file concurrent_hash_map.h.
typedef Key tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::key_type |
Definition at line 593 of file concurrent_hash_map.h.
typedef T tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::mapped_type |
Definition at line 594 of file concurrent_hash_map.h.
|
protected |
Definition at line 612 of file concurrent_hash_map.h.
|
protected |
Definition at line 610 of file concurrent_hash_map.h.
typedef value_type* tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::pointer |
Definition at line 598 of file concurrent_hash_map.h.
typedef internal::hash_map_range<iterator> tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::range_type |
Definition at line 604 of file concurrent_hash_map.h.
typedef value_type& tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::reference |
Definition at line 600 of file concurrent_hash_map.h.
typedef hash_map_base::size_type tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::size_type |
Definition at line 596 of file concurrent_hash_map.h.
typedef std::pair<const Key,T> tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::value_type |
Definition at line 595 of file concurrent_hash_map.h.
|
inlineexplicit |
Construct empty table.
Definition at line 830 of file concurrent_hash_map.h.
|
inlineexplicit |
Definition at line 834 of file concurrent_hash_map.h.
|
inline |
Construct empty table with n preallocated buckets. This number serves also as initial concurrency level.
Definition at line 839 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::my_allocator, and tbb::interface5::internal::hash_map_base::reserve().
|
inline |
Definition at line 845 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::my_allocator, and tbb::interface5::internal::hash_map_base::reserve().
|
inline |
Copy constructor.
Definition at line 852 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::call_clear_on_leave::dismiss(), and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::internal_copy().
|
inline |
Definition at line 861 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::call_clear_on_leave::dismiss(), and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::internal_copy().
|
inline |
Move constructor.
Definition at line 871 of file concurrent_hash_map.h.
|
inline |
Move constructor.
Definition at line 878 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::call_clear_on_leave::dismiss(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::internal_copy(), tbb::interface5::internal::hash_map_base::internal_move(), and tbb::move().
|
inline |
Construction with copying iteration range and given allocator instance.
Definition at line 893 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::call_clear_on_leave::dismiss(), tbb::internal::first(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::internal_copy(), and tbb::internal::last().
|
inline |
Definition at line 902 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::call_clear_on_leave::dismiss(), tbb::internal::first(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::internal_copy(), and tbb::internal::last().
|
inline |
Construct empty table with n preallocated buckets. This number serves also as initial concurrency level.
Definition at line 912 of file concurrent_hash_map.h.
|
inline |
Definition at line 920 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::call_clear_on_leave::dismiss(), and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::internal_copy().
|
inline |
Clear table and destroy it.
Definition at line 971 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::clear().
|
inlinestaticprotected |
Definition at line 663 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::create_node(), and key.
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::insert().
|
inlinestaticprotected |
Definition at line 673 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::create_node(), key, and tbb::move().
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::insert().
|
inlinestaticprotected |
Definition at line 668 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::create_node(), key, and tbb::move().
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::generic_move_insert().
|
inline |
Definition at line 986 of file concurrent_hash_map.h.
References tbb::interface5::internal::hash_map_base::my_embedded_segment, and tbb::interface5::internal::hash_map_base::bucket::node_list.
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::internal_copy(), and tbb::operator==().
|
inline |
Definition at line 988 of file concurrent_hash_map.h.
References tbb::interface5::internal::hash_map_base::my_embedded_segment, and tbb::interface5::internal::hash_map_base::bucket::node_list.
|
inline |
Returns the current number of buckets.
Definition at line 1003 of file concurrent_hash_map.h.
References tbb::interface5::internal::hash_map_base::my_mask.
void tbb::interface5::concurrent_hash_map< Key, T, HashCompare, A >::clear | ( | ) |
Clear table.
Definition at line 1505 of file concurrent_hash_map.h.
References __TBB_ASSERT, __TBB_USE_OPTIONAL_RTTI, tbb::interface5::internal::empty_rehashed, tbb::internal::first(), h, int, tbb::interface5::internal::hash_map_base::bucket::mutex, tbb::interface5::internal::hash_map_node_base::next, tbb::interface5::internal::hash_map_base::bucket::node_list, tbb::interface5::internal::rehash_req, tbb::internal::runtime_warning(), s, and value.
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::operator=(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::call_clear_on_leave::~call_clear_on_leave(), and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::~concurrent_hash_map().
|
inline |
Return count of items (0 or 1)
Definition at line 1016 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::do_not_allocate_node(), and key.
|
inlinestaticprotected |
Definition at line 645 of file concurrent_hash_map.h.
References tbb::internal::allocator_traits< Alloc >::allocate(), tbb::internal::allocator_traits< Alloc >::construct(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::node_scoped_guard::dismiss(), and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::node::storage().
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::allocate_node_copy_construct(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::allocate_node_default_construct(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::allocate_node_move_construct(), and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::generic_emplace().
|
inlineprotected |
Definition at line 623 of file concurrent_hash_map.h.
References tbb::internal::allocator_traits< Alloc >::deallocate(), tbb::internal::allocator_traits< Alloc >::destroy(), and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::my_allocator.
|
inlinestaticprotected |
Definition at line 686 of file concurrent_hash_map.h.
References __TBB_ASSERT.
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::count(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::find(), and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::generic_emplace().
|
inline |
Insert item by copying if there is no such key present already and acquire a read lock on the item.
Returns true if item is new.
Definition at line 1091 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::generic_emplace().
|
inline |
Insert item by copying if there is no such key present already and acquire a write lock on the item.
Returns true if item is new.
Definition at line 1098 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::generic_emplace().
|
inline |
Insert item by copying if there is no such key present already.
Returns true if item is inserted.
Definition at line 1105 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::generic_emplace().
|
inline |
True if size()==0.
Definition at line 997 of file concurrent_hash_map.h.
References tbb::interface5::internal::hash_map_base::my_size.
|
inline |
Definition at line 987 of file concurrent_hash_map.h.
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::equal_range(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::internal_copy(), and tbb::operator==().
|
inline |
Definition at line 989 of file concurrent_hash_map.h.
|
inline |
Definition at line 990 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::end(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::internal_equal_range(), and key.
Referenced by tbb::operator==().
|
inline |
Definition at line 991 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::end(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::internal_equal_range(), and key.
bool tbb::interface5::concurrent_hash_map< Key, T, HashCompare, A >::erase | ( | const Key & | key | ) |
Erase item.
Return true if item was erased by particularly this call.
Definition at line 1386 of file concurrent_hash_map.h.
References h, tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::bucket_accessor::is_writer(), tbb::internal::itt_load_word_with_acquire(), key, tbb::interface5::internal::hash_map_node_base::mutex, tbb::interface5::internal::hash_map_node_base::next, and p.
|
inline |
Erase item by const_accessor.
Return true if item was erased by particularly this call.
Definition at line 1131 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::exclude().
|
inline |
Erase item by accessor.
Return true if item was erased by particularly this call.
Definition at line 1137 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::exclude().
|
protected |
delete item by accessor
Definition at line 1356 of file concurrent_hash_map.h.
References __TBB_ASSERT, h, tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::is_writer(), tbb::internal::itt_load_word_with_acquire(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::my_hash, tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::my_node, tbb::interface5::internal::hash_map_node_base::next, p, and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::release().
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::erase().
|
inline |
Find item and acquire a read lock on the item.
Return true if item is found, false otherwise.
Definition at line 1022 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::do_not_allocate_node(), key, and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::release().
|
inline |
Find item and acquire a write lock on the item.
Return true if item is found, false otherwise.
Definition at line 1029 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::do_not_allocate_node(), key, tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::lookup(), and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::release().
|
inlineprotected |
Definition at line 1162 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::accessor_location, tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::create_node(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::do_not_allocate_node(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::is_write_access_needed, tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::lookup(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::my_allocator, and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::node::value().
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::emplace().
|
inlineprotected |
Definition at line 1155 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::accessor_location, tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::allocate_node_move_construct(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::is_write_access_needed, tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::lookup(), and value.
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::insert().
|
inline |
return allocator object
Definition at line 1006 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::my_allocator.
|
inline |
Insert item (if not already present) and acquire a read lock on the item.
Returns true if item is new.
Definition at line 1036 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::allocate_node_default_construct(), key, tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::lookup(), and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::release().
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::insert().
|
inline |
Insert item (if not already present) and acquire a write lock on the item.
Returns true if item is new.
Definition at line 1043 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::allocate_node_default_construct(), key, tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::lookup(), and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::release().
|
inline |
Insert item by copying if there is no such key present already and acquire a read lock on the item.
Returns true if item is new.
Definition at line 1050 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::allocate_node_copy_construct(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::lookup(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::release(), and value.
|
inline |
Insert item by copying if there is no such key present already and acquire a write lock on the item.
Returns true if item is new.
Definition at line 1057 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::allocate_node_copy_construct(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::lookup(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::release(), and value.
|
inline |
Insert item by copying if there is no such key present already.
Returns true if item is inserted.
Definition at line 1064 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::allocate_node_copy_construct(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::lookup(), and value.
|
inline |
Insert item by copying if there is no such key present already and acquire a read lock on the item.
Returns true if item is new.
Definition at line 1071 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::generic_move_insert(), tbb::move(), and value.
|
inline |
Insert item by copying if there is no such key present already and acquire a write lock on the item.
Returns true if item is new.
Definition at line 1077 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::generic_move_insert(), tbb::move(), and value.
|
inline |
Insert item by copying if there is no such key present already.
Returns true if item is inserted.
Definition at line 1083 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::generic_move_insert(), tbb::move(), and value.
|
inline |
Insert range [first, last)
Definition at line 1113 of file concurrent_hash_map.h.
References tbb::internal::first(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::insert(), and tbb::internal::last().
|
inline |
Insert initializer list.
Definition at line 1120 of file concurrent_hash_map.h.
|
protected |
Copy "source" to *this, where *this must start out empty.
Definition at line 1577 of file concurrent_hash_map.h.
References __TBB_ASSERT, tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::begin(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::end(), tbb::interface5::internal::hash_map_base::get_bucket(), mask, tbb::interface5::internal::hash_map_base::my_mask, tbb::interface5::internal::hash_map_base::my_size, tbb::interface5::internal::hash_map_base::bucket::node_list, tbb::interface5::internal::rehash_req, and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::node::value().
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::concurrent_hash_map(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::internal_move_assign(), and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::operator=().
|
protected |
Definition at line 1603 of file concurrent_hash_map.h.
References __TBB_ASSERT, tbb::internal::first(), h, tbb::internal::last(), tbb::interface5::internal::hash_map_base::bucket::node_list, and tbb::interface5::internal::rehash_req.
|
protected |
Returns an iterator for an item defined by the key, or for the next item after it (if upper==true)
Definition at line 1338 of file concurrent_hash_map.h.
References __TBB_ASSERT, __TBB_Log2(), h, key, tbb::interface5::internal::hash_map_base::bucket::node_list, and tbb::interface5::internal::rehash_req.
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::equal_range().
|
inlineprotected |
Fast find when no concurrent erasure is used. For internal use inside TBB only!
Return pointer to item with given key, or NULL if no such item exists. Must not be called concurrently with erasure operations.
Definition at line 1203 of file concurrent_hash_map.h.
References __TBB_ASSERT, tbb::interface5::internal::hash_map_base::check_mask_race(), tbb::interface5::internal::hash_map_base::get_bucket(), h, tbb::internal::itt_load_word_with_acquire(), key, lock, tbb::interface5::internal::hash_map_base::bucket::mutex, tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::my_hash_compare, tbb::interface5::internal::hash_map_base::my_mask, tbb::interface5::internal::hash_map_base::bucket::node_list, tbb::interface5::internal::rehash_req, tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::search_bucket(), and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::node::storage().
|
inlineprotected |
Definition at line 1185 of file concurrent_hash_map.h.
References tbb::internal::allocator_move_assignment(), tbb::interface5::internal::hash_map_base::internal_move(), tbb::move(), and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::my_allocator.
|
inlineprotected |
Definition at line 1190 of file concurrent_hash_map.h.
References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::internal_copy(), tbb::interface5::internal::hash_map_base::internal_move(), and tbb::move().
|
protected |
Insert or find item and optionally acquire a lock on the item.
Definition at line 1258 of file concurrent_hash_map.h.
References __TBB_ASSERT, __TBB_Yield, h, tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::bucket_accessor::is_writer(), tbb::internal::itt_load_word_with_acquire(), key, tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::my_hash, and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::my_node.
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::find(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::generic_emplace(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::generic_move_insert(), and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::insert().
|
inline |
Upper bound on size.
Definition at line 1000 of file concurrent_hash_map.h.
|
inline |
Assignment.
Definition at line 931 of file concurrent_hash_map.h.
References tbb::internal::allocator_copy_assignment(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::clear(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::internal_copy(), and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::my_allocator.
|
inline |
Move Assignment.
Definition at line 943 of file concurrent_hash_map.h.
|
inline |
Assignment.
Definition at line 954 of file concurrent_hash_map.h.
|
inline |
Definition at line 976 of file concurrent_hash_map.h.
|
inline |
Definition at line 979 of file concurrent_hash_map.h.
void tbb::interface5::concurrent_hash_map< Key, T, HashCompare, A >::rehash | ( | size_type | n = 0 | ) |
Rehashes and optionally resizes the whole table.
Useful to optimize performance before or after concurrent operations. Also enables using of find() and count() concurrent methods in serial context.
Definition at line 1434 of file concurrent_hash_map.h.
References __TBB_ASSERT, __TBB_Log2(), __TBB_USE_OPTIONAL_RTTI, tbb::interface5::internal::empty_rehashed, tbb::internal::first(), h, int, mask, tbb::interface5::internal::hash_map_base::bucket::mutex, tbb::interface5::internal::hash_map_node_base::next, tbb::interface5::internal::hash_map_base::bucket::node_list, p, tbb::interface5::internal::rehash_req, tbb::internal::runtime_warning(), and value.
|
inlineprotected |
Definition at line 723 of file concurrent_hash_map.h.
References __TBB_ASSERT, tbb::internal::__TBB_load_with_acquire(), __TBB_Log2(), tbb::internal::__TBB_store_with_release(), tbb::interface5::internal::hash_map_base::add_to_bucket(), tbb::interface5::internal::empty_rehashed, tbb::internal::first(), h, tbb::interface5::internal::hash_map_base::is_valid(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::bucket_accessor::is_writer(), mask, tbb::interface5::internal::hash_map_base::bucket::mutex, tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::my_hash_compare, tbb::interface5::internal::hash_map_base::bucket::node_list, p, and value.
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::bucket_accessor::acquire().
|
inlineprotected |
Definition at line 691 of file concurrent_hash_map.h.
References __TBB_ASSERT, tbb::interface5::internal::hash_map_base::is_valid(), key, tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::my_hash_compare, tbb::interface5::internal::hash_map_base::bucket::node_list, tbb::interface5::internal::rehash_req, and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::node::value().
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::internal_fast_find().
|
inline |
Number of items in table.
Definition at line 994 of file concurrent_hash_map.h.
References tbb::interface5::internal::hash_map_base::my_size.
Referenced by tbb::operator==().
void tbb::interface5::concurrent_hash_map< Key, T, HashCompare, A >::swap | ( | concurrent_hash_map< Key, T, HashCompare, Allocator > & | table | ) |
swap two instances. Iterators are invalidated
Definition at line 1423 of file concurrent_hash_map.h.
References tbb::internal::allocator_swap(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::my_allocator, tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::my_hash_compare, tbb::swap(), and value.
Referenced by tbb::swap().
|
friend |
|
friend |
Definition at line 1147 of file concurrent_hash_map.h.
|
friend |
Definition at line 609 of file concurrent_hash_map.h.
|
friend |
Definition at line 587 of file concurrent_hash_map.h.
|
friend |
Definition at line 590 of file concurrent_hash_map.h.
|
friend |
|
friend |
Definition at line 1150 of file concurrent_hash_map.h.
|
friend |
Definition at line 1151 of file concurrent_hash_map.h.
|
protected |
Definition at line 613 of file concurrent_hash_map.h.
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::concurrent_hash_map(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::delete_node(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::generic_emplace(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::get_allocator(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::internal_move_assign(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::operator=(), and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::swap().
|
protected |
Definition at line 614 of file concurrent_hash_map.h.
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::internal_fast_find(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::rehash_bucket(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::search_bucket(), and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::swap().