Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::flow::interface11::internal::item_buffer< T, A > Class Template Reference

#include <flow_graph.h>

Inheritance diagram for tbb::flow::interface11::internal::item_buffer< T, A >:
Collaboration diagram for tbb::flow::interface11::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_typeitem (size_type i)
 
const buffer_item_typeitem (size_type i) const
 
bool my_item_valid (size_type i) const
 
bool my_item_reserved (size_type i) const
 
const item_typeget_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_typefront () const
 
const item_typeback () 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_typemy_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 tbb::flow::interface11::internal::item_buffer< T, A >

Definition at line 41 of file flow_graph.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 tbb::flow::interface11::internal::item_buffer< T, A >::allocator_type
protected

Definition at line 48 of file flow_graph.h.

◆ buffer_item_type

template<typename T, typename A = cache_aligned_allocator<T>>
typedef aligned_pair<item_type, buffer_item_state>::type tbb::flow::interface11::internal::item_buffer< T, A >::buffer_item_type
protected

Definition at line 47 of file flow_graph.h.

◆ item_type

template<typename T, typename A = cache_aligned_allocator<T>>
typedef T tbb::flow::interface11::internal::item_buffer< T, A >::item_type

Definition at line 43 of file flow_graph.h.

◆ size_type

template<typename T, typename A = cache_aligned_allocator<T>>
typedef size_t tbb::flow::interface11::internal::item_buffer< T, A >::size_type
protected

Definition at line 46 of file flow_graph.h.

Member Enumeration Documentation

◆ buffer_item_state

template<typename T, typename A = cache_aligned_allocator<T>>
enum tbb::flow::interface11::internal::item_buffer::buffer_item_state
Enumerator
no_item 
has_item 
reserved_item 

Definition at line 44 of file flow_graph.h.

Constructor & Destructor Documentation

◆ item_buffer()

template<typename T, typename A = cache_aligned_allocator<T>>
tbb::flow::interface11::internal::item_buffer< T, A >::item_buffer ( )
inline

Constructor.

Definition at line 231 of file flow_graph.h.

232  {
233  return static_cast<void*>(&t);
234  }

◆ ~item_buffer()

template<typename T, typename A = cache_aligned_allocator<T>>
tbb::flow::interface11::internal::item_buffer< T, A >::~item_buffer ( )
inline

Definition at line 236 of file flow_graph.h.

236  {
237  return *static_cast<const T*>(p);
238  }
void const char const char int ITT_FORMAT __itt_group_sync p

Member Function Documentation

◆ back()

template<typename T, typename A = cache_aligned_allocator<T>>
const item_type& tbb::flow::interface11::internal::item_buffer< T, A >::back ( ) const
inlineprotected

Definition at line 137 of file flow_graph.h.

144  {

◆ buffer_empty()

template<typename T, typename A = cache_aligned_allocator<T>>
bool tbb::flow::interface11::internal::item_buffer< T, A >::buffer_empty ( ) const
inlineprotected

Definition at line 55 of file flow_graph.h.

◆ buffer_full()

template<typename T, typename A = cache_aligned_allocator<T>>
bool tbb::flow::interface11::internal::item_buffer< T, A >::buffer_full ( )
inlineprotected

Definition at line 156 of file flow_graph.h.

162 {

◆ capacity()

template<typename T, typename A = cache_aligned_allocator<T>>
size_type tbb::flow::interface11::internal::item_buffer< T, A >::capacity ( )
inlineprotected

Definition at line 153 of file flow_graph.h.

153 {

◆ clean_up_buffer()

template<typename T, typename A = cache_aligned_allocator<T>>
void tbb::flow::interface11::internal::item_buffer< T, A >::clean_up_buffer ( bool  reset_pointers)
inlineprotected

Definition at line 215 of file flow_graph.h.

217  {
218 
219 template < typename T > class async_storage;
220 
221 template< typename T, typename = void >
222 struct async_helpers {
223  typedef async_msg<T> async_type;
224  typedef T filtered_type;
225 
226  static const bool is_async_type = false;
227 

◆ destroy_back()

template<typename T, typename A = cache_aligned_allocator<T>>
void tbb::flow::interface11::internal::item_buffer< T, A >::destroy_back ( )
inlineprotected

Definition at line 148 of file flow_graph.h.

149 {

◆ destroy_front()

template<typename T, typename A = cache_aligned_allocator<T>>
void tbb::flow::interface11::internal::item_buffer< T, A >::destroy_front ( )
inlineprotected

Definition at line 147 of file flow_graph.h.

149 {

◆ destroy_item()

template<typename T, typename A = cache_aligned_allocator<T>>
void tbb::flow::interface11::internal::item_buffer< T, A >::destroy_item ( size_type  i)
inlineprotected

Definition at line 123 of file flow_graph.h.

124  {
125 
126 template<typename T, typename M> class successor_cache;
127 template<typename T, typename M> class broadcast_cache;

◆ fetch_item()

template<typename T, typename A = cache_aligned_allocator<T>>
void tbb::flow::interface11::internal::item_buffer< T, A >::fetch_item ( size_t  i,
item_type o 
)
inlineprotected

Definition at line 89 of file flow_graph.h.

101  {

◆ front()

template<typename T, typename A = cache_aligned_allocator<T>>
const item_type& tbb::flow::interface11::internal::item_buffer< T, A >::front ( ) const
inlineprotected

Definition at line 130 of file flow_graph.h.

133  {
134 struct following;

◆ get_my_item()

template<typename T, typename A = cache_aligned_allocator<T>>
const item_type& tbb::flow::interface11::internal::item_buffer< T, A >::get_my_item ( size_t  i) const
inlineprotected

Definition at line 73 of file flow_graph.h.

76  {
77  namespace flow {

◆ grow_my_array()

template<typename T, typename A = cache_aligned_allocator<T>>
void tbb::flow::interface11::internal::item_buffer< T, A >::grow_my_array ( size_t  minimum_size)
inlineprotected

Grows the internal array.

Definition at line 159 of file flow_graph.h.

162  {
163  v = built_edges;
164  }
165 
166  size_t edge_count() {
167  return (size_t)(built_edges.size());
168  }
169 
170  void clear() {
171  built_edges.clear();
172  }
173 
174  // methods remove the statement from all predecessors/successors liste in the edge
175  // container.
176  template< typename S > void sender_extract(S &s);
177  template< typename R > void receiver_extract(R &r);
178 
179 private:
180  edge_list_type built_edges;
181 }; // class edge_container
182 #endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
183 
184 } // namespace internal
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 int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle __itt_metadata_type size_t void ITT_FORMAT p const __itt_domain __itt_id __itt_string_handle const wchar_t size_t ITT_FORMAT lu const __itt_domain __itt_id __itt_relation __itt_id ITT_FORMAT p const wchar_t int ITT_FORMAT __itt_group_mark S
void const char const char int ITT_FORMAT __itt_group_sync s

◆ item() [1/2]

template<typename T, typename A = cache_aligned_allocator<T>>
buffer_item_type& tbb::flow::interface11::internal::item_buffer< T, A >::item ( size_type  i)
inlineprotected

Definition at line 57 of file flow_graph.h.

◆ item() [2/2]

template<typename T, typename A = cache_aligned_allocator<T>>
const buffer_item_type& tbb::flow::interface11::internal::item_buffer< T, A >::item ( size_type  i) const
inlineprotected

Definition at line 63 of file flow_graph.h.

76  {

◆ move_item()

template<typename T, typename A = cache_aligned_allocator<T>>
void tbb::flow::interface11::internal::item_buffer< T, A >::move_item ( size_t  to,
size_t  from 
)
inlineprotected

Definition at line 98 of file flow_graph.h.

101  {
102 namespace flow {
103 

◆ my_item_reserved()

template<typename T, typename A = cache_aligned_allocator<T>>
bool tbb::flow::interface11::internal::item_buffer< T, A >::my_item_reserved ( size_type  i) const
inlineprotected

Definition at line 70 of file flow_graph.h.

76 {

◆ my_item_valid()

template<typename T, typename A = cache_aligned_allocator<T>>
bool tbb::flow::interface11::internal::item_buffer< T, A >::my_item_valid ( size_type  i) const
inlineprotected

Definition at line 69 of file flow_graph.h.

76 {

◆ place_item()

template<typename T, typename A = cache_aligned_allocator<T>>
bool tbb::flow::interface11::internal::item_buffer< T, A >::place_item ( size_t  here,
const item_type me 
)
inlineprotected

Definition at line 107 of file flow_graph.h.

107  {
108 
110 struct null_type {};
111 
113 class continue_msg {};

◆ pop_back()

template<typename T, typename A = cache_aligned_allocator<T>>
bool tbb::flow::interface11::internal::item_buffer< T, A >::pop_back ( item_type v)
inlineprotected

Definition at line 195 of file flow_graph.h.

195  {
196 
197 // enqueue left task if necessary. Returns the non-enqueued task if there is one.
198 static inline tbb::task *combine_tasks(graph& g, tbb::task * left, tbb::task * right) {
199  // if no RHS task, don't change left.
200  if (right == NULL) return left;
201  // right != NULL
202  if (left == NULL) return right;
Base class for user-defined tasks.
Definition: task.h:615
static tbb::task * combine_tasks(graph &g, tbb::task *left, tbb::task *right)
Definition: flow_graph.h:198

◆ pop_front()

template<typename T, typename A = cache_aligned_allocator<T>>
bool tbb::flow::interface11::internal::item_buffer< T, A >::pop_front ( item_type v)
inlineprotected

Definition at line 204 of file flow_graph.h.

205  {
206  // both are valid tasks
208  return right;
209  }
210  return left;
211 }
void spawn_in_graph_arena(tbb::flow::interface10::graph &g, tbb::task &arena_task)
Spawns a task inside graph arena.

◆ push_back()

template<typename T, typename A = cache_aligned_allocator<T>>
bool tbb::flow::interface11::internal::item_buffer< T, A >::push_back ( item_type v)
inlineprotected

Definition at line 186 of file flow_graph.h.

193  {

◆ release_item()

template<typename T, typename A = cache_aligned_allocator<T>>
void tbb::flow::interface11::internal::item_buffer< T, A >::release_item ( size_type  i)
inlineprotected

Definition at line 145 of file flow_graph.h.

146 :
147  typedef std::list<C *, tbb::tbb_allocator<C *> > edge_list_type;

◆ reserve_item()

template<typename T, typename A = cache_aligned_allocator<T>>
void tbb::flow::interface11::internal::item_buffer< T, A >::reserve_item ( size_type  i)
inlineprotected

Definition at line 144 of file flow_graph.h.

144 {

◆ reset()

template<typename T, typename A = cache_aligned_allocator<T>>
void tbb::flow::interface11::internal::item_buffer< T, A >::reset ( )
inline

Definition at line 240 of file flow_graph.h.

240 {

◆ set_my_item()

template<typename T, typename A = cache_aligned_allocator<T>>
void tbb::flow::interface11::internal::item_buffer< T, A >::set_my_item ( size_t  i,
const item_type o 
)
inlineprotected

Definition at line 80 of file flow_graph.h.

101  {

◆ size()

template<typename T, typename A = cache_aligned_allocator<T>>
size_type tbb::flow::interface11::internal::item_buffer< T, A >::size ( size_t  new_tail = 0)
inlineprotected

Definition at line 152 of file flow_graph.h.

153 {

◆ swap_items()

template<typename T, typename A = cache_aligned_allocator<T>>
void tbb::flow::interface11::internal::item_buffer< T, A >::swap_items ( size_t  i,
size_t  j 
)
inlineprotected

Definition at line 116 of file flow_graph.h.

124  {

Member Data Documentation

◆ initial_buffer_size

template<typename T, typename A = cache_aligned_allocator<T>>
const size_type tbb::flow::interface11::internal::item_buffer< T, A >::initial_buffer_size = 4
staticprotected

Definition at line 51 of file flow_graph.h.

◆ my_array

template<typename T, typename A = cache_aligned_allocator<T>>
buffer_item_type* tbb::flow::interface11::internal::item_buffer< T, A >::my_array
protected

Definition at line 49 of file flow_graph.h.

◆ my_array_size

template<typename T, typename A = cache_aligned_allocator<T>>
size_type tbb::flow::interface11::internal::item_buffer< T, A >::my_array_size
protected

Definition at line 50 of file flow_graph.h.

◆ my_head

template<typename T, typename A = cache_aligned_allocator<T>>
size_type tbb::flow::interface11::internal::item_buffer< T, A >::my_head
protected

Definition at line 52 of file flow_graph.h.

◆ my_tail

template<typename T, typename A = cache_aligned_allocator<T>>
size_type tbb::flow::interface11::internal::item_buffer< T, A >::my_tail
protected

Definition at line 53 of file flow_graph.h.


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

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.