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

item_buffer with reservable front-end. NOTE: if reserving, do not More...

`#include <_flow_graph_item_buffer_impl.h>`

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

## Public Member Functions

| reservable_item_buffer ()
void | reset ()
Public Member Functions inherited from internal::item_buffer< T, A >
| item_buffer ()
| Constructor. More...
| ~item_buffer ()
void | reset ()

## Protected Member Functions

bool | reserve_front (T &v)
void | consume_front ()
void | release_front ()
Protected Member Functions inherited from internal::item_buffer< T, A >
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

bool | my_reserved
Protected Attributes inherited from internal::item_buffer< T, A >
buffer_item_type * | my_array
size_type | my_array_size
size_type | my_head
size_type | my_tail

## Additional Inherited Members

Public Types inherited from internal::item_buffer< T, A >
enum | buffer_item_state { no_item =0, has_item =1, reserved_item =2 }
typedef T | item_type
Protected Types inherited from internal::item_buffer< T, A >
typedef size_t | size_type
typedef aligned_pair< item_type, buffer_item_state >::type | buffer_item_type
typedef A::template rebind< buffer_item_type >::other | allocator_type
Static Protected Attributes inherited from internal::item_buffer< T, A >
static const size_type | initial_buffer_size = 4

## Detailed Description

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

item_buffer with reservable front-end. NOTE: if reserving, do not

Definition at line 248 of file _flow_graph_item_buffer_impl.h.

## Constructor & Destructor Documentation

## reservable_item_buffer()

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

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

inline

Definition at line 254 of file _flow_graph_item_buffer_impl.h.

: item_buffer<T, A>(), my_reserved(false) {}

## Member Function Documentation

## consume_front()

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

void internal::reservable_item_buffer< T, A >::consume_front | ( |  | ) |

inline protected

Definition at line 267 of file _flow_graph_item_buffer_impl.h.

{
__TBB_ASSERT(my_reserved, "Attempt to consume a non-reserved item");
this->destroy_front();
my_reserved = false;
}

References __TBB_ASSERT, internal::item_buffer< T, A >::destroy_front(), and internal::reservable_item_buffer< T, A >::my_reserved.

Referenced by tbb::flow::interface11::buffer_node< T, A >::internal_consume(), and tbb::flow::interface11::queue_node< T, A >::internal_consume().

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

## release_front()

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

void internal::reservable_item_buffer< T, A >::release_front | ( |  | ) |

inline protected

Definition at line 273 of file _flow_graph_item_buffer_impl.h.

{
__TBB_ASSERT(my_reserved, "Attempt to release a non-reserved item");
this->release_item(this->my_head);
my_reserved = false;
}

References __TBB_ASSERT, internal::item_buffer< T, A >::my_head, internal::reservable_item_buffer< T, A >::my_reserved, and internal::item_buffer< T, A >::release_item().

Referenced by tbb::flow::interface11::buffer_node< T, A >::internal_release().

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

## reserve_front()

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

bool internal::reservable_item_buffer< T, A >::reserve_front | ( | T & | v | ) |

inline protected

Definition at line 258 of file _flow_graph_item_buffer_impl.h.

{
if(my_reserved || !my_item_valid(this->my_head)) return false;
my_reserved = true;
// reserving the head
v = this->front();
this->reserve_item(this->my_head);
return true;
}

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

Referenced by tbb::flow::interface11::buffer_node< T, A >::internal_reserve(), and tbb::flow::interface11::queue_node< T, A >::internal_reserve().

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

## reset()

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

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

inline

Definition at line 255 of file _flow_graph_item_buffer_impl.h.

{my_reserved = false; item_buffer<T,A>::reset(); }

References internal::reservable_item_buffer< T, A >::my_reserved, and internal::item_buffer< T, A >::reset().

Referenced by tbb::flow::interface11::buffer_node< T, A >::reset_node().

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

## Member Data Documentation

## my_reserved

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

bool internal::reservable_item_buffer< T, A >::my_reserved

protected

Definition at line 279 of file _flow_graph_item_buffer_impl.h.

Referenced by internal::reservable_item_buffer< T, A >::consume_front(), tbb::flow::interface11::priority_queue_node< T, Compare, A >::internal_consume(), tbb::flow::interface11::buffer_node< T, A >::internal_forward_task_impl(), tbb::flow::interface11::queue_node< T, A >::internal_pop(), tbb::flow::interface11::priority_queue_node< T, Compare, A >::internal_pop(), tbb::flow::interface11::priority_queue_node< T, Compare, A >::internal_release(), tbb::flow::interface11::queue_node< T, A >::internal_reserve(), tbb::flow::interface11::priority_queue_node< T, Compare, A >::internal_reserve(), internal::reservable_item_buffer< T, A >::release_front(), internal::reservable_item_buffer< T, A >::reserve_front(), and internal::reservable_item_buffer< T, A >::reset().

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

- _flow_graph_item_buffer_impl.h

internal::item_buffer::my_item_valid
bool my_item_valid(size_type i) const
Definition: _flow_graph_item_buffer_impl.h:69
__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
internal::item_buffer::my_head
size_type my_head
Definition: _flow_graph_item_buffer_impl.h:52
internal::item_buffer::reset
void reset()
Definition: _flow_graph_item_buffer_impl.h:240
internal::item_buffer::release_item
void release_item(size_type i)
Definition: _flow_graph_item_buffer_impl.h:145
internal::reservable_item_buffer::my_reserved
bool my_reserved
Definition: _flow_graph_item_buffer_impl.h:279
internal::item_buffer::front
const item_type & front() const
Definition: _flow_graph_item_buffer_impl.h:130
internal::item_buffer::destroy_front
void destroy_front()
Definition: _flow_graph_item_buffer_impl.h:147
internal::item_buffer::reserve_item
void reserve_item(size_type i)
Definition: _flow_graph_item_buffer_impl.h:144

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.