示例#1
0
        public static GraphDsl.ReverseOps <TIn, TMat> Via <TIn, TOut, TMat>(this GraphDsl.ReverseOps <TIn, TMat> ops, UniformFanInShape <TIn, TOut> junction)
            where TIn : TOut
        {
            var inlet = Bind(ops, junction);

            return(ops.Builder.To(inlet));
        }
示例#2
0
        public static GraphDsl.ReverseOps <TIn, TMat> Via <TIn, TOut, TMat>(this GraphDsl.ReverseOps <TIn, TMat> ops, UniformFanOutShape <TIn, TOut> junction)
            where TIn : TOut
        {
            var b = From(ops, junction);

            return(b.To(junction.In));
        }
示例#3
0
        private static Inlet <TIn> Bind <TIn, TOut, TMat>(GraphDsl.ReverseOps <TIn, TMat> ops, UniformFanInShape <TIn, TOut> junction)
            where TIn : TOut
        {
            var b = ops.Builder;

            b.AddEdge(junction.Out, ops.In);
            return(GraphDsl.FindIn(b, junction, 0));
        }
示例#4
0
        public static GraphDsl.Builder <TMat> From <TIn, TOut, TMat>(this GraphDsl.ReverseOps <TIn, TMat> ops, FlowShape <TIn, TOut> flow)
            where TIn : TOut
        {
            var b = ops.Builder;

            b.AddEdge(flow.Outlet, ops.In);
            return(b);
        }
示例#5
0
        public static GraphDsl.Builder <TMat> From <TIn, TOut, TMat>(this GraphDsl.ReverseOps <TIn, TMat> ops, SourceShape <TOut> source)
            where TIn : TOut
        {
            var b = ops.Builder;

            b.AddEdge(source.Outlet, ops.In);
            return(b);
        }
示例#6
0
        public static GraphDsl.Builder <TMat> From <TIn, TOut, TMat>(this GraphDsl.ReverseOps <TIn, TMat> ops, Outlet <TOut> outlet)
            where TIn : TOut
        {
            var b = ops.Builder;

            b.AddEdge(outlet, ops.In);
            return(b);
        }
示例#7
0
        public static GraphDsl.Builder <TMat> From <TIn, TOut1, TOut2, TMat>(this GraphDsl.ReverseOps <TIn, TMat> ops, UniformFanOutShape <TOut1, TOut2> junction)
            where TIn : TOut2
        {
            var b     = ops.Builder;
            var count = junction.Outlets.Count();

            for (var n = 0; n < count; n++)
            {
                var outlet = junction.Out(n);
                if (!b.Module.Downstreams.ContainsKey(outlet))
                {
                    b.AddEdge(outlet, ops.In);
                    return(b);
                }
            }

            throw new ArgumentException("No more inlets free on junction", nameof(junction));
        }
示例#8
0
        public static GraphDsl.ReverseOps <TOut1, TMat> Via <TIn, TOut1, TOut2, TMat>(this GraphDsl.ReverseOps <TIn, TMat> ops, IGraph <FlowShape <TOut1, TOut2>, TMat> flow)
            where TIn : TOut2
        {
            var b = ops.Builder;
            var f = b.Add(flow);

            b.AddEdge(f.Outlet, ops.In);
            return(new GraphDsl.ReverseOps <TOut1, TMat>(b, f.Inlet));
        }
示例#9
0
 public static GraphDsl.Builder <TMat> From <TIn, TOut, TMat>(this GraphDsl.ReverseOps <TIn, TMat> ops, UniformFanInShape <TIn, TOut> junction)
     where TIn : TOut
 {
     Bind(ops, junction);
     return(ops.Builder);
 }