17#ifndef __TBB_flow_graph_H
18#define __TBB_flow_graph_H
20#define __TBB_flow_graph_H_include_area
38#if TBB_USE_THREADING_TOOLS && TBB_PREVIEW_FLOW_GRAPH_TRACE && ( __linux__ || __APPLE__ )
41 #pragma warning (push)
42 #pragma warning( disable: 2196 )
44 #define __TBB_NOINLINE_SYM __attribute__((noinline))
46 #define __TBB_NOINLINE_SYM
49#if __TBB_PREVIEW_ASYNC_MSG
54#if __TBB_PREVIEW_STREAMING_NODE
57#include <unordered_map>
61#if TBB_DEPRECATED_FLOW_ENQUEUE
62#define FLOW_SPAWN(a) tbb::task::enqueue((a))
64#define FLOW_SPAWN(a) tbb::task::spawn((a))
67#if TBB_DEPRECATED_FLOW_NODE_ALLOCATOR
68#define __TBB_DEFAULT_NODE_ALLOCATOR(T) cache_aligned_allocator<T>
70#define __TBB_DEFAULT_NODE_ALLOCATOR(T) null_type
74#if __TBB_CPP11_TUPLE_PRESENT
79 using std::tuple_size;
80 using std::tuple_element;
85 #include "compat/tuple"
107namespace interface11 {
116template<
typename T >
class sender;
117template<
typename T >
class receiver;
132#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
137template<
typename Order,
typename... Args>
struct node_set;
140#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
144class edge_container {
147 typedef std::list<C *, tbb::tbb_allocator<C *> > edge_list_type;
149 void add_edge(C &
s) {
150 built_edges.push_back(&
s);
153 void delete_edge(C &
s) {
154 for (
typename edge_list_type::iterator i = built_edges.begin(); i != built_edges.end(); ++i) {
156 (
void)built_edges.erase(i);
162 void copy_edges(edge_list_type &v) {
166 size_t edge_count() {
167 return (
size_t)(built_edges.size());
176 template<
typename S >
void sender_extract(
S &
s);
177 template<
typename R >
void receiver_extract(R &r);
180 edge_list_type built_edges;
195namespace interface11 {
200 if (right == NULL)
return left;
202 if (left == NULL)
return right;
213#if __TBB_PREVIEW_ASYNC_MSG
221template<
typename T,
typename =
void >
229 return static_cast<const void*
>(&t);
233 return static_cast<void*
>(&t);
237 return *
static_cast<const T*
>(
p);
241 return *
static_cast<T*
>(
p);
249 task*
const new_task = msg.my_storage->subscribe(*this_recv, this_recv->
graph_reference());
262template<
typename T >
271 return static_cast<const void*
>(&
static_cast<const async_msg<filtered_type>&
>(t));
275 return static_cast<void*
>(&
static_cast<async_msg<filtered_type>&
>(t));
280 return *
static_cast<const T*
>(
static_cast<const async_msg<filtered_type>*
>(
p));
284 return *
static_cast<T*
>(
static_cast<async_msg<filtered_type>*
>(
p));
303class untyped_receiver;
330#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
332 typedef internal::edge_container<successor_type> built_successors_type;
333 typedef built_successors_type::edge_list_type successor_list_type;
334 virtual built_successors_type &built_successors() = 0;
335 virtual void internal_add_built_successor(
successor_type & ) = 0;
336 virtual void internal_delete_built_successor(
successor_type & ) = 0;
337 virtual void copy_successors( successor_list_type &) = 0;
338 virtual size_t successor_count() = 0;
342 template<
typename X >
348 template<
typename X >
364#if __TBB_PREVIEW_OPENCL_NODE
378 if (!res)
return false;
393#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
394 typedef internal::edge_container<predecessor_type> built_predecessors_type;
395 typedef built_predecessors_type::edge_list_type predecessor_list_type;
396 virtual built_predecessors_type &built_predecessors() = 0;
399 virtual void copy_predecessors( predecessor_list_type & ) = 0;
400 virtual size_t predecessor_count() = 0;
423template<
typename T >
444 __TBB_ASSERT(
false,
"async_msg interface does not support 'pull' protocol in try_get()");
454 __TBB_ASSERT(
false,
"async_msg interface does not support 'pull' protocol in try_reserve()");
460template<
typename T >
492template<
typename T >
512 virtual bool try_get( T & ) {
return false; }
523#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
525 __TBB_DEPRECATED typedef typename internal::edge_container<successor_type> built_successors_type;
526 __TBB_DEPRECATED typedef typename built_successors_type::edge_list_type successor_list_type;
536template<
typename T >
546 virtual ~receiver() {}
551 if (!res)
return false;
572#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
573 __TBB_DEPRECATED typedef typename internal::edge_container<predecessor_type> built_predecessors_type;
574 __TBB_DEPRECATED typedef typename built_predecessors_type::edge_list_type predecessor_list_type;
578 __TBB_DEPRECATED virtual void copy_predecessors( predecessor_list_type & ) = 0;
589#if __TBB_PREVIEW_OPENCL_NODE
639#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
640 __TBB_DEPRECATED typedef internal::edge_container<predecessor_type> built_predecessors_type;
641 __TBB_DEPRECATED typedef built_predecessors_type::edge_list_type predecessor_list_type;
642 built_predecessors_type &built_predecessors()
__TBB_override {
return my_built_predecessors; }
646 my_built_predecessors.add_edge(
s );
651 my_built_predecessors.delete_edge(
s);
656 my_built_predecessors.copy_edges(v);
661 return my_built_predecessors.edge_count();
683#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
686 built_predecessors_type my_built_predecessors;
700#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
701 my_built_predecessors.clear();
718#if __TBB_PREVIEW_MESSAGE_BASED_KEY_MATCHING
719 template <
typename K,
typename T>
725 using interface11::sender;
726 using interface11::receiver;
727 using interface11::continue_receiver;
736namespace interface11 {
741#if __TBB_PREVIEW_ASYNC_MSG
746template <
typename C,
typename N>
749 if (
begin) current_node = my_graph->my_nodes;
753template <
typename C,
typename N>
756 return *operator->();
759template <
typename C,
typename N>
764template <
typename C,
typename N>
766 if (current_node) current_node = current_node->next;
771namespace interface10 {
773inline graph::graph() : my_nodes(NULL), my_nodes_last(NULL), my_task_arena(NULL) {
786 my_context(&use_this_context), my_nodes(NULL), my_nodes_last(NULL), my_task_arena(NULL) {
877#if TBB_PREVIEW_FLOW_GRAPH_TRACE
878inline void graph::set_name(
const char *
name) {
885namespace interface11 {
897#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
898using internal::node_set;
902template <
typename Output >
914#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
920 template<
typename Body >
932#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
933 template <
typename Body,
typename... Successors>
934 input_node(
const node_set<internal::order::preceding, Successors...>& successors, Body body )
935 :
input_node(successors.graph_reference(), body) {
936 make_edges(*
this, successors);
955#if TBB_PREVIEW_FLOW_GRAPH_TRACE
977#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
1067 template<
typename Body>
1073#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
1132 return (
new ( task::allocate_additional_child_of( *(this->
my_graph.
root_task()) ) )
1159#if TBB_USE_SOURCE_NODE_AS_ALIAS
1160template <
typename Output >
1164 template<
typename Body >
1170#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
1171 template <
typename Body,
typename... Successors>
1172 source_node(
const node_set<internal::order::preceding, Successors...>& successors, Body body )
1173 : input_node<Output>(successors, body) {
1179template < typename Output > class
1180__TBB_DEPRECATED_MSG(
"TBB Warning: tbb::flow::source_node is deprecated, use tbb::flow::input_node." )
1192#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
1198 template<
typename Body >
1200 :
graph_node(g), my_active(is_active), init_my_active(is_active),
1203 my_reserved(false), my_has_cached_item(false)
1205 my_successors.set_owner(
this);
1210#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
1211 template <
typename Body,
typename... Successors>
1212 source_node(
const node_set<internal::order::preceding, Successors...>& successors, Body body,
bool is_active =
true )
1213 :
source_node(successors.graph_reference(), body, is_active) {
1214 make_edges(*
this, successors);
1221 my_active(src.init_my_active),
1222 init_my_active(src.init_my_active), my_body( src.my_init_body->clone() ), my_init_body(src.my_init_body->clone() ),
1223 my_reserved(false), my_has_cached_item(false)
1225 my_successors.set_owner(
this);
1233#if TBB_PREVIEW_FLOW_GRAPH_TRACE
1242 my_successors.register_successor(r);
1251 my_successors.remove_successor(r);
1255#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
1257 built_successors_type &built_successors()
__TBB_override {
return my_successors.built_successors(); }
1259 void internal_add_built_successor( successor_type &r)
__TBB_override {
1261 my_successors.internal_add_built_successor(r);
1264 void internal_delete_built_successor( successor_type &r)
__TBB_override {
1266 my_successors.internal_delete_built_successor(r);
1271 return my_successors.successor_count();
1276 my_successors.copy_successors(v);
1286 if ( my_has_cached_item ) {
1288 my_has_cached_item =
false;
1300 if ( my_reserved ) {
1304 if ( my_has_cached_item ) {
1317 __TBB_ASSERT( my_reserved && my_has_cached_item,
"releasing non-existent reservation" );
1318 my_reserved =
false;
1319 if(!my_successors.empty())
1327 __TBB_ASSERT( my_reserved && my_has_cached_item,
"consuming non-existent reservation" );
1328 my_reserved =
false;
1329 my_has_cached_item =
false;
1330 if ( !my_successors.empty() ) {
1340 if (!my_successors.empty())
1344 template<
typename Body>
1350#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
1352 my_successors.built_successors().sender_extract(*
this);
1353 my_active = init_my_active;
1354 my_reserved =
false;
1355 if(my_has_cached_item) my_has_cached_item =
false;
1363 my_active = init_my_active;
1365 if(my_has_cached_item) {
1366 my_has_cached_item =
false;
1392 if ( my_reserved ) {
1395 if ( !my_has_cached_item ) {
1397 bool r = (*my_body)(my_cached_item);
1400 my_has_cached_item =
true;
1403 if ( my_has_cached_item ) {
1417 return (
new ( task::allocate_additional_child_of( *(this->my_graph.root_task()) ) )
1432 if ( !try_reserve_apply_body(v) )
1435 task *last_task = my_successors.try_put_task(v);
1450#if TBB_DEPRECATED_FLOW_NODE_ALLOCATOR
1457#if TBB_DEPRECATED_FLOW_NODE_ALLOCATOR
1464 "Allocator template parameter for flow graph nodes is deprecated and will be removed. "
1465 "Specify TBB_DEPRECATED_FLOW_NODE_ALLOCATOR to temporary enable the deprecated interface."
1477#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
1478 typedef typename input_impl_type::predecessor_list_type predecessor_list_type;
1479 typedef typename fOutput_type::successor_list_type successor_list_type;
1487 template<
typename Body >
1500#if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT
1501 template <
typename Body>
1506#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
1507 template <
typename Body,
typename... Args>
1511 make_edges_in_order(nodes, *
this);
1514#if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES
1515 template <
typename Body,
typename... Args>
1530#if TBB_PREVIEW_FLOW_GRAPH_TRACE
1536#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
1539 successors().built_successors().sender_extract(*
this);
1566template<
typename Input,
typename Output,
typename Policy =
queueing,
1573 typename internal::wrap_tuple_elements<
1574 tbb::flow::tuple_size<Output>::value,
1575 internal::multifunction_output,
1579#if TBB_DEPRECATED_FLOW_NODE_ALLOCATOR
1582 cache_aligned_allocator<Input>
1585#if TBB_DEPRECATED_FLOW_NODE_ALLOCATOR
1592 "Allocator template parameter for flow graph nodes is deprecated and will be removed. "
1593 "Specify TBB_DEPRECATED_FLOW_NODE_ALLOCATOR to temporary enable the deprecated interface."
1609 template<
typename Body>
1618 tbb::internal::fgt_multioutput_node_with_body<N>(
1619 CODEPTR(), tbb::internal::FLOW_MULTIFUNCTION_NODE,
1625#if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT
1626 template <
typename Body>
1631#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
1632 template <
typename Body,
typename... Args>
1636 make_edges_in_order(nodes, *
this);
1639#if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES
1640 template <
typename Body,
typename... Args>
1648 tbb::internal::fgt_multioutput_node_with_body<N>(
CODEPTR(), tbb::internal::FLOW_MULTIFUNCTION_NODE,
1653#if TBB_PREVIEW_FLOW_GRAPH_TRACE
1659#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
1662 input_impl_type::extract();
1672template<
typename TupleType,
typename Allocator=__TBB_DEFAULT_NODE_ALLOCATOR(TupleType)>
1678#if TBB_DEPRECATED_FLOW_NODE_ALLOCATOR
1683 "Allocator template parameter for flow graph nodes is deprecated and will be removed. "
1684 "Specify TBB_DEPRECATED_FLOW_NODE_ALLOCATOR to temporary enable the deprecated interface."
1687#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
1689 typedef typename base_type::predecessor_list_type predecessor_list_type;
1691 typedef typename predecessor_cache_type::built_predecessors_type built_predecessors_type;
1704 tbb::internal::fgt_multioutput_node<N>(
CODEPTR(), tbb::internal::FLOW_SPLIT_NODE, &this->
my_graph,
1708#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
1709 template <
typename... Args>
1711 make_edges_in_order(nodes, *
this);
1719 tbb::internal::fgt_multioutput_node<N>(
CODEPTR(), tbb::internal::FLOW_SPLIT_NODE, &this->
my_graph,
1723#if TBB_PREVIEW_FLOW_GRAPH_TRACE
1747#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
1761 built_predecessors_type &built_predecessors()
__TBB_override {
return my_predessors; }
1764 built_predecessors_type my_predessors;
1772template <
typename Output,
typename Policy =
internal::Policy<
void> >
1784 template <
typename Body >
1800#if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT
1801 template <
typename Body>
1806#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
1807 template <
typename Body,
typename... Args>
1811 make_edges_in_order(nodes, *
this);
1813#if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES
1814 template <
typename Body,
typename... Args>
1821 template <
typename Body >
1823 graph &g,
int number_of_predecessors,
1837#if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT
1838 template <
typename Body>
1840 :
continue_node(g, number_of_predecessors, body, Policy(), priority) {}
1843#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
1844 template <
typename Body,
typename... Args>
1845 continue_node(
const node_set<Args...>& nodes,
int number_of_predecessors,
1848 make_edges_in_order(nodes, *
this);
1851#if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES
1852 template <
typename Body,
typename... Args>
1853 continue_node(
const node_set<Args...>& nodes,
int number_of_predecessors,
1855 :
continue_node(nodes, number_of_predecessors, body, Policy(), priority) {}
1868#if TBB_PREVIEW_FLOW_GRAPH_TRACE
1874#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
1876 input_impl_type::my_built_predecessors.receiver_extract(*
this);
1877 successors().built_successors().sender_extract(*
this);
1885 using input_impl_type::try_put_task;
1896template <
typename T>
1903#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
1909#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
1910 internal::edge_container<predecessor_type> my_built_predecessors;
1921#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
1922 template <
typename... Args>
1924 make_edges_in_order(nodes, *
this);
1937#if TBB_PREVIEW_FLOW_GRAPH_TRACE
1955#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
1976 typedef typename receiver<T>::built_predecessors_type built_predecessors_type;
1978 built_predecessors_type &built_predecessors()
__TBB_override {
return my_built_predecessors; }
1982 my_built_predecessors.add_edge(
p);
1987 my_built_predecessors.delete_edge(
p);
1992 return my_built_predecessors.edge_count();
1995 void copy_predecessors(predecessor_list_type &v)
__TBB_override {
1997 my_built_predecessors.copy_edges(v);
2001 my_built_predecessors.receiver_extract(*
this);
2026#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
2027 my_built_predecessors.clear();
2035template <
typename T,
typename Allocator=__TBB_DEFAULT_NODE_ALLOCATOR(T) >
2038#if TBB_DEPRECATED_FLOW_NODE_ALLOCATOR
2044#if TBB_DEPRECATED_FLOW_NODE_ALLOCATOR
2055#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
2059#if !TBB_DEPRECATED_FLOW_NODE_ALLOCATOR
2062 "Allocator template parameter for flow graph nodes is deprecated and will be removed. "
2063 "Specify TBB_DEPRECATED_FLOW_NODE_ALLOCATOR to temporary enable the deprecated interface."
2071#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
2072 internal::edge_container<predecessor_type> my_built_predecessors;
2078#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
2079 , add_blt_succ, del_blt_succ,
2080 add_blt_pred, del_blt_pred,
2081 blt_succ_cnt, blt_pred_cnt,
2082 blt_succ_cpy, blt_pred_cpy
2090#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
2097 successor_list_type *svec;
2098 predecessor_list_type *pvec;
2107#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
2110 ,
elem(const_cast<T*>(&e)) ,
ltask(NULL)
2125 template<
typename derived_type>
2130 bool try_forwarding =
false;
2133 op_list = op_list->
next;
2134 switch (tmp->
type) {
2143#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
2145 case add_blt_succ: internal_add_built_succ(tmp);
break;
2146 case del_blt_succ: internal_del_built_succ(tmp);
break;
2147 case add_blt_pred: internal_add_built_pred(tmp);
break;
2148 case del_blt_pred: internal_del_built_pred(tmp);
break;
2149 case blt_succ_cnt: internal_succ_cnt(tmp);
break;
2150 case blt_pred_cnt: internal_pred_cnt(tmp);
break;
2151 case blt_succ_cpy: internal_copy_succs(tmp);
break;
2152 case blt_pred_cpy: internal_copy_preds(tmp);
break;
2161 forwarder_busy =
true;
2163 forward_task_bypass<class_type>(*
this);
2175 return op_data.
ltask;
2190 task *last_task = NULL;
2193 op_data.
ltask = NULL;
2216#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
2221 virtual void internal_add_built_succ(buffer_operation *op) {
2226 virtual void internal_del_built_succ(buffer_operation *op) {
2231 typedef typename receiver<T>::built_predecessors_type built_predecessors_type;
2233 built_predecessors_type &built_predecessors()
__TBB_override {
return my_built_predecessors; }
2235 virtual void internal_add_built_pred(buffer_operation *op) {
2236 my_built_predecessors.add_edge(*(op->p));
2240 virtual void internal_del_built_pred(buffer_operation *op) {
2241 my_built_predecessors.delete_edge(*(op->p));
2245 virtual void internal_succ_cnt(buffer_operation *op) {
2250 virtual void internal_pred_cnt(buffer_operation *op) {
2251 op->cnt_val = my_built_predecessors.edge_count();
2255 virtual void internal_copy_succs(buffer_operation *op) {
2260 virtual void internal_copy_preds(buffer_operation *op) {
2261 my_built_predecessors.copy_edges(*(op->pvec));
2290 template<
typename derived_type>
2294 if (this->
my_reserved || !derived->is_item_valid()) {
2296 this->forwarder_busy =
false;
2300 task * last_task = NULL;
2302 for (; counter > 0 && derived->is_item_valid(); --counter)
2303 derived->try_put_and_add_task(last_task);
2305 op->
ltask = last_task;
2306 if (last_task && !counter) {
2361#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
2362 template <
typename... Args>
2364 make_edges_in_order(nodes, *
this);
2379#if TBB_PREVIEW_FLOW_GRAPH_TRACE
2399#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
2401 buffer_operation op_data(add_blt_succ);
2407 buffer_operation op_data(del_blt_succ);
2413 buffer_operation op_data(add_blt_pred);
2419 buffer_operation op_data(del_blt_pred);
2425 buffer_operation op_data(blt_pred_cnt);
2427 return op_data.cnt_val;
2431 buffer_operation op_data(blt_succ_cnt);
2433 return op_data.cnt_val;
2436 void copy_predecessors( predecessor_list_type &v )
__TBB_override {
2437 buffer_operation op_data(blt_pred_cpy);
2443 buffer_operation op_data(blt_succ_cpy);
2454 r.remove_predecessor(*
this);
2536#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
2539 my_built_predecessors.receiver_extract(*
this);
2550#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
2551 my_built_predecessors.clear();
2559template <
typename T,
typename Allocator=__TBB_DEFAULT_NODE_ALLOCATOR(T) >
2561#if !TBB_DEPRECATED_FLOW_NODE_ALLOCATOR
2564 "Allocator template parameter for flow graph nodes is deprecated and will be removed. "
2565 "Specify TBB_DEPRECATED_FLOW_NODE_ALLOCATOR to temporary enable the deprecated interface."
2582 task *new_task = this->my_successors.try_put_task(this->
front());
2632#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
2633 template <
typename... Args>
2635 make_edges_in_order(nodes, *
this);
2646#if TBB_PREVIEW_FLOW_GRAPH_TRACE
2659template<
typename T,
typename Allocator=__TBB_DEFAULT_NODE_ALLOCATOR(T) >
2665#if !TBB_DEPRECATED_FLOW_NODE_ALLOCATOR
2668 "Allocator template parameter for flow graph nodes is deprecated and will be removed. "
2669 "Specify TBB_DEPRECATED_FLOW_NODE_ALLOCATOR to temporary enable the deprecated interface."
2678 template<
typename Sequencer >
2686#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
2687 template <
typename Sequencer,
typename... Args>
2690 make_edges_in_order(nodes, *
this);
2705#if TBB_PREVIEW_FLOW_GRAPH_TRACE
2717 size_type tag = (*my_sequencer)(*(op->elem));
2718#if !TBB_DEPRECATED_SEQUENCER_DUPLICATES
2726 size_t new_tail = (tag+1 > this->
my_tail) ? tag+1 : this->
my_tail;
2740template<
typename T,
typename Compare = std::less<T>,
typename Allocator=__TBB_DEFAULT_NODE_ALLOCATOR(T)>
2743#if !TBB_DEPRECATED_FLOW_NODE_ALLOCATOR
2746 "Allocator template parameter for flow graph nodes is deprecated and will removed in the future. "
2747 "To temporary enable the deprecated interface specify TBB_ENABLE_DEPRECATED_NODE_ALLOCATOR."
2765#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
2766 template <
typename... Args>
2769 make_edges_in_order(nodes, *
this);
2782#if TBB_PREVIEW_FLOW_GRAPH_TRACE
2821 *(op->elem) =
prio();
2834 *(op->elem) =
prio();
2866 task * new_task = this->my_successors.try_put_task(this->
prio());
2933 size_type cur_pos =
mark;
2950 while (child <
mark) {
2963 child = (cur_pos<<1)+1;
2970namespace interface11 {
2976template<
typename T,
typename DecrementType=continue_msg >
2983#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
3013 bool reserved =
false;
3071 if( delta > 0 &&
size_t(delta) >
my_count )
3095#if TBB_DEPRECATED_LIMITER_NODE_CONSTRUCTOR
3097 "Deprecated interface of the limiter node can be used only in conjunction "
3098 "with continue_msg as the type of DecrementType template parameter." );
3107 init_decrement_predecessors(num_decrement_predecessors),
3108 decrement(num_decrement_predecessors)) {
3112#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
3113 template <
typename... Args>
3114 limiter_node(
const node_set<Args...>& nodes,
size_t threshold)
3116 make_edges_in_order(nodes, *
this);
3126 init_decrement_predecessors(src.init_decrement_predecessors),
3127 decrement(src.init_decrement_predecessors)) {
3131#if TBB_PREVIEW_FLOW_GRAPH_TRACE
3156 r.remove_predecessor(*
this);
3161#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
3189 void copy_predecessors(predecessor_list_type &v)
__TBB_override {
3240 rtask =
new ( task::allocate_additional_child_of( *(this->
my_graph.
root_task()) ) )
3280template<
typename OutputTuple,
typename JP=queueing>
class join_node;
3282template<
typename OutputTuple>
3291 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_RESERVING, &this->my_graph,
3295#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
3296 template <
typename... Args>
3298 make_edges_in_order(nodes, *
this);
3303 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_RESERVING, &this->my_graph,
3307#if TBB_PREVIEW_FLOW_GRAPH_TRACE
3315template<
typename OutputTuple>
3324 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_QUEUEING, &this->my_graph,
3328#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
3329 template <
typename... Args>
3331 make_edges_in_order(nodes, *
this);
3336 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_QUEUEING, &this->my_graph,
3340#if TBB_PREVIEW_FLOW_GRAPH_TRACE
3350template<
typename OutputTuple,
typename K,
typename KHash>
3352 key_matching_port, OutputTuple, key_matching<K,KHash> > {
3360#if __TBB_PREVIEW_MESSAGE_BASED_KEY_MATCHING
3363#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
3364 template <
typename... Args>
3367 make_edges_in_order(nodes, *
this);
3373 template<
typename __TBB_B0,
typename __TBB_B1>
3375 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3378 template<
typename __TBB_B0,
typename __TBB_B1,
typename __TBB_B2>
3380 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3383 template<
typename __TBB_B0,
typename __TBB_B1,
typename __TBB_B2,
typename __TBB_B3>
3385 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3388 template<
typename __TBB_B0,
typename __TBB_B1,
typename __TBB_B2,
typename __TBB_B3,
typename __TBB_B4>
3391 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3394#if __TBB_VARIADIC_MAX >= 6
3395 template<
typename __TBB_B0,
typename __TBB_B1,
typename __TBB_B2,
typename __TBB_B3,
typename __TBB_B4,
3399 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3403#if __TBB_VARIADIC_MAX >= 7
3404 template<
typename __TBB_B0,
typename __TBB_B1,
typename __TBB_B2,
typename __TBB_B3,
typename __TBB_B4,
3405 typename __TBB_B5,
typename __TBB_B6>
3408 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3412#if __TBB_VARIADIC_MAX >= 8
3413 template<
typename __TBB_B0,
typename __TBB_B1,
typename __TBB_B2,
typename __TBB_B3,
typename __TBB_B4,
3414 typename __TBB_B5,
typename __TBB_B6,
typename __TBB_B7>
3416 __TBB_B7 b7) :
unfolded_type(g, b0, b1, b2, b3, b4, b5, b6, b7) {
3417 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3421#if __TBB_VARIADIC_MAX >= 9
3422 template<
typename __TBB_B0,
typename __TBB_B1,
typename __TBB_B2,
typename __TBB_B3,
typename __TBB_B4,
3423 typename __TBB_B5,
typename __TBB_B6,
typename __TBB_B7,
typename __TBB_B8>
3425 __TBB_B7 b7, __TBB_B8 b8) :
unfolded_type(g, b0, b1, b2, b3, b4, b5, b6, b7, b8) {
3426 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3430#if __TBB_VARIADIC_MAX >= 10
3431 template<
typename __TBB_B0,
typename __TBB_B1,
typename __TBB_B2,
typename __TBB_B3,
typename __TBB_B4,
3432 typename __TBB_B5,
typename __TBB_B6,
typename __TBB_B7,
typename __TBB_B8,
typename __TBB_B9>
3434 __TBB_B7 b7, __TBB_B8 b8, __TBB_B9 b9) :
unfolded_type(g, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9) {
3435 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3440#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
3441 template <
typename... Args,
typename... Bodies>
3443 :
join_node(nodes.graph_reference(), bodies...) {
3444 make_edges_in_order(nodes, *
this);
3449 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3453#if TBB_PREVIEW_FLOW_GRAPH_TRACE
3465template<
typename T0,
typename T1=null_type,
typename T2=null_type,
typename T3=null_type,
3466 typename T4=null_type,
typename T5=null_type,
typename T6=null_type,
3467 typename T7=null_type,
typename T8=null_type,
typename T9=null_type>
class indexer_node;
3470template<
typename T0>
3473 static const int N = 1;
3479 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
3483#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
3484 template <
typename... Args>
3486 make_edges_in_order(nodes, *
this);
3492 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
3496#if TBB_PREVIEW_FLOW_GRAPH_TRACE
3503template<
typename T0,
typename T1>
3506 static const int N = 2;
3512 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
3516#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
3517 template <
typename... Args>
3519 make_edges_in_order(nodes, *
this);
3525 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
3529#if TBB_PREVIEW_FLOW_GRAPH_TRACE
3536template<
typename T0,
typename T1,
typename T2>
3539 static const int N = 3;
3545 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
3549#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
3550 template <
typename... Args>
3552 make_edges_in_order(nodes, *
this);
3558 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
3562#if TBB_PREVIEW_FLOW_GRAPH_TRACE
3569template<
typename T0,
typename T1,
typename T2,
typename T3>
3572 static const int N = 4;
3578 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
3582#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
3583 template <
typename... Args>
3585 make_edges_in_order(nodes, *
this);
3591 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
3595#if TBB_PREVIEW_FLOW_GRAPH_TRACE
3602template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4>
3605 static const int N = 5;
3611 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
3615#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
3616 template <
typename... Args>
3618 make_edges_in_order(nodes, *
this);
3624 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
3628#if TBB_PREVIEW_FLOW_GRAPH_TRACE
3635#if __TBB_VARIADIC_MAX >= 6
3636template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
3637class indexer_node<T0, T1, T2, T3, T4, T5> :
public internal::unfolded_indexer_node<tuple<T0, T1, T2, T3, T4, T5> > {
3639 static const int N = 6;
3645 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
3649#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
3650 template <
typename... Args>
3652 make_edges_in_order(nodes, *
this);
3658 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
3662#if TBB_PREVIEW_FLOW_GRAPH_TRACE
3670#if __TBB_VARIADIC_MAX >= 7
3671template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
3673class indexer_node<T0, T1, T2, T3, T4, T5, T6> :
public internal::unfolded_indexer_node<tuple<T0, T1, T2, T3, T4, T5, T6> > {
3675 static const int N = 7;
3681 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
3685#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
3686 template <
typename... Args>
3688 make_edges_in_order(nodes, *
this);
3694 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
3698#if TBB_PREVIEW_FLOW_GRAPH_TRACE
3706#if __TBB_VARIADIC_MAX >= 8
3707template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
3708 typename T6,
typename T7>
3709class indexer_node<T0, T1, T2, T3, T4, T5, T6, T7> :
public internal::unfolded_indexer_node<tuple<T0, T1, T2, T3, T4, T5, T6, T7> > {
3711 static const int N = 8;
3717 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
3721#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
3722 template <
typename... Args>
3724 make_edges_in_order(nodes, *
this);
3730 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
3734#if TBB_PREVIEW_FLOW_GRAPH_TRACE
3742#if __TBB_VARIADIC_MAX >= 9
3743template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
3744 typename T6,
typename T7,
typename T8>
3745class indexer_node<T0, T1, T2, T3, T4, T5, T6, T7, T8> :
public internal::unfolded_indexer_node<tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8> > {
3747 static const int N = 9;
3753 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
3757#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
3758 template <
typename... Args>
3760 make_edges_in_order(nodes, *
this);
3766 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
3770#if TBB_PREVIEW_FLOW_GRAPH_TRACE
3778#if __TBB_VARIADIC_MAX >= 10
3779template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
3780 typename T6,
typename T7,
typename T8,
typename T9>
3783 static const int N = 10;
3785 typedef tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>
InputTuple;
3786 typedef typename internal::tagged_msg<size_t, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> output_type;
3789 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
3793#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
3794 template <
typename... Args>
3796 make_edges_in_order(nodes, *
this);
3802 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
3806#if TBB_PREVIEW_FLOW_GRAPH_TRACE
3814#if __TBB_PREVIEW_ASYNC_MSG
3817template<
typename T >
3820#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
3821 s.internal_add_built_predecessor(
p);
3822 p.internal_add_built_successor(
s);
3824 p.register_successor(
s );
3829template<
typename T >
3834#if __TBB_PREVIEW_ASYNC_MSG
3835template<
typename TS,
typename TR,
3842template<
typename T >
3847template<
typename T >
3854#if __TBB_FLOW_GRAPH_CPP11_FEATURES
3856template<
typename T,
typename V,
3857 typename =
typename T::output_ports_type,
typename =
typename V::input_ports_type >
3859 make_edge(get<0>(output.output_ports()), get<0>(input.input_ports()));
3863template<
typename T,
typename R,
3864 typename =
typename T::output_ports_type >
3866 make_edge(get<0>(output.output_ports()), input);
3870template<
typename S,
typename V,
3871 typename =
typename V::input_ports_type >
3873 make_edge(output, get<0>(input.input_ports()));
3877#if __TBB_PREVIEW_ASYNC_MSG
3880template<
typename T >
3883 p.remove_successor(
s );
3884#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
3886 p.internal_delete_built_successor(
s);
3887 s.internal_delete_built_predecessor(
p);
3893template<
typename T >
3898#if __TBB_PREVIEW_ASYNC_MSG
3899template<
typename TS,
typename TR,
3906template<
typename T >
3911template<
typename T >
3917#if __TBB_FLOW_GRAPH_CPP11_FEATURES
3919template<
typename T,
typename V,
3920 typename =
typename T::output_ports_type,
typename =
typename V::input_ports_type >
3922 remove_edge(get<0>(output.output_ports()), get<0>(input.input_ports()));
3926template<
typename T,
typename R,
3927 typename =
typename T::output_ports_type >
3929 remove_edge(get<0>(output.output_ports()), input);
3932template<
typename S,
typename V,
3933 typename =
typename V::input_ports_type >
3939#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
3940template<
typename C >
3941template<
typename S >
3942void internal::edge_container<C>::sender_extract(
S &
s ) {
3943 edge_list_type e = built_edges;
3944 for (
typename edge_list_type::iterator i = e.begin(); i != e.end(); ++i ) {
3949template<
typename C >
3950template<
typename R >
3951void internal::edge_container<C>::receiver_extract( R &r ) {
3952 edge_list_type e = built_edges;
3953 for (
typename edge_list_type::iterator i = e.begin(); i != e.end(); ++i ) {
3960template<
typename Body,
typename Node >
3962 return n.template copy_function_object<Body>();
3965#if __TBB_FLOW_GRAPH_CPP11_FEATURES
3970template<
typename... InputTypes,
typename... OutputTypes>
3981 static const size_t NUM_INPUTS =
sizeof...(InputTypes);
3982 static const size_t NUM_OUTPUTS =
sizeof...(OutputTypes);
3988#if TBB_PREVIEW_FLOW_GRAPH_TRACE
3999 template<
typename T1,
typename T2>
4003 my_input_ports = tbb::internal::make_unique<input_ports_type>(std::forward<T1>(input_ports_tuple));
4004 my_output_ports = tbb::internal::make_unique<output_ports_type>(std::forward<T2>(output_ports_tuple));
4010 template<
typename... NodeTypes >
4013 template<
typename... NodeTypes >
4016#if TBB_PREVIEW_FLOW_GRAPH_TRACE
4023 __TBB_ASSERT(my_input_ports,
"input ports not set, call set_external_ports to set input ports");
4024 return *my_input_ports;
4028 __TBB_ASSERT(my_output_ports,
"output ports not set, call set_external_ports to set output ports");
4029 return *my_output_ports;
4032#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
4034 __TBB_ASSERT(
false,
"Current composite_node implementation does not support extract");
4040template<
typename... InputTypes>
4047 static const size_t NUM_INPUTS =
sizeof...(InputTypes);
4053#if TBB_PREVIEW_FLOW_GRAPH_TRACE
4064 template<
typename T>
4068 my_input_ports = tbb::internal::make_unique<input_ports_type>(std::forward<T>(input_ports_tuple));
4073 template<
typename... NodeTypes >
4076 template<
typename... NodeTypes >
4079#if TBB_PREVIEW_FLOW_GRAPH_TRACE
4086 __TBB_ASSERT(my_input_ports,
"input ports not set, call set_external_ports to set input ports");
4087 return *my_input_ports;
4090#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
4092 __TBB_ASSERT(
false,
"Current composite_node implementation does not support extract");
4099template<
typename... OutputTypes>
4106 static const size_t NUM_OUTPUTS =
sizeof...(OutputTypes);
4112#if TBB_PREVIEW_FLOW_GRAPH_TRACE
4123 template<
typename T>
4127 my_output_ports = tbb::internal::make_unique<output_ports_type>(std::forward<T>(output_ports_tuple));
4132 template<
typename... NodeTypes >
4135 template<
typename... NodeTypes >
4138#if TBB_PREVIEW_FLOW_GRAPH_TRACE
4145 __TBB_ASSERT(my_output_ports,
"output ports not set, call set_external_ports to set output ports");
4146 return *my_output_ports;
4149#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
4151 __TBB_ASSERT(
false,
"Current composite_node implementation does not support extract");
4161template<
typename Gateway>
4175template<
typename Input,
typename Ports,
typename Gateway,
typename Body>
4197namespace interface11 {
4200template <
typename Input,
typename Output,
4206#if !TBB_DEPRECATED_FLOW_NODE_ALLOCATOR
4209 "Allocator template parameter for flow graph nodes is deprecated and will removed in the future. "
4210 "To temporary enable the deprecated interface specify TBB_ENABLE_DEPRECATED_NODE_ALLOCATOR."
4244 my_node->my_graph.reserve_wait();
4248 my_node->my_graph.release_wait();
4254 return my_node->try_put_impl(i);
4270 bool is_at_least_one_put_successful = port_successors.gather_successful_try_puts(i, tasks);
4272 "Return status is inconsistent with the method operation." );
4274 while( !tasks.
empty() ) {
4278 return is_at_least_one_put_successful;
4282 template<
typename Body>
4294 tbb::internal::fgt_multioutput_node_with_body<1>(
4295 CODEPTR(), tbb::internal::FLOW_ASYNC_NODE,
4297 this->output_ports(), this->my_body
4301#if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT
4302 template <
typename Body,
typename... Args>
4307#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
4308 template <
typename Body,
typename... Args>
4310 const node_set<Args...>& nodes,
size_t concurrency, Body body,
4313 make_edges_in_order(nodes, *
this);
4316#if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES
4317 template <
typename Body,
typename... Args>
4319 : async_node(nodes,
concurrency, body, Policy(), priority) {}
4325 static_cast<async_body_base_type*
>(this->my_init_body->get_body_ptr())->set_gateway(&my_gateway);
4327 tbb::internal::fgt_multioutput_node_with_body<1>(
CODEPTR(), tbb::internal::FLOW_ASYNC_NODE,
4329 this->output_ports(), this->my_body );
4336#if TBB_PREVIEW_FLOW_GRAPH_TRACE
4346 return internal::output_port<0>(*this).register_successor(r);
4351 return internal::output_port<0>(*this).remove_successor(r);
4354 template<
typename Body>
4358 mfn_body_type &body_ref = *this->my_body;
4363#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
4365 typedef typename internal::edge_container<successor_type> built_successors_type;
4366 typedef typename built_successors_type::edge_list_type successor_list_type;
4368 return internal::output_port<0>(*this).built_successors();
4371 void internal_add_built_successor( successor_type &r )
__TBB_override {
4372 internal::output_port<0>(*this).internal_add_built_successor(r);
4375 void internal_delete_built_successor( successor_type &r )
__TBB_override {
4376 internal::output_port<0>(*this).internal_delete_built_successor(r);
4380 internal::output_port<0>(*this).copy_successors(l);
4384 return internal::output_port<0>(*this).successor_count();
4391 base_type::reset_node(f);
4395#if __TBB_PREVIEW_STREAMING_NODE
4401template<
typename T >
4408#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
4416 my_successors.set_owner(
this );
4421#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
4422 template <
typename... Args>
4424 make_edges_in_order(nodes, *
this);
4432 my_successors.set_owner(
this );
4439#if TBB_PREVIEW_FLOW_GRAPH_TRACE
4449 bool ret =
s.try_put( my_buffer );
4452 my_successors.register_successor(
s );
4458 task *rtask =
new ( task::allocate_additional_child_of( *( my_graph.root_task() ) ) )
4464 my_successors.register_successor(
s );
4471 my_successors.remove_successor(
s);
4475#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
4476 built_predecessors_type &built_predecessors()
__TBB_override {
return my_built_predecessors; }
4477 built_successors_type &built_successors()
__TBB_override {
return my_successors.built_successors(); }
4479 void internal_add_built_successor( successor_type &
s)
__TBB_override {
4481 my_successors.internal_add_built_successor(
s);
4484 void internal_delete_built_successor( successor_type &
s)
__TBB_override {
4486 my_successors.internal_delete_built_successor(
s);
4491 return my_successors.successor_count();
4496 my_successors.copy_successors(v);
4499 void internal_add_built_predecessor( predecessor_type &
p)
__TBB_override {
4501 my_built_predecessors.add_edge(
p);
4504 void internal_delete_built_predecessor( predecessor_type &
p)
__TBB_override {
4506 my_built_predecessors.delete_edge(
p);
4511 return my_built_predecessors.edge_count();
4514 void copy_predecessors( predecessor_list_type &v )
__TBB_override {
4516 my_built_predecessors.copy_edges(v);
4520 my_buffer_is_valid =
false;
4521 built_successors().sender_extract(*
this);
4522 built_predecessors().receiver_extract(*
this);
4529 if ( my_buffer_is_valid ) {
4549 return my_buffer_is_valid;
4554 my_buffer_is_valid =
false;
4564 return try_put_task_impl(v);
4569 my_buffer_is_valid =
true;
4583 o(owner),
s(succ) {};
4586 if (!
s.register_predecessor(o)) {
4587 o.register_successor(
s);
4598#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
4599 internal::edge_container<predecessor_type> my_built_predecessors;
4606 my_buffer_is_valid =
false;
4608 my_successors.clear();
4613template<
typename T >
4629#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
4630 template <
typename... Args>
4632 make_edges_in_order(nodes, *
this);
4643#if TBB_PREVIEW_FLOW_GRAPH_TRACE
4655 return this->my_buffer_is_valid ? NULL : this->try_put_task_impl(v);
4666 using interface11::graph;
4667 using interface11::graph_node;
4668 using interface11::continue_msg;
4669 using interface11::source_node;
4670 using interface11::input_node;
4671 using interface11::function_node;
4672 using interface11::multifunction_node;
4673 using interface11::split_node;
4675 using interface11::indexer_node;
4676 using interface11::internal::tagged_msg;
4679 using interface11::continue_node;
4680 using interface11::overwrite_node;
4681 using interface11::write_once_node;
4682 using interface11::broadcast_node;
4683 using interface11::buffer_node;
4684 using interface11::queue_node;
4685 using interface11::sequencer_node;
4686 using interface11::priority_queue_node;
4687 using interface11::limiter_node;
4688 using namespace interface11::internal::graph_policy_namespace;
4689 using interface11::join_node;
4695#if __TBB_FLOW_GRAPH_CPP11_FEATURES
4696 using interface11::composite_node;
4698 using interface11::async_node;
4699#if __TBB_PREVIEW_ASYNC_MSG
4702#if __TBB_PREVIEW_STREAMING_NODE
4706#if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES
4711#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
4712 using interface11::internal::follows;
4713 using interface11::internal::precedes;
4714 using interface11::internal::make_node_set;
4715 using interface11::internal::make_edges;
4724#undef __TBB_PFG_RESET_ARG
4726#undef __TBB_DEFAULT_NODE_ALLOCATOR
4729#undef __TBB_flow_graph_H_include_area
4731#if TBB_USE_THREADING_TOOLS && TBB_PREVIEW_FLOW_GRAPH_TRACE && ( __linux__ || __APPLE__ )
4732 #undef __TBB_NOINLINE_SYM
__TBB_DEPRECATED internal::port_ref_impl< N1, N2 > port_ref()
class __TBB_DEPRECATED streaming_node
#define __TBB_FLOW_GRAPH_PRIORITY_ARG1(arg1, priority)
#define __TBB_DEPRECATED_LIMITER_ARG2(arg1, arg2)
#define __TBB_FLOW_GRAPH_PRIORITY_ARG0(priority)
#define __TBB_FLOW_GRAPH_PRIORITY_EXPR(expr)
#define __TBB_DEPRECATED_LIMITER_ARG4(arg1, arg2, arg3, arg4)
#define __TBB_DEPRECATED_LIMITER_EXPR(expr)
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
#define __TBB_STATIC_ASSERT(condition, msg)
#define __TBB_CPP11_PRESENT
#define __TBB_NOINLINE_SYM
#define __TBB_DEFAULT_NODE_ALLOCATOR(T)
void const char const char int ITT_FORMAT __itt_group_sync s
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 * lock
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 begin
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
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 x void const char * name
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 parent
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 value
void const char const char int ITT_FORMAT __itt_group_sync p
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 type
class __TBB_DEPRECATED_MSG("tbb::tbb_hash is deprecated, use std::hash") tbb_hash
static void fgt_async_try_put_end(void *, void *)
static void fgt_async_reserve(void *, void *)
static void fgt_multioutput_node_desc(const NodeType *, const char *)
static void fgt_async_try_put_begin(void *, void *)
static void fgt_begin_body(void *)
void call(F &&f, Pack &&p)
Calls the given function with arguments taken from a stored_pack.
static void fgt_node(void *, string_index, void *, void *)
static void fgt_reserve_wait(void *)
static void fgt_graph(void *)
static void fgt_node_with_body(void *, string_index, void *, void *, void *)
static void fgt_release_wait(void *)
static void fgt_async_commit(void *, void *)
static void fgt_composite(void *, void *, void *)
void fgt_multiinput_multioutput_node_desc(const NodeType *, const char *)
static void fgt_multiinput_multioutput_node(void *, string_index, void *, void *)
static void fgt_remove_edge(void *, void *)
static void fgt_end_body(void *)
void __TBB_store_with_release(volatile T &location, V value)
static void fgt_node_desc(const NodeType *, const char *)
static void fgt_make_edge(void *, void *)
static void fgt_graph_desc(void *, const char *)
K key_from_message(const T &t)
concurrency
An enumeration the provides the two most common concurrency levels: unlimited and serial.
void internal_remove_edge(internal::untyped_sender &p, internal::untyped_receiver &s)
void internal_make_edge(internal::untyped_sender &p, internal::untyped_receiver &s)
void make_edge(sender< T > &p, receiver< T > &s)
Makes an edge between a single predecessor and a single successor.
static tbb::task * combine_tasks(graph &g, tbb::task *left, tbb::task *right)
class __TBB_DEPRECATED async_msg
void remove_edge(sender< T > &p, receiver< T > &s)
Removes an edge between a single predecessor and a single successor.
Body copy_body(Node &n)
Returns a copy of the body from a function or continue node.
void spawn_in_graph_arena(tbb::flow::interface10::graph &g, tbb::task &arena_task)
Spawns a task inside graph arena.
void deactivate_graph(tbb::flow::interface10::graph &g)
void enqueue_in_graph_arena(tbb::flow::interface10::graph &g, tbb::task &arena_task)
Enqueues a task inside graph arena.
bool is_graph_active(tbb::flow::interface10::graph &g)
void add_task_to_graph_reset_list(tbb::flow::interface10::graph &g, tbb::task *tp)
void activate_graph(tbb::flow::interface10::graph &g)
void add_nodes_impl(CompositeType *, bool)
tbb::internal::uint64_t tag_value
tbb::flow::tuple_element< N, typenameJNT::input_ports_type >::type & input_port(JNT &jn)
templated function to refer to input ports of the join node
const V & cast_to(T const &t)
tbb::flow::tuple_element< N, typenameMOP::output_ports_type >::type & output_port(MOP &op)
interface11::internal::Policy< queueing, lightweight > queueing_lightweight
static const node_priority_t no_priority
unsigned int node_priority_t
static tbb::task *const SUCCESSFULLY_ENQUEUED
Meets "allocator" requirements of ISO C++ Standard, Section 20.1.5.
An empty class used for messages that mean "I'm done".
Forward declaration section.
__TBB_DEPRECATED typedef T output_type
The output type of this sender.
virtual bool try_get(T &)
Request an item from the sender.
virtual bool try_get_wrapper(void *p, bool is_async) __TBB_override
virtual bool try_reserve(T &)
Reserves an item in the sender.
__TBB_DEPRECATED typedef internal::async_helpers< T >::filtered_type filtered_type
virtual bool try_reserve_wrapper(void *p, bool is_async) __TBB_override
Pure virtual template class that defines a receiver of messages of type T.
__TBB_DEPRECATED typedef T input_type
The input type of this receiver.
__TBB_DEPRECATED typedef internal::async_helpers< T >::filtered_type filtered_type
virtual task * try_put_task_wrapper(const void *p, bool is_async) __TBB_override
bool try_put(const typename internal::async_helpers< T >::async_type &t)
bool try_put(const typename internal::async_helpers< T >::filtered_type &t)
Put an item to the receiver.
virtual task * try_put_task(const T &t)=0
Put item to successor; return task to run the successor if possible.
Forwards messages only if the threshold has not been reached.
bool remove_successor(successor_type &r) __TBB_override
Removes a successor from this node.
bool register_successor(successor_type &r) __TBB_override
Replace the current successor with this new successor.
task * try_put_task(const T &t) __TBB_override
Puts an item to this receiver.
limiter_node(graph &g, __TBB_DEPRECATED_LIMITER_ARG2(size_t threshold, int num_decrement_predecessors=0))
Constructor.
bool register_predecessor(predecessor_type &src) __TBB_override
Adds src to the list of cached predecessors.
internal::broadcast_cache< T > my_successors
limiter_node(const limiter_node &src)
Copy constructor.
void reset_receiver(reset_flags) __TBB_override
put receiver back in initial state
bool remove_predecessor(predecessor_type &src) __TBB_override
Removes src from the list of cached predecessors.
graph & graph_reference() const __TBB_override
internal::decrementer< limiter_node< T, DecrementType >, DecrementType > decrement
The internal receiver< DecrementType > that decrements the count.
internal::reservable_predecessor_cache< T, spin_mutex > my_predecessors
receiver< input_type >::predecessor_type predecessor_type
void reset_node(reset_flags f) __TBB_override
task * decrement_counter(long long delta)
sender< output_type >::successor_type successor_type
async_msg< T > async_type
static const void * to_void_ptr(const T &t)
static const T & from_void_ptr(const void *p)
static T & from_void_ptr(void *p)
static task * try_put_task_wrapper_impl(receiver< T > *const this_recv, const void *p, bool is_async)
static void * to_void_ptr(T &t)
static const bool is_async_type
static const T & from_void_ptr(const void *p)
static const void * to_void_ptr(const T &t)
static task * try_put_task_wrapper_impl(receiver< T > *const this_recv, const void *p, bool is_async)
static void * to_void_ptr(T &t)
static T & from_void_ptr(void *p)
T::async_msg_data_type filtered_type
virtual ~untyped_sender()
virtual bool try_get_wrapper(void *p, bool is_async)=0
virtual bool try_consume()
Consumes the reserved item.
bool try_reserve(X &t)
Reserves an item in the sender.
untyped_receiver successor_type
The successor type for this node.
virtual bool register_successor(successor_type &r)=0
Add a new successor to this node.
virtual bool try_release()
Releases the reserved item.
virtual bool remove_successor(successor_type &r)=0
Removes a successor from this node.
bool try_get(X &t)
Request an item from the sender.
virtual bool try_reserve_wrapper(void *p, bool is_async)=0
virtual bool register_predecessor(predecessor_type &)
Add a predecessor to the node.
bool try_put(const X &t)
Put an item to the receiver.
virtual void reset_receiver(reset_flags f=rf_reset_protocol)=0
put receiver back in initial state
virtual graph & graph_reference() const =0
virtual bool remove_predecessor(predecessor_type &)
Remove a predecessor from the node.
friend class run_and_put_task
untyped_sender predecessor_type
The predecessor type for this node.
virtual task * try_put_task_wrapper(const void *p, bool is_async)=0
task * try_put_task(const X &t)
virtual bool is_continue_receiver()
friend class proxy_dependency_receiver
virtual ~untyped_receiver()
Destructor.
Base class for receivers of completion messages.
task * try_put_task(const input_type &) __TBB_override
__TBB_DEPRECATED typedef continue_msg input_type
The input type.
int my_initial_predecessor_count
__TBB_DEPRECATED bool register_predecessor(predecessor_type &) __TBB_override
Increments the trigger threshold.
void reset_receiver(reset_flags f) __TBB_override
put receiver back in initial state
__TBB_DEPRECATED continue_receiver(__TBB_FLOW_GRAPH_PRIORITY_ARG1(int number_of_predecessors, node_priority_t priority))
Constructor.
bool is_continue_receiver() __TBB_override
__TBB_DEPRECATED continue_receiver(const continue_receiver &src)
Copy constructor.
__TBB_DEPRECATED typedef receiver< input_type >::predecessor_type predecessor_type
The predecessor type for this node.
__TBB_DEPRECATED bool remove_predecessor(predecessor_type &) __TBB_override
Decrements the trigger threshold.
virtual task * execute()=0
Does whatever should happen when the threshold is reached.
An executable node that acts as a source, i.e. it has no predecessors.
bool try_release() __TBB_override
Release a reserved item.
internal::source_body< output_type > * my_body
bool remove_successor(successor_type &r) __TBB_override
Removes a successor from this node.
output_type my_cached_item
void spawn_put()
Spawns a task that applies the body.
bool try_reserve_apply_body(output_type &v)
bool register_successor(successor_type &r) __TBB_override
Add a new successor to this node.
__TBB_NOINLINE_SYM input_node(const input_node &src)
Copy constructor.
Body copy_function_object()
bool try_reserve(output_type &v) __TBB_override
Reserves an item.
void activate()
Activates a node that was created in the inactive state.
internal::broadcast_cache< output_type > my_successors
void reset_node(reset_flags f) __TBB_override
resets the source_node to its initial state
sender< output_type >::successor_type successor_type
The type of successors of this node.
Output output_type
The type of the output message, which is complete.
bool try_consume() __TBB_override
Consumes a reserved item.
bool try_get(output_type &v) __TBB_override
Request an item from the node.
__TBB_NOINLINE_SYM input_node(graph &g, Body body)
Constructor for a node with a successor.
internal::source_body< output_type > * my_init_body
~input_node()
The destructor.
task * apply_body_bypass()
Applies the body. Returning SUCCESSFULLY_ENQUEUED okay; forward_task_bypass will handle it.
An executable node that acts as a source, i.e. it has no predecessors.
bool try_consume() __TBB_override
Consumes a reserved item.
__TBB_NOINLINE_SYM source_node(const source_node &src)
Copy constructor.
bool remove_successor(successor_type &r) __TBB_override
Removes a successor from this node.
bool try_reserve_apply_body(output_type &v)
__TBB_NOINLINE_SYM source_node(graph &g, Body body, bool is_active=true)
Constructor for a node with a successor.
void activate()
Activates a node that was created in the inactive state.
bool register_successor(successor_type &r) __TBB_override
Add a new successor to this node.
Output output_type
The type of the output message, which is complete.
void reset_node(reset_flags f) __TBB_override
resets the source_node to its initial state
output_type my_cached_item
task * apply_body_bypass()
Applies the body. Returning SUCCESSFULLY_ENQUEUED okay; forward_task_bypass will handle it.
internal::source_body< output_type > * my_init_body
internal::source_body< output_type > * my_body
sender< output_type >::successor_type successor_type
The type of successors of this node.
internal::broadcast_cache< output_type > my_successors
Body copy_function_object()
bool try_release() __TBB_override
Release a reserved item.
bool try_get(output_type &v) __TBB_override
Request an item from the node.
~source_node()
The destructor.
bool try_reserve(output_type &v) __TBB_override
Reserves an item.
Implements a function node that supports Input -> Output.
internal::broadcast_cache< output_type > & successors() __TBB_override
fOutput_type::successor_type successor_type
internal::function_output< output_type > fOutput_type
internal::function_input_queue< input_type, internals_allocator > input_queue_type
input_impl_type::predecessor_type predecessor_type
cache_aligned_allocator< Input > internals_allocator
__TBB_NOINLINE_SYM function_node(const function_node &src)
Copy constructor.
internal::function_input< input_type, output_type, Policy, internals_allocator > input_impl_type
__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 function_node(graph &g, size_t concurrency, __TBB_FLOW_GRAPH_PRIORITY_ARG1(Body body, node_priority_t priority=tbb::flow::internal::no_priority))
Constructor.
void reset_node(reset_flags f) __TBB_override
implements a function node that supports Input -> (set of outputs)
__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.")
void reset_node(reset_flags f) __TBB_override
__TBB_NOINLINE_SYM multifunction_node(const multifunction_node &other)
__TBB_NOINLINE_SYM multifunction_node(graph &g, size_t concurrency,)
internal::multifunction_input< input_type, output_ports_type, Policy, internals_allocator > input_impl_type
internal::function_input_queue< input_type, internals_allocator > input_queue_type
internal::wrap_tuple_elements< N, internal::multifunction_output, Output >::type output_ports_type
cache_aligned_allocator< Input > internals_allocator
split_node: accepts a tuple as input, forwards each element of the tuple to its
output_ports_type & output_ports()
task * try_put_task(const TupleType &t) __TBB_override
Put item to successor; return task to run the successor if possible.
__TBB_NOINLINE_SYM split_node(graph &g)
__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.")
internal::wrap_tuple_elements< N, internal::multifunction_output, TupleType >::type output_ports_type
receiver< TupleType > base_type
graph & graph_reference() const __TBB_override
void reset_receiver(reset_flags) __TBB_override
put receiver back in initial state
void reset_node(reset_flags f) __TBB_override
output_ports_type my_output_ports
__TBB_NOINLINE_SYM split_node(const split_node &other)
Implements an executable node that supports continue_msg -> Output.
internal::broadcast_cache< output_type > & successors() __TBB_override
internal::continue_input< Output, Policy > input_impl_type
internal::function_output< output_type > fOutput_type
__TBB_NOINLINE_SYM continue_node(const continue_node &src)
Copy constructor.
__TBB_NOINLINE_SYM continue_node(graph &g,)
Constructor for executable node with continue_msg -> Output.
void reset_node(reset_flags f) __TBB_override
input_impl_type::predecessor_type predecessor_type
fOutput_type::successor_type successor_type
__TBB_NOINLINE_SYM continue_node(graph &g, int number_of_predecessors,)
Constructor for executable node with continue_msg -> Output.
Forwards messages of type T to all successors.
__TBB_NOINLINE_SYM broadcast_node(graph &g)
internal::broadcast_cache< input_type > my_successors
void reset_receiver(reset_flags) __TBB_override
put receiver back in initial state
__TBB_NOINLINE_SYM broadcast_node(const broadcast_node &src)
graph & graph_reference() const __TBB_override
sender< output_type >::successor_type successor_type
void reset_node(reset_flags f) __TBB_override
receiver< input_type >::predecessor_type predecessor_type
task * try_put_task(const T &t) __TBB_override
build a task to run the successor if possible. Default is old behavior.
bool register_successor(successor_type &r) __TBB_override
Adds a successor.
bool remove_successor(successor_type &r) __TBB_override
Removes s as a successor.
Forwards messages in arbitrary order.
bool try_consume() __TBB_override
Consumes a reserved item.
bool try_reserve(T &v) __TBB_override
Reserves an item.
sender< output_type >::successor_type successor_type
virtual bool internal_push(buffer_operation *op)
__TBB_NOINLINE_SYM buffer_node(graph &g)
Constructor.
void try_put_and_add_task(task *&last_task)
receiver< input_type >::predecessor_type predecessor_type
void handle_operations_impl(buffer_operation *op_list, derived_type *derived)
bool try_release() __TBB_override
Release a reserved item.
virtual void internal_rem_succ(buffer_operation *op)
Remove successor.
internal::round_robin_cache< T, null_rw_mutex > my_successors
__TBB_NOINLINE_SYM buffer_node(const buffer_node &src)
Copy constructor.
bool try_get(T &v) __TBB_override
Request an item from the buffer_node.
virtual void internal_consume(buffer_operation *op)
virtual void internal_pop(buffer_operation *op)
virtual void internal_reserve(buffer_operation *op)
graph & graph_reference() const __TBB_override
internal::aggregator< handler_type, buffer_operation > my_aggregator
internal::aggregating_functor< class_type, buffer_operation > handler_type
void reset_receiver(reset_flags) __TBB_override
put receiver back in initial state
__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.")
buffer_node< T, Allocator > class_type
void reset_node(reset_flags f) __TBB_override
bool register_successor(successor_type &r) __TBB_override
Adds a new successor.
bool enqueue_forwarding_task(buffer_operation &op_data)
task * try_put_task(const T &t) __TBB_override
receive an item, return a task *if possible
cache_aligned_allocator< T > internals_allocator
void internal_forward_task_impl(buffer_operation *op, derived_type *derived)
virtual void handle_operations(buffer_operation *op_list)
virtual void internal_forward_task(buffer_operation *op)
Tries to forward valid items to successors.
task * grab_forwarding_task(buffer_operation &op_data)
virtual void internal_reg_succ(buffer_operation *op)
Register successor.
bool remove_successor(successor_type &r) __TBB_override
Removes a successor.
virtual void internal_release(buffer_operation *op)
virtual task * forward_task()
This is executed by an enqueued task, the "forwarder".
buffer_operation(const T &e, op_type t)
buffer_operation(op_type t)
Forwards messages in FIFO order.
__TBB_NOINLINE_SYM queue_node(const queue_node &src)
Copy constructor.
__TBB_NOINLINE_SYM queue_node(graph &g)
Constructor.
void try_put_and_add_task(task *&last_task)
base_type::size_type size_type
void internal_pop(queue_operation *op) __TBB_override
void internal_consume(queue_operation *op) __TBB_override
buffer_node< T, Allocator > base_type
receiver< input_type >::predecessor_type predecessor_type
void internal_forward_task(queue_operation *op) __TBB_override
void reset_node(reset_flags f) __TBB_override
void internal_reserve(queue_operation *op) __TBB_override
__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.")
base_type::buffer_operation queue_operation
sender< output_type >::successor_type successor_type
Forwards messages in sequence order.
buffer_node< T, Allocator >::size_type size_type
~sequencer_node()
Destructor.
receiver< input_type >::predecessor_type predecessor_type
__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 internal_push(sequencer_operation *op) __TBB_override
__TBB_NOINLINE_SYM sequencer_node(graph &g, const Sequencer &s)
Constructor.
buffer_node< T, Allocator >::buffer_operation sequencer_operation
sender< output_type >::successor_type successor_type
internal::function_body< T, size_t > * my_sequencer
__TBB_NOINLINE_SYM sequencer_node(const sequencer_node &src)
Copy constructor.
Forwards messages in priority order.
bool internal_push(prio_operation *op) __TBB_override
void try_put_and_add_task(task *&last_task)
void internal_forward_task(prio_operation *op) __TBB_override
Tries to forward valid items to successors.
void internal_pop(prio_operation *op) __TBB_override
buffer_node< T, Allocator >::item_type item_type
__TBB_STATIC_ASSERT((tbb::internal::is_same_type< Allocator, null_type >::value), "Allocator template parameter for flow graph nodes is deprecated and will removed in the future. " "To temporary enable the deprecated interface specify TBB_ENABLE_DEPRECATED_NODE_ALLOCATOR.")
buffer_node< T, Allocator >::buffer_operation prio_operation
void prio_push(const T &src)
buffer_node< T, Allocator >::size_type size_type
buffer_node< T, Allocator > base_type
receiver< input_type >::predecessor_type predecessor_type
void handle_operations(prio_operation *op_list) __TBB_override
sender< output_type >::successor_type successor_type
__TBB_NOINLINE_SYM priority_queue_node(const priority_queue_node &src)
Copy constructor.
void internal_reserve(prio_operation *op) __TBB_override
void internal_consume(prio_operation *op) __TBB_override
__TBB_NOINLINE_SYM priority_queue_node(graph &g, const Compare &comp=Compare())
Constructor.
void internal_release(prio_operation *op) __TBB_override
priority_queue_node class_type
void reset_node(reset_flags f) __TBB_override
__TBB_NOINLINE_SYM join_node(const join_node &other)
internal::unfolded_join_node< N, reserving_port, OutputTuple, reserving > unfolded_type
unfolded_type::input_ports_type input_ports_type
__TBB_NOINLINE_SYM join_node(graph &g)
__TBB_NOINLINE_SYM join_node(const join_node &other)
unfolded_type::input_ports_type input_ports_type
__TBB_NOINLINE_SYM join_node(graph &g)
internal::unfolded_join_node< N, queueing_port, OutputTuple, queueing > unfolded_type
internal::unfolded_join_node< N, key_matching_port, OutputTuple, key_matching< K, KHash > > unfolded_type
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2)
unfolded_type::input_ports_type input_ports_type
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1)
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3, __TBB_B4 b4, __TBB_B5 b5, __TBB_B6 b6)
__TBB_NOINLINE_SYM join_node(const join_node &other)
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3, __TBB_B4 b4, __TBB_B5 b5, __TBB_B6 b6, __TBB_B7 b7, __TBB_B8 b8)
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3, __TBB_B4 b4, __TBB_B5 b5, __TBB_B6 b6, __TBB_B7 b7, __TBB_B8 b8, __TBB_B9 b9)
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3, __TBB_B4 b4)
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3, __TBB_B4 b4, __TBB_B5 b5)
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3)
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3, __TBB_B4 b4, __TBB_B5 b5, __TBB_B6 b6, __TBB_B7 b7)
__TBB_NOINLINE_SYM indexer_node(graph &g)
tuple< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 > InputTuple
internal::unfolded_indexer_node< InputTuple > unfolded_type
internal::tagged_msg< size_t, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 > output_type
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
internal::tagged_msg< size_t, T0 > output_type
__TBB_NOINLINE_SYM indexer_node(graph &g)
internal::unfolded_indexer_node< InputTuple > unfolded_type
internal::unfolded_indexer_node< InputTuple > unfolded_type
internal::tagged_msg< size_t, T0, T1 > output_type
tuple< T0, T1 > InputTuple
__TBB_NOINLINE_SYM indexer_node(graph &g)
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
internal::tagged_msg< size_t, T0, T1, T2 > output_type
__TBB_NOINLINE_SYM indexer_node(graph &g)
internal::unfolded_indexer_node< InputTuple > unfolded_type
tuple< T0, T1, T2 > InputTuple
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
internal::unfolded_indexer_node< InputTuple > unfolded_type
tuple< T0, T1, T2, T3 > InputTuple
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
__TBB_NOINLINE_SYM indexer_node(graph &g)
internal::tagged_msg< size_t, T0, T1, T2, T3 > output_type
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
internal::tagged_msg< size_t, T0, T1, T2, T3, T4 > output_type
internal::unfolded_indexer_node< InputTuple > unfolded_type
tuple< T0, T1, T2, T3, T4 > InputTuple
__TBB_NOINLINE_SYM indexer_node(graph &g)
__TBB_NOINLINE_SYM indexer_node(graph &g)
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
tuple< T0, T1, T2, T3, T4, T5 > InputTuple
internal::unfolded_indexer_node< InputTuple > unfolded_type
internal::tagged_msg< size_t, T0, T1, T2, T3, T4, T5 > output_type
tuple< T0, T1, T2, T3, T4, T5, T6 > InputTuple
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
internal::tagged_msg< size_t, T0, T1, T2, T3, T4, T5, T6 > output_type
__TBB_NOINLINE_SYM indexer_node(graph &g)
internal::unfolded_indexer_node< InputTuple > unfolded_type
internal::unfolded_indexer_node< InputTuple > unfolded_type
internal::tagged_msg< size_t, T0, T1, T2, T3, T4, T5, T6, T7 > output_type
indexer_node(const indexer_node &other)
tuple< T0, T1, T2, T3, T4, T5, T6, T7 > InputTuple
tuple< T0, T1, T2, T3, T4, T5, T6, T7, T8 > InputTuple
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
internal::unfolded_indexer_node< InputTuple > unfolded_type
internal::tagged_msg< size_t, T0, T1, T2, T3, T4, T5, T6, T7, T8 > output_type
__TBB_NOINLINE_SYM indexer_node(graph &g)
output_ports_type & output_ports()
void add_nodes(const NodeTypes &... n)
tbb::flow::tuple< receiver< InputTypes > &... > input_ports_type
input_ports_type & input_ports()
void reset_node(reset_flags) __TBB_override
void add_visible_nodes(const NodeTypes &... n)
std::unique_ptr< output_ports_type > my_output_ports
void set_external_ports(T1 &&input_ports_tuple, T2 &&output_ports_tuple)
std::unique_ptr< input_ports_type > my_input_ports
tbb::flow::tuple< sender< OutputTypes > &... > output_ports_type
void add_visible_nodes(const NodeTypes &... n)
void add_nodes(const NodeTypes &... n)
std::unique_ptr< input_ports_type > my_input_ports
tbb::flow::tuple< receiver< InputTypes > &... > input_ports_type
void reset_node(reset_flags) __TBB_override
void set_external_ports(T &&input_ports_tuple)
input_ports_type & input_ports()
void add_visible_nodes(const NodeTypes &... n)
std::unique_ptr< output_ports_type > my_output_ports
tbb::flow::tuple< sender< OutputTypes > &... > output_ports_type
output_ports_type & output_ports()
__TBB_NOINLINE_SYM composite_node(graph &g)
void add_nodes(const NodeTypes &... n)
void set_external_ports(T &&output_ports_tuple)
void reset_node(reset_flags) __TBB_override
gateway_type * my_gateway
async_body_base(gateway_type *gateway)
void set_gateway(gateway_type *gateway)
async_body(const Body &body, gateway_type *gateway)
async_body_base< Gateway > base_type
void operator()(const Input &v, Ports &)
receiver_type::predecessor_type predecessor_type
bool try_put_impl(const Output &i)
Implements gateway_type::try_put for an external activity to submit a message to FG.
multifunction_node< Input, tuple< Output >, Policy, Allocator > base_type
__TBB_STATIC_ASSERT((tbb::internal::is_same_type< Allocator, null_type >::value), "Allocator template parameter for flow graph nodes is deprecated and will removed in the future. " "To temporary enable the deprecated interface specify TBB_ENABLE_DEPRECATED_NODE_ALLOCATOR.")
internal::multifunction_input< Input, typename base_type::output_ports_type, Policy, Allocator > mfn_input_type
bool remove_successor(successor_type &r) __TBB_override
Removes a successor from this node.
base_type::output_ports_type output_ports_type
internal::async_body_base< gateway_type > async_body_base_type
__TBB_NOINLINE_SYM async_node(const async_node &other)
sender< output_type >::successor_type successor_type
receiver< input_type > receiver_type
bool register_successor(successor_type &r) __TBB_override
Add a new successor to this node.
Body copy_function_object()
void reset_node(reset_flags f) __TBB_override
__TBB_NOINLINE_SYM async_node(graph &g, size_t concurrency,)
receiver_gateway< output_type > gateway_type
internal::multifunction_output< Output > output_port_type
try_put_functor(output_port_type &p, const Output &v)
receiver_gateway_impl(async_node *node)
void reserve_wait() __TBB_override
Inform a graph that messages may come from outside, to prevent premature graph completion.
void release_wait() __TBB_override
Inform a graph that a previous call to reserve_wait is no longer in effect.
bool try_put(const Output &i) __TBB_override
Implements gateway_type::try_put for an external activity to submit a message to FG.
bool try_get(input_type &v) __TBB_override
Request an item from the sender.
internal::broadcast_cache< input_type, null_rw_mutex > my_successors
task * try_put_task(const input_type &v) __TBB_override
Put item to successor; return task to run the successor if possible.
receiver< input_type >::predecessor_type predecessor_type
bool register_successor(successor_type &s) __TBB_override
Add a new successor to this node.
__TBB_NOINLINE_SYM overwrite_node(const overwrite_node &src)
Copy constructor; doesn't take anything from src; default won't work.
bool try_release() __TBB_override
Releases the reserved item.
__TBB_NOINLINE_SYM overwrite_node(graph &g)
void reset_receiver(reset_flags) __TBB_override
put receiver back in initial state
graph & graph_reference() const __TBB_override
task * try_put_task_impl(const input_type &v)
sender< output_type >::successor_type successor_type
bool try_reserve(T &v) __TBB_override
Reserves an item.
bool try_consume() __TBB_override
Consumes the reserved item.
void reset_node(reset_flags f) __TBB_override
bool remove_successor(successor_type &s) __TBB_override
Removes a successor from this node.
Breaks an infinite loop between the node reservation and register_successor call.
register_predecessor_task(predecessor_type &owner, successor_type &succ)
tbb::task * execute() __TBB_override
Should be overridden by derived classes.
sender< output_type >::successor_type successor_type
task * try_put_task(const T &v) __TBB_override
Put item to successor; return task to run the successor if possible.
__TBB_NOINLINE_SYM write_once_node(const write_once_node &src)
Copy constructor: call base class copy constructor.
receiver< input_type >::predecessor_type predecessor_type
__TBB_NOINLINE_SYM write_once_node(graph &g)
Constructor.
overwrite_node< T > base_type
aggregated_operation base class
uintptr_t status
Zero value means "wait" status, all other values are "user" specified values and are defined into the...
field of type K being used for matching.
virtual source_body * clone()=0
The leaf for source_body.
function_body that takes an Input and a set of output ports
leaf for multifunction. OutputSet can be a std::tuple or a vector.
A task that calls a node's forward_task function.
A task that calls a node's apply_body_bypass function with no input.
An abstract cache of successors.
successors_type my_successors
A cache of successors that are broadcast to.
A cache of successors that are put in a round-robin fashion.
Base class for tasks generated by graph nodes.
graph_iterator()
Default constructor.
GraphNodeType & reference
void register_node(tbb::flow::interface11::graph_node *n)
tbb::flow::interface11::graph_iterator< const graph, const tbb::flow::interface11::graph_node > const_iterator
const_iterator cbegin() const
start const iterator
task_list_type my_reset_task_list
tbb::task_group_context * my_context
tbb::flow::interface11::graph_node * my_nodes
void reset(tbb::flow::interface11::reset_flags f=tbb::flow::interface11::rf_reset_protocol)
iterator end()
end iterator
graph()
Constructs a graph with isolated task_group_context.
const_iterator cend() const
end const iterator
void remove_node(tbb::flow::interface11::graph_node *n)
void reserve_wait() __TBB_override
Used to register that an external entity may still interact with the graph.
tbb::spin_mutex nodelist_mutex
tbb::flow::interface11::graph_iterator< graph, tbb::flow::interface11::graph_node > iterator
tbb::task * root_task()
Returns the root task of the graph.
void wait_for_all()
Wait until graph is idle and decrement_wait_count calls equals increment_wait_count calls.
void prepare_task_arena(bool reinit=false)
tbb::task_arena * my_task_arena
tbb::flow::interface11::graph_node * my_nodes_last
iterator begin()
start iterator
void release_wait() __TBB_override
Deregisters an external entity that may have interacted with the graph.
~graph()
Destroys the graph.
The base of all graph nodes.
virtual void reset_node(reset_flags f=rf_reset_protocol)=0
input_type & input_ports()
void destroy_item(size_type i)
bool pop_back(item_type &v)
void move_item(size_t to, size_t from)
const item_type & get_my_item(size_t i) const
bool place_item(size_t here, const item_type &me)
void grow_my_array(size_t minimum_size)
Grows the internal array.
const item_type & front() const
size_type size(size_t new_tail=0)
void fetch_item(size_t i, item_type &o)
bool my_item_valid(size_type i) const
bool pop_front(item_type &v)
void swap_items(size_t i, size_t j)
const item_type & back() const
bool push_back(item_type &v)
item_buffer with reservable front-end. NOTE: if reserving, do not
unfolded_join_node : passes input_ports_type to join_node_base. We build the input port type
wrap_tuple_elements< N, PT, OutputTuple >::type input_ports_type
predecessor_cache< input_type, null_mutex > my_predecessors
task * try_put_task(const input_type &t) __TBB_override
graph & graph_reference() const __TBB_override
Implements methods for a function node that takes a type Input as input and sends.
void reset_function_input(reset_flags f)
function_body_type * my_body
static void clear_this(P &p)
Implements methods for a function node that takes a type Input as input.
void reset(reset_flags f)
output_ports_type & output_ports()
multifunction_body_type * my_body
static task * emit_this(graph &g, const T &t, P &p)
Implements methods for an executable node that takes continue_msg as input.
void reset_receiver(reset_flags f) __TBB_override
function_body_type * my_body
Implements methods for both executable and function nodes that puts Output to its successors.
graph & graph_reference() const
broadcast_cache_type & successors()
broadcast_cache_type my_successors
sender< output_type >::successor_type successor_type
function_output(graph &g)
bool try_put(const output_type &i)
static void alias_port(void *, PortsTuple &)
static void alias_port(void *, PortsTuple &)
Enables one or the other code branches.
Detects whether two given types are the same.
A lock that occupies a single byte.
Represents acquisition of a mutex.
Used to form groups of tasks.
void __TBB_EXPORTED_METHOD reset()
Forcefully reinitializes the context after the task tree it was associated with is completed.
Base class for user-defined tasks.
int decrement_ref_count()
Atomically decrement reference count and returns its new value.
static internal::allocate_root_proxy allocate_root()
Returns proxy for overloaded new that allocates a root task.
void set_ref_count(int count)
Set reference count.
void increment_ref_count()
Atomically increment reference count.
task that does nothing. Useful for synchronization.
task & pop_front()
Pop the front task from the list.
bool empty() const
True if list is empty; false otherwise.
Base class for types that should not be assigned.
Class for determining type of std::allocator<T>::value_type.