Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
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_basemy_queue
 
const size_t offset_of_last
 
concurrent_queue_base::pagearray [concurrent_queue_rep::n_queue]
 

Detailed Description

Definition at line 584 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 590 of file concurrent_queue.cpp.

590  :
591  head_counter(queue.my_rep->head_counter),
592  my_queue(queue),
593  offset_of_last(offset_of_last_)
594  {
595  const concurrent_queue_rep& rep = *queue.my_rep;
596  for( size_t k=0; k<concurrent_queue_rep::n_queue; ++k )
597  array[k] = rep.array[k].head_page;
598  }
static const size_t n_queue
Must be power of 2.
concurrent_queue_base::page * array[concurrent_queue_rep::n_queue]

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 600 of file concurrent_queue.cpp.

600  {
601  if( k==my_queue.my_rep->tail_counter ) {
602  item = NULL;
603  return true;
604  } else {
605  concurrent_queue_base::page* p = array[concurrent_queue_rep::index(k)];
606  __TBB_ASSERT(p,NULL);
608  item = static_cast<unsigned char*>(static_cast<void*>(p)) + offset_of_last + my_queue.item_size*i;
609  return (p->mask & uintptr_t(1)<<i)!=0;
610  }
611  }
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:365
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:169
void const char const char int ITT_FORMAT __itt_group_sync p
static size_t index(ticket k)
Map ticket to an array index.
static const size_t n_queue
Must be power of 2.
concurrent_queue_rep * my_rep
Internal representation.
concurrent_queue_base::page * array[concurrent_queue_rep::n_queue]

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

◆ head_counter

ticket tbb::internal::concurrent_queue_iterator_rep::head_counter

◆ my_queue

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

◆ offset_of_last

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

Definition at line 588 of file concurrent_queue.cpp.

Referenced by get_item().


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.