Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
tbb::flow::interface7::buffer_node< T, A > Class Template Reference

Forwards messages in arbitrary order. More...

#include <flow_graph.h>

Inheritance diagram for tbb::flow::interface7::buffer_node< T, A >:
tbb::flow::interface7::graph_node tbb::flow::interface7::receiver< T > tbb::flow::interface7::sender< T > tbb::flow::interface7::priority_queue_node< T, Compare, A > tbb::flow::interface7::queue_node< T, A > tbb::flow::interface7::sequencer_node< T, A >

Classes

class  buffer_operation
 

Public Types

typedef T input_type
 
typedef T output_type
 
typedef sender< input_typepredecessor_type
 
typedef receiver< output_typesuccessor_type
 
typedef buffer_node< T, A > my_class
 
- Public Types inherited from tbb::flow::interface7::receiver< T >
typedef T input_type
 The input type of this receiver.
 
typedef sender< T > predecessor_type
 The predecessor type for this node.
 
- Public Types inherited from tbb::flow::interface7::sender< T >
typedef T output_type
 The output type of this sender.
 
typedef receiver< T > successor_type
 The successor type for this node.
 

Public Member Functions

 buffer_node (graph &g)
 Constructor.
 
 buffer_node (const buffer_node &src)
 Copy constructor.
 
void set_name (const char *name)
 
bool register_successor (receiver< output_type > &r)
 Adds a new successor. More...
 
bool remove_successor (receiver< output_type > &r)
 Removes a successor. More...
 
bool try_get (T &v)
 Request an item from the buffer_node. More...
 
bool try_reserve (T &v)
 Reserves an item. More...
 
bool try_release ()
 Release a reserved item. More...
 
bool try_consume ()
 Consumes a reserved item. More...
 
- Public Member Functions inherited from tbb::flow::interface7::graph_node
 graph_node (graph &g)
 
- Public Member Functions inherited from tbb::flow::interface7::receiver< T >
virtual ~receiver ()
 Destructor.
 
bool try_put (const T &t)
 Put an item to the receiver.
 
virtual bool register_predecessor (predecessor_type &)
 Add a predecessor to the node.
 
virtual bool remove_predecessor (predecessor_type &)
 Remove a predecessor from the node.
 

Protected Types

enum  op_type {
  reg_succ, rem_succ, req_item, res_item,
  rel_res, con_res, put_item, try_fwd_task
}
 
enum  op_stat { WAIT =0, SUCCEEDED, FAILED }
 
typedef size_t size_type
 
typedef
internal::aggregating_functor
< my_class, buffer_operation
my_handler
 

Protected Member Functions

virtual void handle_operations (buffer_operation *op_list)
 
task * grab_forwarding_task (buffer_operation &op_data)
 
bool enqueue_forwarding_task (buffer_operation &op_data)
 
virtual task * forward_task ()
 This is executed by an enqueued task, the "forwarder".
 
virtual void internal_reg_succ (buffer_operation *op)
 Register successor.
 
virtual void internal_rem_succ (buffer_operation *op)
 Remove successor.
 
virtual void internal_forward_task (buffer_operation *op)
 Tries to forward valid items to successors.
 
virtual void 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)
 
task * try_put_task (const T &t)
 receive an item, return a task *if possible
 
void reset ()
 
void reset_receiver ()
 
- Protected Member Functions inherited from tbb::flow::interface7::receiver< T >
virtual bool is_continue_receiver ()
 

Protected Attributes

internal::round_robin_cache< T,
null_rw_mutex
my_successors
 
bool forwarder_busy
 
internal::aggregator
< my_handler, buffer_operation
my_aggregator
 
- Protected Attributes inherited from tbb::flow::interface7::graph_node
graphmy_graph
 
graph_nodenext
 
graph_nodeprev
 

Friends

class internal::forward_task_bypass< buffer_node< T, A > >
 
class internal::aggregating_functor< my_class, buffer_operation >
 
template<typename R , typename B >
class run_and_put_task
 
template<typename X , typename Y >
class internal::broadcast_cache
 
template<typename X , typename Y >
class internal::round_robin_cache
 

Detailed Description

template<typename T, typename A = cache_aligned_allocator<T>>
class tbb::flow::interface7::buffer_node< T, A >

Forwards messages in arbitrary order.

Member Function Documentation

template<typename T, typename A = cache_aligned_allocator<T>>
bool tbb::flow::interface7::buffer_node< T, A >::register_successor ( receiver< output_type > &  r)
inlinevirtual

Adds a new successor.

Adds successor r to the list of successors; may forward tasks.

Implements tbb::flow::interface7::sender< T >.

template<typename T, typename A = cache_aligned_allocator<T>>
bool tbb::flow::interface7::buffer_node< T, A >::remove_successor ( receiver< output_type > &  r)
inlinevirtual

Removes a successor.

Removes successor r from the list of successors. It also calls r.remove_predecessor(*this) to remove this node as a predecessor.

Implements tbb::flow::interface7::sender< T >.

template<typename T, typename A = cache_aligned_allocator<T>>
bool tbb::flow::interface7::buffer_node< T, A >::try_consume ( )
inlinevirtual

Consumes a reserved item.

true = item is removed from sender and reservation removed

Reimplemented from tbb::flow::interface7::sender< T >.

template<typename T, typename A = cache_aligned_allocator<T>>
bool tbb::flow::interface7::buffer_node< T, A >::try_get ( T &  v)
inlinevirtual

Request an item from the buffer_node.

true = v contains the returned item
false = no item has been returned

Reimplemented from tbb::flow::interface7::sender< T >.

template<typename T, typename A = cache_aligned_allocator<T>>
bool tbb::flow::interface7::buffer_node< T, A >::try_release ( )
inlinevirtual

Release a reserved item.

true = item has been released and so remains in sender

Reimplemented from tbb::flow::interface7::sender< T >.

template<typename T, typename A = cache_aligned_allocator<T>>
bool tbb::flow::interface7::buffer_node< T, A >::try_reserve ( T &  v)
inlinevirtual

Reserves an item.

false = no item can be reserved
true = an item is reserved

Reimplemented from tbb::flow::interface7::sender< T >.


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

Copyright © 2005-2014 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.