tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type Class Reference

`#include <_concurrent_unordered_impl.h>`

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

## Public Types

typedef concurrent_unordered_base::size_type | size_type
| Type for size of a range. More...
typedef concurrent_unordered_base::value_type | value_type
typedef concurrent_unordered_base::reference | reference
typedef concurrent_unordered_base::difference_type | difference_type
typedef concurrent_unordered_base::const_iterator | iterator

## Public Member Functions

bool | empty () const
| True if range is empty. More...
bool | is_divisible () const
| True if range can be partitioned into two subranges. More...
| const_range_type (const_range_type &r, split)
| Split range. More...
| const_range_type (const concurrent_unordered_base &a_table)
| Init range with container and grainsize specified. More...
iterator | begin () const
iterator | end () const
size_type | grainsize () const
| The grain size for this range. More...
void | set_midpoint () const
| Set my_midpoint_node to point approximately half way between my_begin_node and my_end_node. More...

## Private Attributes

const concurrent_unordered_base & | my_table
raw_const_iterator | my_begin_node
raw_const_iterator | my_end_node
raw_const_iterator | my_midpoint_node

## Additional Inherited Members

Private Member Functions inherited from tbb::internal::no_assign
void | operator= (const no_assign &)=delete
| no_assign (const no_assign &)=default
| no_assign ()=default

## Detailed Description

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

Definition at line 977 of file _concurrent_unordered_impl.h.

## Member Typedef Documentation

## difference_type

template<typename Traits >

typedef concurrent_unordered_base::difference_type tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::difference_type

Definition at line 987 of file _concurrent_unordered_impl.h.

## iterator

template<typename Traits >

typedef concurrent_unordered_base::const_iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::iterator

Definition at line 988 of file _concurrent_unordered_impl.h.

## reference

template<typename Traits >

typedef concurrent_unordered_base::reference tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::reference

Definition at line 986 of file _concurrent_unordered_impl.h.

## size_type

template<typename Traits >

typedef concurrent_unordered_base::size_type tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::size_type

Type for size of a range.

Definition at line 984 of file _concurrent_unordered_impl.h.

## value_type

template<typename Traits >

typedef concurrent_unordered_base::value_type tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::value_type

Definition at line 985 of file _concurrent_unordered_impl.h.

## Constructor & Destructor Documentation

## const_range_type() [1/2]

template<typename Traits >

tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::const_range_type | ( | const_range_type & | r,
|  | split |
| ) |  |

inline

Split range.

Definition at line 998 of file _concurrent_unordered_impl.h.

:
my_table(r.my_table), my_end_node(r.my_end_node)
{
r.my_end_node = my_begin_node = r.my_midpoint_node;
__TBB_ASSERT( !empty(), "Splitting despite the range is not divisible" );
__TBB_ASSERT( !r.empty(), "Splitting despite the range is not divisible" );
set_midpoint();
r.set_midpoint();
}
__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
tbb::interface5::internal::concurrent_unordered_base::const_range_type::set_midpoint
void set_midpoint() const
Set my_midpoint_node to point approximately half way between my_begin_node and my_end_node.
Definition: _concurrent_unordered_impl.h:1020
tbb::interface5::internal::concurrent_unordered_base::const_range_type::empty
bool empty() const
True if range is empty.
Definition: _concurrent_unordered_impl.h:991
tbb::interface5::internal::concurrent_unordered_base::const_range_type::my_begin_node
raw_const_iterator my_begin_node
Definition: _concurrent_unordered_impl.h:979
tbb::interface5::internal::concurrent_unordered_base::const_range_type::my_table
const concurrent_unordered_base & my_table
Definition: _concurrent_unordered_impl.h:978
tbb::interface5::internal::concurrent_unordered_base::const_range_type::my_end_node
raw_const_iterator my_end_node
Definition: _concurrent_unordered_impl.h:980

References __TBB_ASSERT, tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::empty(), tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::my_begin_node, tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::my_end_node, tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::my_midpoint_node, and tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::set_midpoint().

Here is the call graph for this function:

## const_range_type() [2/2]

template<typename Traits >

tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::const_range_type | ( | const concurrent_unordered_base & | a_table | ) |

inline

Init range with container and grainsize specified.

Definition at line 1008 of file _concurrent_unordered_impl.h.

:
my_table(a_table), my_begin_node(a_table.my_solist.begin()),
my_end_node(a_table.my_solist.end())
{
set_midpoint();
}

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

Here is the call graph for this function:

## Member Function Documentation

## begin()

template<typename Traits >

iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::begin | ( |  | ) | const

inline

Definition at line 1014 of file _concurrent_unordered_impl.h.

{ return my_table.my_solist.get_iterator(my_begin_node); }
tbb::interface5::internal::split_ordered_list::get_iterator
iterator get_iterator(raw_iterator it)
Definition: _concurrent_unordered_impl.h:465
tbb::interface5::internal::concurrent_unordered_base::my_solist
solist_t my_solist
Definition: _concurrent_unordered_impl.h:1671

References tbb::interface5::internal::split_ordered_list< T, Allocator >::get_iterator(), tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::my_begin_node, tbb::interface5::internal::concurrent_unordered_base< Traits >::my_solist, and tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::my_table.

Referenced by tbb::interface5::internal::concurrent_unordered_base< Traits >::range_type::begin().

Here is the call graph for this function:
Here is the caller graph for this function:

## empty()

template<typename Traits >

bool tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::empty | ( |  | ) | const

inline

True if range is empty.

Definition at line 991 of file _concurrent_unordered_impl.h.

{return my_begin_node == my_end_node;}

References tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::my_begin_node, and tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::my_end_node.

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

Here is the caller graph for this function:

## end()

template<typename Traits >

iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::end | ( |  | ) | const

inline

Definition at line 1015 of file _concurrent_unordered_impl.h.

{ return my_table.my_solist.get_iterator(my_end_node); }

References tbb::interface5::internal::split_ordered_list< T, Allocator >::get_iterator(), tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::my_end_node, tbb::interface5::internal::concurrent_unordered_base< Traits >::my_solist, and tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::my_table.

Referenced by tbb::interface5::internal::concurrent_unordered_base< Traits >::range_type::end().

Here is the call graph for this function:
Here is the caller graph for this function:

## grainsize()

template<typename Traits >

size_type tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::grainsize | ( |  | ) | const

inline

The grain size for this range.

Definition at line 1017 of file _concurrent_unordered_impl.h.

{ return 1; }

## is_divisible()

template<typename Traits >

bool tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::is_divisible | ( |  | ) | const

inline

True if range can be partitioned into two subranges.

Definition at line 994 of file _concurrent_unordered_impl.h.

{
return my_midpoint_node != my_end_node;
}
tbb::interface5::internal::concurrent_unordered_base::const_range_type::my_midpoint_node
raw_const_iterator my_midpoint_node
Definition: _concurrent_unordered_impl.h:981

References tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::my_end_node, and tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::my_midpoint_node.

## set_midpoint()

template<typename Traits >

void tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::set_midpoint | ( |  | ) | const

inline

Set my_midpoint_node to point approximately half way between my_begin_node and my_end_node.

Definition at line 1020 of file _concurrent_unordered_impl.h.

{
if( my_begin_node == my_end_node ) // not divisible
my_midpoint_node = my_end_node;
else {
sokey_t begin_key = solist_t::get_safe_order_key(my_begin_node);
sokey_t end_key = solist_t::get_safe_order_key(my_end_node);
size_t mid_bucket = __TBB_ReverseBits( begin_key + (end_key-begin_key)/2 ) % my_table.my_number_of_buckets;
while ( !my_table.is_initialized(mid_bucket) ) mid_bucket = my_table.get_parent(mid_bucket);
if(__TBB_ReverseBits(mid_bucket) > begin_key) {
// found a dummy_node between begin and end
my_midpoint_node = my_table.my_solist.first_real_iterator(my_table.get_bucket( mid_bucket ));
}
else {
// didn't find a dummy node between begin and end.
my_midpoint_node = my_end_node;
}
#if TBB_USE_ASSERT
{
sokey_t mid_key = solist_t::get_safe_order_key(my_midpoint_node);
__TBB_ASSERT( begin_key < mid_key, "my_begin_node is after my_midpoint_node" );
__TBB_ASSERT( mid_key <= end_key, "my_midpoint_node is after my_end_node" );
}
#endif // TBB_USE_ASSERT
}
}
__TBB_ReverseBits
T __TBB_ReverseBits(T src)
Definition: tbb_machine.h:970
tbb::interface5::internal::sokey_t
size_t sokey_t
Definition: _concurrent_unordered_impl.h:198
tbb::interface5::internal::split_ordered_list< value_type, typename Traits::allocator_type >::get_safe_order_key
static sokey_t get_safe_order_key(const raw_const_iterator &it)
Definition: _concurrent_unordered_impl.h:458
tbb::interface5::internal::split_ordered_list::first_real_iterator
iterator first_real_iterator(raw_iterator it)
Definition: _concurrent_unordered_impl.h:489
tbb::interface5::internal::concurrent_unordered_base::my_number_of_buckets
atomic< size_type > my_number_of_buckets
Definition: _concurrent_unordered_impl.h:1670
tbb::interface5::internal::concurrent_unordered_base::get_parent
size_type get_parent(size_type bucket) const
Definition: _concurrent_unordered_impl.h:1590
tbb::interface5::internal::concurrent_unordered_base::is_initialized
bool is_initialized(size_type bucket) const
Definition: _concurrent_unordered_impl.h:1646
tbb::interface5::internal::concurrent_unordered_base::get_bucket
raw_iterator get_bucket(size_type bucket) const
Definition: _concurrent_unordered_impl.h:1614

References __TBB_ASSERT, __TBB_ReverseBits(), tbb::interface5::internal::split_ordered_list< T, Allocator >::first_real_iterator(), tbb::interface5::internal::concurrent_unordered_base< Traits >::get_bucket(), tbb::interface5::internal::concurrent_unordered_base< Traits >::get_parent(), tbb::interface5::internal::split_ordered_list< value_type, typename Traits::allocator_type >::get_safe_order_key(), tbb::interface5::internal::concurrent_unordered_base< Traits >::is_initialized(), tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::my_begin_node, tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::my_end_node, tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::my_midpoint_node, tbb::interface5::internal::concurrent_unordered_base< Traits >::my_number_of_buckets, tbb::interface5::internal::concurrent_unordered_base< Traits >::my_solist, and tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::my_table.

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

Here is the call graph for this function:
Here is the caller graph for this function:

## Member Data Documentation

## my_begin_node

template<typename Traits >

raw_const_iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::my_begin_node

private

Definition at line 979 of file _concurrent_unordered_impl.h.

Referenced by tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::begin(), tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::const_range_type(), tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::empty(), and tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::set_midpoint().

## my_end_node

template<typename Traits >

raw_const_iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::my_end_node

private

Definition at line 980 of file _concurrent_unordered_impl.h.

Referenced by tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::const_range_type(), tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::empty(), tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::end(), tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::is_divisible(), and tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::set_midpoint().

## my_midpoint_node

template<typename Traits >

raw_const_iterator tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::my_midpoint_node

mutable private

Definition at line 981 of file _concurrent_unordered_impl.h.

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

## my_table

template<typename Traits >

const concurrent_unordered_base& tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::my_table

private

Definition at line 978 of file _concurrent_unordered_impl.h.

Referenced by tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::begin(), tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::end(), and tbb::interface5::internal::concurrent_unordered_base< Traits >::const_range_type::set_midpoint().

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

- _concurrent_unordered_impl.h

Copyright © 2005-2020 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.