6 #include "includes/kratos_parameters.h"
7 #include "includes/define.h"
10 #include <type_traits>
70 template <
class TInput,
class TOutput>
89 template <
class TPipe>
90 using IsPipe = std::integral_constant<bool,
92 std::is_same_v<decltype(std::declval<const TPipe>().operator()(std::declval<typename TPipe::InputType>())),
typename TPipe::OutputType>
95 && !std::is_same_v<typename TPipe::InputType,void>
98 && !std::is_same_v<typename TPipe::OutputType,void>
103 template <class TInput, class TPipe, std::enable_if_t<IsPipe<TPipe>::value && std::is_convertible_v<TInput,typename TPipe::InputType>,
bool> =
true>
104 typename TPipe::OutputType
operator>>(TInput&& rInput,
const TPipe& rPipe);
123 template <
class TInputPipe,
class TOutputPipe>
154 template <
class TInPipe = TInputPipe,
class TOutPipe = TOutputPipe>
156 std::enable_if_t<std::is_constructible_v<TInPipe,Parameters>
157 && std::is_constructible_v<TOutPipe,Parameters>>* = 0);
160 CompoundPipe(TInputPipe&& rInputPipe, TOutputPipe&& rOutputPipe) noexcept;
163 CompoundPipe(
const TInputPipe& rInputPipe,
const TOutputPipe& rOutputPipe);
175 TInputPipe mInputPipe;
177 TOutputPipe mOutputPipe;
182 template <class TInputPipe,
185 IsPipe<TInputPipe>::value &&
IsPipe<TOutputPipe>::value,
188 CompoundPipe<TInputPipe,TOutputPipe> operator|(TInputPipe&& rInputPipe, TOutputPipe&& rOutputPipe);
192 template <class TInputPipe,
195 IsPipe<TInputPipe>::value &&
IsPipe<TOutputPipe>::value,
198 CompoundPipe<TInputPipe,TOutputPipe> operator|(const TInputPipe& rInputPipe, const TOutputPipe& rOutputPipe);
202 template <class TPipe>
214 typename TPipe::OutputType
operator()(
typename TPipe::InputType input)
const;
224 template <
class ...TPipes>
225 using Pipeline = decltype((... | std::declval<TPipes>()));
236 #include "wrapp/pipes/impl/pipe_impl.hpp"
A composable pipe that takes the output of one pipe and feeds its result into another.
Definition: pipe.hpp:125
CompoundPipe(const TInputPipe &rInputPipe, const TOutputPipe &rOutputPipe)
Copy construct the input- and output pipes.
static Parameters GetDefaultParameters() noexcept
Return an array of subparameters, containing the defaults for each pipe segment in order.
TInputPipe InputPipe
Definition: pipe.hpp:127
CompoundPipe::OutputType operator()(typename CompoundPipe::InputType Input) const
Feed the result of the input pipe into the output pipe.
CompoundPipe()
Default construct the input- and output pipes.
CompoundPipe(const Parameters &rParameters, std::enable_if_t< std::is_constructible_v< TInPipe, Parameters > &&std::is_constructible_v< TOutPipe, Parameters >> *=0)
Construct from a Parameters object.
CompoundPipe(TInputPipe &&rInputPipe, TOutputPipe &&rOutputPipe) noexcept
Move construct the input- and output pipes.
CompoundPipe(const CompoundPipe &rOther)=default
Copy construct the input- and output pipes.
CompoundPipe(CompoundPipe &&rOther) noexcept=default
Move construct the input- and output pipes.
TOutputPipe OutputPipe
Definition: pipe.hpp:129
An adaptor class for pipelines consisting of a single segment.
Definition: pipe.hpp:204
SingleSegmentPipeline(SingleSegmentPipeline &&rOther) noexcept=default
SingleSegmentPipeline(const Parameters &rParameters)
static Parameters GetDefaultParameters()
SingleSegmentPipeline(const SingleSegmentPipeline &rOther)=default
TPipe::OutputType operator()(typename TPipe::InputType input) const
SingleSegmentPipeline()=default
TPipe::OutputType operator>>(TInput &&rInput, const TPipe &rPipe)
Operator for calling operator() of the pipe.
decltype((...|std::declval< TPipes >())) Pipeline
Convenience type alias for complex pipes.
Definition: pipe.hpp:225
std::integral_constant< bool, std::is_same_v< decltype(std::declval< const TPipe >().operator()(std::declval< typename TPipe::InputType >())), typename TPipe::OutputType > &&!std::is_same_v< typename TPipe::InputType, void > &&!std::is_same_v< typename TPipe::OutputType, void > > IsPipe
Bool constant checking whether TPipe satisfies the requirements of a pipe.
Definition: pipe.hpp:99
Definition: AddIOToPython.hpp:12
"CheckpointProcess" Factory(KratosMultiphysics.Parameters parameters, KratosMultiphysics.Model model)
Definition: CheckpointProcess.py:228
Definition: CheckpointID.hpp:68
Metaclass containing type information every pipe must inherit from.
Definition: pipe.hpp:72
TInput InputType
cv-qualified argument type of operator()
Definition: pipe.hpp:74
TOutput OutputType
qualified return type of operator()
Definition: pipe.hpp:77