tbb::internal::concurrent_queue_iterator_base_v3 Class Reference
Containers

Type-independent portion of concurrent_queue_iterator. More...

`#include <_concurrent_queue_impl.h>`

Inheritance diagram for tbb::internal::concurrent_queue_iterator_base_v3:
Collaboration diagram for tbb::internal::concurrent_queue_iterator_base_v3:

## Protected Member Functions

| concurrent_queue_iterator_base_v3 ()
| Default constructor. More...
| concurrent_queue_iterator_base_v3 (const concurrent_queue_iterator_base_v3 &i)
| Copy constructor. More...
concurrent_queue_iterator_base_v3 & | operator= (const concurrent_queue_iterator_base_v3 &i)
__TBB_EXPORTED_METHOD | concurrent_queue_iterator_base_v3 (const concurrent_queue_base_v3 &queue)
| Obsolete entry point for constructing iterator pointing to head of queue. More...
__TBB_EXPORTED_METHOD | concurrent_queue_iterator_base_v3 (const concurrent_queue_base_v3 &queue, size_t offset_of_data)
| Construct iterator pointing to head of queue. More...
void __TBB_EXPORTED_METHOD | assign (const concurrent_queue_iterator_base_v3 &i)
| Assignment. More...
void __TBB_EXPORTED_METHOD | advance ()
| Advance iterator one step towards tail of queue. More...
__TBB_EXPORTED_METHOD | ~concurrent_queue_iterator_base_v3 ()
| Destructor. More...

## Protected Attributes

void * | my_item
| Pointer to current item. More...

## Private Member Functions

void | initialize (const concurrent_queue_base_v3 &queue, size_t offset_of_data)

## Private Attributes

concurrent_queue_iterator_rep * | my_rep
| concurrent_queue over which we are iterating. More...

## Friends

template<typename C , typename T , typename U >
bool | operator== (const concurrent_queue_iterator< C, T > &i, const concurrent_queue_iterator< C, U > &j)
template<typename C , typename T , typename U >
bool | operator!= (const concurrent_queue_iterator< C, T > &i, const concurrent_queue_iterator< C, U > &j)

## Detailed Description

Type-independent portion of concurrent_queue_iterator.

Definition at line 960 of file _concurrent_queue_impl.h.

## Constructor & Destructor Documentation

## concurrent_queue_iterator_base_v3() [1/4]

tbb::internal::concurrent_queue_iterator_base_v3::concurrent_queue_iterator_base_v3 | ( |  | ) |

inline protected

Default constructor.

Definition at line 977 of file _concurrent_queue_impl.h.

: my_rep(NULL), my_item(NULL) {}
tbb::internal::concurrent_queue_iterator_base_v3::my_item
void * my_item
Pointer to current item.
Definition: _concurrent_queue_impl.h:974
tbb::internal::concurrent_queue_iterator_base_v3::my_rep
concurrent_queue_iterator_rep * my_rep
concurrent_queue over which we are iterating.
Definition: _concurrent_queue_impl.h:963

## concurrent_queue_iterator_base_v3() [2/4]

tbb::internal::concurrent_queue_iterator_base_v3::concurrent_queue_iterator_base_v3 | ( | const concurrent_queue_iterator_base_v3 & | i | ) |

inline protected

Copy constructor.

Definition at line 980 of file _concurrent_queue_impl.h.

: my_rep(NULL), my_item(NULL) {
assign(i);
}
tbb::internal::concurrent_queue_iterator_base_v3::assign
void __TBB_EXPORTED_METHOD assign(const concurrent_queue_iterator_base_v3 &i)
Assignment.
Definition: concurrent_queue.cpp:629

References tbb::strict_ppl::internal::concurrent_queue_iterator_base_v3< Value >::assign().

Here is the call graph for this function:

## concurrent_queue_iterator_base_v3() [3/4]

tbb::internal::concurrent_queue_iterator_base_v3::concurrent_queue_iterator_base_v3 | ( | const concurrent_queue_base_v3 & | queue | ) |

protected

Obsolete entry point for constructing iterator pointing to head of queue.

Does not work correctly for SSE types.

Definition at line 621 of file concurrent_queue.cpp.

{
initialize(queue,0);
}
tbb::internal::concurrent_queue_iterator_base_v3::initialize
void initialize(const concurrent_queue_base_v3 &queue, size_t offset_of_data)
Definition: concurrent_queue.cpp:614

References initialize().

Here is the call graph for this function:

## concurrent_queue_iterator_base_v3() [4/4]

tbb::internal::concurrent_queue_iterator_base_v3::concurrent_queue_iterator_base_v3 | ( | const concurrent_queue_base_v3 & | queue,
|  | size_t | offset_of_data
| ) |  |

protected

Construct iterator pointing to head of queue.

Definition at line 625 of file concurrent_queue.cpp.

{
initialize(queue,offset_of_last);
}

References initialize().

Here is the call graph for this function:

## ~concurrent_queue_iterator_base_v3()

tbb::internal::concurrent_queue_iterator_base_v3::~concurrent_queue_iterator_base_v3 | ( |  | ) |

protected

Destructor.

Definition at line 662 of file concurrent_queue.cpp.

{
//delete my_rep;
cache_aligned_allocator<concurrent_queue_iterator_rep>().deallocate(my_rep, 1);
my_rep = NULL;
}

References tbb::cache_aligned_allocator< T >::deallocate(), and my_rep.

Here is the call graph for this function:

## Member Function Documentation

## advance()

void tbb::internal::concurrent_queue_iterator_base_v3::advance | ( |  | ) |

protected

Advance iterator one step towards tail of queue.

Definition at line 643 of file concurrent_queue.cpp.

{
__TBB_ASSERT( my_item, "attempt to increment iterator past end of queue" );
size_t k = my_rep->head_counter;
const concurrent_queue_base& queue = my_rep->my_queue;
#if TBB_USE_ASSERT
void* tmp;
my_rep->get_item(tmp,k);
__TBB_ASSERT( my_item==tmp, NULL );
#endif /* TBB_USE_ASSERT */
size_t i = modulo_power_of_two( k/concurrent_queue_rep::n_queue, queue.items_per_page );
if( i==queue.items_per_page-1 ) {
concurrent_queue_base::page*& root = my_rep->array[concurrent_queue_rep::index(k)];
root = root->next;
}
// advance k
my_rep->head_counter = ++k;
if( !my_rep->get_item(my_item, k) ) advance();
}
__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
tbb::internal::concurrent_queue_base
concurrent_queue_base_v3 concurrent_queue_base
Definition: concurrent_queue.cpp:40
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_base_v3::page::next
page * next
Definition: _concurrent_queue_impl.h:839
tbb::internal::concurrent_queue_iterator_base_v3::advance
void __TBB_EXPORTED_METHOD advance()
Advance iterator one step towards tail of queue.
Definition: concurrent_queue.cpp:643
tbb::internal::concurrent_queue_rep::index
static size_t index(ticket k)
Map ticket to an array index.
Definition: concurrent_queue.cpp:125
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::concurrent_queue_iterator_rep::get_item
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 other...
Definition: concurrent_queue.cpp:596
tbb::internal::concurrent_queue_iterator_rep::my_queue
const concurrent_queue_base & my_queue
Definition: concurrent_queue.cpp:583
tbb::internal::concurrent_queue_iterator_rep::head_counter
ticket head_counter
Definition: concurrent_queue.cpp:582
tbb::internal::concurrent_queue_iterator_rep::array
concurrent_queue_base::page * array[concurrent_queue_rep::n_queue]
Definition: concurrent_queue.cpp:585

References __TBB_ASSERT, tbb::internal::concurrent_queue_iterator_rep::array, tbb::internal::concurrent_queue_iterator_rep::get_item(), tbb::internal::concurrent_queue_iterator_rep::head_counter, tbb::internal::concurrent_queue_rep::index(), tbb::internal::concurrent_queue_base_v3::items_per_page, tbb::internal::modulo_power_of_two(), my_item, tbb::internal::concurrent_queue_iterator_rep::my_queue, my_rep, tbb::internal::concurrent_queue_rep::n_queue, and tbb::internal::concurrent_queue_base_v3::page::next.

Referenced by initialize().

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

## assign()

void tbb::internal::concurrent_queue_iterator_base_v3::assign | ( | const concurrent_queue_iterator_base_v3 & | i | ) |

protected

Assignment.

Definition at line 629 of file concurrent_queue.cpp.

{
if( my_rep!=other.my_rep ) {
if( my_rep ) {
cache_aligned_allocator<concurrent_queue_iterator_rep>().deallocate(my_rep, 1);
my_rep = NULL;
}
if( other.my_rep ) {
my_rep = cache_aligned_allocator<concurrent_queue_iterator_rep>().allocate(1);
new( my_rep ) concurrent_queue_iterator_rep( *other.my_rep );
}
}
my_item = other.my_item;
}

References tbb::cache_aligned_allocator< T >::allocate(), tbb::cache_aligned_allocator< T >::deallocate(), my_item, and my_rep.

Here is the call graph for this function:

## initialize()

void tbb::internal::concurrent_queue_iterator_base_v3::initialize | ( | const concurrent_queue_base_v3 & | queue,
|  | size_t | offset_of_data
| ) |  |

private

Definition at line 614 of file concurrent_queue.cpp.

{
my_rep = cache_aligned_allocator<concurrent_queue_iterator_rep>().allocate(1);
new( my_rep ) concurrent_queue_iterator_rep(queue,offset_of_last);
size_t k = my_rep->head_counter;
if( !my_rep->get_item(my_item, k) ) advance();
}

References advance(), tbb::cache_aligned_allocator< T >::allocate(), tbb::internal::concurrent_queue_iterator_rep::get_item(), tbb::internal::concurrent_queue_iterator_rep::head_counter, my_item, and my_rep.

Referenced by concurrent_queue_iterator_base_v3().

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

## operator=()

concurrent_queue_iterator_base_v3& tbb::internal::concurrent_queue_iterator_base_v3::operator= | ( | const concurrent_queue_iterator_base_v3 & | i | ) |

inline protected

Definition at line 984 of file _concurrent_queue_impl.h.

{
assign(i);
return *this;
}

References tbb::strict_ppl::internal::concurrent_queue_iterator_base_v3< Value >::assign().

Here is the call graph for this function:

## Friends And Related Function Documentation

## operator!=

template<typename C , typename T , typename U >

bool operator!= | ( | const concurrent_queue_iterator< C, T > & | i,
|  | const concurrent_queue_iterator< C, U > & | j
| ) |  |

friend

Definition at line 1071 of file _concurrent_queue_impl.h.

{
return i.my_item!=j.my_item;
}

## operator==

template<typename C , typename T , typename U >

bool operator== | ( | const concurrent_queue_iterator< C, T > & | i,
|  | const concurrent_queue_iterator< C, U > & | j
| ) |  |

friend

Definition at line 1066 of file _concurrent_queue_impl.h.

{
return i.my_item==j.my_item;
}

## Member Data Documentation

## my_item

void* tbb::internal::concurrent_queue_iterator_base_v3::my_item

protected

Pointer to current item.

Definition at line 974 of file _concurrent_queue_impl.h.

Referenced by advance(), assign(), and initialize().

## my_rep

concurrent_queue_iterator_rep* tbb::internal::concurrent_queue_iterator_base_v3::my_rep

private

concurrent_queue over which we are iterating.

NULL if one past last element in queue.

Definition at line 963 of file _concurrent_queue_impl.h.

Referenced by advance(), assign(), initialize(), and ~concurrent_queue_iterator_base_v3().

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

- _concurrent_queue_impl.h
- concurrent_queue.cpp

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.