/// <summary> /// TBD /// </summary> /// <param name="outlet">TBD</param> /// <param name="registered">TBD</param> /// <param name="name">TBD</param> protected FanInShape(Outlet <TOut> outlet, IEnumerable <Inlet> registered, string name) { Out = outlet; Outlets = ImmutableArray.Create <Outlet>(outlet); _inlets = ImmutableArray <Inlet> .Empty; _name = name; _registered = registered.GetEnumerator(); }
/// <summary> /// TBD /// </summary> /// <param name="outlet">TBD</param> /// <exception cref="ArgumentNullException">TBD</exception> public SourceShape(Outlet <TOut> outlet) { if (outlet == null) { throw new ArgumentNullException(nameof(outlet)); } Outlet = outlet; Outlets = ImmutableArray.Create <Outlet>(outlet); }
/// <summary> /// TBD /// </summary> /// <param name="name">TBD</param> /// <exception cref="ArgumentException">TBD</exception> public InitName(string name) { if (string.IsNullOrEmpty(name)) { throw new ArgumentNullException(nameof(name)); } _name = name; _outlet = new Outlet <TOut>(name + ".out"); }
/// <summary> /// TBD /// </summary> /// <param name="outlet">TBD</param> /// <param name="inlets">TBD</param> public InitPorts(Outlet <TOut> outlet, IEnumerable <Inlet> inlets) { if (outlet == null) { throw new ArgumentNullException(nameof(outlet)); } if (inlets == null) { throw new ArgumentNullException(nameof(inlets)); } _outlet = outlet; _inlets = inlets; }
/// <summary> /// TBD /// </summary> /// <param name="inlet">TBD</param> /// <param name="outlet">TBD</param> /// <exception cref="ArgumentNullException">TBD</exception> public FlowShape(Inlet <TIn> inlet, Outlet <TOut> outlet) { if (inlet == null) { throw new ArgumentNullException(nameof(inlet), "FlowShape expected non-null inlet"); } if (outlet == null) { throw new ArgumentNullException(nameof(outlet), "FlowShape expected non-null outlet"); } Inlet = inlet; Outlet = outlet; Inlets = ImmutableArray.Create <Inlet>(inlet); Outlets = ImmutableArray.Create <Outlet>(outlet); }
/// <summary> /// TBD /// </summary> /// <param name="outlet">TBD</param> /// <param name="in0">TBD</param> /// <param name="inlets">TBD</param> public FanInShapeN(Outlet <TOut> outlet, Inlet <T0> in0, params Inlet <T1>[] inlets) : this(inlets.Length, new InitPorts(outlet, new Inlet[] { in0 }.Concat(inlets))) { }
/// <summary> /// TBD /// </summary> /// <param name="outlet">TBD</param> /// <param name="in0">TBD</param> /// <param name="in1">TBD</param> /// <returns>TBD</returns> public FanInShape(Outlet <TOut> outlet, Inlet <T0> in0, Inlet <T1> in1) : this(new InitPorts(outlet, new Inlet[] { in0, in1 })) { }
/// <summary> /// TBD /// </summary> /// <param name="inlet">TBD</param> /// <param name="out0">TBD</param> /// <param name="out1">TBD</param> public FanOutShape(Inlet <TIn> inlet, Outlet <T0> out0, Outlet <T1> out1) : this(new InitPorts(inlet, new Outlet[] { out0, out1 })) { }
/// <summary> /// TBD /// </summary> /// <param name="init">TBD</param> public FanOutShape(IInit init) : base(init) { Out0 = NewOutlet <T0>("out0"); Out1 = NewOutlet <T1>("out1"); }
/// <summary> /// TBD /// </summary> /// <typeparam name="T">TBD</typeparam> /// <param name="outlet">TBD</param> /// <returns>TBD</returns> public static Outlet <T> Create <T>(Outlet outlet) => outlet as Outlet <T> ?? new Outlet <T>(outlet.Name);
/// <summary> /// TBD /// </summary> /// <returns>TBD</returns> public override Shape DeepCopy() => new FlowShape <TIn, TOut>((Inlet <TIn>)Inlet.CarbonCopy(), (Outlet <TOut>)Outlet.CarbonCopy());
/// <summary> /// TBD /// </summary> /// <param name="outlet">TBD</param> /// <param name="inlets">TBD</param> public UniformFanInShape(Outlet <TOut> outlet, params Inlet <TIn>[] inlets) : this(inlets.Length, new InitPorts(outlet, inlets)) { }