Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::interface5::internal::concurrent_unordered_base< Traits > Class Template Reference

#include <_concurrent_unordered_impl.h>

Inheritance diagram for tbb::interface5::internal::concurrent_unordered_base< Traits >:
Collaboration diagram for tbb::interface5::internal::concurrent_unordered_base< Traits >:

Classes

struct  call_internal_clear_on_exit
 
class  const_range_type
 
class  range_type
 

Public Member Functions

allocator_type get_allocator () const
 
bool empty () const
 
size_type size () const
 
size_type max_size () const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
range_type range ()
 
const_range_type range () const
 
std::pair< iterator, bool > insert (const value_type &value)
 
iterator insert (const_iterator, const value_type &value)
 
std::pair< iterator, bool > insert (value_type &&value)
 
iterator insert (const_iterator, value_type &&value)
 
template<typename... Args>
std::pair< iterator, bool > emplace (Args &&... args)
 
template<typename... Args>
iterator emplace_hint (const_iterator, Args &&... args)
 
template<class Iterator >
void insert (Iterator first, Iterator last)
 
void insert (std::initializer_list< value_type > il)
 Insert initializer list. More...
 
iterator unsafe_erase (const_iterator where)
 
iterator unsafe_erase (const_iterator first, const_iterator last)
 
size_type unsafe_erase (const key_type &key)
 
void swap (concurrent_unordered_base &right)
 
hasher hash_function () const
 
key_equal key_eq () const
 
void clear ()
 
iterator find (const key_type &key)
 
const_iterator find (const key_type &key) const
 
size_type count (const key_type &key) const
 
std::pair< iterator, iteratorequal_range (const key_type &key)
 
std::pair< const_iterator, const_iteratorequal_range (const key_type &key) const
 
size_type unsafe_bucket_count () const
 
size_type unsafe_max_bucket_count () const
 
size_type unsafe_bucket_size (size_type bucket)
 
size_type unsafe_bucket (const key_type &key) const
 
local_iterator unsafe_begin (size_type bucket)
 
const_local_iterator unsafe_begin (size_type bucket) const
 
local_iterator unsafe_end (size_type bucket)
 
const_local_iterator unsafe_end (size_type bucket) const
 
const_local_iterator unsafe_cbegin (size_type bucket) const
 
const_local_iterator unsafe_cend (size_type bucket) const
 
float load_factor () const
 
float max_load_factor () const
 
void max_load_factor (float newmax)
 
void rehash (size_type buckets)
 

Protected Types

typedef concurrent_unordered_base< Traits > self_type
 
typedef Traits::value_type value_type
 
typedef Traits::key_type key_type
 
typedef Traits::hash_compare hash_compare
 
typedef Traits::allocator_type allocator_type
 
typedef hash_compare::hasher hasher
 
typedef hash_compare::key_equal key_equal
 
typedef tbb::internal::allocator_traits< allocator_type >::size_type size_type
 
typedef tbb::internal::allocator_traits< allocator_type >::difference_type difference_type
 
typedef tbb::internal::allocator_traits< allocator_type >::pointer pointer
 
typedef tbb::internal::allocator_traits< allocator_type >::const_pointer const_pointer
 
typedef allocator_type::value_typereference
 
typedef const allocator_type::value_typeconst_reference
 
typedef split_ordered_list< value_type, typename Traits::allocator_type > solist_t
 
typedef solist_t::nodeptr_t nodeptr_t
 
typedef solist_t::raw_iterator raw_iterator
 
typedef solist_t::raw_const_iterator raw_const_iterator
 
typedef solist_t::iterator iterator
 
typedef solist_t::const_iterator const_iterator
 
typedef iterator local_iterator
 
typedef const_iterator const_local_iterator
 

Protected Member Functions

 concurrent_unordered_base (size_type n_of_buckets=initial_bucket_number, const hash_compare &hc=hash_compare(), const allocator_type &a=allocator_type())
 
 concurrent_unordered_base (const concurrent_unordered_base &right, const allocator_type &a)
 
 concurrent_unordered_base (const concurrent_unordered_base &right)
 
 concurrent_unordered_base (concurrent_unordered_base &&right)
 
 concurrent_unordered_base (concurrent_unordered_base &&right, const allocator_type &a)
 
concurrent_unordered_baseoperator= (const concurrent_unordered_base &right)
 
concurrent_unordered_baseoperator= (concurrent_unordered_base &&other)
 
concurrent_unordered_baseoperator= (std::initializer_list< value_type > il)
 assignment operator from initializer_list More...
 
 ~concurrent_unordered_base ()
 

Static Protected Attributes

static const size_type initial_bucket_number = 8
 

Private Types

typedef std::pair< iterator, iteratorpairii_t
 
typedef std::pair< const_iterator, const_iteratorpaircc_t
 

Private Member Functions

void internal_init ()
 
void internal_clear ()
 
void internal_copy (const self_type &right)
 
void internal_swap_buckets (concurrent_unordered_base &right)
 
template<typename AllowCreate , typename ValueType >
std::pair< iterator, bool > internal_insert (__TBB_FORWARDING_REF(ValueType) value, nodeptr_t pnode=NULL)
 
iterator internal_find (const key_type &key)
 
iterator internal_erase (const_iterator it)
 
pairii_t internal_equal_range (const key_type &key)
 
void init_bucket (size_type bucket)
 
void adjust_table_size (size_type total_elements, size_type current_size)
 
size_type get_parent (size_type bucket) const
 
raw_iterator get_bucket (size_type bucket) const
 
raw_iterator prepare_bucket (sokey_t hash_key)
 
void set_bucket (size_type bucket, raw_iterator dummy_head)
 
bool is_initialized (size_type bucket) const
 
sokey_t split_order_key_regular (sokey_t order_key) const
 
sokey_t split_order_key_dummy (sokey_t order_key) const
 

Static Private Member Functions

static size_type internal_distance (const_iterator first, const_iterator last)
 
static size_type segment_index_of (size_type index)
 
static size_type segment_base (size_type k)
 
static size_type segment_size (size_type k)
 

Private Attributes

atomic< size_typemy_number_of_buckets
 
solist_t my_solist
 
tbb::internal::allocator_rebind< allocator_type, raw_iterator >::type my_allocator
 
float my_maximum_bucket_size
 
atomic< raw_iterator * > my_buckets [pointers_per_table]
 

Static Private Attributes

static size_type const pointers_per_table = sizeof(size_type) * 8
 
static const size_type initial_bucket_load = 4
 

Detailed Description

template<typename Traits>
class tbb::interface5::internal::concurrent_unordered_base< Traits >

Definition at line 58 of file _concurrent_unordered_impl.h.

Member Typedef Documentation

◆ allocator_type

template<typename Traits>
typedef Traits::allocator_type tbb::interface5::internal::concurrent_unordered_base< Traits >::allocator_type
protected

Definition at line 665 of file _concurrent_unordered_impl.h.

◆ const_iterator

Definition at line 683 of file _concurrent_unordered_impl.h.

◆ const_local_iterator

template<typename Traits>
typedef const_iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::const_local_iterator
protected

Definition at line 685 of file _concurrent_unordered_impl.h.

◆ const_pointer

◆ const_reference

template<typename Traits>
typedef const allocator_type::value_type& tbb::interface5::internal::concurrent_unordered_base< Traits >::const_reference
protected

Definition at line 675 of file _concurrent_unordered_impl.h.

◆ difference_type

◆ hash_compare

template<typename Traits>
typedef Traits::hash_compare tbb::interface5::internal::concurrent_unordered_base< Traits >::hash_compare
protected

Definition at line 664 of file _concurrent_unordered_impl.h.

◆ hasher

template<typename Traits>
typedef hash_compare::hasher tbb::interface5::internal::concurrent_unordered_base< Traits >::hasher
protected

Definition at line 666 of file _concurrent_unordered_impl.h.

◆ iterator

template<typename Traits>
typedef solist_t::iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::iterator
protected

Definition at line 682 of file _concurrent_unordered_impl.h.

◆ key_equal

template<typename Traits>
typedef hash_compare::key_equal tbb::interface5::internal::concurrent_unordered_base< Traits >::key_equal
protected

Definition at line 667 of file _concurrent_unordered_impl.h.

◆ key_type

template<typename Traits>
typedef Traits::key_type tbb::interface5::internal::concurrent_unordered_base< Traits >::key_type
protected

Definition at line 663 of file _concurrent_unordered_impl.h.

◆ local_iterator

template<typename Traits>
typedef iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::local_iterator
protected

Definition at line 684 of file _concurrent_unordered_impl.h.

◆ nodeptr_t

template<typename Traits>
typedef solist_t::nodeptr_t tbb::interface5::internal::concurrent_unordered_base< Traits >::nodeptr_t
protected

Definition at line 678 of file _concurrent_unordered_impl.h.

◆ paircc_t

template<typename Traits>
typedef std::pair<const_iterator, const_iterator> tbb::interface5::internal::concurrent_unordered_base< Traits >::paircc_t
private

Definition at line 693 of file _concurrent_unordered_impl.h.

◆ pairii_t

template<typename Traits>
typedef std::pair<iterator, iterator> tbb::interface5::internal::concurrent_unordered_base< Traits >::pairii_t
private

Definition at line 692 of file _concurrent_unordered_impl.h.

◆ pointer

◆ raw_const_iterator

Definition at line 681 of file _concurrent_unordered_impl.h.

◆ raw_iterator

template<typename Traits>
typedef solist_t::raw_iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::raw_iterator
protected

Definition at line 680 of file _concurrent_unordered_impl.h.

◆ reference

template<typename Traits>
typedef allocator_type::value_type& tbb::interface5::internal::concurrent_unordered_base< Traits >::reference
protected

Definition at line 674 of file _concurrent_unordered_impl.h.

◆ self_type

template<typename Traits>
typedef concurrent_unordered_base<Traits> tbb::interface5::internal::concurrent_unordered_base< Traits >::self_type
protected

Definition at line 661 of file _concurrent_unordered_impl.h.

◆ size_type

◆ solist_t

template<typename Traits>
typedef split_ordered_list<value_type, typename Traits::allocator_type> tbb::interface5::internal::concurrent_unordered_base< Traits >::solist_t
protected

Definition at line 677 of file _concurrent_unordered_impl.h.

◆ value_type

template<typename Traits>
typedef Traits::value_type tbb::interface5::internal::concurrent_unordered_base< Traits >::value_type
protected

Definition at line 662 of file _concurrent_unordered_impl.h.

Constructor & Destructor Documentation

◆ concurrent_unordered_base() [1/5]

template<typename Traits>
tbb::interface5::internal::concurrent_unordered_base< Traits >::concurrent_unordered_base ( size_type  n_of_buckets = initial_bucket_number,
const hash_compare hc = hash_compare(),
const allocator_type a = allocator_type() 
)
inlineprotected

Definition at line 710 of file _concurrent_unordered_impl.h.

712  : Traits(hc), my_solist(a),
714  {
715  if( n_of_buckets == 0) ++n_of_buckets;
716  my_number_of_buckets = size_type(1)<<__TBB_Log2((uintptr_t)n_of_buckets*2-1); // round up to power of 2
717  internal_init();
718  }
tbb::internal::allocator_rebind< allocator_type, raw_iterator >::type my_allocator
intptr_t __TBB_Log2(uintptr_t x)
Definition: tbb_machine.h:867
tbb::internal::allocator_traits< allocator_type >::size_type size_type

◆ concurrent_unordered_base() [2/5]

template<typename Traits>
tbb::interface5::internal::concurrent_unordered_base< Traits >::concurrent_unordered_base ( const concurrent_unordered_base< Traits > &  right,
const allocator_type a 
)
inlineprotected

Definition at line 720 of file _concurrent_unordered_impl.h.

721  : Traits(right.my_hash_compare), my_solist(a), my_allocator(a)
722  {
723  internal_init();
724  internal_copy(right);
725  }
tbb::internal::allocator_rebind< allocator_type, raw_iterator >::type my_allocator

◆ concurrent_unordered_base() [3/5]

template<typename Traits>
tbb::interface5::internal::concurrent_unordered_base< Traits >::concurrent_unordered_base ( const concurrent_unordered_base< Traits > &  right)
inlineprotected

Definition at line 727 of file _concurrent_unordered_impl.h.

728  : Traits(right.my_hash_compare), my_solist(right.get_allocator()), my_allocator(right.get_allocator())
729  {
730  //FIXME:exception safety seems to be broken here
731  internal_init();
732  internal_copy(right);
733  }
tbb::internal::allocator_rebind< allocator_type, raw_iterator >::type my_allocator

◆ concurrent_unordered_base() [4/5]

template<typename Traits>
tbb::interface5::internal::concurrent_unordered_base< Traits >::concurrent_unordered_base ( concurrent_unordered_base< Traits > &&  right)
inlineprotected

Definition at line 736 of file _concurrent_unordered_impl.h.

737  : Traits(right.my_hash_compare), my_solist(right.get_allocator()), my_allocator(right.get_allocator()),
739  {
741  internal_init();
742  swap(right);
743  }
tbb::internal::allocator_rebind< allocator_type, raw_iterator >::type my_allocator

◆ concurrent_unordered_base() [5/5]

template<typename Traits>
tbb::interface5::internal::concurrent_unordered_base< Traits >::concurrent_unordered_base ( concurrent_unordered_base< Traits > &&  right,
const allocator_type a 
)
inlineprotected

Definition at line 745 of file _concurrent_unordered_impl.h.

746  : Traits(right.my_hash_compare), my_solist(a), my_allocator(a)
747  {
748  call_internal_clear_on_exit clear_buckets_on_exception(this);
749 
750  internal_init();
751  if (a == right.get_allocator()){
754  this->swap(right);
755  }else{
756  my_maximum_bucket_size = right.my_maximum_bucket_size;
757  my_number_of_buckets = right.my_number_of_buckets;
758  my_solist.my_element_count = right.my_solist.my_element_count;
759 
760  if (! right.my_solist.empty()){
761  nodeptr_t previous_node = my_solist.my_head;
762 
763  // Move all elements one by one, including dummy ones
764  for (raw_const_iterator it = ++(right.my_solist.raw_begin()), last = right.my_solist.raw_end(); it != last; ++it)
765  {
766  const nodeptr_t pnode = it.get_node_ptr();
767  nodeptr_t node;
768  if (pnode->is_dummy()) {
769  node = my_solist.create_node(pnode->get_order_key());
770  size_type bucket = __TBB_ReverseBits(pnode->get_order_key()) % my_number_of_buckets;
771  set_bucket(bucket, node);
772  }else{
773  node = my_solist.create_node(pnode->get_order_key(), std::move(pnode->my_element));
774  }
775 
776  previous_node = my_solist.try_insert_atomic(previous_node, node, NULL);
777  __TBB_ASSERT(previous_node != NULL, "Insertion of node failed. Concurrent inserts in constructor ?");
778  }
780  }
781  }
782 
783  clear_buckets_on_exception.dismiss();
784  }
tbb::internal::allocator_rebind< allocator_type, raw_iterator >::type my_allocator
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:169
T __TBB_ReverseBits(T src)
Definition: tbb_machine.h:974
auto last(Container &c) -> decltype(begin(c))
void set_bucket(size_type bucket, raw_iterator dummy_head)
static nodeptr_t try_insert_atomic(nodeptr_t previous, nodeptr_t new_node, nodeptr_t current_node)
void check_range(raw_iterator first, raw_iterator last)
tbb::internal::allocator_traits< allocator_type >::size_type size_type
void move(tbb_thread &t1, tbb_thread &t2)
Definition: tbb_thread.h:309

◆ ~concurrent_unordered_base()

template<typename Traits>
tbb::interface5::internal::concurrent_unordered_base< Traits >::~concurrent_unordered_base ( )
inlineprotected

Definition at line 829 of file _concurrent_unordered_impl.h.

829  {
830  // Delete all node segments
831  internal_clear();
832  }

Member Function Documentation

◆ adjust_table_size()

template<typename Traits>
void tbb::interface5::internal::concurrent_unordered_base< Traits >::adjust_table_size ( size_type  total_elements,
size_type  current_size 
)
inlineprivate

Definition at line 1423 of file _concurrent_unordered_impl.h.

1424  {
1425  // Grow the table by a factor of 2 if possible and needed
1426  if ( ((float) total_elements / (float) current_size) > my_maximum_bucket_size )
1427  {
1428  // Double the size of the hash only if size has not changed in between loads
1429  my_number_of_buckets.compare_and_swap(2u*current_size, current_size);
1430  //Simple "my_number_of_buckets.compare_and_swap( current_size<<1, current_size );" does not work for VC8
1431  //due to overzealous compiler warnings in /Wp64 mode
1432  }
1433  }
value_type compare_and_swap(value_type value, value_type comparand)
Definition: atomic.h:289

◆ begin() [1/2]

◆ begin() [2/2]

◆ cbegin()

template<typename Traits>
const_iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::cbegin ( ) const
inline

◆ cend()

template<typename Traits>
const_iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::cend ( ) const
inline

◆ clear()

template<typename Traits>
void tbb::interface5::internal::concurrent_unordered_base< Traits >::clear ( )
inline

Definition at line 1057 of file _concurrent_unordered_impl.h.

1057  {
1058  // Clear list
1059  my_solist.clear();
1060 
1061  // Clear buckets
1062  internal_clear();
1063 
1064  // Initialize bucket 0
1065  __TBB_ASSERT(my_buckets[0] == NULL, NULL);
1066  raw_iterator dummy_node = my_solist.raw_begin();
1067  set_bucket(0, dummy_node);
1068  }
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:169
atomic< raw_iterator * > my_buckets[pointers_per_table]
void set_bucket(size_type bucket, raw_iterator dummy_head)

◆ count()

template<typename Traits>
size_type tbb::interface5::internal::concurrent_unordered_base< Traits >::count ( const key_type key) const
inline

Definition at line 1079 of file _concurrent_unordered_impl.h.

1079  {
1080  if(allow_multimapping) {
1081  paircc_t answer = equal_range(key);
1082  size_type item_count = internal_distance(answer.first, answer.second);
1083  return item_count;
1084  } else {
1085  return const_cast<self_type*>(this)->internal_find(key) == end()?0:1;
1086  }
1087  }
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle * key
tbb::internal::allocator_traits< allocator_type >::size_type size_type
std::pair< iterator, iterator > equal_range(const key_type &key)
static size_type internal_distance(const_iterator first, const_iterator last)
std::pair< const_iterator, const_iterator > paircc_t

◆ emplace()

template<typename Traits>
template<typename... Args>
std::pair<iterator, bool> tbb::interface5::internal::concurrent_unordered_base< Traits >::emplace ( Args &&...  args)
inline

Definition at line 990 of file _concurrent_unordered_impl.h.

990  {
991  nodeptr_t pnode = my_solist.create_node_v(tbb::internal::forward<Args>(args)...);
992  const sokey_t hashed_element_key = (sokey_t) my_hash_compare(get_key(pnode->my_element));
993  const sokey_t order_key = split_order_key_regular(hashed_element_key);
994  pnode->init(order_key);
995 
996  return internal_insert</*AllowCreate=*/tbb::internal::false_type>(pnode->my_element, pnode);
997  }
std::pair< iterator, bool > internal_insert(__TBB_FORWARDING_REF(ValueType) value, nodeptr_t pnode=NULL)
nodeptr_t create_node_v(__TBB_FORWARDING_REF(Args) __TBB_PARAMETER_PACK args)

◆ emplace_hint()

template<typename Traits>
template<typename... Args>
iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::emplace_hint ( const_iterator  ,
Args &&...  args 
)
inline

Definition at line 1000 of file _concurrent_unordered_impl.h.

1000  {
1001  // Ignore hint
1002  return emplace(tbb::internal::forward<Args>(args)...).first;
1003  }
std::pair< iterator, bool > emplace(Args &&... args)

◆ empty()

template<typename Traits>
bool tbb::interface5::internal::concurrent_unordered_base< Traits >::empty ( ) const
inline

◆ end() [1/2]

◆ end() [2/2]

◆ equal_range() [1/2]

template<typename Traits>
std::pair<iterator, iterator> tbb::interface5::internal::concurrent_unordered_base< Traits >::equal_range ( const key_type key)
inline

Definition at line 1089 of file _concurrent_unordered_impl.h.

1089  {
1090  return internal_equal_range(key);
1091  }
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle * key

◆ equal_range() [2/2]

template<typename Traits>
std::pair<const_iterator, const_iterator> tbb::interface5::internal::concurrent_unordered_base< Traits >::equal_range ( const key_type key) const
inline

Definition at line 1093 of file _concurrent_unordered_impl.h.

1093  {
1094  return const_cast<self_type*>(this)->internal_equal_range(key);
1095  }
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle * key

◆ find() [1/2]

template<typename Traits>
iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::find ( const key_type key)
inline

Definition at line 1071 of file _concurrent_unordered_impl.h.

1071  {
1072  return internal_find(key);
1073  }
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle * key

◆ find() [2/2]

template<typename Traits>
const_iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::find ( const key_type key) const
inline

Definition at line 1075 of file _concurrent_unordered_impl.h.

1075  {
1076  return const_cast<self_type*>(this)->internal_find(key);
1077  }
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle * key

◆ get_allocator()

template<typename Traits>
allocator_type tbb::interface5::internal::concurrent_unordered_base< Traits >::get_allocator ( ) const
inline

◆ get_bucket()

template<typename Traits>
raw_iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::get_bucket ( size_type  bucket) const
inlineprivate

Definition at line 1459 of file _concurrent_unordered_impl.h.

Referenced by tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::set_midpoint().

1459  {
1460  size_type segment = segment_index_of(bucket);
1461  bucket -= segment_base(segment);
1462  __TBB_ASSERT( my_buckets[segment], "bucket must be in an allocated segment" );
1463  return my_buckets[segment][bucket];
1464  }
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:169
atomic< raw_iterator * > my_buckets[pointers_per_table]
tbb::internal::allocator_traits< allocator_type >::size_type size_type
Here is the caller graph for this function:

◆ get_parent()

template<typename Traits>
size_type tbb::interface5::internal::concurrent_unordered_base< Traits >::get_parent ( size_type  bucket) const
inlineprivate

Definition at line 1435 of file _concurrent_unordered_impl.h.

Referenced by tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::set_midpoint().

1436  {
1437  // Unsets bucket's most significant turned-on bit
1438  size_type msb = __TBB_Log2((uintptr_t)bucket);
1439  return bucket & ~(size_type(1) << msb);
1440  }
intptr_t __TBB_Log2(uintptr_t x)
Definition: tbb_machine.h:867
tbb::internal::allocator_traits< allocator_type >::size_type size_type
Here is the caller graph for this function:

◆ hash_function()

template<typename Traits>
hasher tbb::interface5::internal::concurrent_unordered_base< Traits >::hash_function ( ) const
inline

Definition at line 1049 of file _concurrent_unordered_impl.h.

1049  {
1050  return my_hash_compare.my_hash_object;
1051  }

◆ init_bucket()

template<typename Traits>
void tbb::interface5::internal::concurrent_unordered_base< Traits >::init_bucket ( size_type  bucket)
inlineprivate

Definition at line 1405 of file _concurrent_unordered_impl.h.

1406  {
1407  // Bucket 0 has no parent.
1408  __TBB_ASSERT( bucket != 0, "The first bucket must always be initialized");
1409 
1410  size_type parent_bucket = get_parent(bucket);
1411 
1412  // All parent_bucket buckets have to be initialized before this bucket is
1413  if (!is_initialized(parent_bucket))
1414  init_bucket(parent_bucket);
1415 
1416  raw_iterator parent = get_bucket(parent_bucket);
1417 
1418  // Create a dummy first node in this bucket
1419  raw_iterator dummy_node = my_solist.insert_dummy(parent, split_order_key_dummy(bucket));
1420  set_bucket(bucket, dummy_node);
1421  }
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:169
raw_iterator insert_dummy(raw_iterator it, sokey_t order_key)
void set_bucket(size_type bucket, raw_iterator dummy_head)
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id parent
tbb::internal::allocator_traits< allocator_type >::size_type size_type

◆ insert() [1/6]

template<typename Traits>
std::pair<iterator, bool> tbb::interface5::internal::concurrent_unordered_base< Traits >::insert ( const value_type value)
inline

Definition at line 969 of file _concurrent_unordered_impl.h.

969  {
970  return internal_insert</*AllowCreate=*/tbb::internal::true_type>(value);
971  }
std::pair< iterator, bool > internal_insert(__TBB_FORWARDING_REF(ValueType) value, nodeptr_t pnode=NULL)
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long value

◆ insert() [2/6]

template<typename Traits>
iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::insert ( const_iterator  ,
const value_type value 
)
inline

Definition at line 973 of file _concurrent_unordered_impl.h.

973  {
974  // Ignore hint
975  return insert(value).first;
976  }
std::pair< iterator, bool > insert(const value_type &value)
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long value

◆ insert() [3/6]

template<typename Traits>
std::pair<iterator, bool> tbb::interface5::internal::concurrent_unordered_base< Traits >::insert ( value_type &&  value)
inline

Definition at line 979 of file _concurrent_unordered_impl.h.

979  {
980  return internal_insert</*AllowCreate=*/tbb::internal::true_type>(std::move(value));
981  }
std::pair< iterator, bool > internal_insert(__TBB_FORWARDING_REF(ValueType) value, nodeptr_t pnode=NULL)
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long value
void move(tbb_thread &t1, tbb_thread &t2)
Definition: tbb_thread.h:309

◆ insert() [4/6]

template<typename Traits>
iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::insert ( const_iterator  ,
value_type &&  value 
)
inline

Definition at line 983 of file _concurrent_unordered_impl.h.

983  {
984  // Ignore hint
985  return insert(std::move(value)).first;
986  }
std::pair< iterator, bool > insert(const value_type &value)
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long value
void move(tbb_thread &t1, tbb_thread &t2)
Definition: tbb_thread.h:309

◆ insert() [5/6]

template<typename Traits>
template<class Iterator >
void tbb::interface5::internal::concurrent_unordered_base< Traits >::insert ( Iterator  first,
Iterator  last 
)
inline

Definition at line 1009 of file _concurrent_unordered_impl.h.

1009  {
1010  for (Iterator it = first; it != last; ++it)
1011  insert(*it);
1012  }
auto first(Container &c) -> decltype(begin(c))
std::pair< iterator, bool > insert(const value_type &value)
auto last(Container &c) -> decltype(begin(c))

◆ insert() [6/6]

template<typename Traits>
void tbb::interface5::internal::concurrent_unordered_base< Traits >::insert ( std::initializer_list< value_type il)
inline

Insert initializer list.

Definition at line 1016 of file _concurrent_unordered_impl.h.

1016  {
1017  insert(il.begin(), il.end());
1018  }
std::pair< iterator, bool > insert(const value_type &value)

◆ internal_clear()

template<typename Traits>
void tbb::interface5::internal::concurrent_unordered_base< Traits >::internal_clear ( )
inlineprivate

Definition at line 1221 of file _concurrent_unordered_impl.h.

Referenced by tbb::interface5::internal::concurrent_unordered_base< Traits >::call_internal_clear_on_exit::~call_internal_clear_on_exit().

1221  {
1222  for (size_type index = 0; index < pointers_per_table; ++index) {
1223  if (my_buckets[index] != NULL) {
1224  size_type sz = segment_size(index);
1225  for (size_type index2 = 0; index2 < sz; ++index2)
1226  my_allocator.destroy(&my_buckets[index][index2]);
1227  my_allocator.deallocate(my_buckets[index], sz);
1228  my_buckets[index] = 0;
1229  }
1230  }
1231  }
tbb::internal::allocator_rebind< allocator_type, raw_iterator >::type my_allocator
atomic< raw_iterator * > my_buckets[pointers_per_table]
tbb::internal::allocator_traits< allocator_type >::size_type size_type
Here is the caller graph for this function:

◆ internal_copy()

template<typename Traits>
void tbb::interface5::internal::concurrent_unordered_base< Traits >::internal_copy ( const self_type right)
inlineprivate

Definition at line 1233 of file _concurrent_unordered_impl.h.

1233  {
1234  clear();
1235 
1236  my_maximum_bucket_size = right.my_maximum_bucket_size;
1237  my_number_of_buckets = right.my_number_of_buckets;
1238 
1239  __TBB_TRY {
1240  insert(right.begin(), right.end());
1241  my_hash_compare = right.my_hash_compare;
1242  } __TBB_CATCH(...) {
1243  my_solist.clear();
1244  __TBB_RETHROW();
1245  }
1246  }
#define __TBB_TRY
Definition: tbb_stddef.h:287
std::pair< iterator, bool > insert(const value_type &value)
#define __TBB_CATCH(e)
Definition: tbb_stddef.h:288
#define __TBB_RETHROW()
Definition: tbb_stddef.h:290

◆ internal_distance()

template<typename Traits>
static size_type tbb::interface5::internal::concurrent_unordered_base< Traits >::internal_distance ( const_iterator  first,
const_iterator  last 
)
inlinestaticprivate

Definition at line 1261 of file _concurrent_unordered_impl.h.

1262  {
1263  size_type num = 0;
1264 
1265  for (const_iterator it = first; it != last; ++it)
1266  ++num;
1267 
1268  return num;
1269  }
auto first(Container &c) -> decltype(begin(c))
auto last(Container &c) -> decltype(begin(c))
tbb::internal::allocator_traits< allocator_type >::size_type size_type

◆ internal_equal_range()

template<typename Traits>
pairii_t tbb::interface5::internal::concurrent_unordered_base< Traits >::internal_equal_range ( const key_type key)
inlineprivate

Definition at line 1378 of file _concurrent_unordered_impl.h.

1379  {
1380  sokey_t hash_key = (sokey_t) my_hash_compare(key);
1381  sokey_t order_key = split_order_key_regular(hash_key);
1382  raw_iterator end_it = my_solist.raw_end();
1383 
1384  for (raw_iterator it = prepare_bucket(hash_key); it != end_it; ++it)
1385  {
1386  if (solist_t::get_order_key(it) > order_key)
1387  {
1388  // There is no element with the given key
1389  return pairii_t(end(), end());
1390  }
1391  else if (solist_t::get_order_key(it) == order_key &&
1392  !my_hash_compare(get_key(*it), key)) // TODO: fix negation; also below
1393  {
1395  iterator last = first;
1396  do ++last; while( allow_multimapping && last != end() && !my_hash_compare(get_key(*last), key) );
1397  return pairii_t(first, last);
1398  }
1399  }
1400 
1401  return pairii_t(end(), end());
1402  }
auto first(Container &c) -> decltype(begin(c))
auto last(Container &c) -> decltype(begin(c))
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle * key

◆ internal_erase()

template<typename Traits>
iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::internal_erase ( const_iterator  it)
inlineprivate

Definition at line 1359 of file _concurrent_unordered_impl.h.

1360  {
1361  sokey_t hash_key = (sokey_t) my_hash_compare(get_key(*it));
1362  raw_iterator previous = prepare_bucket(hash_key);
1364  __TBB_ASSERT(previous != last, "Invalid head node");
1365 
1366  // First node is a dummy node
1367  for (raw_iterator where = previous; ; previous = where) {
1368  ++where;
1369  if (where == last)
1370  return end();
1371  else if (my_solist.get_iterator(where) == it)
1372  return my_solist.erase_node(previous, it);
1373  }
1374  }
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:169
auto last(Container &c) -> decltype(begin(c))
void erase_node(raw_iterator previous, raw_const_iterator &where)

◆ internal_find()

template<typename Traits>
iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::internal_find ( const key_type key)
inlineprivate

Definition at line 1331 of file _concurrent_unordered_impl.h.

1332  {
1333  sokey_t hash_key = (sokey_t) my_hash_compare(key);
1334  sokey_t order_key = split_order_key_regular(hash_key);
1336 
1337  for (raw_iterator it = prepare_bucket(hash_key); it != last; ++it)
1338  {
1339  if (solist_t::get_order_key(it) > order_key)
1340  {
1341  // If the order key is smaller than the current order key, the element
1342  // is not in the hash.
1343  return end();
1344  }
1345  else if (solist_t::get_order_key(it) == order_key)
1346  {
1347  // The fact that order keys match does not mean that the element is found.
1348  // Key function comparison has to be performed to check whether this is the
1349  // right element. If not, keep searching while order key is the same.
1350  if (!my_hash_compare(get_key(*it), key)) // TODO: fix negation
1351  return my_solist.get_iterator(it);
1352  }
1353  }
1354 
1355  return end();
1356  }
auto last(Container &c) -> decltype(begin(c))
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle * key

◆ internal_init()

template<typename Traits>
void tbb::interface5::internal::concurrent_unordered_base< Traits >::internal_init ( )
inlineprivate

Definition at line 1212 of file _concurrent_unordered_impl.h.

1212  {
1213  // Initialize the array of segment pointers
1214  memset(my_buckets, 0, sizeof(my_buckets));
1215 
1216  // Initialize bucket 0
1217  raw_iterator dummy_node = my_solist.raw_begin();
1218  set_bucket(0, dummy_node);
1219  }
atomic< raw_iterator * > my_buckets[pointers_per_table]
void set_bucket(size_type bucket, raw_iterator dummy_head)

◆ internal_insert()

template<typename Traits>
template<typename AllowCreate , typename ValueType >
std::pair<iterator, bool> tbb::interface5::internal::concurrent_unordered_base< Traits >::internal_insert ( __TBB_FORWARDING_REF(ValueType)  value,
nodeptr_t  pnode = NULL 
)
inlineprivate

Definition at line 1273 of file _concurrent_unordered_impl.h.

1274  {
1275  const key_type *pkey = &get_key(value);
1276  sokey_t hash_key = (sokey_t) my_hash_compare(*pkey);
1277  size_type new_count = 0;
1278  sokey_t order_key = split_order_key_regular(hash_key);
1279  raw_iterator previous = prepare_bucket(hash_key);
1281  __TBB_ASSERT(previous != last, "Invalid head node");
1282 
1283  // First node is a dummy node
1284  for (raw_iterator where = previous;;)
1285  {
1286  ++where;
1287  if (where == last || solist_t::get_order_key(where) > order_key ||
1288  // if multimapped, stop at the first item equal to us.
1289  (allow_multimapping && solist_t::get_order_key(where) == order_key &&
1290  !my_hash_compare(get_key(*where), *pkey))) // TODO: fix negation
1291  {
1292  if (!pnode) {
1293  pnode = my_solist.create_node(order_key, tbb::internal::forward<ValueType>(value), AllowCreate());
1294  // If the value was moved, the known reference to key might be invalid
1295  pkey = &get_key(pnode->my_element);
1296  }
1297 
1298  // Try to insert 'pnode' between 'previous' and 'where'
1299  std::pair<iterator, bool> result = my_solist.try_insert(previous, where, pnode, &new_count);
1300 
1301  if (result.second)
1302  {
1303  // Insertion succeeded, adjust the table size, if needed
1305  return result;
1306  }
1307  else
1308  {
1309  // Insertion failed: either the same node was inserted by another thread, or
1310  // another element was inserted at exactly the same place as this node.
1311  // Proceed with the search from the previous location where order key was
1312  // known to be larger (note: this is legal only because there is no safe
1313  // concurrent erase operation supported).
1314  where = previous;
1315  continue;
1316  }
1317  }
1318  else if (!allow_multimapping && solist_t::get_order_key(where) == order_key &&
1319  !my_hash_compare(get_key(*where), *pkey)) // TODO: fix negation
1320  { // Element already in the list, return it
1321  if (pnode)
1322  my_solist.destroy_node(pnode);
1323  return std::pair<iterator, bool>(my_solist.get_iterator(where), false);
1324  }
1325  // Move the iterator forward
1326  previous = where;
1327  }
1328  }
void adjust_table_size(size_type total_elements, size_type current_size)
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:169
auto last(Container &c) -> decltype(begin(c))
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long value
tbb::internal::allocator_traits< allocator_type >::size_type size_type
std::pair< iterator, bool > try_insert(raw_iterator it, raw_iterator next, nodeptr_t pnode, size_type *new_count)

◆ internal_swap_buckets()

template<typename Traits>
void tbb::interface5::internal::concurrent_unordered_base< Traits >::internal_swap_buckets ( concurrent_unordered_base< Traits > &  right)
inlineprivate

Definition at line 1248 of file _concurrent_unordered_impl.h.

1249  {
1250  // Swap all node segments
1251  for (size_type index = 0; index < pointers_per_table; ++index)
1252  {
1253  raw_iterator * iterator_pointer = my_buckets[index];
1254  my_buckets[index] = right.my_buckets[index];
1255  right.my_buckets[index] = iterator_pointer;
1256  }
1257  }
atomic< raw_iterator * > my_buckets[pointers_per_table]
tbb::internal::allocator_traits< allocator_type >::size_type size_type

◆ is_initialized()

template<typename Traits>
bool tbb::interface5::internal::concurrent_unordered_base< Traits >::is_initialized ( size_type  bucket) const
inlineprivate

Definition at line 1491 of file _concurrent_unordered_impl.h.

Referenced by tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::set_midpoint().

1491  {
1492  size_type segment = segment_index_of(bucket);
1493  bucket -= segment_base(segment);
1494 
1495  if (my_buckets[segment] == NULL)
1496  return false;
1497 
1498  raw_iterator it = my_buckets[segment][bucket];
1499  return (it.get_node_ptr() != NULL);
1500  }
atomic< raw_iterator * > my_buckets[pointers_per_table]
tbb::internal::allocator_traits< allocator_type >::size_type size_type
Here is the caller graph for this function:

◆ key_eq()

template<typename Traits>
key_equal tbb::interface5::internal::concurrent_unordered_base< Traits >::key_eq ( ) const
inline

Definition at line 1053 of file _concurrent_unordered_impl.h.

1053  {
1054  return my_hash_compare.my_key_compare_object;
1055  }

◆ load_factor()

template<typename Traits>
float tbb::interface5::internal::concurrent_unordered_base< Traits >::load_factor ( ) const
inline

Definition at line 1185 of file _concurrent_unordered_impl.h.

◆ max_load_factor() [1/2]

template<typename Traits>
float tbb::interface5::internal::concurrent_unordered_base< Traits >::max_load_factor ( ) const
inline

◆ max_load_factor() [2/2]

template<typename Traits>
void tbb::interface5::internal::concurrent_unordered_base< Traits >::max_load_factor ( float  newmax)
inline

Definition at line 1193 of file _concurrent_unordered_impl.h.

1193  {
1194  if (newmax != newmax || newmax < 0)
1196  my_maximum_bucket_size = newmax;
1197  }
void throw_exception(exception_id eid)
Versionless convenience wrapper for throw_exception_v4()

◆ max_size()

template<typename Traits>
size_type tbb::interface5::internal::concurrent_unordered_base< Traits >::max_size ( ) const
inline

◆ operator=() [1/3]

template<typename Traits>
concurrent_unordered_base& tbb::interface5::internal::concurrent_unordered_base< Traits >::operator= ( const concurrent_unordered_base< Traits > &  right)
inlineprotected

Definition at line 788 of file _concurrent_unordered_impl.h.

788  {
789  if (this != &right)
790  internal_copy(right);
791  return (*this);
792  }

◆ operator=() [2/3]

template<typename Traits>
concurrent_unordered_base& tbb::interface5::internal::concurrent_unordered_base< Traits >::operator= ( concurrent_unordered_base< Traits > &&  other)
inlineprotected

Definition at line 795 of file _concurrent_unordered_impl.h.

796  {
797  if(this != &other){
799  if(pocma_t::value || this->my_allocator == other.my_allocator) {
800  concurrent_unordered_base trash (std::move(*this));
801  swap(other);
802  if (pocma_t::value) {
803  using std::swap;
804  //TODO: swapping allocators here may be a problem, replace with single direction moving
805  swap(this->my_solist.my_node_allocator, other.my_solist.my_node_allocator);
806  swap(this->my_allocator, other.my_allocator);
807  }
808  } else {
809  concurrent_unordered_base moved_copy(std::move(other),this->my_allocator);
810  this->swap(moved_copy);
811  }
812  }
813  return *this;
814  }
tbb::internal::allocator_rebind< allocator_type, raw_iterator >::type my_allocator
void swap(atomic< T > &lhs, atomic< T > &rhs)
Definition: atomic.h:539
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long value
tbb::internal::allocator_rebind< allocator_type, node >::type my_node_allocator
void move(tbb_thread &t1, tbb_thread &t2)
Definition: tbb_thread.h:309
concurrent_unordered_base(size_type n_of_buckets=initial_bucket_number, const hash_compare &hc=hash_compare(), const allocator_type &a=allocator_type())

◆ operator=() [3/3]

template<typename Traits>
concurrent_unordered_base& tbb::interface5::internal::concurrent_unordered_base< Traits >::operator= ( std::initializer_list< value_type il)
inlineprotected

assignment operator from initializer_list

Definition at line 820 of file _concurrent_unordered_impl.h.

821  {
822  this->clear();
823  this->insert(il.begin(),il.end());
824  return (*this);
825  }
std::pair< iterator, bool > insert(const value_type &value)

◆ prepare_bucket()

template<typename Traits>
raw_iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::prepare_bucket ( sokey_t  hash_key)
inlineprivate

Definition at line 1466 of file _concurrent_unordered_impl.h.

1466  {
1467  size_type bucket = hash_key % my_number_of_buckets;
1468  size_type segment = segment_index_of(bucket);
1469  size_type index = bucket - segment_base(segment);
1470  if (my_buckets[segment] == NULL || my_buckets[segment][index].get_node_ptr() == NULL)
1471  init_bucket(bucket);
1472  return my_buckets[segment][index];
1473  }
atomic< raw_iterator * > my_buckets[pointers_per_table]
tbb::internal::allocator_traits< allocator_type >::size_type size_type

◆ range() [1/2]

template<typename Traits>
range_type tbb::interface5::internal::concurrent_unordered_base< Traits >::range ( )
inline

Definition at line 960 of file _concurrent_unordered_impl.h.

960  {
961  return range_type( *this );
962  }

◆ range() [2/2]

template<typename Traits>
const_range_type tbb::interface5::internal::concurrent_unordered_base< Traits >::range ( ) const
inline

Definition at line 964 of file _concurrent_unordered_impl.h.

964  {
965  return const_range_type( *this );
966  }

◆ rehash()

template<typename Traits>
void tbb::interface5::internal::concurrent_unordered_base< Traits >::rehash ( size_type  buckets)
inline

Definition at line 1202 of file _concurrent_unordered_impl.h.

1202  {
1203  size_type current_buckets = my_number_of_buckets;
1204  if (current_buckets >= buckets)
1205  return;
1206  my_number_of_buckets = size_type(1)<<__TBB_Log2((uintptr_t)buckets*2-1); // round up to power of 2
1207  }
intptr_t __TBB_Log2(uintptr_t x)
Definition: tbb_machine.h:867
tbb::internal::allocator_traits< allocator_type >::size_type size_type

◆ segment_base()

template<typename Traits>
static size_type tbb::interface5::internal::concurrent_unordered_base< Traits >::segment_base ( size_type  k)
inlinestaticprivate
Returns
the first array index of given segment

Definition at line 1450 of file _concurrent_unordered_impl.h.

1450  {
1451  return (size_type(1)<<k & ~size_type(1));
1452  }
tbb::internal::allocator_traits< allocator_type >::size_type size_type

◆ segment_index_of()

template<typename Traits>
static size_type tbb::interface5::internal::concurrent_unordered_base< Traits >::segment_index_of ( size_type  index)
inlinestaticprivate
Returns
segment index of given index in the array

Definition at line 1445 of file _concurrent_unordered_impl.h.

1445  {
1446  return size_type( __TBB_Log2( uintptr_t(index|1) ) );
1447  }
intptr_t __TBB_Log2(uintptr_t x)
Definition: tbb_machine.h:867
tbb::internal::allocator_traits< allocator_type >::size_type size_type

◆ segment_size()

template<typename Traits>
static size_type tbb::interface5::internal::concurrent_unordered_base< Traits >::segment_size ( size_type  k)
inlinestaticprivate
Returns
segment size

Definition at line 1455 of file _concurrent_unordered_impl.h.

1455  {
1456  return k? size_type(1)<<k : 2;
1457  }
tbb::internal::allocator_traits< allocator_type >::size_type size_type

◆ set_bucket()

template<typename Traits>
void tbb::interface5::internal::concurrent_unordered_base< Traits >::set_bucket ( size_type  bucket,
raw_iterator  dummy_head 
)
inlineprivate

Definition at line 1475 of file _concurrent_unordered_impl.h.

1475  {
1476  size_type segment = segment_index_of(bucket);
1477  bucket -= segment_base(segment);
1478 
1479  if (my_buckets[segment] == NULL) {
1480  size_type sz = segment_size(segment);
1481  raw_iterator * new_segment = my_allocator.allocate(sz);
1482  std::memset(static_cast<void*>(new_segment), 0, sz*sizeof(raw_iterator));
1483 
1484  if (my_buckets[segment].compare_and_swap( new_segment, NULL) != NULL)
1485  my_allocator.deallocate(new_segment, sz);
1486  }
1487 
1488  my_buckets[segment][bucket] = dummy_head;
1489  }
tbb::internal::allocator_rebind< allocator_type, raw_iterator >::type my_allocator
atomic< raw_iterator * > my_buckets[pointers_per_table]
tbb::internal::allocator_traits< allocator_type >::size_type size_type

◆ size()

template<typename Traits>
size_type tbb::interface5::internal::concurrent_unordered_base< Traits >::size ( ) const
inline

◆ split_order_key_dummy()

template<typename Traits>
sokey_t tbb::interface5::internal::concurrent_unordered_base< Traits >::split_order_key_dummy ( sokey_t  order_key) const
inlineprivate

Definition at line 1510 of file _concurrent_unordered_impl.h.

1510  {
1511  return __TBB_ReverseBits(order_key) & ~sokey_t(0x1);
1512  }
T __TBB_ReverseBits(T src)
Definition: tbb_machine.h:974

◆ split_order_key_regular()

template<typename Traits>
sokey_t tbb::interface5::internal::concurrent_unordered_base< Traits >::split_order_key_regular ( sokey_t  order_key) const
inlineprivate

Definition at line 1505 of file _concurrent_unordered_impl.h.

1505  {
1506  return __TBB_ReverseBits(order_key) | 0x1;
1507  }
T __TBB_ReverseBits(T src)
Definition: tbb_machine.h:974

◆ swap()

template<typename Traits>
void tbb::interface5::internal::concurrent_unordered_base< Traits >::swap ( concurrent_unordered_base< Traits > &  right)
inline

Definition at line 1038 of file _concurrent_unordered_impl.h.

1038  {
1039  if (this != &right) {
1040  std::swap(my_hash_compare, right.my_hash_compare); // TODO: check what ADL meant here
1041  my_solist.swap(right.my_solist);
1042  internal_swap_buckets(right);
1043  std::swap(my_number_of_buckets, right.my_number_of_buckets);
1044  std::swap(my_maximum_bucket_size, right.my_maximum_bucket_size);
1045  }
1046  }
void swap(atomic< T > &lhs, atomic< T > &rhs)
Definition: atomic.h:539
void internal_swap_buckets(concurrent_unordered_base &right)

◆ unsafe_begin() [1/2]

◆ unsafe_begin() [2/2]

◆ unsafe_bucket()

template<typename Traits>
size_type tbb::interface5::internal::concurrent_unordered_base< Traits >::unsafe_bucket ( const key_type key) const
inline

Definition at line 1117 of file _concurrent_unordered_impl.h.

1117  {
1118  sokey_t order_key = (sokey_t) my_hash_compare(key);
1119  size_type bucket = order_key % my_number_of_buckets;
1120  return bucket;
1121  }
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle * key
tbb::internal::allocator_traits< allocator_type >::size_type size_type

◆ unsafe_bucket_count()

template<typename Traits>
size_type tbb::interface5::internal::concurrent_unordered_base< Traits >::unsafe_bucket_count ( ) const
inline

Definition at line 1098 of file _concurrent_unordered_impl.h.

1098  {
1099  return my_number_of_buckets;
1100  }

◆ unsafe_bucket_size()

template<typename Traits>
size_type tbb::interface5::internal::concurrent_unordered_base< Traits >::unsafe_bucket_size ( size_type  bucket)
inline

Definition at line 1106 of file _concurrent_unordered_impl.h.

1106  {
1107  size_type item_count = 0;
1108  if (is_initialized(bucket)) {
1109  raw_iterator it = get_bucket(bucket);
1110  ++it;
1111  for (; it != my_solist.raw_end() && !it.get_node_ptr()->is_dummy(); ++it)
1112  ++item_count;
1113  }
1114  return item_count;
1115  }
tbb::internal::allocator_traits< allocator_type >::size_type size_type

◆ unsafe_cbegin()

template<typename Traits>
const_local_iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::unsafe_cbegin ( size_type  bucket) const
inline

Definition at line 1176 of file _concurrent_unordered_impl.h.

1176  {
1177  return ((const self_type *) this)->unsafe_begin(bucket);
1178  }

◆ unsafe_cend()

template<typename Traits>
const_local_iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::unsafe_cend ( size_type  bucket) const
inline

Definition at line 1180 of file _concurrent_unordered_impl.h.

1180  {
1181  return ((const self_type *) this)->unsafe_end(bucket);
1182  }

◆ unsafe_end() [1/2]

template<typename Traits>
local_iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::unsafe_end ( size_type  bucket)
inline

Definition at line 1144 of file _concurrent_unordered_impl.h.

1145  {
1146  if (!is_initialized(bucket))
1147  return end();
1148 
1149  raw_iterator it = get_bucket(bucket);
1150 
1151  // Find the end of the bucket, denoted by the dummy element
1152  do ++it;
1153  while(it != my_solist.raw_end() && !it.get_node_ptr()->is_dummy());
1154 
1155  // Return the first real element past the end of the bucket
1156  return my_solist.first_real_iterator(it);
1157  }

◆ unsafe_end() [2/2]

template<typename Traits>
const_local_iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::unsafe_end ( size_type  bucket) const
inline

Definition at line 1161 of file _concurrent_unordered_impl.h.

1162  {
1163  if (!is_initialized(bucket))
1164  return end();
1165 
1166  raw_const_iterator it = get_bucket(bucket);
1167 
1168  // Find the end of the bucket, denoted by the dummy element
1169  do ++it;
1170  while(it != my_solist.raw_end() && !it.get_node_ptr()->is_dummy());
1171 
1172  // Return the first real element past the end of the bucket
1173  return my_solist.first_real_iterator(it);
1174  }

◆ unsafe_erase() [1/3]

template<typename Traits>
iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::unsafe_erase ( const_iterator  where)
inline

Definition at line 1021 of file _concurrent_unordered_impl.h.

1021  {
1022  return internal_erase(where);
1023  }

◆ unsafe_erase() [2/3]

template<typename Traits>
iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::unsafe_erase ( const_iterator  first,
const_iterator  last 
)
inline

Definition at line 1025 of file _concurrent_unordered_impl.h.

1025  {
1026  while (first != last)
1027  unsafe_erase(first++);
1028  return my_solist.get_iterator(first);
1029  }
auto first(Container &c) -> decltype(begin(c))
auto last(Container &c) -> decltype(begin(c))

◆ unsafe_erase() [3/3]

template<typename Traits>
size_type tbb::interface5::internal::concurrent_unordered_base< Traits >::unsafe_erase ( const key_type key)
inline

Definition at line 1031 of file _concurrent_unordered_impl.h.

1031  {
1032  pairii_t where = equal_range(key);
1033  size_type item_count = internal_distance(where.first, where.second);
1034  unsafe_erase(where.first, where.second);
1035  return item_count;
1036  }
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle * key
tbb::internal::allocator_traits< allocator_type >::size_type size_type
std::pair< iterator, iterator > equal_range(const key_type &key)
static size_type internal_distance(const_iterator first, const_iterator last)

◆ unsafe_max_bucket_count()

template<typename Traits>
size_type tbb::interface5::internal::concurrent_unordered_base< Traits >::unsafe_max_bucket_count ( ) const
inline

Definition at line 1102 of file _concurrent_unordered_impl.h.

Member Data Documentation

◆ initial_bucket_load

template<typename Traits>
const size_type tbb::interface5::internal::concurrent_unordered_base< Traits >::initial_bucket_load = 4
staticprivate

Definition at line 696 of file _concurrent_unordered_impl.h.

◆ initial_bucket_number

template<typename Traits>
const size_type tbb::interface5::internal::concurrent_unordered_base< Traits >::initial_bucket_number = 8
staticprotected

Definition at line 690 of file _concurrent_unordered_impl.h.

◆ my_allocator

Definition at line 1517 of file _concurrent_unordered_impl.h.

◆ my_buckets

◆ my_maximum_bucket_size

◆ my_number_of_buckets

◆ my_solist

◆ pointers_per_table

template<typename Traits>
size_type const tbb::interface5::internal::concurrent_unordered_base< Traits >::pointers_per_table = sizeof(size_type) * 8
staticprivate

Definition at line 695 of file _concurrent_unordered_impl.h.


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

Copyright © 2005-2019 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.