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

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

586  :
587  head_counter(queue.my_rep->head_counter),
588  my_queue(queue),
589  offset_of_last(offset_of_last_)
590  {
591  const concurrent_queue_rep& rep = *queue.my_rep;
592  for( size_t k=0; k<concurrent_queue_rep::n_queue; ++k )
593  array[k] = rep.array[k].head_page;
594  }
static const size_t n_queue
Must be power of 2.
concurrent_queue_base::page * array[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.

References __TBB_ASSERT, 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::concurrent_queue_base_v3::page::mask, tbb::internal::modulo_power_of_two(), tbb::internal::concurrent_queue_base_v3::my_rep, tbb::internal::concurrent_queue_rep::n_queue, p, and tbb::internal::concurrent_queue_rep::tail_counter.

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

◆ 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

Definition at line 583 of file concurrent_queue.cpp.

◆ offset_of_last

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

Definition at line 584 of file concurrent_queue.cpp.


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.