예제 #1
0
        /// <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();
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
            /// <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");
            }
예제 #4
0
            /// <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;
            }
예제 #5
0
        /// <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);
        }
예제 #6
0
 /// <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)))
 {
 }
예제 #7
0
 /// <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 }))
 {
 }
예제 #8
0
 /// <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 }))
 {
 }
예제 #9
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="init">TBD</param>
 public FanOutShape(IInit init) : base(init)
 {
     Out0 = NewOutlet <T0>("out0");
     Out1 = NewOutlet <T1>("out1");
 }
예제 #10
0
 /// <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);
예제 #11
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <returns>TBD</returns>
 public override Shape DeepCopy()
 => new FlowShape <TIn, TOut>((Inlet <TIn>)Inlet.CarbonCopy(), (Outlet <TOut>)Outlet.CarbonCopy());
예제 #12
0
 /// <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))
 {
 }