17 #ifndef __TBB_flow_graph_H 18 #define __TBB_flow_graph_H 20 #define __TBB_flow_graph_H_include_area 37 #if TBB_USE_THREADING_TOOLS && TBB_PREVIEW_FLOW_GRAPH_TRACE && ( __linux__ || __APPLE__ ) 40 #pragma warning (push) 41 #pragma warning( disable: 2196 ) 43 #define __TBB_NOINLINE_SYM __attribute__((noinline)) 45 #define __TBB_NOINLINE_SYM 48 #if __TBB_PREVIEW_ASYNC_MSG 53 #if __TBB_PREVIEW_STREAMING_NODE 56 #include <unordered_map> 57 #include <type_traits> 58 #endif // __TBB_PREVIEW_STREAMING_NODE 60 #if TBB_DEPRECATED_FLOW_ENQUEUE 61 #define FLOW_SPAWN(a) tbb::task::enqueue((a)) 63 #define FLOW_SPAWN(a) tbb::task::spawn((a)) 67 #if __TBB_CPP11_TUPLE_PRESENT 72 using std::tuple_size;
73 using std::tuple_element;
78 #include "compat/tuple" 100 namespace interface11 {
123 template<
typename T,
typename M>
class reservable_predecessor_cache;
125 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 130 template<
typename Order,
typename... Args>
struct node_set;
133 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 137 class edge_container {
140 typedef std::list<C *, tbb::tbb_allocator<C *> > edge_list_type;
142 void add_edge(C &
s) {
143 built_edges.push_back(&
s);
146 void delete_edge(C &
s) {
147 for (
typename edge_list_type::iterator i = built_edges.begin(); i != built_edges.end(); ++i) {
155 void copy_edges(edge_list_type &v) {
159 size_t edge_count() {
160 return (
size_t)(built_edges.size());
169 template<
typename S >
void sender_extract(
S &
s);
170 template<
typename R >
void receiver_extract(R &r);
173 edge_list_type built_edges;
188 namespace interface11 {
193 if (right == NULL)
return left;
195 if (left == NULL)
return right;
206 #if __TBB_PREVIEW_ASYNC_MSG 214 template<
typename T,
typename =
void >
222 return static_cast<const void*>(&t);
226 return static_cast<void*>(&t);
230 return *static_cast<const T*>(
p);
234 return *static_cast<T*>(
p);
255 template<
typename T >
323 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 324 typedef internal::edge_container<successor_type> built_successors_type;
326 typedef built_successors_type::edge_list_type successor_list_type;
327 virtual built_successors_type &built_successors() = 0;
330 virtual void copy_successors( successor_list_type &) = 0;
331 virtual size_t successor_count() = 0;
335 template<
typename X >
341 template<
typename X >
357 #if __TBB_PREVIEW_OPENCL_NODE 371 if (!res)
return false;
386 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 387 typedef internal::edge_container<predecessor_type> built_predecessors_type;
388 typedef built_predecessors_type::edge_list_type predecessor_list_type;
389 virtual built_predecessors_type &built_predecessors() = 0;
392 virtual void copy_predecessors( predecessor_list_type & ) = 0;
393 virtual size_t predecessor_count() = 0;
416 template<
typename T >
437 __TBB_ASSERT(
false,
"async_msg interface does not support 'pull' protocol in try_get()");
447 __TBB_ASSERT(
false,
"async_msg interface does not support 'pull' protocol in try_reserve()");
453 template<
typename T >
482 #else // __TBB_PREVIEW_ASYNC_MSG 485 template<
typename T >
505 virtual bool try_get( T & ) {
return false; }
516 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 517 __TBB_DEPRECATED typedef typename internal::edge_container<successor_type> built_successors_type;
519 __TBB_DEPRECATED typedef typename built_successors_type::edge_list_type successor_list_type;
529 template<
typename T >
544 if (!res)
return false;
565 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 566 __TBB_DEPRECATED typedef typename internal::edge_container<predecessor_type> built_predecessors_type;
567 __TBB_DEPRECATED typedef typename built_predecessors_type::edge_list_type predecessor_list_type;
582 #if __TBB_PREVIEW_OPENCL_NODE 587 #endif // __TBB_PREVIEW_ASYNC_MSG 632 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 633 __TBB_DEPRECATED typedef internal::edge_container<predecessor_type> built_predecessors_type;
635 built_predecessors_type &built_predecessors()
__TBB_override {
return my_built_predecessors; }
639 my_built_predecessors.add_edge(
s );
644 my_built_predecessors.delete_edge(
s);
649 my_built_predecessors.copy_edges(v);
654 return my_built_predecessors.edge_count();
676 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 679 built_predecessors_type my_built_predecessors;
693 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 694 my_built_predecessors.clear();
711 #if __TBB_PREVIEW_MESSAGE_BASED_KEY_MATCHING 712 template <
typename K,
typename T>
729 namespace interface11 {
734 #if __TBB_PREVIEW_ASYNC_MSG 739 template <
typename C,
typename N>
742 if (
begin) current_node = my_graph->my_nodes;
746 template <
typename C,
typename N>
749 return *operator->();
752 template <
typename C,
typename N>
757 template <
typename C,
typename N>
759 if (current_node) current_node = current_node->next;
764 namespace interface10 {
766 inline graph::graph() : my_nodes(NULL), my_nodes_last(NULL), my_task_arena(NULL) {
779 my_context(&use_this_context), my_nodes(NULL), my_nodes_last(NULL), my_task_arena(NULL) {
870 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 871 inline void graph::set_name(
const char *
name) {
878 namespace interface11 {
890 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 891 using internal::node_set;
895 template <
typename Output >
907 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 913 template<
typename Body >
925 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 926 template <
typename Body,
typename... Successors>
927 source_node(
const node_set<internal::order::preceding, Successors...>& successors, Body body,
bool is_active =
true )
929 make_edges(*
this, successors);
948 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 970 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1059 template<
typename Body>
1065 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1132 return (
new ( task::allocate_additional_child_of( *(this->
my_graph.
root_task()) ) )
1160 template <
typename Input,
typename Output = continue_msg,
typename Policy = queueing,
typename Allocator=cache_aligned_allocator<Input> >
1170 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1171 typedef typename input_impl_type::predecessor_list_type predecessor_list_type;
1172 typedef typename fOutput_type::successor_list_type successor_list_type;
1180 template<
typename Body >
1193 #if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT 1194 template <
typename Body>
1197 #endif // __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT 1199 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 1200 template <
typename Body,
typename... Args>
1204 make_edges_in_order(nodes, *
this);
1207 #if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES 1208 template <
typename Body,
typename... Args>
1211 #endif // __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES 1212 #endif // __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 1223 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 1229 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1232 successors().built_successors().sender_extract(*
this);
1259 template <
typename Input,
typename Output,
typename Policy = queueing,
typename Allocator=cache_aligned_allocator<Input> >
1265 typename internal::wrap_tuple_elements<
1266 tbb::flow::tuple_size<Output>::value,
1267 internal::multifunction_output,
1285 template<
typename Body>
1294 tbb::internal::fgt_multioutput_node_with_body<N>(
1295 CODEPTR(), tbb::internal::FLOW_MULTIFUNCTION_NODE,
1301 #if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT 1302 template <
typename Body>
1305 #endif // TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT 1307 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 1308 template <
typename Body,
typename... Args>
1312 make_edges_in_order(nodes, *
this);
1315 #if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES 1316 template <
typename Body,
typename... Args>
1319 #endif // __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES 1320 #endif // __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 1324 tbb::internal::fgt_multioutput_node_with_body<N>(
CODEPTR(), tbb::internal::FLOW_MULTIFUNCTION_NODE,
1329 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 1335 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1338 base_type::extract();
1348 template<
typename TupleType,
typename Allocator=cache_aligned_allocator<TupleType> >
1355 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1357 typedef typename base_type::predecessor_list_type predecessor_list_type;
1359 typedef typename predecessor_cache_type::built_predecessors_type built_predecessors_type;
1372 tbb::internal::fgt_multioutput_node<N>(
CODEPTR(), tbb::internal::FLOW_SPLIT_NODE, &this->
my_graph,
1376 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 1377 template <
typename... Args>
1379 make_edges_in_order(nodes, *
this);
1387 tbb::internal::fgt_multioutput_node<N>(
CODEPTR(), tbb::internal::FLOW_SPLIT_NODE, &this->
my_graph,
1391 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 1415 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1429 built_predecessors_type &built_predecessors()
__TBB_override {
return my_predessors; }
1432 built_predecessors_type my_predessors;
1440 template <
typename Output,
typename Policy =
internal::Policy<
void> >
1452 template <
typename Body >
1468 #if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT 1469 template <
typename Body>
1474 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 1475 template <
typename Body,
typename... Args>
1479 make_edges_in_order(nodes, *
this);
1481 #if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES 1482 template <
typename Body,
typename... Args>
1485 #endif // __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES 1486 #endif // __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 1489 template <
typename Body >
1491 graph &g,
int number_of_predecessors,
1505 #if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT 1506 template <
typename Body>
1511 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 1512 template <
typename Body,
typename... Args>
1516 make_edges_in_order(nodes, *
this);
1519 #if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES 1520 template <
typename Body,
typename... Args>
1536 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 1542 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1544 input_impl_type::my_built_predecessors.receiver_extract(*
this);
1564 template <
typename T>
1571 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1577 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1578 internal::edge_container<predecessor_type> my_built_predecessors;
1589 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 1590 template <
typename... Args>
1592 make_edges_in_order(nodes, *
this);
1605 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 1623 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1646 built_predecessors_type &built_predecessors()
__TBB_override {
return my_built_predecessors; }
1650 my_built_predecessors.add_edge(
p);
1655 my_built_predecessors.delete_edge(
p);
1660 return my_built_predecessors.edge_count();
1665 my_built_predecessors.copy_edges(v);
1669 my_built_predecessors.receiver_extract(*
this);
1694 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1695 my_built_predecessors.clear();
1703 template <
typename T,
typename A=cache_aligned_allocator<T> >
1711 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1719 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1720 internal::edge_container<predecessor_type> my_built_predecessors;
1726 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1727 , add_blt_succ, del_blt_succ,
1728 add_blt_pred, del_blt_pred,
1729 blt_succ_cnt, blt_pred_cnt,
1730 blt_succ_cpy, blt_pred_cpy
1738 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1745 successor_list_type *svec;
1746 predecessor_list_type *pvec;
1755 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
1765 typedef internal::aggregating_functor<class_type, buffer_operation>
handler_type;
1773 template<
typename derived_type>
1775 __TBB_ASSERT(static_cast<class_type*>(derived) ==
this,
"'this' is not a base class for derived");
1778 bool try_forwarding =
false;
1781 op_list = op_list->next;
1782 switch (tmp->
type) {
1791 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1793 case add_blt_succ: internal_add_built_succ(tmp);
break;
1794 case del_blt_succ: internal_del_built_succ(tmp);
break;
1795 case add_blt_pred: internal_add_built_pred(tmp);
break;
1796 case del_blt_pred: internal_del_built_pred(tmp);
break;
1797 case blt_succ_cnt: internal_succ_cnt(tmp);
break;
1798 case blt_pred_cnt: internal_pred_cnt(tmp);
break;
1799 case blt_succ_cpy: internal_copy_succs(tmp);
break;
1800 case blt_pred_cpy: internal_copy_preds(tmp);
break;
1809 forwarder_busy =
true;
1839 task *last_task = NULL;
1842 op_data.
ltask = NULL;
1865 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1870 virtual void internal_add_built_succ(buffer_operation *op) {
1875 virtual void internal_del_built_succ(buffer_operation *op) {
1882 built_predecessors_type &built_predecessors()
__TBB_override {
return my_built_predecessors; }
1884 virtual void internal_add_built_pred(buffer_operation *op) {
1885 my_built_predecessors.add_edge(*(op->p));
1889 virtual void internal_del_built_pred(buffer_operation *op) {
1890 my_built_predecessors.delete_edge(*(op->p));
1894 virtual void internal_succ_cnt(buffer_operation *op) {
1899 virtual void internal_pred_cnt(buffer_operation *op) {
1900 op->cnt_val = my_built_predecessors.edge_count();
1904 virtual void internal_copy_succs(buffer_operation *op) {
1909 virtual void internal_copy_preds(buffer_operation *op) {
1910 my_built_predecessors.copy_edges(*(op->pvec));
1939 template<
typename derived_type>
1941 __TBB_ASSERT(static_cast<class_type*>(derived) ==
this,
"'this' is not a base class for derived");
1943 if (this->
my_reserved || !derived->is_item_valid()) {
1945 this->forwarder_busy =
false;
1951 for (; counter > 0 && derived->is_item_valid(); --counter)
1952 derived->try_put_and_add_task(last_task);
1955 if (last_task && !counter) {
2008 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 2009 template <
typename... Args>
2011 make_edges_in_order(nodes, *
this);
2025 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 2045 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 2047 buffer_operation op_data(add_blt_succ);
2053 buffer_operation op_data(del_blt_succ);
2059 buffer_operation op_data(add_blt_pred);
2065 buffer_operation op_data(del_blt_pred);
2071 buffer_operation op_data(blt_pred_cnt);
2073 return op_data.cnt_val;
2077 buffer_operation op_data(blt_succ_cnt);
2079 return op_data.cnt_val;
2082 void copy_predecessors( predecessor_list_type &v )
__TBB_override {
2083 buffer_operation op_data(blt_pred_cpy);
2089 buffer_operation op_data(blt_succ_cpy);
2100 r.remove_predecessor(*
this);
2182 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 2185 my_built_predecessors.receiver_extract(*
this);
2196 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 2197 my_built_predecessors.clear();
2205 template <
typename T,
typename A=cache_aligned_allocator<T> >
2271 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 2272 template <
typename... Args>
2274 make_edges_in_order(nodes, *
this);
2285 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 2298 template<
typename T,
typename A=cache_aligned_allocator<T> >
2310 template<
typename Sequencer >
2318 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 2319 template <
typename Sequencer,
typename... Args>
2322 make_edges_in_order(nodes, *
this);
2337 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 2350 #if !TBB_DEPRECATED_SEQUENCER_DUPLICATES 2358 size_t new_tail = (tag+1 > this->
my_tail) ? tag+1 : this->
my_tail;
2372 template<
typename T,
typename Compare = std::less<T>,
typename A=cache_aligned_allocator<T> >
2390 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 2391 template <
typename... Args>
2394 make_edges_in_order(nodes, *
this);
2405 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 2556 size_type cur_pos =
mark;
2573 while (child <
mark) {
2586 child = (cur_pos<<1)+1;
2593 namespace interface11 {
2599 template<
typename T,
typename DecrementType=continue_msg >
2600 class limiter_node :
public graph_node,
public receiver< T >,
public sender< T > {
2606 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 2636 bool reserved =
false;
2694 if( delta > 0 &&
size_t(delta) >
my_count )
2718 #if TBB_DEPRECATED_LIMITER_NODE_CONSTRUCTOR 2720 "Deprecated interface of the limiter node can be used only in conjunction " 2721 "with continue_msg as the type of DecrementType template parameter." );
2722 #endif // Check for incompatible interface 2730 init_decrement_predecessors(num_decrement_predecessors),
2731 decrement(num_decrement_predecessors)) {
2735 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 2736 template <
typename... Args>
2737 limiter_node(
const node_set<Args...>& nodes,
size_t threshold)
2739 make_edges_in_order(nodes, *
this);
2749 init_decrement_predecessors(src.init_decrement_predecessors),
2750 decrement(src.init_decrement_predecessors)) {
2754 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 2779 r.remove_predecessor(*
this);
2784 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 2812 void copy_predecessors(predecessor_list_type &v)
__TBB_override {
2863 rtask =
new ( task::allocate_additional_child_of( *(this->
my_graph.
root_task()) ) )
2903 template<
typename OutputTuple,
typename JP=queueing>
class join_node;
2905 template<
typename OutputTuple>
2914 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_RESERVING, &this->my_graph,
2918 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 2919 template <
typename... Args>
2921 make_edges_in_order(nodes, *
this);
2926 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_RESERVING, &this->my_graph,
2930 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 2938 template<
typename OutputTuple>
2947 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_QUEUEING, &this->my_graph,
2951 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 2952 template <
typename... Args>
2954 make_edges_in_order(nodes, *
this);
2959 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_QUEUEING, &this->my_graph,
2963 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 2973 template<
typename OutputTuple,
typename K,
typename KHash>
2975 key_matching_port, OutputTuple, key_matching<K,KHash> > {
2983 #if __TBB_PREVIEW_MESSAGE_BASED_KEY_MATCHING 2986 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 2987 template <
typename... Args>
2990 make_edges_in_order(nodes, *
this);
2996 template<
typename __TBB_B0,
typename __TBB_B1>
2998 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3001 template<
typename __TBB_B0,
typename __TBB_B1,
typename __TBB_B2>
3003 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3006 template<
typename __TBB_B0,
typename __TBB_B1,
typename __TBB_B2,
typename __TBB_B3>
3008 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3011 template<
typename __TBB_B0,
typename __TBB_B1,
typename __TBB_B2,
typename __TBB_B3,
typename __TBB_B4>
3014 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3017 #if __TBB_VARIADIC_MAX >= 6 3018 template<
typename __TBB_B0,
typename __TBB_B1,
typename __TBB_B2,
typename __TBB_B3,
typename __TBB_B4,
3022 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3026 #if __TBB_VARIADIC_MAX >= 7 3027 template<
typename __TBB_B0,
typename __TBB_B1,
typename __TBB_B2,
typename __TBB_B3,
typename __TBB_B4,
3028 typename __TBB_B5,
typename __TBB_B6>
3031 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3035 #if __TBB_VARIADIC_MAX >= 8 3036 template<
typename __TBB_B0,
typename __TBB_B1,
typename __TBB_B2,
typename __TBB_B3,
typename __TBB_B4,
3037 typename __TBB_B5,
typename __TBB_B6,
typename __TBB_B7>
3039 __TBB_B7 b7) :
unfolded_type(g, b0, b1, b2, b3, b4, b5, b6, b7) {
3040 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3044 #if __TBB_VARIADIC_MAX >= 9 3045 template<
typename __TBB_B0,
typename __TBB_B1,
typename __TBB_B2,
typename __TBB_B3,
typename __TBB_B4,
3046 typename __TBB_B5,
typename __TBB_B6,
typename __TBB_B7,
typename __TBB_B8>
3048 __TBB_B7 b7, __TBB_B8 b8) :
unfolded_type(g, b0, b1, b2, b3, b4, b5, b6, b7, b8) {
3049 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3053 #if __TBB_VARIADIC_MAX >= 10 3054 template<
typename __TBB_B0,
typename __TBB_B1,
typename __TBB_B2,
typename __TBB_B3,
typename __TBB_B4,
3055 typename __TBB_B5,
typename __TBB_B6,
typename __TBB_B7,
typename __TBB_B8,
typename __TBB_B9>
3057 __TBB_B7 b7, __TBB_B8 b8, __TBB_B9 b9) :
unfolded_type(g, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9) {
3058 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3063 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3064 template <
typename... Args,
typename... Bodies>
3066 :
join_node(nodes.graph_reference(), bodies...) {
3067 make_edges_in_order(nodes, *
this);
3072 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3076 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3088 template<
typename T0,
typename T1=null_type,
typename T2=null_type,
typename T3=null_type,
3089 typename T4=null_type,
typename T5=null_type,
typename T6=null_type,
3093 template<
typename T0>
3096 static const int N = 1;
3102 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3106 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3107 template <
typename... Args>
3109 make_edges_in_order(nodes, *
this);
3115 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3119 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3126 template<
typename T0,
typename T1>
3129 static const int N = 2;
3135 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3139 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3140 template <
typename... Args>
3142 make_edges_in_order(nodes, *
this);
3148 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3152 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3159 template<
typename T0,
typename T1,
typename T2>
3162 static const int N = 3;
3168 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3172 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3173 template <
typename... Args>
3175 make_edges_in_order(nodes, *
this);
3181 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3185 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3192 template<
typename T0,
typename T1,
typename T2,
typename T3>
3195 static const int N = 4;
3201 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3205 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3206 template <
typename... Args>
3208 make_edges_in_order(nodes, *
this);
3214 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3218 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3225 template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4>
3228 static const int N = 5;
3234 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3238 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3239 template <
typename... Args>
3241 make_edges_in_order(nodes, *
this);
3247 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3251 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3258 #if __TBB_VARIADIC_MAX >= 6 3259 template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
3260 class indexer_node<T0, T1, T2, T3, T4, T5> :
public internal::unfolded_indexer_node<tuple<T0, T1, T2, T3, T4, T5> > {
3262 static const int N = 6;
3268 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3272 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3273 template <
typename... Args>
3275 make_edges_in_order(nodes, *
this);
3281 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3285 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3291 #endif //variadic max 6 3293 #if __TBB_VARIADIC_MAX >= 7 3294 template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
3296 class indexer_node<T0, T1, T2, T3, T4, T5, T6> :
public internal::unfolded_indexer_node<tuple<T0, T1, T2, T3, T4, T5, T6> > {
3298 static const int N = 7;
3304 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3308 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3309 template <
typename... Args>
3311 make_edges_in_order(nodes, *
this);
3317 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3321 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3327 #endif //variadic max 7 3329 #if __TBB_VARIADIC_MAX >= 8 3330 template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
3331 typename T6,
typename T7>
3332 class indexer_node<T0, T1, T2, T3, T4, T5, T6, T7> :
public internal::unfolded_indexer_node<tuple<T0, T1, T2, T3, T4, T5, T6, T7> > {
3334 static const int N = 8;
3340 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3344 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3345 template <
typename... Args>
3347 make_edges_in_order(nodes, *
this);
3353 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3357 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3363 #endif //variadic max 8 3365 #if __TBB_VARIADIC_MAX >= 9 3366 template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
3367 typename T6,
typename T7,
typename T8>
3368 class 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> > {
3370 static const int N = 9;
3376 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3380 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3381 template <
typename... Args>
3383 make_edges_in_order(nodes, *
this);
3389 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3393 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3399 #endif //variadic max 9 3401 #if __TBB_VARIADIC_MAX >= 10 3402 template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
3403 typename T6,
typename T7,
typename T8,
typename T9>
3406 static const int N = 10;
3408 typedef tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>
InputTuple;
3409 typedef typename internal::tagged_msg<size_t, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> output_type;
3412 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3416 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3417 template <
typename... Args>
3419 make_edges_in_order(nodes, *
this);
3425 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3429 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3435 #endif //variadic max 10 3437 #if __TBB_PREVIEW_ASYNC_MSG 3440 template<
typename T >
3443 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 3444 s.internal_add_built_predecessor(
p);
3445 p.internal_add_built_successor(
s);
3447 p.register_successor(
s );
3452 template<
typename T >
3457 #if __TBB_PREVIEW_ASYNC_MSG 3458 template<
typename TS,
typename TR,
3465 template<
typename T >
3470 template<
typename T >
3475 #endif // __TBB_PREVIEW_ASYNC_MSG 3477 #if __TBB_FLOW_GRAPH_CPP11_FEATURES 3479 template<
typename T,
typename V,
3480 typename =
typename T::output_ports_type,
typename =
typename V::input_ports_type >
3482 make_edge(get<0>(output.output_ports()), get<0>(input.input_ports()));
3486 template<
typename T,
typename R,
3487 typename =
typename T::output_ports_type >
3489 make_edge(get<0>(output.output_ports()), input);
3493 template<
typename S,
typename V,
3494 typename =
typename V::input_ports_type >
3496 make_edge(output, get<0>(input.input_ports()));
3500 #if __TBB_PREVIEW_ASYNC_MSG 3503 template<
typename T >
3506 p.remove_successor(
s );
3507 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 3509 p.internal_delete_built_successor(
s);
3510 s.internal_delete_built_predecessor(
p);
3516 template<
typename T >
3521 #if __TBB_PREVIEW_ASYNC_MSG 3522 template<
typename TS,
typename TR,
3529 template<
typename T >
3534 template<
typename T >
3538 #endif // __TBB_PREVIEW_ASYNC_MSG 3540 #if __TBB_FLOW_GRAPH_CPP11_FEATURES 3542 template<
typename T,
typename V,
3543 typename =
typename T::output_ports_type,
typename =
typename V::input_ports_type >
3545 remove_edge(get<0>(output.output_ports()), get<0>(input.input_ports()));
3549 template<
typename T,
typename R,
3550 typename =
typename T::output_ports_type >
3552 remove_edge(get<0>(output.output_ports()), input);
3555 template<
typename S,
typename V,
3556 typename =
typename V::input_ports_type >
3562 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 3563 template<
typename C >
3564 template<
typename S >
3565 void internal::edge_container<C>::sender_extract(
S &
s ) {
3566 edge_list_type e = built_edges;
3567 for (
typename edge_list_type::iterator i = e.begin(); i != e.end(); ++i ) {
3572 template<
typename C >
3573 template<
typename R >
3574 void internal::edge_container<C>::receiver_extract( R &r ) {
3575 edge_list_type e = built_edges;
3576 for (
typename edge_list_type::iterator i = e.begin(); i != e.end(); ++i ) {
3583 template<
typename Body,
typename Node >
3585 return n.template copy_function_object<Body>();
3588 #if __TBB_FLOW_GRAPH_CPP11_FEATURES 3593 template<
typename... InputTypes,
typename... OutputTypes>
3604 static const size_t NUM_INPUTS =
sizeof...(InputTypes);
3605 static const size_t NUM_OUTPUTS =
sizeof...(OutputTypes);
3611 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3622 template<
typename T1,
typename T2>
3626 my_input_ports = tbb::internal::make_unique<input_ports_type>(std::forward<T1>(input_ports_tuple));
3627 my_output_ports = tbb::internal::make_unique<output_ports_type>(std::forward<T2>(output_ports_tuple));
3633 template<
typename... NodeTypes >
3636 template<
typename... NodeTypes >
3639 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3646 __TBB_ASSERT(my_input_ports,
"input ports not set, call set_external_ports to set input ports");
3647 return *my_input_ports;
3651 __TBB_ASSERT(my_output_ports,
"output ports not set, call set_external_ports to set output ports");
3652 return *my_output_ports;
3655 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 3657 __TBB_ASSERT(
false,
"Current composite_node implementation does not support extract");
3663 template<
typename... InputTypes>
3670 static const size_t NUM_INPUTS =
sizeof...(InputTypes);
3676 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3687 template<
typename T>
3691 my_input_ports = tbb::internal::make_unique<input_ports_type>(std::forward<T>(input_ports_tuple));
3696 template<
typename... NodeTypes >
3699 template<
typename... NodeTypes >
3702 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3709 __TBB_ASSERT(my_input_ports,
"input ports not set, call set_external_ports to set input ports");
3710 return *my_input_ports;
3713 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 3715 __TBB_ASSERT(
false,
"Current composite_node implementation does not support extract");
3722 template<
typename... OutputTypes>
3729 static const size_t NUM_OUTPUTS =
sizeof...(OutputTypes);
3735 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3746 template<
typename T>
3750 my_output_ports = tbb::internal::make_unique<output_ports_type>(std::forward<T>(output_ports_tuple));
3755 template<
typename... NodeTypes >
3758 template<
typename... NodeTypes >
3761 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3768 __TBB_ASSERT(my_output_ports,
"output ports not set, call set_external_ports to set output ports");
3769 return *my_output_ports;
3772 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 3774 __TBB_ASSERT(
false,
"Current composite_node implementation does not support extract");
3780 #endif // __TBB_FLOW_GRAPH_CPP11_FEATURES 3784 template<
typename Gateway>
3798 template<
typename Input,
typename Ports,
typename Gateway,
typename Body>
3820 namespace interface11 {
3823 template <
typename Input,
typename Output,
3858 my_node->my_graph.reserve_wait();
3862 my_node->my_graph.release_wait();
3868 return my_node->try_put_impl(i);
3886 "Return status is inconsistent with the method operation." );
3888 while( !tasks.
empty() ) {
3892 return is_at_least_one_put_successful;
3896 template<
typename Body>
3908 tbb::internal::fgt_multioutput_node_with_body<1>(
3909 CODEPTR(), tbb::internal::FLOW_ASYNC_NODE,
3911 this->output_ports(), this->my_body
3915 #if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT 3916 template <
typename Body,
typename... Args>
3919 #endif // __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES 3921 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3922 template <
typename Body,
typename... Args>
3924 const node_set<Args...>& nodes,
size_t concurrency, Body body,
3927 make_edges_in_order(nodes, *
this);
3930 #if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES 3931 template <
typename Body,
typename... Args>
3933 : async_node(nodes,
concurrency, body, Policy(), priority) {}
3934 #endif // __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES 3935 #endif // __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3938 static_cast<async_body_base_type*>(this->my_body->get_body_ptr())->set_gateway(&my_gateway);
3939 static_cast<async_body_base_type*>(this->my_init_body->get_body_ptr())->set_gateway(&my_gateway);
3941 tbb::internal::fgt_multioutput_node_with_body<1>(
CODEPTR(), tbb::internal::FLOW_ASYNC_NODE,
3943 this->output_ports(), this->my_body );
3950 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3960 return internal::output_port<0>(*this).register_successor(r);
3965 return internal::output_port<0>(*this).remove_successor(r);
3968 template<
typename Body>
3972 mfn_body_type &body_ref = *this->my_body;
3974 return ab.get_body();
3977 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 3978 typedef typename internal::edge_container<successor_type> built_successors_type;
3980 typedef typename built_successors_type::edge_list_type successor_list_type;
3982 return internal::output_port<0>(*this).built_successors();
3985 void internal_add_built_successor( successor_type &r )
__TBB_override {
3986 internal::output_port<0>(*this).internal_add_built_successor(r);
3989 void internal_delete_built_successor( successor_type &r )
__TBB_override {
3990 internal::output_port<0>(*this).internal_delete_built_successor(r);
3994 internal::output_port<0>(*this).copy_successors(l);
3998 return internal::output_port<0>(*this).successor_count();
4005 base_type::reset_node(f);
4009 #if __TBB_PREVIEW_STREAMING_NODE 4011 #endif // __TBB_PREVIEW_STREAMING_NODE 4015 template<
typename T >
4022 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 4035 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 4036 template <
typename... Args>
4038 make_edges_in_order(nodes, *
this);
4053 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 4063 bool ret =
s.try_put( my_buffer );
4072 task *rtask =
new ( task::allocate_additional_child_of( *( my_graph.root_task() ) ) )
4089 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 4090 built_predecessors_type &built_predecessors()
__TBB_override {
return my_built_predecessors; }
4091 built_successors_type &built_successors()
__TBB_override {
return my_successors.built_successors(); }
4093 void internal_add_built_successor( successor_type &
s)
__TBB_override {
4095 my_successors.internal_add_built_successor(
s);
4098 void internal_delete_built_successor( successor_type &
s)
__TBB_override {
4100 my_successors.internal_delete_built_successor(
s);
4105 return my_successors.successor_count();
4110 my_successors.copy_successors(v);
4113 void internal_add_built_predecessor( predecessor_type &
p)
__TBB_override {
4115 my_built_predecessors.add_edge(
p);
4118 void internal_delete_built_predecessor( predecessor_type &
p)
__TBB_override {
4120 my_built_predecessors.delete_edge(
p);
4125 return my_built_predecessors.edge_count();
4128 void copy_predecessors( predecessor_list_type &v )
__TBB_override {
4130 my_built_predecessors.copy_edges(v);
4134 my_buffer_is_valid =
false;
4135 built_successors().sender_extract(*
this);
4136 built_predecessors().receiver_extract(*
this);
4143 if ( my_buffer_is_valid ) {
4163 return my_buffer_is_valid;
4168 my_buffer_is_valid =
false;
4178 return try_put_task_impl(v);
4183 my_buffer_is_valid =
true;
4197 o(owner),
s(succ) {};
4200 if (!
s.register_predecessor(o)) {
4201 o.register_successor(
s);
4212 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 4213 internal::edge_container<predecessor_type> my_built_predecessors;
4220 my_buffer_is_valid =
false;
4222 my_successors.
clear();
4227 template<
typename T >
4243 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 4244 template <
typename... Args>
4246 make_edges_in_order(nodes, *
this);
4257 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 4269 return this->my_buffer_is_valid ? NULL : this->try_put_task_impl(v);
4280 using interface11::graph;
4281 using interface11::graph_node;
4282 using interface11::continue_msg;
4284 using interface11::source_node;
4285 using interface11::function_node;
4286 using interface11::multifunction_node;
4287 using interface11::split_node;
4289 using interface11::indexer_node;
4290 using interface11::internal::tagged_msg;
4293 using interface11::continue_node;
4294 using interface11::overwrite_node;
4295 using interface11::write_once_node;
4296 using interface11::broadcast_node;
4297 using interface11::buffer_node;
4298 using interface11::queue_node;
4299 using interface11::sequencer_node;
4300 using interface11::priority_queue_node;
4301 using interface11::limiter_node;
4302 using namespace interface11::internal::graph_policy_namespace;
4303 using interface11::join_node;
4309 #if __TBB_FLOW_GRAPH_CPP11_FEATURES 4310 using interface11::composite_node;
4312 using interface11::async_node;
4313 #if __TBB_PREVIEW_ASYNC_MSG 4314 using interface11::async_msg;
4316 #if __TBB_PREVIEW_STREAMING_NODE 4318 using interface11::streaming_node;
4319 #endif // __TBB_PREVIEW_STREAMING_NODE 4320 #if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES 4325 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 4326 using interface11::internal::follows;
4327 using interface11::internal::precedes;
4328 using interface11::internal::make_node_set;
4329 using interface11::internal::make_edges;
4338 #undef __TBB_PFG_RESET_ARG 4342 #undef __TBB_flow_graph_H_include_area 4344 #if TBB_USE_THREADING_TOOLS && TBB_PREVIEW_FLOW_GRAPH_TRACE && ( __linux__ || __APPLE__ ) 4345 #undef __TBB_NOINLINE_SYM 4348 #endif // __TBB_flow_graph_H void activate()
Activates a node that was created in the inactive state.
internal::function_input_queue< input_type, Allocator > input_queue_type
tbb::flow::interface11::graph_iterator< graph, tbb::flow::interface11::graph_node > iterator
buffer_node< T, A > class_type
__TBB_NOINLINE_SYM indexer_node(graph &g)
internal::wrap_tuple_elements< N, internal::multifunction_output, TupleType >::type output_ports_type
bool register_successor(successor_type &r) __TBB_override
Adds a successor.
__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)
indexer_node(const indexer_node &other)
graph & graph_reference() const
static void * to_void_ptr(T &t)
internal::aggregating_functor< class_type, buffer_operation > handler_type
internal::multifunction_input< input_type, output_ports_type, Policy, Allocator > base_type
__TBB_NOINLINE_SYM indexer_node(graph &g)
bool register_successor(successor_type &r) __TBB_override
Add a new successor to this node.
void reset_node(reset_flags f) __TBB_override
Base class for types that should not be assigned.
__TBB_NOINLINE_SYM indexer_node(graph &g)
void reset_node(reset_flags f) __TBB_override
bool register_successor(successor_type &r) __TBB_override
Adds a new successor.
internal::broadcast_cache< output_type > my_successors
static void alias_port(void *, PortsTuple &)
internal::tagged_msg< size_t, T0, T1, T2, T3, T4, T5, T6, T7 > output_type
internal::unfolded_indexer_node< InputTuple > unfolded_type
iterator begin()
start iterator
bool gather_successful_try_puts(const X &t, task_list &tasks)
void handle_operations_impl(buffer_operation *op_list, derived_type *derived)
__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)
bool try_put(const typename internal::async_helpers< T >::async_type &t)
static void clear_this(P &p)
~graph()
Destroys the graph.
task * try_put_task(const T &t) __TBB_override
Puts an item to this receiver.
Implements methods for both executable and function nodes that puts Output to its successors.
bool my_item_valid(size_type i) const
tbb::flow::tuple< receiver< InputTypes > &... > input_ports_type
#define __TBB_DEPRECATED_LIMITER_ARG2(arg1, arg2)
__TBB_DEPRECATED typedef T output_type
The output type of this sender.
overwrite_node< T > base_type
void reset_node(reset_flags f) __TBB_override
void call(F &&f, Pack &&p)
Calls the given function with arguments taken from a stored_pack.
virtual task * try_put_task_wrapper(const void *p, bool is_async)=0
void reset_node(reset_flags f) __TBB_override
#define __TBB_NOINLINE_SYM
receiver< input_type > receiver_type
internal::function_input_queue< input_type, Allocator > input_queue_type
void fetch_item(size_t i, item_type &o)
int my_initial_predecessor_count
bool place_item(size_t here, const item_type &me)
void handle_operations(prio_operation *op_list) __TBB_override
__TBB_DEPRECATED continue_receiver(const continue_receiver &src)
Copy constructor.
virtual ~untyped_sender()
void internal_remove_edge(internal::untyped_sender &p, internal::untyped_receiver &s)
void internal_release(prio_operation *op) __TBB_override
virtual bool try_release()
Releases the reserved item.
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
graph & graph_reference() const __TBB_override
#define __TBB_DEPRECATED_LIMITER_ARG4(arg1, arg2, arg3, arg4)
buffer_node< T, A >::item_type item_type
virtual void finalize() const
__TBB_NOINLINE_SYM overwrite_node(const overwrite_node &src)
Copy constructor; doesn't take anything from src; default won't work.
static void fgt_async_reserve(void *, void *)
task * try_put_task(const X &t)
void reset_node(reset_flags f) __TBB_override
resets the source_node to its initial state
internal::unfolded_indexer_node< InputTuple > unfolded_type
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
receiver< input_type >::predecessor_type predecessor_type
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
#define __TBB_FLOW_GRAPH_PRIORITY_ARG0(priority)
sender< output_type >::successor_type successor_type
bool remove_predecessor(predecessor_type &src) __TBB_override
Removes src from the list of cached predecessors.
task * decrement_counter(long long delta)
virtual task * try_put_task_wrapper(const void *p, bool is_async) __TBB_override
graph & graph_reference() const __TBB_override
static void fgt_graph(void *)
virtual void internal_rem_succ(buffer_operation *op)
Remove successor.
bool is_continue_receiver() __TBB_override
async_msg< T > async_type
untyped_sender predecessor_type
The predecessor type for this node.
split_node: accepts a tuple as input, forwards each element of the tuple to its
static void fgt_make_edge(void *, void *)
__TBB_NOINLINE_SYM continue_node(const continue_node &src)
Copy constructor.
void enqueue_in_graph_arena(tbb::flow::interface10::graph &g, tbb::task &arena_task)
Enqueues a task inside graph arena.
receiver< input_type >::predecessor_type predecessor_type
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
bool internal_push(prio_operation *op) __TBB_override
internal::unfolded_indexer_node< InputTuple > unfolded_type
field of type K being used for matching.
Forward declaration section.
limiter_node(graph &g, __TBB_DEPRECATED_LIMITER_ARG2(size_t threshold, int num_decrement_predecessors=0))
Constructor.
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 reset(reset_flags f)
internal::multifunction_input< Input, typename base_type::output_ports_type, Policy, Allocator > mfn_input_type
An executable node that acts as a source, i.e. it has no predecessors.
void add_nodes_impl(CompositeType *, bool)
The base of all graph nodes.
void spawn_put()
Spawns a task that applies the body.
static void fgt_remove_edge(void *, void *)
output_ports_type & output_ports()
bool internal_push(sequencer_operation *op) __TBB_override
static void fgt_composite(void *, void *, void *)
bool try_release() __TBB_override
Releases the reserved item.
void spawn_in_graph_arena(tbb::flow::interface10::graph &g, tbb::task &arena_task)
Spawns a task inside graph arena.
bool try_get(T &v) __TBB_override
Request an item from the buffer_node.
graph & graph_reference() const __TBB_override
internal::reservable_predecessor_cache< T, spin_mutex > my_predecessors
priority_queue_node class_type
task * try_put_task(const input_type &) __TBB_override
tuple< T0, T1, T2, T3, T4, T5, T6 > InputTuple
__TBB_NOINLINE_SYM source_node(graph &g, Body body, bool is_active=true)
Constructor for a node with a successor.
tbb::flow::tuple< sender< OutputTypes > &... > output_ports_type
internal::multifunction_input< input_type, output_ports_type, Policy, Allocator > input_impl_type
sender< output_type >::successor_type successor_type
tuple< T0, T1 > InputTuple
function_body_type * my_body
static const T & from_void_ptr(const void *p)
receiver_gateway< output_type > gateway_type
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3, __TBB_B4 b4)
internal::broadcast_cache< T > my_successors
static T & from_void_ptr(void *p)
static void fgt_graph_desc(void *, const char *)
function_body that takes an Input and a set of output ports
An cache of predecessors that supports requests and reservations.
receiver< TupleType > base_type
Forwards messages in FIFO order.
void release_wait() __TBB_override
Deregisters an external entity that may have interacted with the graph.
void try_put_and_add_task(task *&last_task)
internal::port_ref_impl< N1, N2 > port_ref()
__TBB_NOINLINE_SYM async_node(const async_node &other)
sender< output_type >::successor_type successor_type
The type of successors of this node.
A cache of successors that are broadcast to.
tuple< T0, T1, T2 > InputTuple
tbb::flow::tuple_element< N, typename JNT::input_ports_type >::type & input_port(JNT &jn)
templated function to refer to input ports of the join node
__TBB_NOINLINE_SYM composite_node(graph &g)
Forwards messages of type T to all successors.
internal::wrap_tuple_elements< N, internal::multifunction_output, Output >::type output_ports_type
#define __TBB_CPP11_PRESENT
int decrement_ref_count()
Atomically decrement reference count and returns its new value.
sender< output_type >::successor_type successor_type
base_type::output_ports_type output_ports_type
bool empty() const
True if list is empty; false otherwise.
void remove_successor(successor_type &r)
__TBB_DEPRECATED bool remove_predecessor(predecessor_type &) __TBB_override
Decrements the trigger threshold.
__TBB_DEPRECATED continue_receiver(__TBB_FLOW_GRAPH_PRIORITY_ARG1(int number_of_predecessors, node_priority_t priority))
Constructor.
void deactivate_graph(tbb::flow::interface10::graph &g)
input_ports_type & input_ports()
graph & graph_reference() const __TBB_override
__TBB_NOINLINE_SYM write_once_node(const write_once_node &src)
Copy constructor: call base class copy constructor.
__TBB_NOINLINE_SYM indexer_node(graph &g)
const item_type & back() const
internal::continue_input< Output, Policy > input_impl_type
size_type size(size_t new_tail=0)
static void fgt_node(void *, string_index, void *, void *)
buffer_operation(op_type t)
internal::decrementer< limiter_node< T, DecrementType >, DecrementType > decrement
The internal receiver< DecrementType > that decrements the count.
unsigned int node_priority_t
internal::unfolded_indexer_node< InputTuple > unfolded_type
internal::unfolded_indexer_node< InputTuple > unfolded_type
virtual bool remove_predecessor(predecessor_type &)
Remove a predecessor from the node.
void register_successor(successor_type &r)
~source_node()
The destructor.
task * grab_forwarding_task(buffer_operation &op_data)
void internal_consume(prio_operation *op) __TBB_override
multifunction_node< Input, tuple< Output >, Policy, Allocator > base_type
void reset_node(reset_flags f) __TBB_override
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
internal::unfolded_indexer_node< InputTuple > unfolded_type
__TBB_NOINLINE_SYM priority_queue_node(const priority_queue_node &src)
Copy constructor.
void reset_function_input(reset_flags f)
GraphNodeType & reference
fOutput_type::successor_type successor_type
internal::broadcast_cache< output_type > & successors() __TBB_override
void move_item(size_t to, size_t from)
void internal_pop(queue_operation *op) __TBB_override
virtual void internal_consume(buffer_operation *op)
multifunction_body_type * my_body
bool remove_successor(successor_type &r) __TBB_override
Removes s as a successor.
void internal_forward_task_impl(buffer_operation *op, derived_type *derived)
void reset_receiver(reset_flags) __TBB_override
put receiver back in initial state
item_buffer with reservable front-end. NOTE: if reserving, do not
tbb::flow::tuple_element< N, typename MOP::output_ports_type >::type & output_port(MOP &op)
register_predecessor_task(predecessor_type &owner, successor_type &succ)
receiver< input_type >::predecessor_type predecessor_type
sender< output_type >::successor_type successor_type
fOutput_type::successor_type successor_type
Forwards messages in priority order.
bool register_predecessor(predecessor_type &src) __TBB_override
Adds src to the list of cached predecessors.
internal::source_body< output_type > * my_body
bool register_successor(successor_type &r) __TBB_override
Replace the current successor with this new successor.
virtual bool try_get_wrapper(void *p, bool is_async)=0
__TBB_NOINLINE_SYM indexer_node(graph &g)
static const void * to_void_ptr(const T &t)
void __TBB_store_with_release(volatile T &location, V value)
tbb::flow::interface11::graph_node * my_nodes_last
static void fgt_multiinput_multioutput_node(void *, string_index, void *, void *)
void swap_items(size_t i, size_t j)
std::unique_ptr< input_ports_type > my_input_ports
const item_type & front() const
static const bool is_async_type
graph & graph_reference() const __TBB_override
bool try_put(const Output &i) __TBB_override
Implements gateway_type::try_put for an external activity to submit a message to FG.
bool is_graph_active(tbb::flow::interface10::graph &g)
internal::unfolded_indexer_node< InputTuple > unfolded_type
void add_visible_nodes(const NodeTypes &... n)
__TBB_NOINLINE_SYM buffer_node(graph &g)
Constructor.
Base class for user-defined tasks.
limiter_node(const limiter_node &src)
Copy constructor.
Enables one or the other code branches.
internal::round_robin_cache< T, null_rw_mutex > my_successors
Represents acquisition of a mutex.
#define __TBB_STATIC_ASSERT(condition, msg)
tbb::flow::tuple< receiver< InputTypes > &... > input_ports_type
bool remove_successor(successor_type &s) __TBB_override
Removes a successor from this node.
virtual bool is_continue_receiver()
tbb::spin_mutex nodelist_mutex
predecessor_cache< input_type, null_mutex > my_predecessors
void add_task_to_graph_reset_list(tbb::flow::interface10::graph &g, tbb::task *tp)
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
void reset_node(reset_flags f) __TBB_override
__TBB_DEPRECATED typedef T input_type
The input type of this receiver.
internal::source_body< output_type > * my_init_body
virtual bool try_consume()
Consumes the reserved item.
output_ports_type my_output_ports
input_impl_type::predecessor_type predecessor_type
tbb::internal::uint64_t tag_value
Output output_type
The type of the output message, which is complete.
tuple< T0, T1, T2, T3, T4, T5, T6, T7, T8 > InputTuple
receiver_type::predecessor_type predecessor_type
tbb::task * root_task()
Returns the root task of the graph.
async_storage_ptr my_storage
The leaf for source_body.
internal::unfolded_join_node< N, reserving_port, OutputTuple, reserving > unfolded_type
__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)
Forwards messages only if the threshold has not been reached.
static void fgt_release_wait(void *)
void reset_node(reset_flags f) __TBB_override
implements a function node that supports Input -> (set of outputs)
static internal::allocate_root_proxy allocate_root()
Returns proxy for overloaded new that allocates a root task.
Implements methods for a function node that takes a type Input as input and sends.
virtual bool internal_push(buffer_operation *op)
internal::async_body_base< gateway_type > async_body_base_type
Base class for receivers of completion messages.
task & pop_front()
Pop the front task from the list.
virtual void internal_forward_task(buffer_operation *op)
Tries to forward valid items to successors.
input_impl_type::predecessor_type predecessor_type
An empty class used for messages that mean "I'm done".
tbb::flow::interface11::graph_node * my_nodes
bool remove_successor(successor_type &r) __TBB_override
Removes a successor.
void reset_node(reset_flags) __TBB_override
virtual void reset_receiver(reset_flags f=rf_reset_protocol)=0
put receiver back in initial state
bool pop_front(item_type &v)
#define __TBB_FLOW_GRAPH_PRIORITY_ARG1(arg1, priority)
graph & graph_reference() const __TBB_override
__TBB_NOINLINE_SYM join_node(graph &g)
task * try_put_task(const T &v) __TBB_override
Put item to successor; return task to run the successor if possible.
__TBB_NOINLINE_SYM broadcast_node(graph &g)
static void fgt_async_try_put_begin(void *, void *)
virtual task * forward_task()
This is executed by an enqueued task, the "forwarder".
virtual graph & graph_reference() const =0
__TBB_DEPRECATED typedef continue_msg input_type
The input type.
internal::broadcast_cache< input_type, null_rw_mutex > my_successors
tuple< T0, T1, T2, T3, T4 > InputTuple
virtual bool register_predecessor(predecessor_type &)
Add a predecessor to the node.
void reset_node(reset_flags) __TBB_override
void add_nodes(const NodeTypes &... n)
internal::tagged_msg< size_t, T0, T1, T2 > output_type
virtual source_body * clone()=0
internal::unfolded_indexer_node< InputTuple > unfolded_type
concurrency
An enumeration the provides the two most common concurrency levels: unlimited and serial.
task_list_type my_reset_task_list
function_body_type * my_body
internal::broadcast_cache< output_type > & successors() __TBB_override
virtual void reset_node(reset_flags f=rf_reset_protocol)=0
internal::tagged_msg< size_t, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 > output_type
async_body_base< Gateway > base_type
tbb::task_arena * my_task_arena
task * try_put_task_impl(const input_type &v)
tbb::task_group_context * my_context
__TBB_NOINLINE_SYM continue_node(graph &g, int number_of_predecessors,)
Constructor for executable node with continue_msg -> Output.
Body copy_function_object()
internal::multifunction_output< Output > output_port_type
static void fgt_end_body(void *)
void internal_consume(queue_operation *op) __TBB_override
receiver< input_type >::predecessor_type predecessor_type
void prio_push(const T &src)
virtual bool try_get_wrapper(void *p, bool is_async) __TBB_override
bool try_reserve(output_type &v) __TBB_override
Reserves an item.
try_put_functor(output_port_type &p, const Output &v)
Body copy_function_object()
Body copy_body(Node &n)
Returns a copy of the body from a function or continue node.
static void * to_void_ptr(T &t)
void set_owner(owner_type *owner)
void const char const char int ITT_FORMAT __itt_group_sync p
void reset_receiver(reset_flags f) __TBB_override
put receiver back in initial state
A cache of predecessors that only supports try_get.
static task * try_put_task_wrapper_impl(receiver< T > *const this_recv, const void *p, bool is_async)
virtual void internal_reserve(buffer_operation *op)
const_iterator cbegin() const
start const iterator
graph & graph_reference() const __TBB_override
A lock that occupies a single byte.
void reserve_wait() __TBB_override
Used to register that an external entity may still interact with the graph.
tbb::flow::interface11::graph_iterator< const graph, const tbb::flow::interface11::graph_node > const_iterator
~sequencer_node()
Destructor.
static void fgt_async_commit(void *, void *)
task * try_put_task(const X &t)
An abstract cache of successors.
graph()
Constructs a graph with isolated task_group_context.
output_type my_cached_item
virtual bool try_reserve_wrapper(void *p, bool is_async) __TBB_override
Implements an executable node that supports continue_msg -> Output.
virtual void internal_reg_succ(buffer_operation *op)
Register successor.
bool register_successor(successor_type &r) __TBB_override
Add a new successor to this node.
internal::tagged_msg< size_t, T0, T1 > output_type
static task * try_put_task_wrapper_impl(receiver< T > *const this_recv, const void *p, bool is_async)
static T & from_void_ptr(void *p)
Pure virtual template class that defines a receiver of messages of type T.
__TBB_NOINLINE_SYM multifunction_node(const multifunction_node &other)
static const node_priority_t no_priority
Implements a function node that supports Input -> Output.
__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)
task * try_put_task(const T &t) __TBB_override
receive an item, return a task *if possible
__TBB_NOINLINE_SYM split_node(const split_node &other)
task * try_put_task(const X &t)
static tbb::task *const SUCCESSFULLY_ENQUEUED
unfolded_type::input_ports_type input_ports_type
bool try_put(const output_type &i)
base_type::size_type size_type
Detects whether two given types are the same.
bool push_back(item_type &v)
static void fgt_reserve_wait(void *)
buffer_operation(const T &e, op_type t)
__TBB_NOINLINE_SYM buffer_node(const buffer_node &src)
Copy constructor.
internal::unfolded_indexer_node< InputTuple > unfolded_type
void add_visible_nodes(const NodeTypes &... n)
__TBB_NOINLINE_SYM sequencer_node(graph &g, const Sequencer &s)
Constructor.
Input and scheduling for a function node that takes a type Input as input.
async_body_base(gateway_type *gateway)
virtual task * execute()=0
Does whatever should happen when the threshold is reached.
void reset_receiver(reset_flags f) __TBB_override
put receiver back in initial state
__TBB_NOINLINE_SYM write_once_node(graph &g)
Constructor.
void add_nodes(const NodeTypes &... n)
void fgt_multiinput_multioutput_node_desc(const NodeType *, const char *)
#define __TBB_FLOW_GRAPH_PRIORITY_EXPR(expr)
unfolded_join_node : passes input_ports_type to join_node_base. We build the input port type
unfolded_type::input_ports_type input_ports_type
bool remove_successor(successor_type &r) __TBB_override
Removes a successor from this node.
internal::unfolded_indexer_node< InputTuple > unfolded_type
__TBB_NOINLINE_SYM join_node(graph &g)
leaf for multifunction. OutputSet can be a std::tuple or a vector.
void add_nodes(const NodeTypes &... n)
__TBB_NOINLINE_SYM join_node(const join_node &other)
__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 set_external_ports(T &&output_ports_tuple)
void increment_ref_count()
Atomically increment reference count.
T::async_msg_data_type filtered_type
Forwards messages in sequence order.
reference operator*() const
Dereference.
virtual bool remove_successor(successor_type &r)=0
Removes a successor from this node.
__TBB_NOINLINE_SYM priority_queue_node(graph &g, const Compare &comp=Compare())
Constructor.
sender< output_type >::successor_type successor_type
bool try_get(output_type &v) __TBB_override
Request an item from the node.
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2)
void internal_forward_task(queue_operation *op) __TBB_override
Tries to forward valid items to successors.
buffer_node< T, A >::size_type size_type
virtual bool try_get(T &)
Request an item from the sender.
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1)
buffer_node< T, A > base_type
buffer_node< T, A > base_type
A cache of successors that are put in a round-robin fashion.
receiver< input_type >::predecessor_type predecessor_type
tuple< T0, T1, T2, T3, T4, T5 > InputTuple
Forwards messages in arbitrary order.
void internal_forward_task(prio_operation *op) __TBB_override
Tries to forward valid items to successors.
__TBB_NOINLINE_SYM join_node(const join_node &other)
task * try_put_task(const input_type &t) __TBB_override
bool try_get(X &t)
Request an item from the sender.
void const char const char int ITT_FORMAT __itt_group_sync x void const char * name
Breaks an infinite loop between the node reservation and register_successor call.
void register_node(tbb::flow::interface11::graph_node *n)
internal::function_output< output_type > fOutput_type
static void alias_port(void *, PortsTuple &)
__TBB_NOINLINE_SYM indexer_node(graph &g)
void internal_make_edge(internal::untyped_sender &p, internal::untyped_receiver &s)
bool remove_successor(successor_type &r) __TBB_override
Removes a successor from this node.
void try_put_and_add_task(task *&last_task)
void reset_receiver(reset_flags) __TBB_override
put receiver back in initial state
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3)
virtual bool try_reserve_wrapper(void *p, bool is_async)=0
input_type & input_ports()
async_body(const Body &body, gateway_type *gateway)
void reset_receiver(reset_flags) __TBB_override
put receiver back in initial state
void __TBB_EXPORTED_METHOD reset()
Forcefully reinitializes the context after the task tree it was associated with is completed.
__TBB_NOINLINE_SYM indexer_node(graph &g)
buffer_node< T, A >::size_type size_type
void make_edge(sender< T > &p, receiver< T > &s)
Makes an edge between a single predecessor and a single successor.
static const T & from_void_ptr(const void *p)
void reset_node(reset_flags f) __TBB_override
__TBB_NOINLINE_SYM overwrite_node(graph &g)
receiver_gateway_impl(async_node *node)
internal::aggregator< handler_type, buffer_operation > my_aggregator
void release_wait() __TBB_override
Inform a graph that a previous call to reserve_wait is no longer in effect.
__TBB_DEPRECATED bool register_predecessor(predecessor_type &) __TBB_override
Increments the trigger threshold.
void reset_node(reset_flags) __TBB_override
const_iterator cend() const
end const iterator
__TBB_NOINLINE_SYM async_node(graph &g, size_t concurrency,)
__TBB_DEPRECATED typedef internal::async_helpers< T >::filtered_type filtered_type
void internal_reserve(prio_operation *op) __TBB_override
virtual bool register_successor(successor_type &r)=0
Add a new successor to this node.
__TBB_NOINLINE_SYM queue_node(const queue_node &src)
Copy constructor.
input_ports_type & input_ports()
static void fgt_multioutput_node_desc(const NodeType *, const char *)
const item_type & get_my_item(size_t i) const
Meets "allocator" requirements of ISO C++ Standard, Section 20.1.5.
void const char const char int ITT_FORMAT __itt_group_sync s
sender< output_type >::successor_type successor_type
pointer operator->() const
Dereference.
output_ports_type & output_ports()
tuple< T0, T1, T2, T3, T4, T5, T6, T7 > InputTuple
tuple< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 > InputTuple
__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)
A task that calls a node's forward_task function.
bool try_reserve_apply_body(output_type &v)
static void fgt_async_try_put_end(void *, void *)
std::unique_ptr< output_ports_type > my_output_ports
gateway_type * my_gateway
void reset(tbb::flow::interface11::reset_flags f=tbb::flow::interface11::rf_reset_protocol)
internal::broadcast_cache< input_type > my_successors
__TBB_NOINLINE_SYM function_node(const function_node &src)
Copy constructor.
bool remove_successor(successor_type &r) __TBB_override
Removes a successor from this node.
output_ports_type & output_ports()
interface11::internal::Policy< queueing, lightweight > queueing_lightweight
bool try_put(const typename internal::async_helpers< T >::filtered_type &t)
Put an item to the receiver.
void reset_receiver(reset_flags) __TBB_override
put receiver back in initial state
unfolded_type::input_ports_type input_ports_type
internal::tagged_msg< size_t, T0, T1, T2, T3 > output_type
receiver< input_type >::predecessor_type predecessor_type
virtual void internal_pop(buffer_operation *op)
task * try_put_task(const T &t) __TBB_override
build a task to run the successor if possible. Default is old behavior.
static void fgt_node_desc(const NodeType *, const char *)
void remove_node(tbb::flow::interface11::graph_node *n)
bool enqueue_forwarding_task(buffer_operation &op_data)
void set_external_ports(T &&input_ports_tuple)
void prepare_task_arena(bool reinit=false)
wrap_tuple_elements< N, PT, OutputTuple >::type input_ports_type
buffer_node< T, A >::buffer_operation prio_operation
void internal_pop(prio_operation *op) __TBB_override
tuple< T0, T1, T2, T3 > InputTuple
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
broadcast_cache_type & successors()
tbb::task * execute() __TBB_override
Should be overridden by derived classes.
iterator end()
end iterator
bool try_release() __TBB_override
Release a reserved item.
internal::tagged_msg< size_t, T0 > output_type
internal::tagged_msg< size_t, T0, T1, T2, T3, T4, T5 > output_type
task that does nothing. Useful for synchronization.
bool try_release() __TBB_override
Release a reserved item.
friend class proxy_dependency_receiver
__TBB_NOINLINE_SYM indexer_node(graph &g)
internal::function_output< output_type > fOutput_type
bool try_put_impl(const Output &i)
Implements gateway_type::try_put for an external activity to submit a message to FG.
virtual void internal_release(buffer_operation *op)
internal::tagged_msg< size_t, T0, T1, T2, T3, T4 > output_type
Implements methods for an executable node that takes continue_msg as input.
void grow_my_array(size_t minimum_size)
Grows the internal array.
std::unique_ptr< output_ports_type > my_output_ports
bool register_successor(successor_type &s) __TBB_override
Add a new successor to this node.
sender< output_type >::successor_type successor_type
static task * emit_this(graph &g, const T &t, P &p)
bool try_consume() __TBB_override
Consumes a reserved item.
__TBB_NOINLINE_SYM broadcast_node(const broadcast_node &src)
static void fgt_node_with_body(void *, string_index, void *, void *, void *)
Used to form groups of tasks.
__TBB_NOINLINE_SYM multifunction_node(graph &g, size_t concurrency,)
output_ports_type & output_ports()
virtual task * try_put_task(const T &t)=0
Put item to successor; return task to run the successor if possible.
bool try_reserve(X &t)
Reserves an item in the sender.
static void fgt_begin_body(void *)
Implements methods for a function node that takes a type Input as input.
bool try_put(const X &t)
Put an item to the receiver.
void remove_edge(sender< T > &p, receiver< T > &s)
Removes an edge between a single predecessor and a single successor.
receiver< input_type >::predecessor_type predecessor_type
bool pop_back(item_type &v)
void reset_node(reset_flags f) __TBB_override
#define __TBB_DEPRECATED_LIMITER_EXPR(expr)
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 reset_node(reset_flags f) __TBB_override
sender< output_type >::successor_type successor_type
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
receiver< input_type >::predecessor_type predecessor_type
internal::tagged_msg< size_t, T0, T1, T2, T3, T4, T5, T6 > output_type
bool try_get(input_type &v) __TBB_override
Request an item from the sender.
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
internal::function_body< T, size_t > * my_sequencer
virtual ~untyped_receiver()
Destructor.
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
buffer_node< T, A >::buffer_operation sequencer_operation
untyped_receiver successor_type
The successor type for this node.
task * try_put_task(const TupleType &t) __TBB_override
Put item to successor; return task to run the successor if possible.
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
A task that calls a node's apply_body_bypass function with no input.
internal::tagged_msg< size_t, T0, T1, T2, T3, T4, T5, T6, T7, T8 > output_type
Base class for tasks generated by graph nodes.
void reset_node(reset_flags f) __TBB_override
void set_gateway(gateway_type *gateway)
__TBB_NOINLINE_SYM indexer_node(graph &g)
base_type::buffer_operation queue_operation
__TBB_DEPRECATED typedef internal::async_helpers< T >::filtered_type filtered_type
__TBB_NOINLINE_SYM join_node(const join_node &other)
__TBB_NOINLINE_SYM sequencer_node(const sequencer_node &src)
Copy constructor.
static tbb::task * combine_tasks(graph &g, tbb::task *left, tbb::task *right)
bool try_consume() __TBB_override
Consumes the reserved item.
void destroy_item(size_type i)
__TBB_NOINLINE_SYM queue_node(graph &g)
Constructor.
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
virtual void handle_operations(buffer_operation *op_list)
__TBB_NOINLINE_SYM continue_node(graph &g,)
Constructor for executable node with continue_msg -> Output.
graph_iterator()
Default constructor.
void internal_reserve(queue_operation *op) __TBB_override
void reserve_wait() __TBB_override
Inform a graph that messages may come from outside, to prevent premature graph completion.
std::unique_ptr< input_ports_type > my_input_ports
sender< output_type >::successor_type successor_type
void reset_receiver(reset_flags) __TBB_override
put receiver back in initial state
broadcast_cache_type my_successors
bool try_reserve(T &v) __TBB_override
Reserves an item.
void add_visible_nodes(const NodeTypes &... n)
__TBB_DEPRECATED typedef receiver< input_type >::predecessor_type predecessor_type
The predecessor type for this node.
void set_ref_count(int count)
Set reference count.
internal::unfolded_join_node< N, key_matching_port, OutputTuple, key_matching< K, KHash > > unfolded_type
void set_external_ports(T1 &&input_ports_tuple, T2 &&output_ports_tuple)
void activate_graph(tbb::flow::interface10::graph &g)
void wait_for_all()
Wait until graph is idle and decrement_wait_count calls equals increment_wait_count calls.
internal::function_input< input_type, output_type, Policy, Allocator > input_impl_type
bool try_consume() __TBB_override
Consumes a reserved item.
successors_type my_successors
bool try_reserve(T &v) __TBB_override
Reserves an item.
task * apply_body_bypass()
Applies the body. Returning SUCCESSFULLY_ENQUEUED okay; forward_task_bypass will handle it.
virtual bool try_reserve(T &)
Reserves an item in the sender.
void try_put_and_add_task(task *&last_task)
tbb::flow::tuple< sender< OutputTypes > &... > output_ports_type
__TBB_NOINLINE_SYM split_node(graph &g)
const V & cast_to(T const &t)
K key_from_message(const T &t)
internal::unfolded_join_node< N, queueing_port, OutputTuple, queueing > unfolded_type
task * try_put_task(const input_type &v) __TBB_override
Put item to successor; return task to run the successor if possible.
void operator()(const Input &v, Ports &)
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
static const void * to_void_ptr(const T &t)