tbb::internal::concurrent_queue_iterator_rep Class Reference
Inheritance diagram for tbb::internal::concurrent_queue_iterator_rep:
Collaboration diagram for tbb::internal::concurrent_queue_iterator_rep:

## Public Member Functions

| concurrent_queue_iterator_rep (const concurrent_queue_base &queue, size_t offset_of_last_)
bool | get_item (void *&item, size_t k)
| Set item to point to kth element. Return true if at end of queue or item is marked valid; false otherwise. More...

## Public Attributes

ticket | head_counter
const concurrent_queue_base & | my_queue
const size_t | offset_of_last
concurrent_queue_base::page * | array [concurrent_queue_rep::n_queue]

## 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

Definition at line 580 of file concurrent_queue.cpp.

## Constructor & Destructor Documentation

## concurrent_queue_iterator_rep()

tbb::internal::concurrent_queue_iterator_rep::concurrent_queue_iterator_rep | ( | const concurrent_queue_base & | queue,
|  | size_t | offset_of_last_
| ) |  |

inline

Definition at line 586 of file concurrent_queue.cpp.

:
head_counter(queue.my_rep->head_counter),
my_queue(queue),
offset_of_last(offset_of_last_)
{
const concurrent_queue_rep& rep = *queue.my_rep;
for( size_t k=0; k<concurrent_queue_rep::n_queue; ++k )
array[k] = rep.array[k].head_page;
}

References tbb::internal::concurrent_queue_rep::array, array, tbb::internal::micro_queue::head_page, tbb::internal::concurrent_queue_base_v3::my_rep, and tbb::internal::concurrent_queue_rep::n_queue.

## Member Function Documentation

## get_item()

bool tbb::internal::concurrent_queue_iterator_rep::get_item | ( | void *& | item,
|  | size_t | k
| ) |  |

inline

Set item to point to kth element. Return true if at end of queue or item is marked valid; false otherwise.

Definition at line 596 of file concurrent_queue.cpp.

{
if( k==my_queue.my_rep->tail_counter ) {
item = NULL;
return true;
} else {
concurrent_queue_base::page* p = array[concurrent_queue_rep::index(k)];
__TBB_ASSERT(p,NULL);
size_t i = modulo_power_of_two( k/concurrent_queue_rep::n_queue, my_queue.items_per_page );
item = static_cast<unsigned char*>(static_cast<void*>(p)) + offset_of_last + my_queue.item_size*i;
return (p->mask & uintptr_t(1)<<i)!=0;
}
}

References __TBB_ASSERT, array, tbb::internal::concurrent_queue_rep::index(), tbb::internal::concurrent_queue_base_v3::item_size, tbb::internal::concurrent_queue_base_v3::items_per_page, tbb::internal::modulo_power_of_two(), my_queue, tbb::internal::concurrent_queue_base_v3::my_rep, tbb::internal::concurrent_queue_rep::n_queue, offset_of_last, p, and tbb::internal::concurrent_queue_rep::tail_counter.

Referenced by tbb::internal::concurrent_queue_iterator_base_v3::advance(), and tbb::internal::concurrent_queue_iterator_base_v3::initialize().

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

## Member Data Documentation

## array

concurrent_queue_base::page* tbb::internal::concurrent_queue_iterator_rep::array[concurrent_queue_rep::n_queue]

Definition at line 585 of file concurrent_queue.cpp.

Referenced by tbb::internal::concurrent_queue_iterator_base_v3::advance(), concurrent_queue_iterator_rep(), and get_item().

## head_counter

ticket tbb::internal::concurrent_queue_iterator_rep::head_counter

Definition at line 582 of file concurrent_queue.cpp.

Referenced by tbb::internal::concurrent_queue_iterator_base_v3::advance(), and tbb::internal::concurrent_queue_iterator_base_v3::initialize().

## my_queue

const concurrent_queue_base& tbb::internal::concurrent_queue_iterator_rep::my_queue

Definition at line 583 of file concurrent_queue.cpp.

Referenced by tbb::internal::concurrent_queue_iterator_base_v3::advance(), and get_item().

## offset_of_last

const size_t tbb::internal::concurrent_queue_iterator_rep::offset_of_last

Definition at line 584 of file concurrent_queue.cpp.

Referenced by get_item().

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

- concurrent_queue.cpp

tbb::internal::concurrent_queue_iterator_rep::my_queue
const concurrent_queue_base & my_queue
Definition: concurrent_queue.cpp:583
tbb::internal::concurrent_queue_base_v3::my_rep
concurrent_queue_rep * my_rep
Internal representation.
Definition: _concurrent_queue_impl.h:829
__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
tbb::internal::concurrent_queue_rep::tail_counter
atomic< ticket > tail_counter
Definition: concurrent_queue.cpp:134
tbb::internal::concurrent_queue_iterator_rep::array
concurrent_queue_base::page * array[concurrent_queue_rep::n_queue]
Definition: concurrent_queue.cpp:585
tbb::internal::concurrent_queue_base_v3::items_per_page
size_t items_per_page
Always a power of 2.
Definition: _concurrent_queue_impl.h:847
tbb::internal::concurrent_queue_iterator_rep::offset_of_last
const size_t offset_of_last
Definition: concurrent_queue.cpp:584
tbb::internal::concurrent_queue_rep::n_queue
static const size_t n_queue
Must be power of 2.
Definition: concurrent_queue.cpp:122
tbb::internal::modulo_power_of_two
argument_integer_type modulo_power_of_two(argument_integer_type arg, divisor_integer_type divisor)
A function to compute arg modulo divisor where divisor is a power of 2.
Definition: tbb_stddef.h:382
tbb::internal::concurrent_queue_rep::index
static size_t index(ticket k)
Map ticket to an array index.
Definition: concurrent_queue.cpp:125
p
void const char const char int ITT_FORMAT __itt_group_sync p
Definition: ittnotify_static.h:91
tbb::internal::concurrent_queue_base_v3::item_size
size_t item_size
Size of an item.
Definition: _concurrent_queue_impl.h:850
tbb::internal::concurrent_queue_iterator_rep::head_counter
ticket head_counter
Definition: concurrent_queue.cpp:582

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.