internal::item_buffer< T, A > Class Template Reference

`#include <_flow_graph_item_buffer_impl.h>`

Inheritance diagram for internal::item_buffer< T, A >:
Collaboration diagram for internal::item_buffer< T, A >:

## Public Types

enum | buffer_item_state { no_item =0 , has_item =1 , reserved_item =2 }
typedef T | item_type

## Public Member Functions

| item_buffer ()
| Constructor. More...
| ~item_buffer ()
void | reset ()

## Protected Types

typedef size_t | size_type
typedef aligned_pair< item_type, buffer_item_state >::type | buffer_item_type
typedef tbb::internal::allocator_rebind< A, buffer_item_type >::type | allocator_type

## Protected Member Functions

bool | buffer_empty () const
buffer_item_type & | item (size_type i)
const buffer_item_type & | item (size_type i) const
bool | my_item_valid (size_type i) const
bool | my_item_reserved (size_type i) const
const item_type & | get_my_item (size_t i) const
void | set_my_item (size_t i, const item_type &o)
void | fetch_item (size_t i, item_type &o)
void | move_item (size_t to, size_t from)
bool | place_item (size_t here, const item_type &me)
void | swap_items (size_t i, size_t j)
void | destroy_item (size_type i)
const item_type & | front () const
const item_type & | back () const
void | reserve_item (size_type i)
void | release_item (size_type i)
void | destroy_front ()
void | destroy_back ()
size_type | size (size_t new_tail=0)
size_type | capacity ()
bool | buffer_full ()
void | grow_my_array (size_t minimum_size)
| Grows the internal array. More...
bool | push_back (item_type &v)
bool | pop_back (item_type &v)
bool | pop_front (item_type &v)
void | clean_up_buffer (bool reset_pointers)

## Protected Attributes

buffer_item_type * | my_array
size_type | my_array_size
size_type | my_head
size_type | my_tail

## Static Protected Attributes

static const size_type | initial_buffer_size = 4

## Detailed Description

### template<typename T, typename A = cache_aligned_allocator<T>>
class internal::item_buffer< T, A >

Definition at line 40 of file _flow_graph_item_buffer_impl.h.

## Member Typedef Documentation

## allocator_type

template<typename T , typename A = cache_aligned_allocator<T>>

typedef tbb::internal::allocator_rebind<A, buffer_item_type>::type internal::item_buffer< T, A >::allocator_type

protected

Definition at line 47 of file _flow_graph_item_buffer_impl.h.

## buffer_item_type

template<typename T , typename A = cache_aligned_allocator<T>>

typedef aligned_pair<item_type, buffer_item_state>::type internal::item_buffer< T, A >::buffer_item_type

protected

Definition at line 46 of file _flow_graph_item_buffer_impl.h.

## item_type

template<typename T , typename A = cache_aligned_allocator<T>>

typedef T internal::item_buffer< T, A >::item_type

Definition at line 42 of file _flow_graph_item_buffer_impl.h.

## size_type

template<typename T , typename A = cache_aligned_allocator<T>>

typedef size_t internal::item_buffer< T, A >::size_type

protected

Definition at line 45 of file _flow_graph_item_buffer_impl.h.

## Member Enumeration Documentation

## buffer_item_state

template<typename T , typename A = cache_aligned_allocator<T>>

enum internal::item_buffer::buffer_item_state

Enumerator
no_item |
has_item |
reserved_item |

Definition at line 43 of file _flow_graph_item_buffer_impl.h.

{ no_item=0, has_item=1, reserved_item=2 };
internal::item_buffer::reserved_item
@ reserved_item
Definition: _flow_graph_item_buffer_impl.h:43
internal::item_buffer::no_item
@ no_item
Definition: _flow_graph_item_buffer_impl.h:43
internal::item_buffer::has_item
@ has_item
Definition: _flow_graph_item_buffer_impl.h:43

## Constructor & Destructor Documentation

## item_buffer()

template<typename T , typename A = cache_aligned_allocator<T>>

internal::item_buffer< T, A >::item_buffer | ( |  | ) |

inline

Constructor.

Definition at line 230 of file _flow_graph_item_buffer_impl.h.

: my_array(NULL), my_array_size(0),
my_head(0), my_tail(0) {
grow_my_array(initial_buffer_size);
}
internal::item_buffer::my_array
buffer_item_type * my_array
Definition: _flow_graph_item_buffer_impl.h:48
internal::item_buffer::initial_buffer_size
static const size_type initial_buffer_size
Definition: _flow_graph_item_buffer_impl.h:50
internal::item_buffer::my_tail
size_type my_tail
Definition: _flow_graph_item_buffer_impl.h:52
internal::item_buffer::grow_my_array
void grow_my_array(size_t minimum_size)
Grows the internal array.
Definition: _flow_graph_item_buffer_impl.h:158
internal::item_buffer::my_head
size_type my_head
Definition: _flow_graph_item_buffer_impl.h:51
internal::item_buffer::my_array_size
size_type my_array_size
Definition: _flow_graph_item_buffer_impl.h:49

References internal::item_buffer< T, A >::grow_my_array(), and internal::item_buffer< T, A >::initial_buffer_size.

Here is the call graph for this function:

## ~item_buffer()

template<typename T , typename A = cache_aligned_allocator<T>>

internal::item_buffer< T, A >::~item_buffer | ( |  | ) |

inline

Definition at line 235 of file _flow_graph_item_buffer_impl.h.

{
clean_up_buffer(/*reset_pointers*/true);
}
internal::item_buffer::clean_up_buffer
void clean_up_buffer(bool reset_pointers)
Definition: _flow_graph_item_buffer_impl.h:214

References internal::item_buffer< T, A >::clean_up_buffer().

Here is the call graph for this function:

## Member Function Documentation

## back()

template<typename T , typename A = cache_aligned_allocator<T>>

const item_type& internal::item_buffer< T, A >::back | ( |  | ) | const

inline protected

Definition at line 136 of file _flow_graph_item_buffer_impl.h.

{
__TBB_ASSERT(my_item_valid(my_tail - 1), "attempt to fetch head non-item");
return get_my_item(my_tail - 1);
}
__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
internal::item_buffer::get_my_item
const item_type & get_my_item(size_t i) const
Definition: _flow_graph_item_buffer_impl.h:72
internal::item_buffer::my_item_valid
bool my_item_valid(size_type i) const
Definition: _flow_graph_item_buffer_impl.h:68

References __TBB_ASSERT, internal::item_buffer< T, A >::get_my_item(), internal::item_buffer< T, A >::my_item_valid(), and internal::item_buffer< T, A >::my_tail.

Referenced by internal::item_buffer< T, A >::pop_back().

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

## buffer_empty()

template<typename T , typename A = cache_aligned_allocator<T>>

bool internal::item_buffer< T, A >::buffer_empty | ( |  | ) | const

inline protected

Definition at line 54 of file _flow_graph_item_buffer_impl.h.

{ return my_head == my_tail; }

References internal::item_buffer< T, A >::my_head, and internal::item_buffer< T, A >::my_tail.

Referenced by internal::queueing_port< T >::handle_operations().

Here is the caller graph for this function:

## buffer_full()

template<typename T , typename A = cache_aligned_allocator<T>>

bool internal::item_buffer< T, A >::buffer_full | ( |  | ) |

inline protected

Definition at line 155 of file _flow_graph_item_buffer_impl.h.

{ return size() >= capacity(); }
internal::item_buffer::capacity
size_type capacity()
Definition: _flow_graph_item_buffer_impl.h:152
internal::item_buffer::size
size_type size(size_t new_tail=0)
Definition: _flow_graph_item_buffer_impl.h:151

References internal::item_buffer< T, A >::capacity(), and internal::item_buffer< T, A >::size().

Referenced by internal::item_buffer< T, A >::push_back().

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

## capacity()

template<typename T , typename A = cache_aligned_allocator<T>>

size_type internal::item_buffer< T, A >::capacity | ( |  | ) |

inline protected

Definition at line 152 of file _flow_graph_item_buffer_impl.h.

{ return my_array_size; }

References internal::item_buffer< T, A >::my_array_size.

Referenced by internal::item_buffer< T, A >::buffer_full(), and internal::item_buffer< T, A >::grow_my_array().

Here is the caller graph for this function:

## clean_up_buffer()

template<typename T , typename A = cache_aligned_allocator<T>>

void internal::item_buffer< T, A >::clean_up_buffer | ( | bool | reset_pointers | ) |

inline protected

Definition at line 214 of file _flow_graph_item_buffer_impl.h.

{
if (my_array) {
for( size_type i=my_head; i<my_tail; ++i ) {
if(my_item_valid(i))
destroy_item(i);
}
allocator_type().deallocate(my_array,my_array_size);
}
my_array = NULL;
if(reset_pointers) {
my_head = my_tail = my_array_size = 0;
}
}
internal::item_buffer::destroy_item
void destroy_item(size_type i)
Definition: _flow_graph_item_buffer_impl.h:122
internal::item_buffer::size_type
size_t size_type
Definition: _flow_graph_item_buffer_impl.h:45
internal::item_buffer::allocator_type
tbb::internal::allocator_rebind< A, buffer_item_type >::type allocator_type
Definition: _flow_graph_item_buffer_impl.h:47

References internal::item_buffer< T, A >::destroy_item(), internal::item_buffer< T, A >::my_array, internal::item_buffer< T, A >::my_array_size, internal::item_buffer< T, A >::my_head, internal::item_buffer< T, A >::my_item_valid(), and internal::item_buffer< T, A >::my_tail.

Referenced by internal::item_buffer< T, A >::grow_my_array(), internal::item_buffer< T, A >::reset(), and internal::item_buffer< T, A >::~item_buffer().

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

## destroy_back()

template<typename T , typename A = cache_aligned_allocator<T>>

void internal::item_buffer< T, A >::destroy_back | ( |  | ) |

inline protected

Definition at line 147 of file _flow_graph_item_buffer_impl.h.

{ destroy_item(my_tail-1); --my_tail; }

References internal::item_buffer< T, A >::destroy_item(), and internal::item_buffer< T, A >::my_tail.

Referenced by internal::item_buffer< T, A >::pop_back().

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

## destroy_front()

template<typename T , typename A = cache_aligned_allocator<T>>

void internal::item_buffer< T, A >::destroy_front | ( |  | ) |

inline protected

Definition at line 146 of file _flow_graph_item_buffer_impl.h.

{ destroy_item(my_head); ++my_head; }

References internal::item_buffer< T, A >::destroy_item(), and internal::item_buffer< T, A >::my_head.

Referenced by internal::queueing_port< T >::handle_operations(), and internal::item_buffer< T, A >::pop_front().

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

## destroy_item()

template<typename T , typename A = cache_aligned_allocator<T>>

void internal::item_buffer< T, A >::destroy_item | ( | size_type | i | ) |

inline protected

Definition at line 122 of file _flow_graph_item_buffer_impl.h.

{
__TBB_ASSERT(my_item_valid(i), "destruction of invalid item");
(tbb::internal::punned_cast<item_type *>(&(item(i).first)))->~item_type();
item(i).second = no_item;
}
tbb::internal::first
auto first(Container &c) -> decltype(begin(c))
Definition: _range_iterator.h:34
internal::item_buffer::item_type
T item_type
Definition: _flow_graph_item_buffer_impl.h:42
internal::item_buffer::item
buffer_item_type & item(size_type i)
Definition: _flow_graph_item_buffer_impl.h:56
internal::type_plus_align::second
T2 second
Definition: _flow_graph_types_impl.h:393

References __TBB_ASSERT, tbb::internal::first(), internal::item_buffer< T, A >::item(), internal::item_buffer< T, A >::my_item_valid(), internal::item_buffer< T, A >::no_item, and internal::type_plus_align< T1, T2, REM >::second.

Referenced by internal::item_buffer< T, A >::clean_up_buffer(), internal::item_buffer< T, A >::destroy_back(), internal::item_buffer< T, A >::destroy_front(), internal::item_buffer< T, A >::fetch_item(), internal::item_buffer< T, A >::move_item(), and internal::item_buffer< T, A >::set_my_item().

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

## fetch_item()

template<typename T , typename A = cache_aligned_allocator<T>>

void internal::item_buffer< T, A >::fetch_item | ( | size_t | i,
|  | item_type & | o
| ) |  |

inline protected

Definition at line 88 of file _flow_graph_item_buffer_impl.h.

{
__TBB_ASSERT(my_item_valid(i), "Trying to fetch an empty slot");
o = get_my_item(i); // could have std::move assign semantics
destroy_item(i);
}

References __TBB_ASSERT, internal::item_buffer< T, A >::destroy_item(), internal::item_buffer< T, A >::get_my_item(), and internal::item_buffer< T, A >::my_item_valid().

Here is the call graph for this function:

## front()

template<typename T , typename A = cache_aligned_allocator<T>>

const item_type& internal::item_buffer< T, A >::front | ( |  | ) | const

inline protected

Definition at line 129 of file _flow_graph_item_buffer_impl.h.

{
__TBB_ASSERT(my_item_valid(my_head), "attempt to fetch head non-item");
return get_my_item(my_head);
}

References __TBB_ASSERT, internal::item_buffer< T, A >::get_my_item(), internal::item_buffer< T, A >::my_head, and internal::item_buffer< T, A >::my_item_valid().

Referenced by internal::function_input_queue< T, A >::front(), internal::queueing_port< T >::handle_operations(), and internal::item_buffer< T, A >::pop_front().

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

## get_my_item()

template<typename T , typename A = cache_aligned_allocator<T>>

const item_type& internal::item_buffer< T, A >::get_my_item | ( | size_t | i | ) | const

inline protected

Definition at line 72 of file _flow_graph_item_buffer_impl.h.

{
__TBB_ASSERT(my_item_valid(i),"attempt to get invalid item");
item_type *itm = (tbb::internal::punned_cast<item_type *>(&(item(i).first)));
return *(const item_type *)itm;
}

References __TBB_ASSERT, tbb::internal::first(), internal::item_buffer< T, A >::item(), and internal::item_buffer< T, A >::my_item_valid().

Referenced by internal::item_buffer< T, A >::back(), internal::item_buffer< T, A >::fetch_item(), internal::item_buffer< T, A >::front(), internal::item_buffer< T, A >::grow_my_array(), internal::item_buffer< T, A >::move_item(), and internal::item_buffer< T, A >::swap_items().

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

## grow_my_array()

template<typename T , typename A = cache_aligned_allocator<T>>

void internal::item_buffer< T, A >::grow_my_array | ( | size_t | minimum_size | ) |

inline protected

Grows the internal array.

Definition at line 158 of file _flow_graph_item_buffer_impl.h.

{
// test that we haven't made the structure inconsistent.
__TBB_ASSERT(capacity() >= my_tail - my_head, "total items exceed capacity");
size_type new_size = my_array_size ? 2*my_array_size : initial_buffer_size;
while( new_size<minimum_size )
new_size*=2;
buffer_item_type* new_array = allocator_type().allocate(new_size);
// initialize validity to "no"
for( size_type i=0; i<new_size; ++i ) { new_array[i].second = no_item; }
for( size_type i=my_head; i<my_tail; ++i) {
if(my_item_valid(i)) { // sequencer_node may have empty slots
// placement-new copy-construct; could be std::move
char *new_space = (char *)&(new_array[i&(new_size-1)].first);
(void)new(new_space) item_type(get_my_item(i));
new_array[i&(new_size-1)].second = item(i).second;
}
}
clean_up_buffer(/*reset_pointers*/false);
my_array = new_array;
my_array_size = new_size;
}
new_size
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t new_size
Definition: ittnotify_static.h:163
void
void
Definition: ittnotify_static.h:91
internal::item_buffer::buffer_item_type
aligned_pair< item_type, buffer_item_state >::type buffer_item_type
Definition: _flow_graph_item_buffer_impl.h:46

References __TBB_ASSERT, internal::item_buffer< T, A >::capacity(), internal::item_buffer< T, A >::clean_up_buffer(), internal::type_plus_align< T1, T2, REM >::first, internal::item_buffer< T, A >::get_my_item(), internal::item_buffer< T, A >::initial_buffer_size, internal::item_buffer< T, A >::item(), internal::item_buffer< T, A >::my_array, internal::item_buffer< T, A >::my_array_size, internal::item_buffer< T, A >::my_head, internal::item_buffer< T, A >::my_item_valid(), internal::item_buffer< T, A >::my_tail, new_size, internal::item_buffer< T, A >::no_item, internal::type_plus_align< T1, T2, REM >::second, and void.

Referenced by internal::item_buffer< T, A >::item_buffer(), internal::item_buffer< T, A >::push_back(), and internal::item_buffer< T, A >::reset().

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

## item() [1/2]

template<typename T , typename A = cache_aligned_allocator<T>>

buffer_item_type& internal::item_buffer< T, A >::item | ( | size_type | i | ) |

inline protected

Definition at line 56 of file _flow_graph_item_buffer_impl.h.

{
__TBB_ASSERT(!(size_type(&(my_array[i&(my_array_size-1)].second))%alignment_of<buffer_item_state>::value),NULL);
__TBB_ASSERT(!(size_type(&(my_array[i&(my_array_size-1)].first))%alignment_of<item_type>::value), NULL);
return my_array[i & (my_array_size - 1) ];
}
internal::alignment_of
Definition: _flow_graph_types_impl.h:403

References __TBB_ASSERT, tbb::internal::first(), internal::item_buffer< T, A >::my_array, and internal::item_buffer< T, A >::my_array_size.

Referenced by internal::item_buffer< T, A >::destroy_item(), internal::item_buffer< T, A >::get_my_item(), internal::item_buffer< T, A >::grow_my_array(), internal::item_buffer< T, A >::my_item_reserved(), internal::item_buffer< T, A >::my_item_valid(), internal::item_buffer< T, A >::release_item(), internal::item_buffer< T, A >::reserve_item(), and internal::item_buffer< T, A >::set_my_item().

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

## item() [2/2]

template<typename T , typename A = cache_aligned_allocator<T>>

const buffer_item_type& internal::item_buffer< T, A >::item | ( | size_type | i | ) | const

inline protected

Definition at line 62 of file _flow_graph_item_buffer_impl.h.

{
__TBB_ASSERT(!(size_type(&(my_array[i&(my_array_size-1)].second))%alignment_of<buffer_item_state>::value), NULL);
__TBB_ASSERT(!(size_type(&(my_array[i&(my_array_size-1)].first))%alignment_of<item_type>::value), NULL);
return my_array[i & (my_array_size-1)];
}

References __TBB_ASSERT, tbb::internal::first(), internal::item_buffer< T, A >::my_array, and internal::item_buffer< T, A >::my_array_size.

Here is the call graph for this function:

## move_item()

template<typename T , typename A = cache_aligned_allocator<T>>

void internal::item_buffer< T, A >::move_item | ( | size_t | to,
|  | size_t | from
| ) |  |

inline protected

Definition at line 97 of file _flow_graph_item_buffer_impl.h.

{
__TBB_ASSERT(!my_item_valid(to), "Trying to move to a non-empty slot");
__TBB_ASSERT(my_item_valid(from), "Trying to move from an empty slot");
set_my_item(to, get_my_item(from)); // could have std::move semantics
destroy_item(from);
}
internal::item_buffer::set_my_item
void set_my_item(size_t i, const item_type &o)
Definition: _flow_graph_item_buffer_impl.h:79

References __TBB_ASSERT, internal::item_buffer< T, A >::destroy_item(), internal::item_buffer< T, A >::get_my_item(), internal::item_buffer< T, A >::my_item_valid(), and internal::item_buffer< T, A >::set_my_item().

Here is the call graph for this function:

## my_item_reserved()

template<typename T , typename A = cache_aligned_allocator<T>>

bool internal::item_buffer< T, A >::my_item_reserved | ( | size_type | i | ) | const

inline protected

Definition at line 69 of file _flow_graph_item_buffer_impl.h.

{ return item(i).second == reserved_item; }

References internal::item_buffer< T, A >::item(), internal::item_buffer< T, A >::reserved_item, and internal::type_plus_align< T1, T2, REM >::second.

Referenced by internal::item_buffer< T, A >::release_item(), and internal::item_buffer< T, A >::reserve_item().

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

## my_item_valid()

template<typename T , typename A = cache_aligned_allocator<T>>

bool internal::item_buffer< T, A >::my_item_valid | ( | size_type | i | ) | const

inline protected

Definition at line 68 of file _flow_graph_item_buffer_impl.h.

{ return (i < my_tail) && (i >= my_head) && (item(i).second != no_item); }

References internal::item_buffer< T, A >::item(), internal::item_buffer< T, A >::my_head, internal::item_buffer< T, A >::my_tail, internal::item_buffer< T, A >::no_item, and internal::type_plus_align< T1, T2, REM >::second.

Referenced by internal::item_buffer< T, A >::back(), internal::item_buffer< T, A >::clean_up_buffer(), internal::item_buffer< T, A >::destroy_item(), internal::item_buffer< T, A >::fetch_item(), internal::item_buffer< T, A >::front(), internal::item_buffer< T, A >::get_my_item(), internal::item_buffer< T, A >::grow_my_array(), internal::queueing_port< T >::handle_operations(), internal::item_buffer< T, A >::move_item(), internal::item_buffer< T, A >::place_item(), internal::item_buffer< T, A >::pop_back(), internal::item_buffer< T, A >::pop_front(), internal::item_buffer< T, A >::reserve_item(), and internal::item_buffer< T, A >::swap_items().

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

## place_item()

template<typename T , typename A = cache_aligned_allocator<T>>

bool internal::item_buffer< T, A >::place_item | ( | size_t | here,
|  | const item_type & | me
| ) |  |

inline protected

Definition at line 106 of file _flow_graph_item_buffer_impl.h.

{
#if !TBB_DEPRECATED_SEQUENCER_DUPLICATES
if(my_item_valid(here)) return false;
#endif
set_my_item(here, me);
return true;
}

References internal::item_buffer< T, A >::my_item_valid(), and internal::item_buffer< T, A >::set_my_item().

Here is the call graph for this function:

## pop_back()

template<typename T , typename A = cache_aligned_allocator<T>>

bool internal::item_buffer< T, A >::pop_back | ( | item_type & | v | ) |

inline protected

Definition at line 194 of file _flow_graph_item_buffer_impl.h.

{
if (!my_item_valid(my_tail-1)) {
return false;
}
v = this->back();
destroy_back();
return true;
}
internal::item_buffer::back
const item_type & back() const
Definition: _flow_graph_item_buffer_impl.h:136
internal::item_buffer::destroy_back
void destroy_back()
Definition: _flow_graph_item_buffer_impl.h:147

References internal::item_buffer< T, A >::back(), internal::item_buffer< T, A >::destroy_back(), internal::item_buffer< T, A >::my_item_valid(), and internal::item_buffer< T, A >::my_tail.

Here is the call graph for this function:

## pop_front()

template<typename T , typename A = cache_aligned_allocator<T>>

bool internal::item_buffer< T, A >::pop_front | ( | item_type & | v | ) |

inline protected

Definition at line 203 of file _flow_graph_item_buffer_impl.h.

{
if(!my_item_valid(my_head)) {
return false;
}
v = this->front();
destroy_front();
return true;
}
internal::item_buffer::front
const item_type & front() const
Definition: _flow_graph_item_buffer_impl.h:129
internal::item_buffer::destroy_front
void destroy_front()
Definition: _flow_graph_item_buffer_impl.h:146

References internal::item_buffer< T, A >::destroy_front(), internal::item_buffer< T, A >::front(), internal::item_buffer< T, A >::my_head, and internal::item_buffer< T, A >::my_item_valid().

Here is the call graph for this function:

## push_back()

template<typename T , typename A = cache_aligned_allocator<T>>

bool internal::item_buffer< T, A >::push_back | ( | item_type & | v | ) |

inline protected

Definition at line 185 of file _flow_graph_item_buffer_impl.h.

{
if(buffer_full()) {
grow_my_array(size() + 1);
}
set_my_item(my_tail, v);
++my_tail;
return true;
}
internal::item_buffer::buffer_full
bool buffer_full()
Definition: _flow_graph_item_buffer_impl.h:155

References internal::item_buffer< T, A >::buffer_full(), internal::item_buffer< T, A >::grow_my_array(), internal::item_buffer< T, A >::my_tail, internal::item_buffer< T, A >::set_my_item(), and internal::item_buffer< T, A >::size().

Referenced by internal::queueing_port< T >::handle_operations().

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

## release_item()

template<typename T , typename A = cache_aligned_allocator<T>>

void internal::item_buffer< T, A >::release_item | ( | size_type | i | ) |

inline protected

Definition at line 144 of file _flow_graph_item_buffer_impl.h.

{ __TBB_ASSERT(my_item_reserved(i), "item is not reserved"); item(i).second = has_item; }
internal::item_buffer::my_item_reserved
bool my_item_reserved(size_type i) const
Definition: _flow_graph_item_buffer_impl.h:69

References __TBB_ASSERT, internal::item_buffer< T, A >::has_item, internal::item_buffer< T, A >::item(), internal::item_buffer< T, A >::my_item_reserved(), and internal::type_plus_align< T1, T2, REM >::second.

Here is the call graph for this function:

## reserve_item()

template<typename T , typename A = cache_aligned_allocator<T>>

void internal::item_buffer< T, A >::reserve_item | ( | size_type | i | ) |

inline protected

Definition at line 143 of file _flow_graph_item_buffer_impl.h.

{ __TBB_ASSERT(my_item_valid(i) && !my_item_reserved(i), "item cannot be reserved"); item(i).second = reserved_item; }

References __TBB_ASSERT, internal::item_buffer< T, A >::item(), internal::item_buffer< T, A >::my_item_reserved(), internal::item_buffer< T, A >::my_item_valid(), internal::item_buffer< T, A >::reserved_item, and internal::type_plus_align< T1, T2, REM >::second.

Here is the call graph for this function:

## reset()

template<typename T , typename A = cache_aligned_allocator<T>>

void internal::item_buffer< T, A >::reset | ( |  | ) |

inline

Definition at line 239 of file _flow_graph_item_buffer_impl.h.

{ clean_up_buffer(/*reset_pointers*/true); grow_my_array(initial_buffer_size); }

References internal::item_buffer< T, A >::clean_up_buffer(), internal::item_buffer< T, A >::grow_my_array(), and internal::item_buffer< T, A >::initial_buffer_size.

Referenced by internal::reservable_item_buffer< T, A >::reset(), internal::function_input_base< Input, Policy, A, ImplType >::reset_function_input_base(), and internal::queueing_port< T >::reset_receiver().

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

## set_my_item()

template<typename T , typename A = cache_aligned_allocator<T>>

void internal::item_buffer< T, A >::set_my_item | ( | size_t | i,
|  | const item_type & | o
| ) |  |

inline protected

Definition at line 79 of file _flow_graph_item_buffer_impl.h.

{
if(item(i).second != no_item) {
destroy_item(i);
}
new(&(item(i).first)) item_type(o);
item(i).second = has_item;
}
internal::type_plus_align::first
char first[sizeof(T1)]
Definition: _flow_graph_types_impl.h:392

References internal::item_buffer< T, A >::destroy_item(), internal::type_plus_align< T1, T2, REM >::first, internal::item_buffer< T, A >::has_item, internal::item_buffer< T, A >::item(), internal::item_buffer< T, A >::no_item, and internal::type_plus_align< T1, T2, REM >::second.

Referenced by internal::item_buffer< T, A >::move_item(), internal::item_buffer< T, A >::place_item(), internal::item_buffer< T, A >::push_back(), and internal::item_buffer< T, A >::swap_items().

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

## size()

template<typename T , typename A = cache_aligned_allocator<T>>

size_type internal::item_buffer< T, A >::size | ( | size_t | new_tail = `0` | ) |

inline protected

Definition at line 151 of file _flow_graph_item_buffer_impl.h.

{ return (new_tail ? new_tail : my_tail) - my_head; }

References internal::item_buffer< T, A >::my_head, and internal::item_buffer< T, A >::my_tail.

Referenced by internal::item_buffer< T, A >::buffer_full(), and internal::item_buffer< T, A >::push_back().

Here is the caller graph for this function:

## swap_items()

template<typename T , typename A = cache_aligned_allocator<T>>

void internal::item_buffer< T, A >::swap_items | ( | size_t | i,
|  | size_t | j
| ) |  |

inline protected

Definition at line 115 of file _flow_graph_item_buffer_impl.h.

{
__TBB_ASSERT(my_item_valid(i) && my_item_valid(j), "attempt to swap invalid item(s)");
item_type temp = get_my_item(i);
set_my_item(i, get_my_item(j));
set_my_item(j, temp);
}

References __TBB_ASSERT, internal::item_buffer< T, A >::get_my_item(), internal::item_buffer< T, A >::my_item_valid(), and internal::item_buffer< T, A >::set_my_item().

Here is the call graph for this function:

## Member Data Documentation

## initial_buffer_size

template<typename T , typename A = cache_aligned_allocator<T>>

const size_type internal::item_buffer< T, A >::initial_buffer_size = 4

static protected

Definition at line 50 of file _flow_graph_item_buffer_impl.h.

Referenced by internal::item_buffer< T, A >::grow_my_array(), internal::item_buffer< T, A >::item_buffer(), and internal::item_buffer< T, A >::reset().

## my_array

template<typename T , typename A = cache_aligned_allocator<T>>

buffer_item_type* internal::item_buffer< T, A >::my_array

protected

Definition at line 48 of file _flow_graph_item_buffer_impl.h.

Referenced by internal::item_buffer< T, A >::clean_up_buffer(), internal::item_buffer< T, A >::grow_my_array(), and internal::item_buffer< T, A >::item().

## my_array_size

template<typename T , typename A = cache_aligned_allocator<T>>

size_type internal::item_buffer< T, A >::my_array_size

protected

Definition at line 49 of file _flow_graph_item_buffer_impl.h.

Referenced by internal::item_buffer< T, A >::capacity(), internal::item_buffer< T, A >::clean_up_buffer(), internal::item_buffer< T, A >::grow_my_array(), and internal::item_buffer< T, A >::item().

## my_head

template<typename T , typename A = cache_aligned_allocator<T>>

size_type internal::item_buffer< T, A >::my_head

protected

Definition at line 51 of file _flow_graph_item_buffer_impl.h.

Referenced by internal::item_buffer< T, A >::buffer_empty(), internal::item_buffer< T, A >::clean_up_buffer(), internal::item_buffer< T, A >::destroy_front(), internal::item_buffer< T, A >::front(), internal::item_buffer< T, A >::grow_my_array(), internal::queueing_port< T >::handle_operations(), internal::item_buffer< T, A >::my_item_valid(), internal::item_buffer< T, A >::pop_front(), and internal::item_buffer< T, A >::size().

## my_tail

template<typename T , typename A = cache_aligned_allocator<T>>

size_type internal::item_buffer< T, A >::my_tail

protected

Definition at line 52 of file _flow_graph_item_buffer_impl.h.

Referenced by internal::item_buffer< T, A >::back(), internal::item_buffer< T, A >::buffer_empty(), internal::item_buffer< T, A >::clean_up_buffer(), internal::item_buffer< T, A >::destroy_back(), internal::item_buffer< T, A >::grow_my_array(), internal::item_buffer< T, A >::my_item_valid(), internal::item_buffer< T, A >::pop_back(), internal::item_buffer< T, A >::push_back(), and internal::item_buffer< T, A >::size().

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

- _flow_graph_item_buffer_impl.h

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.