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

Forwards messages in FIFO order. More...

#include <flow_graph.h>

Inheritance diagram for tbb::flow::interface11::queue_node< T, Allocator >:
Collaboration diagram for tbb::flow::interface11::queue_node< T, Allocator >:

Public Types

typedef T input_type
 
typedef T output_type
 
typedef receiver< input_type >::predecessor_type predecessor_type
 
typedef sender< output_type >::successor_type successor_type
 
- Public Types inherited from tbb::flow::interface11::buffer_node< T, __TBB_DEFAULT_NODE_ALLOCATOR(T) >
typedef T input_type
 
typedef T output_type
 
typedef receiver< input_type >::predecessor_type predecessor_type
 
typedef sender< output_type >::successor_type successor_type
 
typedef buffer_node< T, __TBB_DEFAULT_NODE_ALLOCATOR(T) > class_type
 
- Public Types inherited from internal::item_buffer< T, cache_aligned_allocator< T > >
enum  buffer_item_state
 
typedef T item_type
 

Public Member Functions

__TBB_NOINLINE_SYM queue_node (graph &g)
 Constructor. More...
 
__TBB_NOINLINE_SYM queue_node (const queue_node &src)
 Copy constructor. More...
 
- Public Member Functions inherited from tbb::flow::interface11::buffer_node< T, __TBB_DEFAULT_NODE_ALLOCATOR(T) >
 __TBB_STATIC_ASSERT ((tbb::internal::is_same_type< __TBB_DEFAULT_NODE_ALLOCATOR(T), null_type >::value), "__TBB_DEFAULT_NODE_ALLOCATOR(T) template parameter for flow graph nodes is deprecated and will be removed. " "Specify TBB_DEPRECATED_FLOW_NODE_ALLOCATOR to temporary enable the deprecated interface.")
 
__TBB_NOINLINE_SYM buffer_node (graph &g)
 Constructor. More...
 
__TBB_NOINLINE_SYM buffer_node (const buffer_node &src)
 Copy constructor. More...
 
bool register_successor (successor_type &r) __TBB_override
 Adds a new successor. More...
 
bool remove_successor (successor_type &r) __TBB_override
 Removes a successor. More...
 
bool try_get (T &v) __TBB_override
 Request an item from the buffer_node. More...
 
bool try_reserve (T &v) __TBB_override
 Reserves an item. More...
 
bool try_release () __TBB_override
 Release a reserved item. More...
 
bool try_consume () __TBB_override
 Consumes a reserved item. More...
 
- Public Member Functions inherited from tbb::flow::interface11::graph_node
 graph_node (graph &g)
 
virtual ~graph_node ()
 
- Public Member Functions inherited from internal::reservable_item_buffer< T, cache_aligned_allocator< T > >
 reservable_item_buffer ()
 
void reset ()
 
- Public Member Functions inherited from internal::item_buffer< T, cache_aligned_allocator< T > >
 item_buffer ()
 Constructor. More...
 
 ~item_buffer ()
 
void reset ()
 
- Public Member Functions inherited from tbb::flow::interface11::receiver< T >
virtual ~receiver ()
 Destructor. More...
 
bool try_put (const T &t)
 Put an item to the receiver. More...
 
virtual __TBB_DEPRECATED bool register_predecessor (predecessor_type &)
 Add a predecessor to the node. More...
 
virtual __TBB_DEPRECATED bool remove_predecessor (predecessor_type &)
 Remove a predecessor from the node. More...
 
- Public Member Functions inherited from tbb::flow::interface11::sender< T >
virtual ~sender ()
 
virtual __TBB_DEPRECATED bool register_successor (successor_type &r)=0
 Add a new successor to this node. More...
 
virtual __TBB_DEPRECATED bool remove_successor (successor_type &r)=0
 Removes a successor from this node. More...
 

Protected Types

typedef buffer_node< T, Allocator > base_type
 
typedef base_type::size_type size_type
 
typedef base_type::buffer_operation queue_operation
 
typedef queue_node class_type
 
- Protected Types inherited from tbb::flow::interface11::buffer_node< T, __TBB_DEFAULT_NODE_ALLOCATOR(T) >
enum  op_type
 
typedef size_t size_type
 
typedef internal::aggregating_functor< class_type, buffer_operation > handler_type
 
- Protected Types inherited from internal::item_buffer< T, cache_aligned_allocator< T > >
typedef size_t size_type
 
typedef aligned_pair< item_type, buffer_item_state >::type buffer_item_type
 
typedef tbb::internal::allocator_rebind< cache_aligned_allocator< T >, buffer_item_type >::type allocator_type
 

Protected Member Functions

void internal_forward_task (queue_operation *op) __TBB_override
 
void internal_pop (queue_operation *op) __TBB_override
 
void internal_reserve (queue_operation *op) __TBB_override
 
void internal_consume (queue_operation *op) __TBB_override
 
void reset_node (reset_flags f) __TBB_override
 
- Protected Member Functions inherited from tbb::flow::interface11::buffer_node< T, __TBB_DEFAULT_NODE_ALLOCATOR(T) >
virtual void handle_operations (buffer_operation *op_list)
 
void handle_operations_impl (buffer_operation *op_list, derived_type *derived)
 
taskgrab_forwarding_task (buffer_operation &op_data)
 
bool enqueue_forwarding_task (buffer_operation &op_data)
 
virtual taskforward_task ()
 This is executed by an enqueued task, the "forwarder". More...
 
virtual void internal_reg_succ (buffer_operation *op)
 Register successor. More...
 
virtual void internal_rem_succ (buffer_operation *op)
 Remove successor. More...
 
virtual void internal_forward_task (buffer_operation *op)
 Tries to forward valid items to successors. More...
 
void internal_forward_task_impl (buffer_operation *op, derived_type *derived)
 
virtual bool internal_push (buffer_operation *op)
 
virtual void internal_pop (buffer_operation *op)
 
virtual void internal_reserve (buffer_operation *op)
 
virtual void internal_consume (buffer_operation *op)
 
virtual void internal_release (buffer_operation *op)
 
tasktry_put_task (const T &t) __TBB_override
 receive an item, return a task *if possible More...
 
graphgraph_reference () const __TBB_override
 
void reset_receiver (reset_flags) __TBB_override
 put receiver back in initial state More...
 
void reset_node (reset_flags f) __TBB_override
 
- Protected Member Functions inherited from internal::reservable_item_buffer< T, cache_aligned_allocator< T > >
bool reserve_front (T &v)
 
void consume_front ()
 
void release_front ()
 
- Protected Member Functions inherited from internal::item_buffer< T, cache_aligned_allocator< T > >
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 Member Functions inherited from tbb::flow::interface11::receiver< T >
virtual graphgraph_reference () const =0
 
virtual bool is_continue_receiver ()
 

Private Member Functions

 __TBB_STATIC_ASSERT ((tbb::internal::is_same_type< Allocator, null_type >::value), "Allocator template parameter for flow graph nodes is deprecated and will be removed. " "Specify TBB_DEPRECATED_FLOW_NODE_ALLOCATOR to temporary enable the deprecated interface.")
 
bool is_item_valid ()
 
void try_put_and_add_task (task *&last_task)
 

Friends

template<typename , typename >
class buffer_node
 

Additional Inherited Members

- Public Attributes inherited from tbb::flow::interface11::receiver< T >
__TBB_DEPRECATED typedef T input_type
 The input type of this receiver. More...
 
__TBB_DEPRECATED typedef sender< T > predecessor_type
 The predecessor type for this node. More...
 
- Public Attributes inherited from tbb::flow::interface11::sender< T >
__TBB_DEPRECATED typedef T output_type
 The output type of this sender. More...
 
__TBB_DEPRECATED typedef receiver< T > successor_type
 The successor type for this node. More...
 
- Protected Attributes inherited from tbb::flow::interface11::buffer_node< T, __TBB_DEFAULT_NODE_ALLOCATOR(T) >
internal::round_robin_cache< T, null_rw_mutexmy_successors
 
bool forwarder_busy
 
internal::aggregator< handler_type, buffer_operation > my_aggregator
 
- Protected Attributes inherited from tbb::flow::interface11::graph_node
graphmy_graph
 
graph_nodenext
 
graph_nodeprev
 
- Protected Attributes inherited from internal::reservable_item_buffer< T, cache_aligned_allocator< T > >
bool my_reserved
 
- Protected Attributes inherited from internal::item_buffer< T, cache_aligned_allocator< T > >
buffer_item_typemy_array
 
size_type my_array_size
 
size_type my_head
 
size_type my_tail
 
- Static Protected Attributes inherited from internal::item_buffer< T, cache_aligned_allocator< T > >
static const size_type initial_buffer_size
 

Detailed Description

template<typename T, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
class tbb::flow::interface11::queue_node< T, Allocator >

Forwards messages in FIFO order.

Definition at line 2560 of file flow_graph.h.

Member Typedef Documentation

◆ base_type

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
typedef buffer_node<T, Allocator> tbb::flow::interface11::queue_node< T, Allocator >::base_type
protected

Definition at line 2569 of file flow_graph.h.

◆ class_type

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
typedef queue_node tbb::flow::interface11::queue_node< T, Allocator >::class_type
protected

Definition at line 2572 of file flow_graph.h.

◆ input_type

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
typedef T tbb::flow::interface11::queue_node< T, Allocator >::input_type

Definition at line 2620 of file flow_graph.h.

◆ output_type

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
typedef T tbb::flow::interface11::queue_node< T, Allocator >::output_type

Definition at line 2621 of file flow_graph.h.

◆ predecessor_type

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
typedef receiver<input_type>::predecessor_type tbb::flow::interface11::queue_node< T, Allocator >::predecessor_type

Definition at line 2622 of file flow_graph.h.

◆ queue_operation

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
typedef base_type::buffer_operation tbb::flow::interface11::queue_node< T, Allocator >::queue_operation
protected

Definition at line 2571 of file flow_graph.h.

◆ size_type

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
typedef base_type::size_type tbb::flow::interface11::queue_node< T, Allocator >::size_type
protected

Definition at line 2570 of file flow_graph.h.

◆ successor_type

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
typedef sender<output_type>::successor_type tbb::flow::interface11::queue_node< T, Allocator >::successor_type

Definition at line 2623 of file flow_graph.h.

Constructor & Destructor Documentation

◆ queue_node() [1/2]

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
__TBB_NOINLINE_SYM tbb::flow::interface11::queue_node< T, Allocator >::queue_node ( graph g)
inlineexplicit

Constructor.

Definition at line 2626 of file flow_graph.h.

2626  : base_type(g) {
2627  tbb::internal::fgt_node( CODEPTR(), tbb::internal::FLOW_QUEUE_NODE, &(this->my_graph),
2628  static_cast<receiver<input_type> *>(this),
2629  static_cast<sender<output_type> *>(this) );
2630  }

◆ queue_node() [2/2]

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
__TBB_NOINLINE_SYM tbb::flow::interface11::queue_node< T, Allocator >::queue_node ( const queue_node< T, Allocator > &  src)
inline

Copy constructor.

Definition at line 2640 of file flow_graph.h.

2640  : base_type(src) {
2641  tbb::internal::fgt_node( CODEPTR(), tbb::internal::FLOW_QUEUE_NODE, &(this->my_graph),
2642  static_cast<receiver<input_type> *>(this),
2643  static_cast<sender<output_type> *>(this) );
2644  }

Member Function Documentation

◆ __TBB_STATIC_ASSERT()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
tbb::flow::interface11::queue_node< T, Allocator >::__TBB_STATIC_ASSERT ( (tbb::internal::is_same_type< Allocator, null_type >::value ,
"Allocator template parameter for flow graph nodes is deprecated and will be removed. " "Specify TBB_DEPRECATED_FLOW_NODE_ALLOCATOR to temporary enable the deprecated interface."   
)
private

◆ internal_consume()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
void tbb::flow::interface11::queue_node< T, Allocator >::internal_consume ( queue_operation op)
inlineprotected

Definition at line 2614 of file flow_graph.h.

2614  {
2615  this->consume_front();
2617  }

◆ internal_forward_task()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
void tbb::flow::interface11::queue_node< T, Allocator >::internal_forward_task ( queue_operation op)
inlineprotected

Definition at line 2592 of file flow_graph.h.

2592  {
2593  this->internal_forward_task_impl(op, this);
2594  }

◆ internal_pop()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
void tbb::flow::interface11::queue_node< T, Allocator >::internal_pop ( queue_operation op)
inlineprotected

Definition at line 2596 of file flow_graph.h.

2596  {
2597  if ( this->my_reserved || !this->my_item_valid(this->my_head)){
2599  }
2600  else {
2601  this->pop_front(*(op->elem));
2603  }
2604  }

◆ internal_reserve()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
void tbb::flow::interface11::queue_node< T, Allocator >::internal_reserve ( queue_operation op)
inlineprotected

Definition at line 2605 of file flow_graph.h.

2605  {
2606  if (this->my_reserved || !this->my_item_valid(this->my_head)) {
2608  }
2609  else {
2610  this->reserve_front(*(op->elem));
2612  }
2613  }

◆ is_item_valid()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
bool tbb::flow::interface11::queue_node< T, Allocator >::is_item_valid ( )
inlineprivate

Definition at line 2577 of file flow_graph.h.

2577  {
2578  return this->my_item_valid(this->my_head);
2579  }

◆ reset_node()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
void tbb::flow::interface11::queue_node< T, Allocator >::reset_node ( reset_flags  f)
inlineprotectedvirtual

Implements tbb::flow::interface11::graph_node.

Definition at line 2653 of file flow_graph.h.

2653  {
2655  }

◆ try_put_and_add_task()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
void tbb::flow::interface11::queue_node< T, Allocator >::try_put_and_add_task ( task *&  last_task)
inlineprivate

Definition at line 2581 of file flow_graph.h.

2581  {
2582  task *new_task = this->my_successors.try_put_task(this->front());
2583  if (new_task) {
2584  // workaround for icc bug
2585  graph& graph_ref = this->graph_reference();
2586  last_task = combine_tasks(graph_ref, last_task, new_task);
2587  this->destroy_front();
2588  }
2589  }

Friends And Related Function Documentation

◆ buffer_node

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
template<typename , typename >
friend class buffer_node
friend

Definition at line 2575 of file flow_graph.h.


The documentation for this class was generated from the following file:
tbb::flow::interface11::buffer_node< T, __TBB_DEFAULT_NODE_ALLOCATOR(T) >::my_successors
internal::round_robin_cache< T, null_rw_mutex > my_successors
Definition: flow_graph.h:2069
internal::item_buffer< T, cache_aligned_allocator< T > >::my_item_valid
bool my_item_valid(size_type i) const
Definition: _flow_graph_item_buffer_impl.h:68
internal::reservable_item_buffer< T, cache_aligned_allocator< T > >::reserve_front
bool reserve_front(T &v)
Definition: _flow_graph_item_buffer_impl.h:257
internal::SUCCEEDED
@ SUCCEEDED
Definition: _flow_graph_types_impl.h:719
CODEPTR
#define CODEPTR()
Definition: _flow_graph_trace_impl.h:297
internal::item_buffer< T, cache_aligned_allocator< T > >::pop_front
bool pop_front(item_type &v)
Definition: _flow_graph_item_buffer_impl.h:203
tbb::flow::interface11::graph_node::my_graph
graph & my_graph
Definition: _flow_graph_impl.h:464
internal::reservable_item_buffer< T, cache_aligned_allocator< T > >::consume_front
void consume_front()
Definition: _flow_graph_item_buffer_impl.h:266
tbb::flow::interface11::queue_node::base_type
buffer_node< T, Allocator > base_type
Definition: flow_graph.h:2569
internal::item_buffer< T, cache_aligned_allocator< T > >::destroy_front
void destroy_front()
Definition: _flow_graph_item_buffer_impl.h:146
tbb::flow::interface11::combine_tasks
static tbb::task * combine_tasks(graph &g, tbb::task *left, tbb::task *right)
Definition: flow_graph.h:198
tbb::internal::__TBB_store_with_release
void __TBB_store_with_release(volatile T &location, V value)
Definition: tbb_machine.h:713
tbb::flow::interface11::buffer_node< T, __TBB_DEFAULT_NODE_ALLOCATOR(T) >::internal_forward_task_impl
void internal_forward_task_impl(buffer_operation *op, derived_type *derived)
Definition: flow_graph.h:2291
internal::item_buffer< T, cache_aligned_allocator< T > >::my_head
size_type my_head
Definition: _flow_graph_item_buffer_impl.h:51
tbb::flow::interface11::buffer_node< T, __TBB_DEFAULT_NODE_ALLOCATOR(T) >::graph_reference
graph & graph_reference() const __TBB_override
Definition: flow_graph.h:2530
internal::item_buffer< T, cache_aligned_allocator< T > >::front
const item_type & front() const
Definition: _flow_graph_item_buffer_impl.h:129
task
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 * task
Definition: ittnotify_static.h:119
internal::FAILED
@ FAILED
Definition: _flow_graph_types_impl.h:719
tbb::internal::fgt_node
static void fgt_node(void *, string_index, void *, void *)
Definition: _flow_graph_trace_impl.h:326
internal::reservable_item_buffer< T, cache_aligned_allocator< T > >::my_reserved
bool my_reserved
Definition: _flow_graph_item_buffer_impl.h:278
tbb::flow::interface11::graph_node::graph
friend class graph
Definition: _flow_graph_impl.h:455
tbb::flow::interface11::buffer_node::reset_node
void reset_node(reset_flags f) __TBB_override
Definition: flow_graph.h:2545

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.