tbb::interface5::internal::hash_map_range< Iterator > Class Template Reference
Containers

Range class used with concurrent_hash_map. More...

`#include <concurrent_hash_map.h>`

Collaboration diagram for tbb::interface5::internal::hash_map_range< Iterator >:

## Public Types

typedef std::size_t | size_type
| Type for size of a range. More...
typedef Iterator::value_type | value_type
typedef Iterator::reference | reference
typedef Iterator::difference_type | difference_type
typedef 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...
| hash_map_range (hash_map_range &r, split)
| Split range. More...
template<typename U >
| hash_map_range (hash_map_range< U > &r)
| type conversion More...
| hash_map_range (const map_type &map, size_type grainsize_=1)
| Init range with container and grainsize specified. More...
const Iterator & | begin () const
const Iterator & | end () const
size_type | grainsize () const
| The grain size for this range. More...

## Private Types

typedef Iterator::map_type | map_type

## Private Member Functions

void | set_midpoint () const
| Set my_midpoint to point approximately half way between my_begin and my_end. More...

## Private Attributes

Iterator | my_begin
Iterator | my_end
Iterator | my_midpoint
size_t | my_grainsize

## Friends

template<typename U >
class | hash_map_range

## Detailed Description

### template<typename Iterator>
class tbb::interface5::internal::hash_map_range< Iterator >

Range class used with concurrent_hash_map.

Definition at line 340 of file concurrent_hash_map.h.

## Member Typedef Documentation

## difference_type

template<typename Iterator >

typedef Iterator::difference_type tbb::interface5::internal::hash_map_range< Iterator >::difference_type

Definition at line 482 of file concurrent_hash_map.h.

## iterator

template<typename Iterator >

typedef Iterator tbb::interface5::internal::hash_map_range< Iterator >::iterator

Definition at line 483 of file concurrent_hash_map.h.

## map_type

template<typename Iterator >

typedef Iterator::map_type tbb::interface5::internal::hash_map_range< Iterator >::map_type

private

Definition at line 469 of file concurrent_hash_map.h.

## reference

template<typename Iterator >

typedef Iterator::reference tbb::interface5::internal::hash_map_range< Iterator >::reference

Definition at line 481 of file concurrent_hash_map.h.

## size_type

template<typename Iterator >

typedef std::size_t tbb::interface5::internal::hash_map_range< Iterator >::size_type

Type for size of a range.

Definition at line 479 of file concurrent_hash_map.h.

## value_type

template<typename Iterator >

typedef Iterator::value_type tbb::interface5::internal::hash_map_range< Iterator >::value_type

Definition at line 480 of file concurrent_hash_map.h.

## Constructor & Destructor Documentation

## hash_map_range() [1/3]

template<typename Iterator >

tbb::interface5::internal::hash_map_range< Iterator >::hash_map_range | ( | hash_map_range< Iterator > & | r,
|  | split |
| ) |  |

inline

Split range.

Definition at line 493 of file concurrent_hash_map.h.

:
my_end(r.my_end),
my_grainsize(r.my_grainsize)
{
r.my_end = my_begin = r.my_midpoint;
__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();
}

References __TBB_ASSERT, tbb::interface5::internal::hash_map_range< Iterator >::empty(), tbb::interface5::internal::hash_map_range< Iterator >::my_begin, and tbb::interface5::internal::hash_map_range< Iterator >::set_midpoint().

Here is the call graph for this function:

## hash_map_range() [2/3]

template<typename Iterator >
template<typename U >

tbb::interface5::internal::hash_map_range< Iterator >::hash_map_range | ( | hash_map_range< U > & | r | ) |

inline

type conversion

Definition at line 505 of file concurrent_hash_map.h.

:
my_begin(r.my_begin),
my_end(r.my_end),
my_midpoint(r.my_midpoint),
my_grainsize(r.my_grainsize)
{}

## hash_map_range() [3/3]

template<typename Iterator >

tbb::interface5::internal::hash_map_range< Iterator >::hash_map_range | ( | const map_type & | map,
|  | size_type | grainsize_ = `1`
| ) |  |

inline

Init range with container and grainsize specified.

Definition at line 512 of file concurrent_hash_map.h.

:
my_begin( Iterator( map, 0, map.my_embedded_segment, map.my_embedded_segment->node_list ) ),
my_end( Iterator( map, map.my_mask + 1, 0, 0 ) ),
my_grainsize( grainsize_ )
{
__TBB_ASSERT( grainsize_>0, "grainsize must be positive" );
set_midpoint();
}

References __TBB_ASSERT, and tbb::interface5::internal::hash_map_range< Iterator >::set_midpoint().

Here is the call graph for this function:

## Member Function Documentation

## begin()

template<typename Iterator >

const Iterator& tbb::interface5::internal::hash_map_range< Iterator >::begin | ( |  | ) | const

inline

Definition at line 520 of file concurrent_hash_map.h.

{return my_begin;}

References tbb::interface5::internal::hash_map_range< Iterator >::my_begin.

## empty()

template<typename Iterator >

bool tbb::interface5::internal::hash_map_range< Iterator >::empty | ( |  | ) | const

inline

True if range is empty.

Definition at line 486 of file concurrent_hash_map.h.

{return my_begin==my_end;}

References tbb::interface5::internal::hash_map_range< Iterator >::my_begin, and tbb::interface5::internal::hash_map_range< Iterator >::my_end.

Referenced by tbb::interface5::internal::hash_map_range< Iterator >::hash_map_range().

Here is the caller graph for this function:

## end()

template<typename Iterator >

const Iterator& tbb::interface5::internal::hash_map_range< Iterator >::end | ( |  | ) | const

inline

Definition at line 521 of file concurrent_hash_map.h.

{return my_end;}

References tbb::interface5::internal::hash_map_range< Iterator >::my_end.

## grainsize()

template<typename Iterator >

size_type tbb::interface5::internal::hash_map_range< Iterator >::grainsize | ( |  | ) | const

inline

The grain size for this range.

Definition at line 523 of file concurrent_hash_map.h.

{return my_grainsize;}

References tbb::interface5::internal::hash_map_range< Iterator >::my_grainsize.

## is_divisible()

template<typename Iterator >

bool tbb::interface5::internal::hash_map_range< Iterator >::is_divisible | ( |  | ) | const

inline

True if range can be partitioned into two subranges.

Definition at line 489 of file concurrent_hash_map.h.

{
return my_midpoint!=my_end;
}

References tbb::interface5::internal::hash_map_range< Iterator >::my_end, and tbb::interface5::internal::hash_map_range< Iterator >::my_midpoint.

## set_midpoint()

template<typename Iterator >

void tbb::interface5::internal::hash_map_range< Iterator >::set_midpoint | ( |  | ) | const

private

Set my_midpoint to point approximately half way between my_begin and my_end.

Definition at line 527 of file concurrent_hash_map.h.

{
// Split by groups of nodes
size_t m = my_end.my_index-my_begin.my_index;
if( m > my_grainsize ) {
m = my_begin.my_index + m/2u;
hash_map_base::bucket *b = my_begin.my_map->get_bucket(m);
my_midpoint = Iterator(*my_begin.my_map,m,b,b->node_list);
} else {
my_midpoint = my_end;
}
__TBB_ASSERT( my_begin.my_index <= my_midpoint.my_index,
"my_begin is after my_midpoint" );
__TBB_ASSERT( my_midpoint.my_index <= my_end.my_index,
"my_midpoint is after my_end" );
__TBB_ASSERT( my_begin != my_midpoint || my_begin == my_end,
"[my_begin, my_midpoint) range should not be empty" );
}

References __TBB_ASSERT, and tbb::interface5::internal::hash_map_base::bucket::node_list.

Referenced by tbb::interface5::internal::hash_map_range< Iterator >::hash_map_range().

Here is the caller graph for this function:

## Friends And Related Function Documentation

## hash_map_range

template<typename Iterator >
template<typename U >

friend class hash_map_range

friend

Definition at line 476 of file concurrent_hash_map.h.

## Member Data Documentation

## my_begin

template<typename Iterator >

Iterator tbb::interface5::internal::hash_map_range< Iterator >::my_begin

private

Definition at line 470 of file concurrent_hash_map.h.

Referenced by tbb::interface5::internal::hash_map_range< Iterator >::begin(), tbb::interface5::internal::hash_map_range< Iterator >::empty(), and tbb::interface5::internal::hash_map_range< Iterator >::hash_map_range().

## my_end

template<typename Iterator >

Iterator tbb::interface5::internal::hash_map_range< Iterator >::my_end

private

Definition at line 471 of file concurrent_hash_map.h.

Referenced by tbb::interface5::internal::hash_map_range< Iterator >::empty(), tbb::interface5::internal::hash_map_range< Iterator >::end(), and tbb::interface5::internal::hash_map_range< Iterator >::is_divisible().

## my_grainsize

template<typename Iterator >

size_t tbb::interface5::internal::hash_map_range< Iterator >::my_grainsize

private

Definition at line 473 of file concurrent_hash_map.h.

Referenced by tbb::interface5::internal::hash_map_range< Iterator >::grainsize().

## my_midpoint

template<typename Iterator >

Iterator tbb::interface5::internal::hash_map_range< Iterator >::my_midpoint

mutable private

Definition at line 472 of file concurrent_hash_map.h.

Referenced by tbb::interface5::internal::hash_map_range< Iterator >::is_divisible().

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

- concurrent_hash_map.h

__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
tbb::interface5::internal::hash_map_range::my_midpoint
Iterator my_midpoint
Definition: concurrent_hash_map.h:472
tbb::interface5::internal::hash_map_range::my_end
Iterator my_end
Definition: concurrent_hash_map.h:471
tbb::interface5::internal::hash_map_range::my_begin
Iterator my_begin
Definition: concurrent_hash_map.h:470
tbb::interface5::internal::hash_map_range::empty
bool empty() const
True if range is empty.
Definition: concurrent_hash_map.h:486
tbb::interface5::internal::hash_map_range::set_midpoint
void set_midpoint() const
Set my_midpoint to point approximately half way between my_begin and my_end.
Definition: concurrent_hash_map.h:527
tbb::interface5::internal::hash_map_range::my_grainsize
size_t my_grainsize
Definition: concurrent_hash_map.h:473

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.