Hedgehog  3.1.0
A library to generate hybrid pipeline workflow systems
Loading...
Searching...
No Matches
traits.h
Go to the documentation of this file.
1// NIST-developed software is provided by NIST as a public service. You may use, copy and distribute copies of the
2// software in any medium, provided that you keep intact this entire notice. You may improve, modify and create
3// derivative works of the software or any portion of the software, and you may copy and distribute such modifications
4// or works. Modified works should carry a notice stating that you changed the software and should note the date and
5// nature of any such change. Please explicitly acknowledge the National Institute of Standards and Technology as the
6// source of the software. NIST-developed software is expressly provided "AS IS." NIST MAKES NO WARRANTY OF ANY KIND,
7// EXPRESS, IMPLIED, IN FACT OR ARISING BY OPERATION OF LAW, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
8// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT AND DATA ACCURACY. NIST NEITHER REPRESENTS NOR
9// WARRANTS THAT THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT ANY DEFECTS WILL BE
10// CORRECTED. NIST DOES NOT WARRANT OR MAKE ANY REPRESENTATIONS REGARDING THE USE OF THE SOFTWARE OR THE RESULTS
11// THEREOF, INCLUDING BUT NOT LIMITED TO THE CORRECTNESS, ACCURACY, RELIABILITY, OR USEFULNESS OF THE SOFTWARE. You
12// are solely responsible for determining the appropriateness of using and distributing the software and you assume
13// all risks associated with its use, including but not limited to the risks and costs of program errors, compliance
14// with applicable laws, damage to or loss of data, programs or equipment, and the unavailability or interruption of
15// operation. This software is not intended to be used in any situation where a failure could cause risk of injury or
16// damage to property. The software developed by NIST employees is not subject to copyright protection within the
17// United States.
18
19
20
21#ifndef HEDGEHOG_TRAITS_H
22#define HEDGEHOG_TRAITS_H
23
24#pragma once
25
26#include <tuple>
27
28#include "../core/implementors/concrete_implementor/default_multi_senders.h"
29
31namespace hh {
33namespace core {
34
35#ifndef DOXYGEN_SHOULD_SKIP_THIS
37namespace abstraction {
40template<class ...Inputs>
41class TaskInputsManagementAbstraction;
44template<class ...Inputs>
45class GraphInputsManagementAbstraction;
48template<class ...Outputs>
49class GraphOutputsManagementAbstraction;
52template<class ...Outputs>
53class TaskOutputsManagementAbstraction;
56template<class ...Inputs>
57class ExecutionPipelineInputsManagementAbstraction;
60template<class ...Outputs>
61class ExecutionPipelineOutputsManagementAbstraction;
62}
63
65namespace implementor {
68template<class ...Inputs>
69class DefaultMultiExecutes;
70
73template<class ...Inputs>
74class MultiQueueReceivers;
75}
76}
77
79namespace behavior {
82template<class ...Inputs>
83class MultiExecute;
86template<class ...Inputs>
87class MultiReceivers;
90template<class ...Inputs>
91class MultiSwitchRules;
94template<class ...Outputs>
95class MultiSenders;
98template<class ...Outputs>
99class TaskMultiSenders;
102template<class ...Outputs>
103class StateMultiSenders;
104}
105
106#endif //DOXYGEN_SHOULD_SKIP_THIS
107
109namespace tool {
110
114template<class Inputs>
115struct TaskInputsManagementAbstractionTypeDeducer;
116
119template<class ...Inputs>
120struct TaskInputsManagementAbstractionTypeDeducer<std::tuple<Inputs...>> {
121 using type = core::abstraction::TaskInputsManagementAbstraction<Inputs...>;
122};
123
125template<class TupleInputs>
126using TaskInputsManagementAbstractionTypeDeducer_t =
127 typename TaskInputsManagementAbstractionTypeDeducer<TupleInputs>::type;
128
131template<class Outputs>
132struct TaskOutputsManagementAbstractionTypeDeducer;
133
136template<class ...Outputs>
137struct TaskOutputsManagementAbstractionTypeDeducer<std::tuple<Outputs...>> {
138 using type = core::abstraction::TaskOutputsManagementAbstraction<Outputs...>;
139};
140
142template<class TupleOutputs>
143using TaskOutputsManagementAbstractionTypeDeducer_t =
144 typename TaskOutputsManagementAbstractionTypeDeducer<TupleOutputs>::type;
145
148template<class Inputs>
149struct GraphInputsManagementAbstractionTypeDeducer;
150
153template<class ...Inputs>
154struct GraphInputsManagementAbstractionTypeDeducer<std::tuple<Inputs...>> {
155 using type = core::abstraction::GraphInputsManagementAbstraction<Inputs...>;
156};
157
159template<class TupleInputs>
160using GraphInputsManagementAbstractionTypeDeducer_t =
161 typename GraphInputsManagementAbstractionTypeDeducer<TupleInputs>::type;
162
165template<class Outputs>
166struct GraphOutputsManagementAbstractionTypeDeducer;
167
170template<class ...Outputs>
171struct GraphOutputsManagementAbstractionTypeDeducer<std::tuple<Outputs...>> {
172 using type = core::abstraction::GraphOutputsManagementAbstraction<Outputs...>;
173};
174
176template<class TupleOutputs>
177using GraphOutputsManagementAbstractionTypeDeducer_t =
178 typename GraphOutputsManagementAbstractionTypeDeducer<TupleOutputs>::type;
179
182template<class Inputs>
183struct ExecutionPipelineInputsManagementAbstractionTypeDeducer;
184
187template<class ...Inputs>
188struct ExecutionPipelineInputsManagementAbstractionTypeDeducer<std::tuple<Inputs...>> {
189 using type = core::abstraction::ExecutionPipelineInputsManagementAbstraction<Inputs...>;
190};
191
193template<class TupleInputs>
194using ExecutionPipelineInputsManagementAbstractionTypeDeducer_t =
195 typename ExecutionPipelineInputsManagementAbstractionTypeDeducer<TupleInputs>::type;
196
199template<class Outputs>
200struct ExecutionPipelineOutputsManagementAbstractionTypeDeducer;
201
204template<class ...Outputs>
205struct ExecutionPipelineOutputsManagementAbstractionTypeDeducer<std::tuple<Outputs...>> {
206 using type = core::abstraction::ExecutionPipelineOutputsManagementAbstraction<Outputs...>;
207};
208
210template<class TupleOutputs>
211using ExecutionPipelineOutputsManagementAbstractionTypeDeducer_t =
212 typename ExecutionPipelineOutputsManagementAbstractionTypeDeducer<TupleOutputs>::type;
213
215
218template<class Inputs>
219struct DefaultMultiExecutesTypeDeducer;
220
223template<class ...Inputs>
224struct DefaultMultiExecutesTypeDeducer<std::tuple<Inputs...>> {
225 using type = core::implementor::DefaultMultiExecutes<Inputs...>;
226};
227
230template<class TupleInputs>
231using DefaultMultiExecutesTypeDeducer_t = typename DefaultMultiExecutesTypeDeducer<TupleInputs>::type;
232
236template<size_t Separator, class ...AllTypes>
237using DME = DefaultMultiExecutesTypeDeducer_t<hh::tool::Inputs<Separator, AllTypes...>>;
238
241template<class Outputs>
242struct MultiDefaultSendersTypeDeducer;
243
246template<class ...Outputs>
247struct MultiDefaultSendersTypeDeducer<std::tuple<Outputs...>> {
249};
250
253template<class TupleOutputs>
254using MultiDefaultSendersTypeDeducer_t = typename MultiDefaultSendersTypeDeducer<TupleOutputs>::type;
255
259template<size_t Separator, class ...AllTypes>
260using MDS = MultiDefaultSendersTypeDeducer_t<hh::tool::Outputs<Separator, AllTypes...>>;
261
264template<class Inputs>
265struct MultiQueueReceiversTypeDeducer;
266
269template<class ...Inputs>
270struct MultiQueueReceiversTypeDeducer<std::tuple<Inputs...>> {
271 using type = core::implementor::MultiQueueReceivers<Inputs...>;
272};
273
276template<class TupleInputs>
277using MultiQueueReceiversTypeDeducer_t = typename MultiQueueReceiversTypeDeducer<TupleInputs>::type;
278
282template<size_t Separator, class ...AllTypes>
283using MQR = MultiQueueReceiversTypeDeducer_t<hh::tool::Inputs<Separator, AllTypes...>>;
284
288template<class Inputs>
289struct BehaviorMultiExecuteTypeDeducer;
290
293template<class ...Inputs>
294struct BehaviorMultiExecuteTypeDeducer<std::tuple<Inputs...>> { using type = behavior::MultiExecute<Inputs...>; };
295
297template<class TupleInputs>
298using BehaviorMultiExecuteTypeDeducer_t = typename BehaviorMultiExecuteTypeDeducer<TupleInputs>::type;
299
302template<class Inputs>
303struct BehaviorMultiReceiversTypeDeducer;
304
307template<class ...Inputs>
308struct BehaviorMultiReceiversTypeDeducer<std::tuple<Inputs...>> { using type = behavior::MultiReceivers<Inputs...>; };
309
311template<class TupleInputs>
312using BehaviorMultiReceiversTypeDeducer_t = typename BehaviorMultiReceiversTypeDeducer<TupleInputs>::type;
313
316template<class Inputs>
317struct BehaviorMultiSwitchRulesTypeDeducer;
318
321template<class ...Inputs>
322struct BehaviorMultiSwitchRulesTypeDeducer<std::tuple<Inputs...>> { using type = behavior::MultiSwitchRules<Inputs...>; };
323
325template<class TupleInputs>
326using BehaviorMultiSwitchRulesTypeDeducer_t = typename BehaviorMultiSwitchRulesTypeDeducer<TupleInputs>::type;
327
330template<class Outputs>
331struct BehaviorMultiSenderTypeDeducer;
332
335template<class ...Outputs>
336struct BehaviorMultiSenderTypeDeducer<std::tuple<Outputs...>> { using type = behavior::MultiSenders<Outputs...>; };
337
339template<class TupleOutputs>
340using BehaviorMultiSendersTypeDeducer_t = typename BehaviorMultiSenderTypeDeducer<TupleOutputs>::type;
341
344template<class Outputs>
345struct BehaviorTaskMultiSenderTypeDeducer;
346
349template<class ...Outputs>
350struct BehaviorTaskMultiSenderTypeDeducer<std::tuple<Outputs...>> { using type = behavior::TaskMultiSenders<Outputs...>; };
351
353template<class TupleOutputs>
354using BehaviorTaskMultiSendersTypeDeducer_t = typename BehaviorTaskMultiSenderTypeDeducer<TupleOutputs>::type;
355
358template<class Outputs>
359struct BehaviorStateMultiSenderTypeDeducer;
360
363template<class ...Outputs>
364struct BehaviorStateMultiSenderTypeDeducer<std::tuple<Outputs...>> { using type = behavior::StateMultiSenders<Outputs...>; };
365
367template<class TupleOutputs>
368using BehaviorStateMultiSendersTypeDeducer_t = typename BehaviorStateMultiSenderTypeDeducer<TupleOutputs>::type;
369}
370}
371#endif //HEDGEHOG_TRAITS_H
Hedgehog main namespace.
typename internals::Splitter< delta, Types... >::Inputs Inputs
Helper getting the input types from a list of template types (variadic)
typename internals::Splitter< delta, Types... >::Outputs Outputs
Helper getting the output types from a list of template types (variadic)
Default implementors for the sender abstraction, used by tasks or state managers.