17 #ifndef __TBB_flow_graph_H 18 #define __TBB_flow_graph_H 20 #define __TBB_flow_graph_H_include_area 39 #if TBB_USE_THREADING_TOOLS && TBB_PREVIEW_FLOW_GRAPH_TRACE && ( __linux__ || __APPLE__ ) 42 #pragma warning (push) 43 #pragma warning( disable: 2196 ) 45 #define __TBB_NOINLINE_SYM __attribute__((noinline)) 47 #define __TBB_NOINLINE_SYM 50 #if __TBB_PREVIEW_ASYNC_MSG 55 #if __TBB_PREVIEW_STREAMING_NODE 58 #include <unordered_map> 59 #include <type_traits> 60 #endif // __TBB_PREVIEW_STREAMING_NODE 62 #if TBB_DEPRECATED_FLOW_ENQUEUE 63 #define FLOW_SPAWN(a) tbb::task::enqueue((a)) 65 #define FLOW_SPAWN(a) tbb::task::spawn((a)) 68 #if TBB_DEPRECATED_FLOW_NODE_ALLOCATOR 69 #define __TBB_DEFAULT_NODE_ALLOCATOR(T) cache_aligned_allocator<T> 71 #define __TBB_DEFAULT_NODE_ALLOCATOR(T) null_type 75 #if __TBB_CPP11_TUPLE_PRESENT 80 using std::tuple_size;
81 using std::tuple_element;
86 #include "compat/tuple" 108 namespace interface11 {
128 template<
typename T,
typename M>
class broadcast_cache;
133 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 138 template<
typename Order,
typename... Args>
struct node_set;
141 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 145 class edge_container {
148 typedef std::list<C *, tbb::tbb_allocator<C *> > edge_list_type;
150 void add_edge(C &
s) {
151 built_edges.push_back(&
s);
154 void delete_edge(C &
s) {
155 for (
typename edge_list_type::iterator i = built_edges.begin(); i != built_edges.end(); ++i) {
163 void copy_edges(edge_list_type &v) {
167 size_t edge_count() {
168 return (
size_t)(built_edges.size());
177 template<
typename S >
void sender_extract(
S &
s);
178 template<
typename R >
void receiver_extract(R &r);
181 edge_list_type built_edges;
196 namespace interface11 {
201 if (right == NULL)
return left;
203 if (left == NULL)
return right;
214 #if __TBB_PREVIEW_ASYNC_MSG 222 template<
typename T,
typename =
void >
230 return static_cast<const void*>(&t);
234 return static_cast<void*>(&t);
238 return *static_cast<const T*>(
p);
242 return *static_cast<T*>(
p);
263 template<
typename T >
304 class untyped_receiver;
331 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 332 typedef internal::edge_container<successor_type> built_successors_type;
334 typedef built_successors_type::edge_list_type successor_list_type;
335 virtual built_successors_type &built_successors() = 0;
338 virtual void copy_successors( successor_list_type &) = 0;
339 virtual size_t successor_count() = 0;
343 template<
typename X >
349 template<
typename X >
358 class untyped_receiver {
365 #if __TBB_PREVIEW_OPENCL_NODE 379 if (!res)
return false;
394 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 395 typedef internal::edge_container<predecessor_type> built_predecessors_type;
396 typedef built_predecessors_type::edge_list_type predecessor_list_type;
397 virtual built_predecessors_type &built_predecessors() = 0;
400 virtual void copy_predecessors( predecessor_list_type & ) = 0;
401 virtual size_t predecessor_count() = 0;
424 template<
typename T >
445 __TBB_ASSERT(
false,
"async_msg interface does not support 'pull' protocol in try_get()");
455 __TBB_ASSERT(
false,
"async_msg interface does not support 'pull' protocol in try_reserve()");
461 template<
typename T >
490 #else // __TBB_PREVIEW_ASYNC_MSG 493 template<
typename T >
513 virtual bool try_get( T & ) {
return false; }
524 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 525 __TBB_DEPRECATED typedef typename internal::edge_container<successor_type> built_successors_type;
527 __TBB_DEPRECATED typedef typename built_successors_type::edge_list_type successor_list_type;
537 template<
typename T >
552 if (!res)
return false;
573 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 574 __TBB_DEPRECATED typedef typename internal::edge_container<predecessor_type> built_predecessors_type;
575 __TBB_DEPRECATED typedef typename built_predecessors_type::edge_list_type predecessor_list_type;
590 #if __TBB_PREVIEW_OPENCL_NODE 595 #endif // __TBB_PREVIEW_ASYNC_MSG 640 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 641 __TBB_DEPRECATED typedef internal::edge_container<predecessor_type> built_predecessors_type;
643 built_predecessors_type &built_predecessors()
__TBB_override {
return my_built_predecessors; }
647 my_built_predecessors.add_edge(
s );
652 my_built_predecessors.delete_edge(
s);
657 my_built_predecessors.copy_edges(v);
662 return my_built_predecessors.edge_count();
684 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 687 built_predecessors_type my_built_predecessors;
701 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 702 my_built_predecessors.clear();
719 #if __TBB_PREVIEW_MESSAGE_BASED_KEY_MATCHING 720 template <
typename K,
typename T>
737 namespace interface11 {
742 #if __TBB_PREVIEW_ASYNC_MSG 747 template <
typename C,
typename N>
750 if (
begin) current_node = my_graph->my_nodes;
754 template <
typename C,
typename N>
757 return *operator->();
760 template <
typename C,
typename N>
765 template <
typename C,
typename N>
767 if (current_node) current_node = current_node->next;
772 namespace interface10 {
774 inline graph::graph() : my_nodes(NULL), my_nodes_last(NULL), my_task_arena(NULL) {
787 my_context(&use_this_context), my_nodes(NULL), my_nodes_last(NULL), my_task_arena(NULL) {
788 prepare_task_arena();
791 caught_exception =
false;
793 my_root_task->set_ref_count(1);
800 my_root_task->set_ref_count(0);
801 tbb::task::destroy(*my_root_task);
802 if (own_context)
delete my_context;
803 delete my_task_arena;
808 my_root_task->increment_ref_count();
816 my_root_task->decrement_ref_count();
824 n->
prev = my_nodes_last;
825 if (my_nodes_last) my_nodes_last->
next = n;
827 if (!my_nodes) my_nodes = n;
834 __TBB_ASSERT(my_nodes && my_nodes_last,
"graph::remove_node: Error: no registered nodes");
837 if (my_nodes_last == n) my_nodes_last = n->
prev;
838 if (my_nodes == n) my_nodes = n->
next;
847 if(my_context) my_context->reset();
849 caught_exception =
false;
851 for(iterator ii =
begin(); ii !=
end(); ++ii) {
857 prepare_task_arena(
true );
860 for(task_list_type::iterator rti = my_reset_task_list.begin(); rti != my_reset_task_list.end(); ++rti) {
863 my_reset_task_list.clear();
878 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 879 inline void graph::set_name(
const char *
name) {
886 namespace interface11 {
898 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 899 using internal::node_set;
903 template <
typename Output >
915 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 921 template<
typename Body >
933 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 934 template <
typename Body,
typename... Successors>
935 input_node(
const node_set<internal::order::preceding, Successors...>& successors, Body body )
936 :
input_node(successors.graph_reference(), body) {
937 make_edges(*
this, successors);
956 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 978 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1068 template<
typename Body>
1074 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1118 #if TBB_DEPRECATED_INPUT_NODE_BODY 1140 return (
new ( task::allocate_additional_child_of( *(this->
my_graph.
root_task()) ) )
1167 #if TBB_USE_SOURCE_NODE_AS_ALIAS 1168 template <
typename Output >
1172 template<
typename Body >
1178 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 1179 template <
typename Body,
typename... Successors>
1180 source_node(
const node_set<internal::order::preceding, Successors...>& successors, Body body )
1185 #else // TBB_USE_SOURCE_NODE_AS_ALIAS 1186 template <
typename Output >
class 1188 __TBB_DEPRECATED_MSG(
"TBB Warning: tbb::flow::source_node is deprecated, use tbb::flow::input_node." )
1200 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1206 template<
typename Body >
1208 :
graph_node(g), my_active(is_active), init_my_active(is_active),
1211 my_reserved(false), my_has_cached_item(false)
1218 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 1219 template <
typename Body,
typename... Successors>
1220 source_node(
const node_set<internal::order::preceding, Successors...>& successors, Body body,
bool is_active =
true )
1221 :
source_node(successors.graph_reference(), body, is_active) {
1222 make_edges(*
this, successors);
1229 my_active(src.init_my_active),
1230 init_my_active(src.init_my_active), my_body( src.my_init_body->clone() ), my_init_body(src.my_init_body->clone() ),
1231 my_reserved(false), my_has_cached_item(false)
1241 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 1263 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1265 built_successors_type &built_successors()
__TBB_override {
return my_successors.built_successors(); }
1267 void internal_add_built_successor( successor_type &r)
__TBB_override {
1269 my_successors.internal_add_built_successor(r);
1274 my_successors.internal_delete_built_successor(r);
1279 return my_successors.successor_count();
1284 my_successors.copy_successors(v);
1294 if ( my_has_cached_item ) {
1296 my_has_cached_item =
false;
1308 if ( my_reserved ) {
1312 if ( my_has_cached_item ) {
1325 __TBB_ASSERT( my_reserved && my_has_cached_item,
"releasing non-existent reservation" );
1326 my_reserved =
false;
1327 if(!my_successors.
empty())
1335 __TBB_ASSERT( my_reserved && my_has_cached_item,
"consuming non-existent reservation" );
1336 my_reserved =
false;
1337 my_has_cached_item =
false;
1338 if ( !my_successors.
empty() ) {
1348 if (!my_successors.
empty())
1352 template<
typename Body>
1358 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1360 my_successors.built_successors().sender_extract(*
this);
1361 my_active = init_my_active;
1362 my_reserved =
false;
1363 if(my_has_cached_item) my_has_cached_item =
false;
1371 my_active = init_my_active;
1373 if(my_has_cached_item) {
1374 my_has_cached_item =
false;
1400 if ( my_reserved ) {
1403 if ( !my_has_cached_item ) {
1405 bool r = (*my_body)(my_cached_item);
1408 my_has_cached_item =
true;
1411 if ( my_has_cached_item ) {
1425 return (
new ( task::allocate_additional_child_of( *(this->my_graph.root_task()) ) )
1440 if ( !try_reserve_apply_body(v) )
1451 #endif // TBB_USE_SOURCE_NODE_AS_ALIAS 1458 #if TBB_DEPRECATED_FLOW_NODE_ALLOCATOR 1465 #if TBB_DEPRECATED_FLOW_NODE_ALLOCATOR 1472 "Allocator template parameter for flow graph nodes is deprecated and will be removed. " 1473 "Specify TBB_DEPRECATED_FLOW_NODE_ALLOCATOR to temporary enable the deprecated interface." 1485 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1486 typedef typename input_impl_type::predecessor_list_type predecessor_list_type;
1487 typedef typename fOutput_type::successor_list_type successor_list_type;
1495 template<
typename Body >
1508 #if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT 1509 template <
typename Body>
1512 #endif // __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT 1514 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 1515 template <
typename Body,
typename... Args>
1519 make_edges_in_order(nodes, *
this);
1522 #if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES 1523 template <
typename Body,
typename... Args>
1526 #endif // __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES 1527 #endif // __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 1538 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 1544 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1547 successors().built_successors().sender_extract(*
this);
1574 template<
typename Input,
typename Output,
typename Policy =
queueing,
1581 typename internal::wrap_tuple_elements<
1582 tbb::flow::tuple_size<Output>::value,
1583 internal::multifunction_output,
1587 #if TBB_DEPRECATED_FLOW_NODE_ALLOCATOR
1590 cache_aligned_allocator<Input>
1593 #if TBB_DEPRECATED_FLOW_NODE_ALLOCATOR 1600 "Allocator template parameter for flow graph nodes is deprecated and will be removed. " 1601 "Specify TBB_DEPRECATED_FLOW_NODE_ALLOCATOR to temporary enable the deprecated interface." 1617 template<
typename Body>
1626 tbb::internal::fgt_multioutput_node_with_body<N>(
1627 CODEPTR(), tbb::internal::FLOW_MULTIFUNCTION_NODE,
1633 #if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT 1634 template <
typename Body>
1637 #endif // TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT 1639 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 1640 template <
typename Body,
typename... Args>
1644 make_edges_in_order(nodes, *
this);
1647 #if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES 1648 template <
typename Body,
typename... Args>
1651 #endif // __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES 1652 #endif // __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 1656 tbb::internal::fgt_multioutput_node_with_body<N>(
CODEPTR(), tbb::internal::FLOW_MULTIFUNCTION_NODE,
1661 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 1667 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1670 input_impl_type::extract();
1680 template<
typename TupleType,
typename Allocator=__TBB_DEFAULT_NODE_ALLOCATOR(TupleType)>
1686 #if TBB_DEPRECATED_FLOW_NODE_ALLOCATOR 1691 "Allocator template parameter for flow graph nodes is deprecated and will be removed. " 1692 "Specify TBB_DEPRECATED_FLOW_NODE_ALLOCATOR to temporary enable the deprecated interface." 1695 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1697 typedef typename base_type::predecessor_list_type predecessor_list_type;
1699 typedef typename predecessor_cache_type::built_predecessors_type built_predecessors_type;
1712 tbb::internal::fgt_multioutput_node<N>(
CODEPTR(), tbb::internal::FLOW_SPLIT_NODE, &this->
my_graph,
1716 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 1717 template <
typename... Args>
1719 make_edges_in_order(nodes, *
this);
1727 tbb::internal::fgt_multioutput_node<N>(
CODEPTR(), tbb::internal::FLOW_SPLIT_NODE, &this->
my_graph,
1731 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 1755 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1769 built_predecessors_type &built_predecessors()
__TBB_override {
return my_predessors; }
1772 built_predecessors_type my_predessors;
1780 template <
typename Output,
typename Policy =
internal::Policy<
void> >
1792 template <
typename Body >
1808 #if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT 1809 template <
typename Body>
1814 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 1815 template <
typename Body,
typename... Args>
1819 make_edges_in_order(nodes, *
this);
1821 #if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES 1822 template <
typename Body,
typename... Args>
1825 #endif // __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES 1826 #endif // __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 1829 template <
typename Body >
1831 graph &g,
int number_of_predecessors,
1845 #if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT 1846 template <
typename Body>
1851 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 1852 template <
typename Body,
typename... Args>
1853 continue_node(
const node_set<Args...>& nodes,
int number_of_predecessors,
1856 make_edges_in_order(nodes, *
this);
1859 #if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES 1860 template <
typename Body,
typename... Args>
1861 continue_node(
const node_set<Args...>& nodes,
int number_of_predecessors,
1876 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 1882 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1884 input_impl_type::my_built_predecessors.receiver_extract(*
this);
1904 template <
typename T>
1911 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1917 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1918 internal::edge_container<predecessor_type> my_built_predecessors;
1929 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 1930 template <
typename... Args>
1932 make_edges_in_order(nodes, *
this);
1945 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 1963 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 1986 built_predecessors_type &built_predecessors()
__TBB_override {
return my_built_predecessors; }
1990 my_built_predecessors.add_edge(
p);
1995 my_built_predecessors.delete_edge(
p);
2000 return my_built_predecessors.edge_count();
2003 void copy_predecessors(predecessor_list_type &v)
__TBB_override {
2005 my_built_predecessors.copy_edges(v);
2009 my_built_predecessors.receiver_extract(*
this);
2034 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 2035 my_built_predecessors.clear();
2043 template <
typename T,
typename Allocator=__TBB_DEFAULT_NODE_ALLOCATOR(T) >
2046 #if TBB_DEPRECATED_FLOW_NODE_ALLOCATOR 2052 #if TBB_DEPRECATED_FLOW_NODE_ALLOCATOR 2063 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 2067 #if !TBB_DEPRECATED_FLOW_NODE_ALLOCATOR 2070 "Allocator template parameter for flow graph nodes is deprecated and will be removed. " 2071 "Specify TBB_DEPRECATED_FLOW_NODE_ALLOCATOR to temporary enable the deprecated interface." 2079 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 2080 internal::edge_container<predecessor_type> my_built_predecessors;
2086 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 2087 , add_blt_succ, del_blt_succ,
2088 add_blt_pred, del_blt_pred,
2089 blt_succ_cnt, blt_pred_cnt,
2090 blt_succ_cpy, blt_pred_cpy
2098 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 2105 successor_list_type *svec;
2106 predecessor_list_type *pvec;
2115 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
2118 ,
elem(const_cast<T*>(&e)) ,
ltask(NULL)
2125 typedef internal::aggregating_functor<class_type, buffer_operation>
handler_type;
2133 template<
typename derived_type>
2135 __TBB_ASSERT(static_cast<class_type*>(derived) ==
this,
"'this' is not a base class for derived");
2138 bool try_forwarding =
false;
2141 op_list = op_list->next;
2142 switch (tmp->
type) {
2151 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 2153 case add_blt_succ: internal_add_built_succ(tmp);
break;
2154 case del_blt_succ: internal_del_built_succ(tmp);
break;
2155 case add_blt_pred: internal_add_built_pred(tmp);
break;
2156 case del_blt_pred: internal_del_built_pred(tmp);
break;
2157 case blt_succ_cnt: internal_succ_cnt(tmp);
break;
2158 case blt_pred_cnt: internal_pred_cnt(tmp);
break;
2159 case blt_succ_cpy: internal_copy_succs(tmp);
break;
2160 case blt_pred_cpy: internal_copy_preds(tmp);
break;
2169 forwarder_busy =
true;
2171 forward_task_bypass<class_type>(*
this);
2183 return op_data.
ltask;
2198 task *last_task = NULL;
2201 op_data.
ltask = NULL;
2224 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 2229 virtual void internal_add_built_succ(buffer_operation *op) {
2234 virtual void internal_del_built_succ(buffer_operation *op) {
2239 typedef typename receiver<T>::built_predecessors_type built_predecessors_type;
2241 built_predecessors_type &built_predecessors()
__TBB_override {
return my_built_predecessors; }
2243 virtual void internal_add_built_pred(buffer_operation *op) {
2244 my_built_predecessors.add_edge(*(op->p));
2248 virtual void internal_del_built_pred(buffer_operation *op) {
2249 my_built_predecessors.delete_edge(*(op->p));
2253 virtual void internal_succ_cnt(buffer_operation *op) {
2258 virtual void internal_pred_cnt(buffer_operation *op) {
2259 op->cnt_val = my_built_predecessors.edge_count();
2263 virtual void internal_copy_succs(buffer_operation *op) {
2268 virtual void internal_copy_preds(buffer_operation *op) {
2269 my_built_predecessors.copy_edges(*(op->pvec));
2298 template<
typename derived_type>
2300 __TBB_ASSERT(static_cast<class_type*>(derived) ==
this,
"'this' is not a base class for derived");
2302 if (this->my_reserved || !derived->is_item_valid()) {
2304 this->forwarder_busy =
false;
2308 task * last_task = NULL;
2310 for (; counter > 0 && derived->is_item_valid(); --counter)
2311 derived->try_put_and_add_task(last_task);
2313 op->
ltask = last_task;
2314 if (last_task && !counter) {
2369 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 2370 template <
typename... Args>
2372 make_edges_in_order(nodes, *
this);
2387 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 2407 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 2409 buffer_operation op_data(add_blt_succ);
2415 buffer_operation op_data(del_blt_succ);
2421 buffer_operation op_data(add_blt_pred);
2427 buffer_operation op_data(del_blt_pred);
2433 buffer_operation op_data(blt_pred_cnt);
2435 return op_data.cnt_val;
2439 buffer_operation op_data(blt_succ_cnt);
2441 return op_data.cnt_val;
2444 void copy_predecessors( predecessor_list_type &v )
__TBB_override {
2445 buffer_operation op_data(blt_pred_cpy);
2451 buffer_operation op_data(blt_succ_cpy);
2462 r.remove_predecessor(*
this);
2544 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 2547 my_built_predecessors.receiver_extract(*
this);
2558 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 2559 my_built_predecessors.clear();
2567 template <
typename T,
typename Allocator=__TBB_DEFAULT_NODE_ALLOCATOR(T) >
2569 #if !TBB_DEPRECATED_FLOW_NODE_ALLOCATOR 2572 "Allocator template parameter for flow graph nodes is deprecated and will be removed. " 2573 "Specify TBB_DEPRECATED_FLOW_NODE_ALLOCATOR to temporary enable the deprecated interface." 2640 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 2641 template <
typename... Args>
2643 make_edges_in_order(nodes, *
this);
2654 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 2667 template<
typename T,
typename Allocator=__TBB_DEFAULT_NODE_ALLOCATOR(T) >
2673 #if !TBB_DEPRECATED_FLOW_NODE_ALLOCATOR 2676 "Allocator template parameter for flow graph nodes is deprecated and will be removed. " 2677 "Specify TBB_DEPRECATED_FLOW_NODE_ALLOCATOR to temporary enable the deprecated interface." 2686 template<
typename Sequencer >
2694 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 2695 template <
typename Sequencer,
typename... Args>
2698 make_edges_in_order(nodes, *
this);
2713 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 2725 size_type tag = (*my_sequencer)(*(op->elem));
2726 #if !TBB_DEPRECATED_SEQUENCER_DUPLICATES 2734 size_t new_tail = (tag+1 > this->
my_tail) ? tag+1 : this->
my_tail;
2748 template<
typename T,
typename Compare = std::less<T>,
typename Allocator=__TBB_DEFAULT_NODE_ALLOCATOR(T)>
2751 #if !TBB_DEPRECATED_FLOW_NODE_ALLOCATOR 2754 "Allocator template parameter for flow graph nodes is deprecated and will removed in the future. " 2755 "To temporary enable the deprecated interface specify TBB_ENABLE_DEPRECATED_NODE_ALLOCATOR." 2773 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 2774 template <
typename... Args>
2777 make_edges_in_order(nodes, *
this);
2790 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 2824 if ( this->my_reserved ==
true || this->
my_tail == 0 ) {
2829 *(op->elem) =
prio();
2837 if (this->my_reserved ==
true || this->
my_tail == 0) {
2841 this->my_reserved =
true;
2842 *(op->elem) =
prio();
2850 this->my_reserved =
false;
2857 this->my_reserved =
false;
2941 size_type cur_pos =
mark;
2958 while (child <
mark) {
2971 child = (cur_pos<<1)+1;
2978 namespace interface11 {
2984 template<
typename T,
typename DecrementType=continue_msg >
2985 class limiter_node :
public graph_node,
public receiver< T >,
public sender< T > {
2991 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 3021 bool reserved =
false;
3079 if( delta > 0 &&
size_t(delta) >
my_count )
3103 #if TBB_DEPRECATED_LIMITER_NODE_CONSTRUCTOR 3105 "Deprecated interface of the limiter node can be used only in conjunction " 3106 "with continue_msg as the type of DecrementType template parameter." );
3107 #endif // Check for incompatible interface 3115 init_decrement_predecessors(num_decrement_predecessors),
3116 decrement(num_decrement_predecessors)) {
3120 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3121 template <
typename... Args>
3122 limiter_node(
const node_set<Args...>& nodes,
size_t threshold)
3124 make_edges_in_order(nodes, *
this);
3134 init_decrement_predecessors(src.init_decrement_predecessors),
3135 decrement(src.init_decrement_predecessors)) {
3139 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3164 r.remove_predecessor(*
this);
3169 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 3197 void copy_predecessors(predecessor_list_type &v)
__TBB_override {
3248 rtask =
new ( task::allocate_additional_child_of( *(this->
my_graph.
root_task()) ) )
3288 template<
typename OutputTuple,
typename JP=queueing>
class join_node;
3290 template<
typename OutputTuple>
3299 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_RESERVING, &this->my_graph,
3303 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3304 template <
typename... Args>
3306 make_edges_in_order(nodes, *
this);
3311 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_RESERVING, &this->my_graph,
3315 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3323 template<
typename OutputTuple>
3332 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_QUEUEING, &this->my_graph,
3336 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3337 template <
typename... Args>
3339 make_edges_in_order(nodes, *
this);
3344 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_QUEUEING, &this->my_graph,
3348 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3358 template<
typename OutputTuple,
typename K,
typename KHash>
3360 key_matching_port, OutputTuple, key_matching<K,KHash> > {
3368 #if __TBB_PREVIEW_MESSAGE_BASED_KEY_MATCHING 3371 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3372 template <
typename... Args>
3375 make_edges_in_order(nodes, *
this);
3381 template<
typename __TBB_B0,
typename __TBB_B1>
3383 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3386 template<
typename __TBB_B0,
typename __TBB_B1,
typename __TBB_B2>
3388 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3391 template<
typename __TBB_B0,
typename __TBB_B1,
typename __TBB_B2,
typename __TBB_B3>
3393 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3396 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,
3402 #if __TBB_VARIADIC_MAX >= 6 3403 template<
typename __TBB_B0,
typename __TBB_B1,
typename __TBB_B2,
typename __TBB_B3,
typename __TBB_B4,
3407 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3411 #if __TBB_VARIADIC_MAX >= 7 3412 template<
typename __TBB_B0,
typename __TBB_B1,
typename __TBB_B2,
typename __TBB_B3,
typename __TBB_B4,
3413 typename __TBB_B5,
typename __TBB_B6>
3416 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3420 #if __TBB_VARIADIC_MAX >= 8 3421 template<
typename __TBB_B0,
typename __TBB_B1,
typename __TBB_B2,
typename __TBB_B3,
typename __TBB_B4,
3422 typename __TBB_B5,
typename __TBB_B6,
typename __TBB_B7>
3424 __TBB_B7 b7) :
unfolded_type(g, b0, b1, b2, b3, b4, b5, b6, b7) {
3425 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3429 #if __TBB_VARIADIC_MAX >= 9 3430 template<
typename __TBB_B0,
typename __TBB_B1,
typename __TBB_B2,
typename __TBB_B3,
typename __TBB_B4,
3431 typename __TBB_B5,
typename __TBB_B6,
typename __TBB_B7,
typename __TBB_B8>
3433 __TBB_B7 b7, __TBB_B8 b8) :
unfolded_type(g, b0, b1, b2, b3, b4, b5, b6, b7, b8) {
3434 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3438 #if __TBB_VARIADIC_MAX >= 10 3439 template<
typename __TBB_B0,
typename __TBB_B1,
typename __TBB_B2,
typename __TBB_B3,
typename __TBB_B4,
3440 typename __TBB_B5,
typename __TBB_B6,
typename __TBB_B7,
typename __TBB_B8,
typename __TBB_B9>
3442 __TBB_B7 b7, __TBB_B8 b8, __TBB_B9 b9) :
unfolded_type(g, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9) {
3443 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3448 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3449 template <
typename... Args,
typename... Bodies>
3451 :
join_node(nodes.graph_reference(), bodies...) {
3452 make_edges_in_order(nodes, *
this);
3457 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
3461 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3473 template<
typename T0,
typename T1=null_type,
typename T2=null_type,
typename T3=null_type,
3474 typename T4=null_type,
typename T5=null_type,
typename T6=null_type,
3478 template<
typename T0>
3481 static const int N = 1;
3487 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3491 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3492 template <
typename... Args>
3494 make_edges_in_order(nodes, *
this);
3500 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3504 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3511 template<
typename T0,
typename T1>
3514 static const int N = 2;
3520 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3524 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3525 template <
typename... Args>
3527 make_edges_in_order(nodes, *
this);
3533 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3537 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3544 template<
typename T0,
typename T1,
typename T2>
3547 static const int N = 3;
3553 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3557 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3558 template <
typename... Args>
3560 make_edges_in_order(nodes, *
this);
3566 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3570 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3577 template<
typename T0,
typename T1,
typename T2,
typename T3>
3580 static const int N = 4;
3586 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3590 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3591 template <
typename... Args>
3593 make_edges_in_order(nodes, *
this);
3599 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3603 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3610 template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4>
3613 static const int N = 5;
3619 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3623 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3624 template <
typename... Args>
3626 make_edges_in_order(nodes, *
this);
3632 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3636 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3643 #if __TBB_VARIADIC_MAX >= 6 3644 template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
3645 class indexer_node<T0, T1, T2, T3, T4, T5> :
public internal::unfolded_indexer_node<tuple<T0, T1, T2, T3, T4, T5> > {
3647 static const int N = 6;
3653 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3657 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3658 template <
typename... Args>
3660 make_edges_in_order(nodes, *
this);
3666 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3670 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3676 #endif //variadic max 6 3678 #if __TBB_VARIADIC_MAX >= 7 3679 template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
3681 class indexer_node<T0, T1, T2, T3, T4, T5, T6> :
public internal::unfolded_indexer_node<tuple<T0, T1, T2, T3, T4, T5, T6> > {
3683 static const int N = 7;
3689 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3693 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3694 template <
typename... Args>
3696 make_edges_in_order(nodes, *
this);
3702 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3706 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3712 #endif //variadic max 7 3714 #if __TBB_VARIADIC_MAX >= 8 3715 template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
3716 typename T6,
typename T7>
3717 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> > {
3719 static const int N = 8;
3725 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3729 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3730 template <
typename... Args>
3732 make_edges_in_order(nodes, *
this);
3738 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3742 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3748 #endif //variadic max 8 3750 #if __TBB_VARIADIC_MAX >= 9 3751 template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
3752 typename T6,
typename T7,
typename T8>
3753 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> > {
3755 static const int N = 9;
3761 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3765 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3766 template <
typename... Args>
3768 make_edges_in_order(nodes, *
this);
3774 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3778 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3784 #endif //variadic max 9 3786 #if __TBB_VARIADIC_MAX >= 10 3787 template<
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
3788 typename T6,
typename T7,
typename T8,
typename T9>
3791 static const int N = 10;
3793 typedef tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>
InputTuple;
3794 typedef typename internal::tagged_msg<size_t, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> output_type;
3797 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3801 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 3802 template <
typename... Args>
3804 make_edges_in_order(nodes, *
this);
3810 tbb::internal::fgt_multiinput_node<N>(
CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->
my_graph,
3814 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 3820 #endif //variadic max 10 3822 #if __TBB_PREVIEW_ASYNC_MSG 3825 template<
typename T >
3828 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 3829 s.internal_add_built_predecessor(
p);
3830 p.internal_add_built_successor(
s);
3832 p.register_successor(
s );
3837 template<
typename T >
3842 #if __TBB_PREVIEW_ASYNC_MSG 3843 template<
typename TS,
typename TR,
3850 template<
typename T >
3855 template<
typename T >
3860 #endif // __TBB_PREVIEW_ASYNC_MSG 3862 #if __TBB_FLOW_GRAPH_CPP11_FEATURES 3864 template<
typename T,
typename V,
3865 typename =
typename T::output_ports_type,
typename =
typename V::input_ports_type >
3867 make_edge(get<0>(output.output_ports()), get<0>(input.input_ports()));
3871 template<
typename T,
typename R,
3872 typename =
typename T::output_ports_type >
3874 make_edge(get<0>(output.output_ports()), input);
3878 template<
typename S,
typename V,
3879 typename =
typename V::input_ports_type >
3881 make_edge(output, get<0>(input.input_ports()));
3885 #if __TBB_PREVIEW_ASYNC_MSG 3888 template<
typename T >
3891 p.remove_successor(
s );
3892 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 3894 p.internal_delete_built_successor(
s);
3895 s.internal_delete_built_predecessor(
p);
3901 template<
typename T >
3906 #if __TBB_PREVIEW_ASYNC_MSG 3907 template<
typename TS,
typename TR,
3914 template<
typename T >
3919 template<
typename T >
3923 #endif // __TBB_PREVIEW_ASYNC_MSG 3925 #if __TBB_FLOW_GRAPH_CPP11_FEATURES 3927 template<
typename T,
typename V,
3928 typename =
typename T::output_ports_type,
typename =
typename V::input_ports_type >
3930 remove_edge(get<0>(output.output_ports()), get<0>(input.input_ports()));
3934 template<
typename T,
typename R,
3935 typename =
typename T::output_ports_type >
3937 remove_edge(get<0>(output.output_ports()), input);
3940 template<
typename S,
typename V,
3941 typename =
typename V::input_ports_type >
3947 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 3948 template<
typename C >
3949 template<
typename S >
3950 void internal::edge_container<C>::sender_extract(
S &
s ) {
3951 edge_list_type e = built_edges;
3952 for (
typename edge_list_type::iterator i = e.begin(); i != e.end(); ++i ) {
3957 template<
typename C >
3958 template<
typename R >
3959 void internal::edge_container<C>::receiver_extract( R &r ) {
3960 edge_list_type e = built_edges;
3961 for (
typename edge_list_type::iterator i = e.begin(); i != e.end(); ++i ) {
3968 template<
typename Body,
typename Node >
3970 return n.template copy_function_object<Body>();
3973 #if __TBB_FLOW_GRAPH_CPP11_FEATURES 3978 template<
typename... InputTypes,
typename... OutputTypes>
3989 static const size_t NUM_INPUTS =
sizeof...(InputTypes);
3990 static const size_t NUM_OUTPUTS =
sizeof...(OutputTypes);
3996 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 4007 template<
typename T1,
typename T2>
4011 my_input_ports = tbb::internal::make_unique<input_ports_type>(std::forward<T1>(input_ports_tuple));
4012 my_output_ports = tbb::internal::make_unique<output_ports_type>(std::forward<T2>(output_ports_tuple));
4018 template<
typename... NodeTypes >
4021 template<
typename... NodeTypes >
4024 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 4031 __TBB_ASSERT(my_input_ports,
"input ports not set, call set_external_ports to set input ports");
4032 return *my_input_ports;
4036 __TBB_ASSERT(my_output_ports,
"output ports not set, call set_external_ports to set output ports");
4037 return *my_output_ports;
4040 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 4042 __TBB_ASSERT(
false,
"Current composite_node implementation does not support extract");
4048 template<
typename... InputTypes>
4055 static const size_t NUM_INPUTS =
sizeof...(InputTypes);
4061 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 4072 template<
typename T>
4076 my_input_ports = tbb::internal::make_unique<input_ports_type>(std::forward<T>(input_ports_tuple));
4081 template<
typename... NodeTypes >
4084 template<
typename... NodeTypes >
4087 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 4094 __TBB_ASSERT(my_input_ports,
"input ports not set, call set_external_ports to set input ports");
4095 return *my_input_ports;
4098 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 4100 __TBB_ASSERT(
false,
"Current composite_node implementation does not support extract");
4107 template<
typename... OutputTypes>
4114 static const size_t NUM_OUTPUTS =
sizeof...(OutputTypes);
4120 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 4131 template<
typename T>
4135 my_output_ports = tbb::internal::make_unique<output_ports_type>(std::forward<T>(output_ports_tuple));
4140 template<
typename... NodeTypes >
4143 template<
typename... NodeTypes >
4146 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 4153 __TBB_ASSERT(my_output_ports,
"output ports not set, call set_external_ports to set output ports");
4154 return *my_output_ports;
4157 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 4159 __TBB_ASSERT(
false,
"Current composite_node implementation does not support extract");
4165 #endif // __TBB_FLOW_GRAPH_CPP11_FEATURES 4169 template<
typename Gateway>
4183 template<
typename Input,
typename Ports,
typename Gateway,
typename Body>
4205 namespace interface11 {
4208 template <
typename Input,
typename Output,
4214 #if !TBB_DEPRECATED_FLOW_NODE_ALLOCATOR 4217 "Allocator template parameter for flow graph nodes is deprecated and will removed in the future. " 4218 "To temporary enable the deprecated interface specify TBB_ENABLE_DEPRECATED_NODE_ALLOCATOR." 4252 my_node->my_graph.reserve_wait();
4256 my_node->my_graph.release_wait();
4262 return my_node->try_put_impl(i);
4280 "Return status is inconsistent with the method operation." );
4282 while( !tasks.
empty() ) {
4286 return is_at_least_one_put_successful;
4290 template<
typename Body>
4302 tbb::internal::fgt_multioutput_node_with_body<1>(
4303 CODEPTR(), tbb::internal::FLOW_ASYNC_NODE,
4305 this->output_ports(), this->my_body
4309 #if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT 4310 template <
typename Body,
typename... Args>
4313 #endif // __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES 4315 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 4316 template <
typename Body,
typename... Args>
4318 const node_set<Args...>& nodes,
size_t concurrency, Body body,
4321 make_edges_in_order(nodes, *
this);
4324 #if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES 4325 template <
typename Body,
typename... Args>
4327 : async_node(nodes,
concurrency, body, Policy(), priority) {}
4328 #endif // __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES 4329 #endif // __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 4332 static_cast<async_body_base_type*>(this->my_body->get_body_ptr())->set_gateway(&my_gateway);
4333 static_cast<async_body_base_type*>(this->my_init_body->get_body_ptr())->set_gateway(&my_gateway);
4335 tbb::internal::fgt_multioutput_node_with_body<1>(
CODEPTR(), tbb::internal::FLOW_ASYNC_NODE,
4337 this->output_ports(), this->my_body );
4344 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 4354 return internal::output_port<0>(*this).register_successor(r);
4359 return internal::output_port<0>(*this).remove_successor(r);
4362 template<
typename Body>
4366 mfn_body_type &body_ref = *this->my_body;
4368 return ab.get_body();
4371 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 4372 typedef typename internal::edge_container<successor_type> built_successors_type;
4374 typedef typename built_successors_type::edge_list_type successor_list_type;
4376 return internal::output_port<0>(*this).built_successors();
4379 void internal_add_built_successor( successor_type &r )
__TBB_override {
4380 internal::output_port<0>(*this).internal_add_built_successor(r);
4383 void internal_delete_built_successor( successor_type &r )
__TBB_override {
4384 internal::output_port<0>(*this).internal_delete_built_successor(r);
4388 internal::output_port<0>(*this).copy_successors(l);
4392 return internal::output_port<0>(*this).successor_count();
4399 base_type::reset_node(f);
4403 #if __TBB_PREVIEW_STREAMING_NODE 4405 #endif // __TBB_PREVIEW_STREAMING_NODE 4409 template<
typename T >
4416 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 4429 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 4430 template <
typename... Args>
4432 make_edges_in_order(nodes, *
this);
4447 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 4457 bool ret =
s.try_put( my_buffer );
4466 task *rtask =
new ( task::allocate_additional_child_of( *( my_graph.root_task() ) ) )
4483 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 4484 built_predecessors_type &built_predecessors()
__TBB_override {
return my_built_predecessors; }
4485 built_successors_type &built_successors()
__TBB_override {
return my_successors.built_successors(); }
4487 void internal_add_built_successor( successor_type &
s)
__TBB_override {
4489 my_successors.internal_add_built_successor(
s);
4492 void internal_delete_built_successor( successor_type &
s)
__TBB_override {
4494 my_successors.internal_delete_built_successor(
s);
4499 return my_successors.successor_count();
4504 my_successors.copy_successors(v);
4507 void internal_add_built_predecessor( predecessor_type &
p)
__TBB_override {
4509 my_built_predecessors.add_edge(
p);
4512 void internal_delete_built_predecessor( predecessor_type &
p)
__TBB_override {
4514 my_built_predecessors.delete_edge(
p);
4519 return my_built_predecessors.edge_count();
4522 void copy_predecessors( predecessor_list_type &v )
__TBB_override {
4524 my_built_predecessors.copy_edges(v);
4528 my_buffer_is_valid =
false;
4529 built_successors().sender_extract(*
this);
4530 built_predecessors().receiver_extract(*
this);
4537 if ( my_buffer_is_valid ) {
4557 return my_buffer_is_valid;
4562 my_buffer_is_valid =
false;
4572 return try_put_task_impl(v);
4577 my_buffer_is_valid =
true;
4591 o(owner),
s(succ) {};
4594 if (!
s.register_predecessor(o)) {
4595 o.register_successor(
s);
4606 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION 4607 internal::edge_container<predecessor_type> my_built_predecessors;
4614 my_buffer_is_valid =
false;
4616 my_successors.
clear();
4621 template<
typename T >
4637 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 4638 template <
typename... Args>
4640 make_edges_in_order(nodes, *
this);
4651 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 4663 return this->my_buffer_is_valid ? NULL : this->try_put_task_impl(v);
4674 using interface11::graph;
4675 using interface11::graph_node;
4676 using interface11::continue_msg;
4677 using interface11::source_node;
4678 using interface11::input_node;
4679 using interface11::function_node;
4680 using interface11::multifunction_node;
4681 using interface11::split_node;
4683 using interface11::indexer_node;
4684 using interface11::internal::tagged_msg;
4687 using interface11::continue_node;
4688 using interface11::overwrite_node;
4689 using interface11::write_once_node;
4690 using interface11::broadcast_node;
4691 using interface11::buffer_node;
4692 using interface11::queue_node;
4693 using interface11::sequencer_node;
4694 using interface11::priority_queue_node;
4695 using interface11::limiter_node;
4696 using namespace interface11::internal::graph_policy_namespace;
4697 using interface11::join_node;
4703 #if __TBB_FLOW_GRAPH_CPP11_FEATURES 4704 using interface11::composite_node;
4706 using interface11::async_node;
4707 #if __TBB_PREVIEW_ASYNC_MSG 4710 #if __TBB_PREVIEW_STREAMING_NODE 4713 #endif // __TBB_PREVIEW_STREAMING_NODE 4714 #if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES 4719 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 4720 using interface11::internal::follows;
4721 using interface11::internal::precedes;
4722 using interface11::internal::make_node_set;
4723 using interface11::internal::make_edges;
4732 #undef __TBB_PFG_RESET_ARG 4734 #undef __TBB_DEFAULT_NODE_ALLOCATOR 4737 #undef __TBB_flow_graph_H_include_area 4739 #if TBB_USE_THREADING_TOOLS && TBB_PREVIEW_FLOW_GRAPH_TRACE && ( __linux__ || __APPLE__ ) 4740 #undef __TBB_NOINLINE_SYM 4743 #endif // __TBB_flow_graph_H
virtual task * try_put_task_wrapper(const void *p, bool is_async)=0
void handle_operations_impl(buffer_operation *op_list, derived_type *derived)
__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 set_external_ports(T1 &&input_ports_tuple, T2 &&output_ports_tuple)
tbb::task * execute() __TBB_override
Should be overridden by derived classes.
bool try_reserve(output_type &v) __TBB_override
Reserves an item.
bool try_reserve(T &v) __TBB_override
Reserves an item.
bool try_get(output_type &v) __TBB_override
Request an item from the node.
receiver_gateway_impl(async_node *node)
broadcast_cache_type & successors()
tuple< T0, T1, T2 > InputTuple
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 end
virtual bool try_release()
Releases the reserved item.
__TBB_NOINLINE_SYM indexer_node(graph &g)
void reset_node(reset_flags f) __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.")
output_type my_cached_item
output_ports_type & output_ports()
virtual bool register_successor(successor_type &r)=0
Add a new successor to this node.
bool pop_back(item_type &v)
Used to form groups of tasks.
std::unique_ptr< input_ports_type > my_input_ports
output_ports_type & output_ports()
bool register_successor(successor_type &r) __TBB_override
Add a new successor to this node.
__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)
static void * to_void_ptr(T &t)
void reserve_wait() __TBB_override
Used to register that an external entity may still interact with the graph.
graph & graph_reference() const __TBB_override
bool remove_successor(successor_type &r) __TBB_override
Removes s as a successor.
internal::tagged_msg< size_t, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 > output_type
void reset_node(reset_flags f) __TBB_override
void destroy_item(size_type i)
static task * try_put_task_wrapper_impl(receiver< T > *const this_recv, const void *p, bool is_async)
void reset_node(reset_flags) __TBB_override
tbb::task_group_context * my_context
bool try_get(output_type &v) __TBB_override
Request an item from the node.
bool gather_successful_try_puts(const X &t, task_list &tasks)
__TBB_NOINLINE_SYM split_node(graph &g)
__TBB_NOINLINE_SYM indexer_node(graph &g)
bool is_continue_receiver() __TBB_override
task * try_put_task(const input_type &) __TBB_override
task * apply_body_bypass()
Applies the body. Returning SUCCESSFULLY_ENQUEUED okay; forward_task_bypass will handle it.
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
task * try_put_task(const T &t) __TBB_override
Puts an item to this receiver.
virtual bool is_continue_receiver()
void reset_function_input(reset_flags f)
void operator()(const Input &v, Ports &)
~sequencer_node()
Destructor.
#define __TBB_DEPRECATED_LIMITER_ARG2(arg1, arg2)
__TBB_DEPRECATED typedef T output_type
The output type of this sender.
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.
__TBB_NOINLINE_SYM queue_node(graph &g)
Constructor.
internal::broadcast_cache< output_type > & successors() __TBB_override
Body copy_function_object()
__TBB_NOINLINE_SYM multifunction_node(graph &g, size_t concurrency,)
#define __TBB_NOINLINE_SYM
void prepare_task_arena(bool reinit=false)
__TBB_DEPRECATED bool register_predecessor(predecessor_type &) __TBB_override
Increments the trigger threshold.
priority_queue_node class_type
void internal_release(prio_operation *op) __TBB_override
receiver< input_type >::predecessor_type predecessor_type
virtual task * forward_task()
This is executed by an enqueued task, the "forwarder".
__TBB_NOINLINE_SYM indexer_node(graph &g)
__TBB_DEPRECATED bool remove_predecessor(predecessor_type &) __TBB_override
Decrements the trigger threshold.
void internal_remove_edge(internal::untyped_sender &p, internal::untyped_receiver &s)
__TBB_NOINLINE_SYM indexer_node(graph &g)
__TBB_NOINLINE_SYM broadcast_node(graph &g)
__TBB_DEPRECATED typedef receiver< input_type >::predecessor_type predecessor_type
The predecessor type for this node.
bool try_release() __TBB_override
Release a reserved item.
Body copy_function_object()
bool register_successor(successor_type &s) __TBB_override
Add a new successor to this node.
static task * emit_this(graph &g, const T &t, P &p)
graph & graph_reference() const __TBB_override
buffer_node< T, Allocator >::buffer_operation prio_operation
#define __TBB_DEPRECATED_LIMITER_ARG4(arg1, arg2, arg3, arg4)
__TBB_NOINLINE_SYM join_node(const join_node &other)
tuple< T0, T1 > InputTuple
static void fgt_async_reserve(void *, void *)
base_type::size_type size_type
static const void * to_void_ptr(const T &t)
tuple< T0, T1, T2, T3, T4, T5, T6 > InputTuple
task * try_put_task(const X &t)
void reset_node(reset_flags f) __TBB_override
__TBB_NOINLINE_SYM write_once_node(const write_once_node &src)
Copy constructor: call base class copy constructor.
virtual void internal_rem_succ(buffer_operation *op)
Remove successor.
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
virtual bool register_predecessor(predecessor_type &)
Add a predecessor to the node.
internal::continue_input< Output, Policy > input_impl_type
internal::unfolded_indexer_node< InputTuple > unfolded_type
Base class for user-defined tasks.
#define __TBB_FLOW_GRAPH_PRIORITY_ARG0(priority)
bool remove_successor(successor_type &s) __TBB_override
Removes a successor from this node.
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
void reset_node(reset_flags f) __TBB_override
static void fgt_graph(void *)
The leaf for source_body.
output_ports_type my_output_ports
buffer_operation(const T &e, op_type t)
An executable node that acts as a source, i.e. it has no predecessors.
static void fgt_make_edge(void *, void *)
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 try_put(const output_type &i)
receiver< TupleType > base_type
async_msg< T > async_type
buffer_node< T, Allocator > base_type
task * try_put_task(const T &t) __TBB_override
receive an item, return a task *if possible
reference operator *() const
Dereference.
Forward declaration section.
__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.")
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
Implements methods for both executable and function nodes that puts Output to its successors.
void add_nodes_impl(CompositeType *, bool)
__TBB_DEPRECATED internal::port_ref_impl< N1, N2 > port_ref()
__TBB_NOINLINE_SYM composite_node(graph &g)
unfolded_type::input_ports_type input_ports_type
void reserve_wait() __TBB_override
Inform a graph that messages may come from outside, to prevent premature graph completion.
int my_initial_predecessor_count
static void fgt_remove_edge(void *, void *)
fOutput_type::successor_type successor_type
__TBB_NOINLINE_SYM async_node(const async_node &other)
static void fgt_composite(void *, void *, void *)
bool try_reserve(T &v) __TBB_override
Reserves an item.
void spawn_in_graph_arena(tbb::flow::interface10::graph &g, tbb::task &arena_task)
Spawns a task inside graph arena.
__TBB_NOINLINE_SYM async_node(graph &g, size_t concurrency,)
async_body_base(gateway_type *gateway)
internal::reservable_predecessor_cache< T, spin_mutex > my_predecessors
graph & graph_reference() const __TBB_override
__TBB_NOINLINE_SYM source_node(graph &g, Body body, bool is_active=true)
Constructor for a node with a successor.
bool try_reserve_apply_body(output_type &v)
sender< output_type >::successor_type successor_type
tuple< T0, T1, T2, T3, T4 > InputTuple
void try_put_and_add_task(task *&last_task)
bool try_consume() __TBB_override
Consumes a reserved item.
A lock that occupies a single byte.
virtual bool remove_successor(successor_type &r)=0
Removes a successor from this node.
internal::tagged_msg< size_t, T0, T1, T2, T3, T4, T5, T6, T7 > output_type
untyped_receiver successor_type
The successor type for this node.
tbb::flow::tuple< sender< OutputTypes > &... > output_ports_type
buffer_operation(op_type t)
tuple< T0, T1, T2, T3 > InputTuple
internal::broadcast_cache< T > my_successors
static void fgt_graph_desc(void *, const char *)
bool enqueue_forwarding_task(buffer_operation &op_data)
void reset(tbb::flow::interface11::reset_flags f=tbb::flow::interface11::rf_reset_protocol)
internal::unfolded_indexer_node< InputTuple > unfolded_type
task * try_put_task(const input_type &v) __TBB_override
Put item to successor; return task to run the successor if possible.
Base class for types that should not be assigned.
input_impl_type::predecessor_type predecessor_type
bool internal_push(prio_operation *op) __TBB_override
predecessor_cache< input_type, null_mutex > my_predecessors
An cache of predecessors that supports requests and reservations.
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3, __TBB_B4 b4)
task & pop_front()
Pop the front task from the list.
__TBB_NOINLINE_SYM sequencer_node(graph &g, const Sequencer &s)
Constructor.
internal::source_body< output_type > * my_init_body
Forwards messages of type T to all successors.
__TBB_NOINLINE_SYM join_node(const join_node &other)
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
GraphNodeType & reference
void internal_pop(queue_operation *op) __TBB_override
Breaks an infinite loop between the node reservation and register_successor call.
internal::function_input< input_type, output_type, Policy, internals_allocator > input_impl_type
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2)
static const void * to_void_ptr(const T &t)
tuple< T0, T1, T2, T3, T4, T5, T6, T7, T8 > InputTuple
Output output_type
The type of the output message, which is complete.
const_iterator cbegin() const
start const iterator
A cache of successors that are broadcast to.
receiver_type::predecessor_type predecessor_type
virtual bool internal_push(buffer_operation *op)
tbb::flow::tuple< receiver< InputTypes > &... > input_ports_type
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
void try_put_and_add_task(task *&last_task)
implements a function node that supports Input -> (set of outputs)
#define __TBB_CPP11_PRESENT
virtual void internal_forward_task(buffer_operation *op)
Tries to forward valid items to successors.
internal::function_input_queue< input_type, internals_allocator > input_queue_type
void remove_successor(successor_type &r)
__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.")
virtual bool try_get_wrapper(void *p, bool is_async)=0
__TBB_DEPRECATED continue_receiver(const continue_receiver &src)
Copy constructor.
void deactivate_graph(tbb::flow::interface10::graph &g)
void reset_receiver(reset_flags f) __TBB_override
put receiver back in initial state
void prio_push(const T &src)
__TBB_NOINLINE_SYM indexer_node(graph &g)
static void fgt_node(void *, string_index, void *, void *)
virtual void internal_reg_succ(buffer_operation *op)
Register successor.
internal::decrementer< limiter_node< T, DecrementType >, DecrementType > decrement
The internal receiver< DecrementType > that decrements the count.
unsigned int node_priority_t
void register_successor(successor_type &r)
void reset_node(reset_flags f) __TBB_override
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
void internal_reserve(queue_operation *op) __TBB_override
iterator end()
end iterator
void reset(reset_flags f)
class __TBB_DEPRECATED_MSG("tbb::tbb_hash is deprecated, use std::hash") tbb_hash
internal::unfolded_join_node< N, reserving_port, OutputTuple, reserving > unfolded_type
graph_iterator()
Default constructor.
#define __TBB_DEFAULT_NODE_ALLOCATOR(T)
Forwards messages in priority order.
void add_nodes(const NodeTypes &... n)
__TBB_NOINLINE_SYM join_node(const join_node &other)
void reset_receiver(reset_flags) __TBB_override
put receiver back in initial state
broadcast_cache_type my_successors
tbb::flow::tuple_element< N, typename MOP::output_ports_type >::type & output_port(MOP &op)
leaf for multifunction. OutputSet can be a std::tuple or a vector.
const item_type & front() const
sender< output_type >::successor_type successor_type
__TBB_NOINLINE_SYM source_node(const source_node &src)
Copy constructor.
bool register_predecessor(predecessor_type &src) __TBB_override
Adds src to the list of cached predecessors.
virtual task * execute()=0
Does whatever should happen when the threshold is reached.
internal::tagged_msg< size_t, T0 > output_type
void spawn_put()
Spawns a task that applies the body.
bool register_successor(successor_type &r) __TBB_override
Replace the current successor with this new successor.
__TBB_NOINLINE_SYM queue_node(const queue_node &src)
Copy constructor.
bool remove_successor(successor_type &r) __TBB_override
Removes a successor.
void reset_receiver(reset_flags f) __TBB_override
put receiver back in initial state
static internal::allocate_root_proxy allocate_root()
Returns proxy for overloaded new that allocates a root task.
void __TBB_store_with_release(volatile T &location, V value)
static void fgt_multiinput_multioutput_node(void *, string_index, void *, void *)
graph & graph_reference() const __TBB_override
sender< output_type >::successor_type successor_type
bool is_graph_active(tbb::flow::interface10::graph &g)
bool register_successor(successor_type &r) __TBB_override
Add a new successor to this node.
void reset_node(reset_flags) __TBB_override
virtual bool remove_predecessor(predecessor_type &)
Remove a predecessor from the node.
internal::tagged_msg< size_t, T0, T1, T2 > output_type
__TBB_NOINLINE_SYM write_once_node(graph &g)
Constructor.
limiter_node(const limiter_node &src)
Copy constructor.
__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 remove_successor(successor_type &r) __TBB_override
Removes a successor from this node.
unfolded_type::input_ports_type input_ports_type
#define __TBB_STATIC_ASSERT(condition, msg)
unfolded_type::input_ports_type input_ports_type
sender< output_type >::successor_type successor_type
void internal_pop(prio_operation *op) __TBB_override
void internal_consume(prio_operation *op) __TBB_override
void add_task_to_graph_reset_list(tbb::flow::interface10::graph &g, tbb::task *tp)
virtual void internal_reserve(buffer_operation *op)
void internal_forward_task_impl(buffer_operation *op, derived_type *derived)
__TBB_DEPRECATED typedef T input_type
The input type of this receiver.
graph & graph_reference() const __TBB_override
__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)
void grow_my_array(size_t minimum_size)
Grows the internal array.
tbb::flow::tuple< receiver< InputTypes > &... > input_ports_type
tbb::internal::uint64_t tag_value
buffer_node< T, Allocator > base_type
void activate()
Activates a node that was created in the inactive state.
__TBB_NOINLINE_SYM continue_node(graph &g,)
Constructor for executable node with continue_msg -> Output.
void swap_items(size_t i, size_t j)
void reset_receiver(reset_flags) __TBB_override
put receiver back in initial state
Forwards messages only if the threshold has not been reached.
internal::unfolded_indexer_node< InputTuple > unfolded_type
void fetch_item(size_t i, item_type &o)
static void fgt_release_wait(void *)
sender< output_type >::successor_type successor_type
base_type::output_ports_type output_ports_type
__TBB_NOINLINE_SYM overwrite_node(graph &g)
An executable node that acts as a source, i.e. it has no predecessors.
friend class proxy_dependency_receiver
A task that calls a node's forward_task function.
void release_wait() __TBB_override
Inform a graph that a previous call to reserve_wait is no longer in effect.
std::unique_ptr< input_ports_type > my_input_ports
void add_visible_nodes(const NodeTypes &... n)
field of type K being used for matching.
An empty class used for messages that mean "I'm done".
bool try_release() __TBB_override
Releases the reserved item.
unfolded_join_node : passes input_ports_type to join_node_base. We build the input port type
virtual void internal_consume(buffer_operation *op)
void internal_consume(queue_operation *op) __TBB_override
internal::tagged_msg< size_t, T0, T1 > output_type
indexer_node(const indexer_node &other)
Implements methods for an executable node that takes continue_msg as input.
internal::aggregating_functor< class_type, buffer_operation > handler_type
bool remove_successor(successor_type &r) __TBB_override
Removes a successor from this node.
void set_external_ports(T &&output_ports_tuple)
#define __TBB_FLOW_GRAPH_PRIORITY_ARG1(arg1, priority)
static void fgt_async_try_put_begin(void *, void *)
bool try_put(const Output &i) __TBB_override
Implements gateway_type::try_put for an external activity to submit a message to FG.
cache_aligned_allocator< T > internals_allocator
void internal_reserve(prio_operation *op) __TBB_override
multifunction_node< Input, tuple< Output >, Policy, Allocator > base_type
bool internal_push(sequencer_operation *op) __TBB_override
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
virtual ~untyped_receiver()
Destructor.
internal::tagged_msg< size_t, T0, T1, T2, T3, T4, T5, T6, T7, T8 > output_type
concurrency
An enumeration the provides the two most common concurrency levels: unlimited and serial.
void reset_receiver(reset_flags) __TBB_override
put receiver back in initial state
internal::unfolded_indexer_node< InputTuple > unfolded_type
internal::function_output< output_type > fOutput_type
const item_type & get_my_item(size_t i) const
task * try_put_task(const X &t)
sender< output_type >::successor_type successor_type
input_ports_type & input_ports()
internal::input_body< output_type > * my_init_body
successors_type my_successors
static void fgt_end_body(void *)
__TBB_NOINLINE_SYM input_node(graph &g, Body body)
Constructor for a node with a successor.
sender< output_type >::successor_type successor_type
The type of successors of this node.
virtual bool try_get_wrapper(void *p, bool is_async) __TBB_override
internal::unfolded_join_node< N, key_matching_port, OutputTuple, key_matching< K, KHash > > unfolded_type
static void * to_void_ptr(T &t)
void reset_node(reset_flags f) __TBB_override
tbb::flow::tuple< sender< OutputTypes > &... > output_ports_type
internal::broadcast_cache< output_type > my_successors
static const T & from_void_ptr(const void *p)
Body copy_body(Node &n)
Returns a copy of the body from a function or continue node.
void release_wait() __TBB_override
Deregisters an external entity that may have interacted with the graph.
void set_owner(owner_type *owner)
void const char const char int ITT_FORMAT __itt_group_sync p
internal::multifunction_output< Output > output_port_type
A cache of predecessors that only supports try_get.
register_predecessor_task(predecessor_type &owner, successor_type &succ)
receiver< input_type > receiver_type
internal::round_robin_cache< T, null_rw_mutex > my_successors
__TBB_DEPRECATED continue_receiver(__TBB_FLOW_GRAPH_PRIORITY_ARG1(int number_of_predecessors, node_priority_t priority))
Constructor.
task that does nothing. Useful for synchronization.
Implements an executable node that supports continue_msg -> Output.
static task * try_put_task_wrapper_impl(receiver< T > *const this_recv, const void *p, bool is_async)
sender< output_type >::successor_type successor_type
void move_item(size_t to, size_t from)
static void fgt_async_commit(void *, void *)
task * try_put_task(const X &t)
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
An abstract cache of successors.
__TBB_NOINLINE_SYM indexer_node(graph &g)
internal::unfolded_indexer_node< InputTuple > unfolded_type
virtual bool try_reserve_wrapper(void *p, bool is_async) __TBB_override
output_type my_cached_item
Implements a function node that supports Input -> Output.
input_ports_type & input_ports()
tuple< T0, T1, T2, T3, T4, T5, T6, T7 > 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)
void try_put_and_add_task(task *&last_task)
internal::broadcast_cache< output_type > my_successors
virtual graph & graph_reference() const =0
static const bool is_async_type
bool try_get(input_type &v) __TBB_override
Request an item from the sender.
Pure virtual template class that defines a receiver of messages of type T.
receiver< input_type >::predecessor_type predecessor_type
buffer_node< T, Allocator >::size_type size_type
__TBB_NOINLINE_SYM indexer_node(graph &g)
static const T & from_void_ptr(const void *p)
static const node_priority_t no_priority
void reset_receiver(reset_flags) __TBB_override
put receiver back in initial state
internal::tagged_msg< size_t, T0, T1, T2, T3, T4, T5 > output_type
static tbb::task *const SUCCESSFULLY_ENQUEUED
try_put_functor(output_port_type &p, const Output &v)
buffer_node< T, Allocator >::size_type size_type
sender< output_type >::successor_type successor_type
buffer_node< T, Allocator >::buffer_operation sequencer_operation
std::unique_ptr< output_ports_type > my_output_ports
bool try_consume() __TBB_override
Consumes a reserved item.
static void fgt_reserve_wait(void *)
class __TBB_DEPRECATED streaming_node
bool try_consume() __TBB_override
Consumes the reserved item.
__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.")
void reset_node(reset_flags f) __TBB_override
resets the input_node to its initial state
Represents acquisition of a mutex.
virtual ~untyped_sender()
async_body(const Body &body, gateway_type *gateway)
void spawn_put()
Spawns a task that applies the body.
internal::async_body_base< gateway_type > async_body_base_type
void add_visible_nodes(const NodeTypes &... n)
item_buffer with reservable front-end. NOTE: if reserving, do not
internal::tagged_msg< size_t, T0, T1, T2, T3, T4, T5, T6 > output_type
tuple< T0, T1, T2, T3, T4, T5 > InputTuple
void reset_node(reset_flags) __TBB_override
~input_node()
The destructor.
Forwards messages in sequence order.
void fgt_multiinput_multioutput_node_desc(const NodeType *, const char *)
#define __TBB_FLOW_GRAPH_PRIORITY_EXPR(expr)
internal::source_body< output_type > * my_body
graph()
Constructs a graph with isolated task_group_context.
internal::wrap_tuple_elements< N, internal::multifunction_output, Output >::type output_ports_type
bool try_release() __TBB_override
Release a reserved item.
internal::function_body< T, size_t > * my_sequencer
virtual void internal_pop(buffer_operation *op)
bool register_successor(successor_type &r) __TBB_override
Adds a new successor.
__TBB_DEPRECATED typedef continue_msg input_type
The input type.
void handle_operations(prio_operation *op_list) __TBB_override
function_body that takes an Input and a set of output ports
const item_type & back() const
virtual void handle_operations(buffer_operation *op_list)
void reset_receiver(reset_flags) __TBB_override
put receiver back in initial state
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
Forwards messages in arbitrary order.
std::unique_ptr< output_ports_type > my_output_ports
internal::aggregator< handler_type, buffer_operation > my_aggregator
tuple< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 > InputTuple
bool try_release() __TBB_override
Release a reserved item.
T::async_msg_data_type filtered_type
__TBB_NOINLINE_SYM split_node(const split_node &other)
virtual bool try_get(T &)
Request an item from the sender.
void set_ref_count(int count)
Set reference count.
A cache of successors that are put in a round-robin fashion.
Enables one or the other code branches.
internal::unfolded_indexer_node< InputTuple > unfolded_type
void internal_forward_task(queue_operation *op) __TBB_override
Tries to forward valid items to successors.
split_node: accepts a tuple as input, forwards each element of the tuple to its
void const char const char int ITT_FORMAT __itt_group_sync x void const char * name
void set_gateway(gateway_type *gateway)
__TBB_NOINLINE_SYM priority_queue_node(graph &g, const Compare &comp=Compare())
Constructor.
void internal_make_edge(internal::untyped_sender &p, internal::untyped_receiver &s)
__TBB_NOINLINE_SYM input_node(const input_node &src)
Copy constructor.
task * try_put_task(const T &v) __TBB_override
Put item to successor; return task to run the successor if possible.
bool remove_successor(successor_type &r) __TBB_override
Removes a successor from this node.
bool register_successor(successor_type &r) __TBB_override
Adds a successor.
receiver< input_type >::predecessor_type predecessor_type
internal::unfolded_indexer_node< InputTuple > unfolded_type
The base of all graph nodes.
internal::broadcast_cache< input_type > my_successors
base_type::buffer_operation queue_operation
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1)
Detects whether two given types are the same.
void make_edge(sender< T > &p, receiver< T > &s)
Makes an edge between a single predecessor and a single successor.
internal::function_input_queue< input_type, internals_allocator > input_queue_type
graph & graph_reference() const
Implements methods for a function node that takes a type Input as input and sends.
A task that calls a node's apply_body_bypass function with no input.
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
sender< output_type >::successor_type successor_type
The type of successors of this node.
__TBB_DEPRECATED typedef internal::async_helpers< T >::filtered_type filtered_type
internal::wrap_tuple_elements< N, internal::multifunction_output, TupleType >::type output_ports_type
void add_nodes(const NodeTypes &... n)
bool try_consume() __TBB_override
Consumes a reserved item.
bool push_back(item_type &v)
gateway_type * my_gateway
internal::multifunction_input< Input, typename base_type::output_ports_type, Policy, Allocator > mfn_input_type
static void fgt_multioutput_node_desc(const NodeType *, const char *)
bool register_successor(successor_type &r) __TBB_override
Add a new successor to this node.
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3)
Meets "allocator" requirements of ISO C++ Standard, Section 20.1.5.
void const char const char int ITT_FORMAT __itt_group_sync s
bool try_reserve_apply_body(output_type &v)
Class for determining type of std::allocator<T>::value_type.
void reset_node(reset_flags f) __TBB_override
resets the source_node to its initial state
async_storage_ptr my_storage
bool my_item_valid(size_type i) const
Base class for receivers of completion messages.
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
output_ports_type & output_ports()
bool try_put(const X &t)
Put an item to the receiver.
graph & graph_reference() const __TBB_override
static void fgt_async_try_put_end(void *, void *)
static void alias_port(void *, PortsTuple &)
internal::tagged_msg< size_t, T0, T1, T2, T3 > output_type
iterator begin()
start iterator
internal::broadcast_cache< input_type, null_rw_mutex > my_successors
internal::unfolded_indexer_node< InputTuple > 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)
internal::unfolded_indexer_node< InputTuple > unfolded_type
__TBB_DEPRECATED tbb::task * root_task()
Returns the root task of the graph.
bool remove_successor(successor_type &r) __TBB_override
Removes a successor from this node.
interface11::internal::Policy< queueing, lightweight > queueing_lightweight
__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)
bool try_put(const typename internal::async_helpers< T >::filtered_type &t)
Put an item to the receiver.
~source_node()
The destructor.
Forwards messages in FIFO order.
bool try_get(X &t)
Request an item from the sender.
task * try_put_task(const TupleType &t) __TBB_override
Put item to successor; return task to run the successor if possible.
task * try_put_task_impl(const input_type &v)
virtual void reset_node(reset_flags f=rf_reset_protocol)=0
static void fgt_node_desc(const NodeType *, const char *)
receiver_gateway< output_type > gateway_type
async_body_base< Gateway > base_type
internal::function_output< output_type > fOutput_type
__TBB_NOINLINE_SYM indexer_node(graph &g)
untyped_sender predecessor_type
The predecessor type for this node.
fOutput_type::successor_type successor_type
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
virtual bool try_reserve_wrapper(void *p, bool is_async)=0
const_iterator cend() const
end const iterator
buffer_node< T, Allocator > class_type
cache_aligned_allocator< Input > internals_allocator
internal::multifunction_input< input_type, output_ports_type, Policy, internals_allocator > input_impl_type
void add_nodes(const NodeTypes &... n)
__TBB_NOINLINE_SYM join_node(graph &g)
static void fgt_node_with_body(void *, string_index, void *, void *, void *)
__TBB_NOINLINE_SYM buffer_node(graph &g)
Constructor.
virtual void reset_receiver(reset_flags f=rf_reset_protocol)=0
put receiver back in initial state
__TBB_NOINLINE_SYM overwrite_node(const overwrite_node &src)
Copy constructor; doesn't take anything from src; default won't work.
virtual task * try_put_task(const T &t)=0
Put item to successor; return task to run the successor if possible.
__TBB_NOINLINE_SYM indexer_node(graph &g)
buffer_node< T, Allocator >::item_type item_type
static void fgt_begin_body(void *)
bool pop_front(item_type &v)
void internal_forward_task(prio_operation *op) __TBB_override
Tries to forward valid items to successors.
void remove_edge(sender< T > &p, receiver< T > &s)
Removes an edge between a single predecessor and a single successor.
sender< output_type >::successor_type successor_type
Base class for tasks generated by graph nodes.
#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 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
task * try_put_task(const input_type &t) __TBB_override
task * try_put_task(const T &t) __TBB_override
build a task to run the successor if possible. Default is old behavior.
bool place_item(size_t here, const item_type &me)
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
static void clear_this(P &p)
internal::unfolded_join_node< N, queueing_port, OutputTuple, queueing > unfolded_type
virtual bool try_consume()
Consumes the reserved item.
void remove_node(tbb::flow::interface11::graph_node *n)
cache_aligned_allocator< Input > internals_allocator
virtual void internal_release(buffer_operation *op)
void activate()
Activates a node that was created in the inactive state.
internal::broadcast_cache< output_type > & successors() __TBB_override
Body copy_function_object()
__TBB_DEPRECATED typedef internal::async_helpers< T >::filtered_type filtered_type
internal::unfolded_indexer_node< InputTuple > unfolded_type
input_type & input_ports()
static tbb::task * combine_tasks(graph &g, tbb::task *left, tbb::task *right)
bool try_put_impl(const Output &i)
Implements gateway_type::try_put for an external activity to submit a message to FG.
void reset_node(reset_flags f) __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.")
receiver< input_type >::predecessor_type predecessor_type
bool try_reserve(output_type &v) __TBB_override
Reserves an item.
internal::input_body< output_type > * my_body
size_type size(size_t new_tail=0)
internal::tagged_msg< size_t, T0, T1, T2, T3, T4 > output_type
bool try_get(T &v) __TBB_override
Request an item from the buffer_node.
bool empty() const
True if list is empty; false otherwise.
input_filter control to signal end-of-input for parallel_pipeline
receiver< input_type >::predecessor_type predecessor_type
__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.
virtual input_body * clone()=0
virtual void finalize() const
~graph()
Destroys the graph.
__TBB_NOINLINE_SYM buffer_node(const buffer_node &src)
Copy constructor.
task * grab_forwarding_task(buffer_operation &op_data)
pointer operator->() const
Dereference.
class __TBB_DEPRECATED async_msg
void add_visible_nodes(const NodeTypes &... n)
output_ports_type & output_ports()
overwrite_node< T > base_type
bool try_reserve(X &t)
Reserves an item in the sender.
__TBB_NOINLINE_SYM join_node(graph &g)
void reset_node(reset_flags f) __TBB_override
__TBB_NOINLINE_SYM priority_queue_node(const priority_queue_node &src)
Copy constructor.
void activate_graph(tbb::flow::interface10::graph &g)
virtual bool try_reserve(T &)
Reserves an item in the sender.
__TBB_NOINLINE_SYM sequencer_node(const sequencer_node &src)
Copy constructor.
Implements methods for a function node that takes a type Input as input.
const V & cast_to(T const &t)
K key_from_message(const T &t)
graph & graph_reference() const __TBB_override
void set_external_ports(T &&input_ports_tuple)
static void alias_port(void *, PortsTuple &)
void register_node(tbb::flow::interface11::graph_node *n)
task * apply_body_bypass()
Applies the body. Returning SUCCESSFULLY_ENQUEUED okay; forward_task_bypass will handle it.
Output output_type
The type of the output message, which is complete.
wrap_tuple_elements< N, PT, OutputTuple >::type input_ports_type
input_impl_type::predecessor_type predecessor_type
void reset_node(reset_flags f) __TBB_override