Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
Forwards messages in arbitrary order. More...
#include <flow_graph.h>
Classes | |
class | buffer_operation |
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 |
typedef buffer_node< T, Allocator > | class_type |
![]() | |
enum | buffer_item_state |
typedef T | item_type |
![]() | |
typedef untyped_sender | predecessor_type |
The predecessor type for this node. More... | |
![]() | |
typedef untyped_receiver | successor_type |
The successor type for this node. More... | |
Public 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.") | |
__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... | |
![]() | |
graph_node (graph &g) | |
virtual | ~graph_node () |
![]() | |
reservable_item_buffer () | |
void | reset () |
![]() | |
item_buffer () | |
Constructor. More... | |
~item_buffer () | |
void | reset () |
![]() | |
bool | try_put (const typename internal::async_helpers< T >::filtered_type &t) |
Put an item to the receiver. More... | |
bool | try_put (const typename internal::async_helpers< T >::async_type &t) |
![]() | |
virtual | ~untyped_receiver () |
Destructor. More... | |
template<typename X > | |
bool | try_put (const X &t) |
Put an item to the receiver. More... | |
virtual bool | register_predecessor (predecessor_type &) |
Add a predecessor to the node. More... | |
virtual bool | remove_predecessor (predecessor_type &) |
Remove a predecessor from the node. More... | |
![]() | |
virtual | ~untyped_sender () |
Protected Types | |
enum | op_type { reg_succ, rem_succ, req_item, res_item, rel_res, con_res, put_item, try_fwd_task } |
typedef size_t | size_type |
typedef internal::aggregating_functor< class_type, buffer_operation > | handler_type |
![]() | |
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 Attributes | |
internal::round_robin_cache< T, null_rw_mutex > | my_successors |
bool | forwarder_busy |
internal::aggregator< handler_type, buffer_operation > | my_aggregator |
![]() | |
graph & | my_graph |
graph_node * | next |
graph_node * | prev |
![]() | |
bool | my_reserved |
![]() | |
buffer_item_type * | my_array |
size_type | my_array_size |
size_type | my_head |
size_type | my_tail |
Private Types | |
typedef cache_aligned_allocator< T > | internals_allocator |
Private Member Functions | |
void | order () |
bool | is_item_valid () |
void | try_put_and_add_task (task *&last_task) |
Friends | |
class | internal::forward_task_bypass< class_type > |
class | internal::aggregating_functor< class_type, 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 |
Additional Inherited Members | |
![]() | |
__TBB_DEPRECATED typedef T | input_type |
The input type of this receiver. More... | |
__TBB_DEPRECATED typedef internal::async_helpers< T >::filtered_type | filtered_type |
![]() | |
__TBB_DEPRECATED typedef T | output_type |
The output type of this sender. More... | |
__TBB_DEPRECATED typedef internal::async_helpers< T >::filtered_type | filtered_type |
![]() | |
static const size_type | initial_buffer_size |
Forwards messages in arbitrary order.
Definition at line 2044 of file flow_graph.h.
typedef buffer_node<T, Allocator> tbb::flow::interface11::buffer_node< T, Allocator >::class_type |
Definition at line 2062 of file flow_graph.h.
|
protected |
Definition at line 2125 of file flow_graph.h.
typedef T tbb::flow::interface11::buffer_node< T, Allocator >::input_type |
Definition at line 2058 of file flow_graph.h.
|
private |
Definition at line 2055 of file flow_graph.h.
typedef T tbb::flow::interface11::buffer_node< T, Allocator >::output_type |
Definition at line 2059 of file flow_graph.h.
typedef receiver<input_type>::predecessor_type tbb::flow::interface11::buffer_node< T, Allocator >::predecessor_type |
Definition at line 2060 of file flow_graph.h.
|
protected |
Definition at line 2076 of file flow_graph.h.
typedef sender<output_type>::successor_type tbb::flow::interface11::buffer_node< T, Allocator >::successor_type |
Definition at line 2061 of file flow_graph.h.
|
protected |
Enumerator | |
---|---|
reg_succ | |
rem_succ | |
req_item | |
res_item | |
rel_res | |
con_res | |
put_item | |
try_fwd_task |
Definition at line 2085 of file flow_graph.h.
|
inlineexplicit |
Constructor.
Definition at line 2359 of file flow_graph.h.
References CODEPTR, tbb::internal::fgt_node(), tbb::flow::interface11::graph_node::my_graph, and tbb::flow::interface11::internal::successor_cache< T, M >::set_owner().
|
inline |
Copy constructor.
Definition at line 2377 of file flow_graph.h.
References __TBB_override, CODEPTR, tbb::internal::fgt_node(), tbb::internal::fgt_node_desc(), tbb::flow::interface11::graph_node::my_graph, and tbb::flow::interface11::internal::successor_cache< T, M >::set_owner().
tbb::flow::interface11::buffer_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." | |||
) |
|
inlineprotected |
Definition at line 2186 of file flow_graph.h.
References tbb::flow::interface11::internal::spawn_in_graph_arena().
|
inlineprotectedvirtual |
This is executed by an enqueued task, the "forwarder".
Definition at line 2196 of file flow_graph.h.
References tbb::flow::interface11::combine_tasks(), tbb::task::execute(), tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::ltask, tbb::flow::interface11::graph_node::my_graph, tbb::flow::interface11::internal::SUCCEEDED, and tbb::flow::interface11::internal::WAIT.
|
inlineprotected |
Definition at line 2182 of file flow_graph.h.
References tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::ltask.
|
inlineprotectedvirtual |
Implements tbb::flow::interface11::internal::untyped_receiver.
Definition at line 2538 of file flow_graph.h.
References tbb::flow::interface11::graph_node::my_graph.
|
inlineprotectedvirtual |
Reimplemented in tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >.
Definition at line 2129 of file flow_graph.h.
|
inlineprotected |
Definition at line 2134 of file flow_graph.h.
References __TBB_ASSERT, tbb::flow::interface11::combine_tasks(), tbb::flow::interface11::internal::is_graph_active(), tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::ltask, tbb::flow::interface11::graph_node::my_graph, tbb::flow::interface10::graph::root_task(), and tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::type.
|
inlineprotectedvirtual |
Reimplemented in tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >, and tbb::flow::interface11::queue_node< T, Allocator >.
Definition at line 2347 of file flow_graph.h.
References tbb::internal::__TBB_store_with_release(), and tbb::flow::interface11::internal::SUCCEEDED.
|
inlineprotectedvirtual |
Tries to forward valid items to successors.
Reimplemented in tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >, and tbb::flow::interface11::queue_node< T, Allocator >.
Definition at line 2294 of file flow_graph.h.
|
inlineprotected |
Definition at line 2299 of file flow_graph.h.
References __TBB_ASSERT, tbb::internal::__TBB_store_with_release(), tbb::flow::interface11::internal::FAILED, tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::ltask, tbb::flow::interface11::internal::round_robin_cache< T, M >::size(), and tbb::flow::interface11::internal::SUCCEEDED.
|
inlineprotectedvirtual |
Reimplemented in tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >, and tbb::flow::interface11::queue_node< T, Allocator >.
Definition at line 2329 of file flow_graph.h.
References tbb::internal::__TBB_store_with_release(), tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::elem, tbb::flow::interface11::internal::FAILED, and tbb::flow::interface11::internal::SUCCEEDED.
|
inlineprotectedvirtual |
Reimplemented in tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >, and tbb::flow::interface11::sequencer_node< T, Allocator >.
Definition at line 2323 of file flow_graph.h.
References tbb::internal::__TBB_store_with_release(), tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::elem, and tbb::flow::interface11::internal::SUCCEEDED.
|
inlineprotectedvirtual |
Register successor.
Definition at line 2213 of file flow_graph.h.
References tbb::internal::__TBB_store_with_release(), tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::r, tbb::flow::interface11::internal::successor_cache< T, M >::register_successor(), and tbb::flow::interface11::internal::SUCCEEDED.
|
inlineprotectedvirtual |
Reimplemented in tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >.
Definition at line 2352 of file flow_graph.h.
References tbb::internal::__TBB_store_with_release(), and tbb::flow::interface11::internal::SUCCEEDED.
|
inlineprotectedvirtual |
Remove successor.
Definition at line 2219 of file flow_graph.h.
References __TBB_override, tbb::internal::__TBB_store_with_release(), tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::r, tbb::flow::interface11::internal::successor_cache< T, M >::remove_successor(), and tbb::flow::interface11::internal::SUCCEEDED.
|
inlineprotectedvirtual |
Reimplemented in tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >, and tbb::flow::interface11::queue_node< T, Allocator >.
Definition at line 2338 of file flow_graph.h.
References tbb::internal::__TBB_store_with_release(), tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::elem, tbb::flow::interface11::internal::FAILED, and tbb::flow::interface11::internal::SUCCEEDED.
|
inlineprivate |
Definition at line 2278 of file flow_graph.h.
|
inlineprivate |
Definition at line 2276 of file flow_graph.h.
|
inlinevirtual |
Adds a new successor.
Adds successor r to the list of successors; may forward tasks.
Implements tbb::flow::interface11::internal::untyped_sender.
Definition at line 2399 of file flow_graph.h.
References __TBB_override, p, tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::r, and void.
|
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::interface11::internal::untyped_sender.
Definition at line 2461 of file flow_graph.h.
References tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::r, tbb::flow::interface11::internal::untyped_receiver::remove_predecessor(), and void.
|
inlineprotectedvirtual |
Implements tbb::flow::interface11::graph_node.
Reimplemented in tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >, and tbb::flow::interface11::queue_node< T, Allocator >.
Definition at line 2553 of file flow_graph.h.
References tbb::flow::interface11::internal::successor_cache< T, M >::clear(), and tbb::flow::interface11::internal::reservable_item_buffer< T, A >::reset().
|
inlineprotectedvirtual |
put receiver back in initial state
Implements tbb::flow::interface11::internal::untyped_receiver.
Definition at line 2542 of file flow_graph.h.
References __TBB_override.
|
inlinevirtual |
Consumes a reserved item.
true = item is removed from sender and reservation removed
Reimplemented from tbb::flow::interface11::internal::untyped_sender.
Definition at line 2506 of file flow_graph.h.
References void.
|
inlinevirtual |
Request an item from the buffer_node.
true = v contains the returned item
false = no item has been returned
Reimplemented from tbb::flow::interface11::sender< T >.
Definition at line 2476 of file flow_graph.h.
References tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::elem, tbb::flow::interface11::internal::SUCCEEDED, and void.
|
inlineprivate |
Definition at line 2282 of file flow_graph.h.
References tbb::flow::interface11::combine_tasks(), tbb::flow::interface11::graph_node::my_graph, and tbb::flow::interface11::internal::round_robin_cache< T, M >::try_put_task().
|
inlineprotectedvirtual |
receive an item, return a task *if possible
Implements tbb::flow::interface11::receiver< T >.
Definition at line 2519 of file flow_graph.h.
References tbb::flow::interface11::internal::FAILED, tbb::flow::interface11::internal::spawn_in_graph_arena(), tbb::flow::interface11::internal::SUCCEEDED, and tbb::flow::internal::SUCCESSFULLY_ENQUEUED.
|
inlinevirtual |
Release a reserved item.
true = item has been released and so remains in sender
Reimplemented from tbb::flow::interface11::internal::untyped_sender.
Definition at line 2497 of file flow_graph.h.
References void.
|
inlinevirtual |
Reserves an item.
false = no item can be reserved
true = an item is reserved
Reimplemented from tbb::flow::interface11::sender< T >.
Definition at line 2487 of file flow_graph.h.
References tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::elem, tbb::flow::interface11::internal::SUCCEEDED, and void.
|
friend |
Definition at line 2126 of file flow_graph.h.
|
friend |
Definition at line 2516 of file flow_graph.h.
|
friend |
Definition at line 2083 of file flow_graph.h.
|
friend |
Definition at line 2517 of file flow_graph.h.
|
friend |
Definition at line 2515 of file flow_graph.h.
|
protected |
Definition at line 2124 of file flow_graph.h.
|
protected |
Definition at line 2127 of file flow_graph.h.
|
protected |
Definition at line 2077 of file flow_graph.h.