17 #ifndef __TBB_flow_graph_nodes_deduction_H 18 #define __TBB_flow_graph_nodes_deduction_H 20 #if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT 24 namespace interface11 {
26 template <
typename Input,
typename Output>
27 struct declare_body_types {
28 using input_type = Input;
29 using output_type = Output;
32 template <
typename T>
struct body_types;
34 template <
typename T,
typename Input,
typename Output>
35 struct body_types<Output (T::*)(const Input&) const> : declare_body_types<Input, Output> {};
37 template <
typename T,
typename Input,
typename Output>
38 struct body_types<Output (T::*)(const Input&)> : declare_body_types<Input, Output> {};
40 template <
typename T,
typename Input,
typename Output>
41 struct body_types<Output (T::*)(Input&) const> : declare_body_types<Input, Output> {};
43 template <
typename T,
typename Input,
typename Output>
44 struct body_types<Output (T::*)(Input&)> : declare_body_types<Input, Output> {};
46 template <
typename Input,
typename Output>
47 struct body_types<Output (*)(Input&)> : declare_body_types<Input, Output> {};
49 template <
typename Input,
typename Output>
50 struct body_types<Output (*)(
const Input&)> : declare_body_types<Input, Output> {};
52 template <
typename Body>
53 using input_t =
typename body_types<Body>::input_type;
55 template <
typename Body>
56 using output_t =
typename body_types<Body>::output_type;
58 template <
typename T,
typename Input,
typename Output>
59 auto decide_on_operator_overload(Output (T::*
name)(
const Input&)
const)->decltype(name);
61 template <
typename T,
typename Input,
typename Output>
62 auto decide_on_operator_overload(Output (T::*name)(
const Input&))->decltype(name);
64 template <
typename T,
typename Input,
typename Output>
65 auto decide_on_operator_overload(Output (T::*name)(Input&)
const)->decltype(name);
67 template <
typename T,
typename Input,
typename Output>
68 auto decide_on_operator_overload(Output (T::*name)(Input&))->decltype(name);
70 template <
typename Input,
typename Output>
71 auto decide_on_operator_overload(Output (*name)(
const Input&))->decltype(name);
73 template <
typename Input,
typename Output>
74 auto decide_on_operator_overload(Output (*name)(Input&))->decltype(name);
76 template <
typename Body>
77 decltype(decide_on_operator_overload(&Body::operator())) decide_on_callable_type(
int);
79 template <typename Body>
80 decltype(decide_on_operator_overload(
std::declval<Body>())) decide_on_callable_type(...);
83 template <typename GraphOrSet, typename Body>
84 source_node(GraphOrSet&&, Body,
bool = true)
85 ->source_node<input_t<decltype(decide_on_callable_type<Body>(0))>>;
87 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 89 template <
typename NodeSet>
92 template <
typename Node,
typename... Nodes>
93 struct decide_on_set<node_set<
internal::order::following, Node, Nodes...>> {
94 using type =
typename Node::output_type;
97 template <
typename Node,
typename... Nodes>
98 struct decide_on_set<node_set<
internal::order::preceding, Node, Nodes...>> {
99 using type =
typename Node::input_type;
102 template <
typename NodeSet>
103 using decide_on_set_t =
typename decide_on_set<std::decay_t<NodeSet>>
::type;
105 template <
typename NodeSet>
106 broadcast_node(
const NodeSet&)
107 ->broadcast_node<decide_on_set_t<NodeSet>>;
109 template <
typename NodeSet>
110 buffer_node(
const NodeSet&)
111 ->buffer_node<decide_on_set_t<NodeSet>>;
113 template <
typename NodeSet>
114 queue_node(
const NodeSet&)
115 ->queue_node<decide_on_set_t<NodeSet>>;
116 #endif // __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 118 template <
typename GraphOrProxy,
typename Sequencer>
119 sequencer_node(GraphOrProxy&&, Sequencer)
120 ->sequencer_node<input_t<decltype(decide_on_callable_type<Sequencer>(0))>>;
122 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 123 template <
typename NodeSet,
typename Compare>
124 priority_queue_node(
const NodeSet&,
const Compare&)
125 ->priority_queue_node<decide_on_set_t<NodeSet>, Compare>;
127 template <
typename NodeSet>
128 priority_queue_node(
const NodeSet&)
129 ->priority_queue_node<decide_on_set_t<NodeSet>, std::less<decide_on_set_t<NodeSet>>>;
130 #endif // __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 132 template <
typename Key>
137 template <
typename T>
138 struct join_key<const T&> {
142 template <
typename Key>
145 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 146 template <
typename Policy,
typename... Predecessors>
147 join_node(
const node_set<internal::order::following, Predecessors...>&, Policy)
148 ->join_node<std::tuple<
typename Predecessors::output_type...>,
151 template <
typename Policy,
typename Successor,
typename... Successors>
152 join_node(
const node_set<internal::order::preceding, Successor, Successors...>&, Policy)
153 ->join_node<
typename Successor::input_type, Policy>;
155 template <
typename... Predecessors>
156 join_node(
const node_set<internal::order::following, Predecessors...>)
157 ->join_node<std::tuple<
typename Predecessors::output_type...>,
160 template <
typename Successor,
typename... Successors>
161 join_node(
const node_set<internal::order::preceding, Successor, Successors...>)
162 ->join_node<
typename Successor::input_type, queueing>;
165 template <
typename GraphOrProxy,
typename Body,
typename... Bodies>
166 join_node(GraphOrProxy&&, Body, Bodies...)
167 ->join_node<std::tuple<input_t<decltype(decide_on_callable_type<Body>(0))>,
168 input_t<decltype(decide_on_callable_type<Bodies>(0))>...>,
169 key_matching<join_key_t<output_t<decltype(decide_on_callable_type<Body>(0))>>>>;
171 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 172 template <
typename... Predecessors>
173 indexer_node(
const node_set<internal::order::following, Predecessors...>&)
174 ->indexer_node<
typename Predecessors::output_type...>;
177 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 178 template <
typename NodeSet>
179 limiter_node(
const NodeSet&,
size_t)
180 ->limiter_node<decide_on_set_t<NodeSet>>;
182 template <
typename Predecessor,
typename... Predecessors>
183 split_node(
const node_set<internal::order::following, Predecessor, Predecessors...>&)
184 ->split_node<
typename Predecessor::output_type>;
186 template <
typename... Successors>
187 split_node(
const node_set<internal::order::preceding, Successors...>&)
188 ->split_node<std::tuple<
typename Successors::input_type...>>;
192 template <
typename GraphOrSet,
typename Body,
typename Policy>
193 function_node(GraphOrSet&&,
196 ->function_node<input_t<decltype(decide_on_callable_type<Body>(0))>,
197 output_t<decltype(decide_on_callable_type<Body>(0))>,
200 template <
typename GraphOrSet,
typename Body>
201 function_node(GraphOrSet&&,
size_t,
203 ->function_node<input_t<decltype(decide_on_callable_type<Body>(0))>,
204 output_t<decltype(decide_on_callable_type<Body>(0))>,
207 template <
typename Output>
208 struct continue_output {
213 struct continue_output<
void> {
214 using type = continue_msg;
217 template <
typename T>
220 template <
typename GraphOrSet,
typename Body,
typename Policy>
221 continue_node(GraphOrSet&&, Body,
223 ->continue_node<continue_output_t<std::invoke_result_t<Body, continue_msg>>,
226 template <
typename GraphOrSet,
typename Body,
typename Policy>
227 continue_node(GraphOrSet&&,
230 ->continue_node<continue_output_t<std::invoke_result_t<Body, continue_msg>>,
233 template <
typename GraphOrSet,
typename Body>
234 continue_node(GraphOrSet&&,
236 ->continue_node<continue_output_t<std::invoke_result_t<Body, continue_msg>>,
239 template <
typename GraphOrSet,
typename Body>
240 continue_node(GraphOrSet&&,
int,
242 ->continue_node<continue_output_t<std::invoke_result_t<Body, continue_msg>>,
243 internal::Policy<void>>;
245 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 247 template <
typename NodeSet>
248 overwrite_node(
const NodeSet&)
249 ->overwrite_node<decide_on_set_t<NodeSet>>;
251 template <
typename NodeSet>
252 write_once_node(
const NodeSet&)
253 ->write_once_node<decide_on_set_t<NodeSet>>;
254 #endif // __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 259 #endif // __TBB_CPP17_DEDUCTION_GUIDES_PRESENT 260 #endif // __TBB_flow_graph_nodes_deduction_H static const node_priority_t no_priority
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_id __itt_string_handle __itt_metadata_type type
void const char const char int ITT_FORMAT __itt_group_sync x void const char * name
#define __TBB_FLOW_GRAPH_PRIORITY_ARG1(arg1, priority)
unsigned int node_priority_t