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 397 of file _concurrent_queue_impl.h.

Member Typedef Documentation

◆ padded_page

Definition at line 616 of file _concurrent_queue_impl.h.

Constructor & Destructor Documentation

◆ concurrent_queue_iterator_rep()

Definition at line 621 of file _concurrent_queue_impl.h.

621  :
623  my_queue(queue)
624  {
625  for( size_t k=0; k<concurrent_queue_rep<T>::n_queue; ++k )
626  array[k] = queue.my_rep->array[k].head_page;
627  }
concurrent_queue_rep * my_rep
Internal representation.
concurrent_queue_base_v3< T >::page * array[concurrent_queue_rep< T >::n_queue]

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 634 of file _concurrent_queue_impl.h.

634  {
635  if( k==my_queue.my_rep->tail_counter ) {
636  item = NULL;
637  return true;
638  } else {
640  __TBB_ASSERT(p,NULL);
641  size_t i = modulo_power_of_two( k/concurrent_queue_rep<T>::n_queue, my_queue.my_rep->items_per_page );
642  item = &micro_queue<T>::get_ref(*p,i);
643  return (p->mask & uintptr_t(1)<<i)!=0;
644  }
645 }
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
Internal representation of a ConcurrentQueue.
#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
concurrent_queue_base_v3< T >::page * array[concurrent_queue_rep< T >::n_queue]
static size_t index(ticket k)
Map ticket to an array index.
static T & get_ref(page &p, size_t index)

Member Data Documentation

◆ array

Definition at line 620 of file _concurrent_queue_impl.h.

◆ head_counter

◆ my_queue

Definition at line 619 of file _concurrent_queue_impl.h.


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.