Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::strict_ppl::internal::concurrent_queue_iterator_rep< T > Class Template Reference

#include <_concurrent_queue_impl.h>

Inheritance diagram for tbb::strict_ppl::internal::concurrent_queue_iterator_rep< T >:
Collaboration diagram for tbb::strict_ppl::internal::concurrent_queue_iterator_rep< T >:

Public Member Functions

 concurrent_queue_iterator_rep (const concurrent_queue_base_v3< T > &queue)
 
bool get_item (T *&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_v3< T > & my_queue
 
concurrent_queue_base_v3< T >::page * array [concurrent_queue_rep< T >::n_queue]
 

Private Types

typedef micro_queue< T >::padded_page padded_page
 

Detailed Description

template<typename T>
class tbb::strict_ppl::internal::concurrent_queue_iterator_rep< T >

Definition at line 393 of file _concurrent_queue_impl.h.

Member Typedef Documentation

◆ padded_page

Definition at line 612 of file _concurrent_queue_impl.h.

Constructor & Destructor Documentation

◆ concurrent_queue_iterator_rep()

Definition at line 617 of file _concurrent_queue_impl.h.

617  :
619  my_queue(queue)
620  {
621  for( size_t k=0; k<concurrent_queue_rep<T>::n_queue; ++k )
622  array[k] = queue.my_rep->array[k].head_page;
623  }

Member Function Documentation

◆ get_item()

template<typename T >
bool tbb::strict_ppl::internal::concurrent_queue_iterator_rep< T >::get_item ( T *&  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.

Definition at line 630 of file _concurrent_queue_impl.h.

630  {
631  if( k==my_queue.my_rep->tail_counter ) {
632  item = NULL;
633  return true;
634  } else {
636  __TBB_ASSERT(p,NULL);
637  size_t i = modulo_power_of_two( k/concurrent_queue_rep<T>::n_queue, my_queue.my_rep->items_per_page );
638  item = &micro_queue<T>::get_ref(*p,i);
639  return (p->mask & uintptr_t(1)<<i)!=0;
640  }
641 }

Member Data Documentation

◆ array

Definition at line 616 of file _concurrent_queue_impl.h.

◆ head_counter

◆ my_queue

Definition at line 615 of file _concurrent_queue_impl.h.


The documentation for this class was generated from the following file:
tbb::internal::concurrent_queue_base_v3::my_rep
concurrent_queue_rep * my_rep
Internal representation.
Definition: _concurrent_queue_impl.h:829
tbb::strict_ppl::internal::micro_queue::get_ref
static T & get_ref(page &p, size_t index)
Definition: _concurrent_queue_impl.h:176
__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
tbb::strict_ppl::internal::concurrent_queue_iterator_rep::my_queue
const concurrent_queue_base_v3< T > & my_queue
Definition: _concurrent_queue_impl.h:615
tbb::internal::concurrent_queue_base_v3::page
Prefix on a page.
Definition: _concurrent_queue_impl.h:838
tbb::strict_ppl::internal::concurrent_queue_rep::index
static size_t index(ticket k)
Map ticket to an array index.
Definition: _concurrent_queue_impl.h:405
tbb::strict_ppl::internal::concurrent_queue_iterator_rep::array
concurrent_queue_base_v3< T >::page * array[concurrent_queue_rep< T >::n_queue]
Definition: _concurrent_queue_impl.h:616
tbb::strict_ppl::internal::concurrent_queue_iterator_rep::head_counter
ticket head_counter
Definition: _concurrent_queue_impl.h:614
tbb::internal::concurrent_queue_rep::head_counter
atomic< ticket > head_counter
Definition: concurrent_queue.cpp:129
tbb::internal::concurrent_queue_rep
Internal representation of a ConcurrentQueue.
Definition: concurrent_queue.cpp:112
tbb::internal::concurrent_queue_rep::array
micro_queue array[n_queue]
Definition: concurrent_queue.cpp:137
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::micro_queue::head_page
atomic< page * > head_page
Definition: concurrent_queue.cpp:52
p
void const char const char int ITT_FORMAT __itt_group_sync p
Definition: ittnotify_static.h:91

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.