Complex processes
Sometimes we wish to combine two or more streams of data. There are
two many combinations of inputs and output, passive and active inputs,
to support directly, however some simple cases are provided
for. Implementing other more complex combinations for a specific
application is not complicated. As before both the use of simple
functions and processes based on classes are supported. The wrappers
of multiple argument processes are show in Figure 5
and Figure 6.
Figure 5:
2 Argument process
|
Figure 6:
3 Argument process
|
The following example is not as elegant as previous examples, as the
two input streams are setup separately to aid clarity. Figure
7 shows the pipelines created.
Figure 7:
Example of a 2 input process.
|
DPIFileC<IntT> src1("in.dat");
DPIPortC<RealT> src2 = DPIFileC<RealT>("in2.dat") >> DPOffsetScale(2.0,3.0);
DPIStreamOp21C<IntT,RealT,RealT>(MyComibinationProcC("some parameters"),src1,src2) >> DPOffsetScale(5.0,2.0) >>= DPIFileC<RealT>("out.dat");
Normal classes:
Normal functions:
Advanced classes:
Develop classes:
Develop functions:
|