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 struct NoInputBody {};
34 template <
typename Output>
35 struct declare_body_types<NoInputBody, Output> {
36 using output_type = Output;
39 template <
typename T>
struct body_types;
41 template <
typename T,
typename Input,
typename Output>
42 struct body_types<Output (T::*)(const Input&) const> : declare_body_types<Input, Output> {};
44 template <
typename T,
typename Input,
typename Output>
45 struct body_types<Output (T::*)(const Input&)> : declare_body_types<Input, Output> {};
47 template <
typename T,
typename Input,
typename Output>
48 struct body_types<Output (T::*)(Input&) const> : declare_body_types<Input, Output> {};
50 template <
typename T,
typename Input,
typename Output>
51 struct body_types<Output (T::*)(Input&)> : declare_body_types<Input, Output> {};
53 template <
typename Input,
typename Output>
54 struct body_types<Output (*)(Input&)> : declare_body_types<Input, Output> {};
56 template <
typename Input,
typename Output>
57 struct body_types<Output (*)(
const Input&)> : declare_body_types<Input, Output> {};
59 template <
typename T,
typename Output>
60 struct body_types<Output (T::*)(flow_control&) const> : declare_body_types<NoInputBody, Output> {};
62 template <
typename T,
typename Output>
63 struct body_types<Output (T::*)(flow_control&)> : declare_body_types<NoInputBody, Output> {};
65 template <
typename Output>
66 struct body_types<Output (*)(flow_control&)> : declare_body_types<NoInputBody, Output> {};
68 template <
typename Body>
69 using input_t =
typename body_types<Body>::input_type;
71 template <
typename Body>
72 using output_t =
typename body_types<Body>::output_type;
74 template <
typename T,
typename Input,
typename Output>
75 auto decide_on_operator_overload(Output (T::*
name)(
const Input&)
const)->decltype(
name);
77 template <
typename T,
typename Input,
typename Output>
78 auto decide_on_operator_overload(Output (T::*
name)(
const Input&))->decltype(
name);
80 template <
typename T,
typename Input,
typename Output>
81 auto decide_on_operator_overload(Output (T::*
name)(Input&)
const)->decltype(
name);
83 template <
typename T,
typename Input,
typename Output>
84 auto decide_on_operator_overload(Output (T::*
name)(Input&))->decltype(
name);
86 template <
typename Input,
typename Output>
87 auto decide_on_operator_overload(Output (*
name)(
const Input&))->decltype(
name);
89 template <
typename Input,
typename Output>
90 auto decide_on_operator_overload(Output (*
name)(Input&))->decltype(
name);
92 template <
typename Body>
93 decltype(decide_on_operator_overload(&Body::operator())) decide_on_callable_type(
int);
95 template <typename Body>
96 decltype(decide_on_operator_overload(std::declval<Body>())) decide_on_callable_type(...);
99 #if TBB_USE_SOURCE_NODE_AS_ALIAS 100 #if TBB_DEPRECATED_INPUT_NODE_BODY 101 template <
typename GraphOrSet,
typename Body>
102 source_node(GraphOrSet&&, Body)
103 ->source_node<input_t<decltype(decide_on_callable_type<Body>(0))>>;
105 template <
typename GraphOrSet,
typename Body>
106 source_node(GraphOrSet&&, Body)
107 ->source_node<output_t<decltype(decide_on_callable_type<Body>(0))>>;
108 #endif // TBB_DEPRECATED_INPUT_NODE_BODY 110 template <
typename GraphOrSet,
typename Body>
111 source_node(GraphOrSet&&, Body,
bool =
true)
112 ->source_node<input_t<decltype(decide_on_callable_type<Body>(0))>>;
115 #if TBB_DEPRECATED_INPUT_NODE_BODY 116 template <
typename GraphOrSet,
typename Body>
117 input_node(GraphOrSet&&, Body,
bool =
true)
118 ->input_node<input_t<decltype(decide_on_callable_type<Body>(0))>>;
120 template <
typename GraphOrSet,
typename Body>
121 input_node(GraphOrSet&&, Body)
122 ->input_node<output_t<decltype(decide_on_callable_type<Body>(0))>>;
125 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 127 template <
typename NodeSet>
128 struct decide_on_set;
130 template <
typename Node,
typename... Nodes>
131 struct decide_on_set<node_set<
internal::order::following, Node, Nodes...>> {
132 using type =
typename Node::output_type;
135 template <
typename Node,
typename... Nodes>
136 struct decide_on_set<node_set<
internal::order::preceding, Node, Nodes...>> {
137 using type =
typename Node::input_type;
140 template <
typename NodeSet>
141 using decide_on_set_t =
typename decide_on_set<std::decay_t<NodeSet>>
::type;
143 template <
typename NodeSet>
144 broadcast_node(
const NodeSet&)
145 ->broadcast_node<decide_on_set_t<NodeSet>>;
147 template <
typename NodeSet>
148 buffer_node(
const NodeSet&)
149 ->buffer_node<decide_on_set_t<NodeSet>>;
151 template <
typename NodeSet>
152 queue_node(
const NodeSet&)
153 ->queue_node<decide_on_set_t<NodeSet>>;
154 #endif // __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 156 template <
typename GraphOrProxy,
typename Sequencer>
157 sequencer_node(GraphOrProxy&&, Sequencer)
158 ->sequencer_node<input_t<decltype(decide_on_callable_type<Sequencer>(0))>>;
160 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 161 template <
typename NodeSet,
typename Compare>
162 priority_queue_node(
const NodeSet&,
const Compare&)
163 ->priority_queue_node<decide_on_set_t<NodeSet>, Compare>;
165 template <
typename NodeSet>
166 priority_queue_node(
const NodeSet&)
167 ->priority_queue_node<decide_on_set_t<NodeSet>, std::less<decide_on_set_t<NodeSet>>>;
168 #endif // __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 170 template <
typename Key>
175 template <
typename T>
176 struct join_key<const T&> {
180 template <
typename Key>
183 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 184 template <
typename Policy,
typename... Predecessors>
185 join_node(
const node_set<internal::order::following, Predecessors...>&, Policy)
186 ->join_node<std::tuple<
typename Predecessors::output_type...>,
189 template <
typename Policy,
typename Successor,
typename... Successors>
190 join_node(
const node_set<internal::order::preceding, Successor, Successors...>&, Policy)
191 ->join_node<
typename Successor::input_type, Policy>;
193 template <
typename... Predecessors>
194 join_node(
const node_set<internal::order::following, Predecessors...>)
195 ->join_node<std::tuple<
typename Predecessors::output_type...>,
198 template <
typename Successor,
typename... Successors>
199 join_node(
const node_set<internal::order::preceding, Successor, Successors...>)
200 ->join_node<
typename Successor::input_type, queueing>;
203 template <
typename GraphOrProxy,
typename Body,
typename... Bodies>
204 join_node(GraphOrProxy&&, Body, Bodies...)
205 ->join_node<std::tuple<input_t<decltype(decide_on_callable_type<Body>(0))>,
206 input_t<decltype(decide_on_callable_type<Bodies>(0))>...>,
207 key_matching<join_key_t<output_t<decltype(decide_on_callable_type<Body>(0))>>>>;
209 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 210 template <
typename... Predecessors>
211 indexer_node(
const node_set<internal::order::following, Predecessors...>&)
212 ->indexer_node<
typename Predecessors::output_type...>;
215 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 216 template <
typename NodeSet>
217 limiter_node(
const NodeSet&,
size_t)
218 ->limiter_node<decide_on_set_t<NodeSet>>;
220 template <
typename Predecessor,
typename... Predecessors>
221 split_node(
const node_set<internal::order::following, Predecessor, Predecessors...>&)
222 ->split_node<
typename Predecessor::output_type>;
224 template <
typename... Successors>
225 split_node(
const node_set<internal::order::preceding, Successors...>&)
226 ->split_node<std::tuple<
typename Successors::input_type...>>;
230 template <
typename GraphOrSet,
typename Body,
typename Policy>
231 function_node(GraphOrSet&&,
234 ->function_node<input_t<decltype(decide_on_callable_type<Body>(0))>,
235 output_t<decltype(decide_on_callable_type<Body>(0))>,
238 template <
typename GraphOrSet,
typename Body>
239 function_node(GraphOrSet&&,
size_t,
241 ->function_node<input_t<decltype(decide_on_callable_type<Body>(0))>,
242 output_t<decltype(decide_on_callable_type<Body>(0))>,
245 template <
typename Output>
246 struct continue_output {
251 struct continue_output<
void> {
252 using type = continue_msg;
255 template <
typename T>
258 template <
typename GraphOrSet,
typename Body,
typename Policy>
259 continue_node(GraphOrSet&&, Body,
261 ->continue_node<continue_output_t<std::invoke_result_t<Body, continue_msg>>,
264 template <
typename GraphOrSet,
typename Body,
typename Policy>
265 continue_node(GraphOrSet&&,
268 ->continue_node<continue_output_t<std::invoke_result_t<Body, continue_msg>>,
271 template <
typename GraphOrSet,
typename Body>
272 continue_node(GraphOrSet&&,
274 ->continue_node<continue_output_t<std::invoke_result_t<Body, continue_msg>>,
277 template <
typename GraphOrSet,
typename Body>
278 continue_node(GraphOrSet&&,
int,
280 ->continue_node<continue_output_t<std::invoke_result_t<Body, continue_msg>>,
283 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 285 template <
typename NodeSet>
286 overwrite_node(
const NodeSet&)
287 ->overwrite_node<decide_on_set_t<NodeSet>>;
289 template <
typename NodeSet>
290 write_once_node(
const NodeSet&)
291 ->write_once_node<decide_on_set_t<NodeSet>>;
292 #endif // __TBB_PREVIEW_FLOW_GRAPH_NODE_SET 297 #endif // __TBB_CPP17_DEDUCTION_GUIDES_PRESENT 298 #endif // __TBB_flow_graph_nodes_deduction_H
unsigned int node_priority_t
#define __TBB_FLOW_GRAPH_PRIORITY_ARG1(arg1, priority)
static const node_priority_t no_priority
void const char const char int ITT_FORMAT __itt_group_sync x void const char * name
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __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