Esempio n. 1
0
        /// <summary>
        /// TBD
        /// </summary>
        /// <typeparam name="TIn2">TBD</typeparam>
        /// <typeparam name="TOut2">TBD</typeparam>
        /// <typeparam name="TMat2">TBD</typeparam>
        /// <typeparam name="TMatRes">TBD</typeparam>
        /// <param name="bidi">TBD</param>
        /// <param name="combine">TBD</param>
        /// <returns>TBD</returns>
        public Flow <TIn2, TOut2, TMatRes> JoinMaterialized <TIn2, TOut2, TMat2, TMatRes>(IGraph <BidiShape <TOut, TOut2, TIn2, TIn>, TMat2> bidi, Func <TMat, TMat2, TMatRes> combine)
        {
            var copy = bidi.Module.CarbonCopy();
            var ins  = copy.Shape.Inlets.ToArray();
            var outs = copy.Shape.Outlets.ToArray();

            return(new Flow <TIn2, TOut2, TMatRes>(Module.Compose(copy, combine)
                                                   .Wire(Shape.Outlet, ins[0])
                                                   .Wire(outs[1], Shape.Inlet)
                                                   .ReplaceShape(new FlowShape <TIn2, TOut2>(Inlet.Create <TIn2>(ins[1]), Outlet.Create <TOut2>(outs[0])))));
        }
Esempio n. 2
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <returns>TBD</returns>
 public override IModule CarbonCopy()
 => NewInstance(new SourceShape <TOut>(Outlet.Create <TOut>(_shape.Outlet.CarbonCopy())));