add a scanner, but this seems to be a wrong solution. Change open-source head
This commit is contained in:
@@ -1,30 +1,10 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
// file="PipelineNodePort"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload
|
||||
// Copyright (c) Nitload. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// Copyright (c) Nitload.
|
||||
// SPDX-License-Identifier: MIT
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -40,7 +20,10 @@ namespace StgSharp.PipeLine
|
||||
|
||||
private HashSet<PipelineNodeOutPort> _linkerSet = new HashSet<PipelineNodeOutPort>();
|
||||
|
||||
public PipelineNodeInPort(PipelineNode container, string label)
|
||||
public PipelineNodeInPort(
|
||||
PipelineNode container,
|
||||
string label
|
||||
)
|
||||
{
|
||||
Container = container;
|
||||
Label = label;
|
||||
@@ -56,7 +39,9 @@ namespace StgSharp.PipeLine
|
||||
|
||||
internal HashSet<PipelineNodeOutPort> Linkers => _linkerSet;
|
||||
|
||||
public void Connect(PipelineNodeOutPort port)
|
||||
public void Connect(
|
||||
PipelineNodeOutPort port
|
||||
)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(port);
|
||||
if (_linkerSet.Add(port))
|
||||
@@ -79,7 +64,9 @@ namespace StgSharp.PipeLine
|
||||
PipelineNodeOutPort.WaitAll(_linkerSet);
|
||||
}
|
||||
|
||||
public static void WaitAll(IDictionary<string, PipelineNodeInPort> ports)
|
||||
public static void WaitAll(
|
||||
IDictionary<string, PipelineNodeInPort> ports
|
||||
)
|
||||
{
|
||||
if (ports is null) {
|
||||
return;
|
||||
@@ -89,7 +76,9 @@ namespace StgSharp.PipeLine
|
||||
}
|
||||
}
|
||||
|
||||
public static void WaitAll(IEnumerable<PipelineNodeInPort> ports)
|
||||
public static void WaitAll(
|
||||
IEnumerable<PipelineNodeInPort> ports
|
||||
)
|
||||
{
|
||||
if (ports is null) {
|
||||
return;
|
||||
@@ -108,7 +97,10 @@ namespace StgSharp.PipeLine
|
||||
private volatile int _passCount;
|
||||
private SemaphoreSlim formerCompleteSemaphore;
|
||||
|
||||
public PipelineNodeOutPort(PipelineNode container, string label)
|
||||
public PipelineNodeOutPort(
|
||||
PipelineNode container,
|
||||
string label
|
||||
)
|
||||
{
|
||||
Container = container;
|
||||
Label = label;
|
||||
@@ -123,7 +115,9 @@ namespace StgSharp.PipeLine
|
||||
|
||||
private SemaphoreSlim Waiter => formerCompleteSemaphore;
|
||||
|
||||
public void Connect(PipelineNodeInPort port)
|
||||
public void Connect(
|
||||
PipelineNodeInPort port
|
||||
)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(port);
|
||||
if (_linkerSet.Add(port))
|
||||
@@ -145,7 +139,9 @@ namespace StgSharp.PipeLine
|
||||
}
|
||||
}
|
||||
|
||||
public static void SkipAll(Dictionary<string, PipelineNodeOutPort> ports)
|
||||
public static void SkipAll(
|
||||
Dictionary<string, PipelineNodeOutPort> ports
|
||||
)
|
||||
{
|
||||
if (ports is null) {
|
||||
return;
|
||||
@@ -155,12 +151,16 @@ namespace StgSharp.PipeLine
|
||||
}
|
||||
}
|
||||
|
||||
public void TransmitValue(IPipeLineConnectionPayload value)
|
||||
public void TransmitValue(
|
||||
IPipeLineConnectionPayload value
|
||||
)
|
||||
{
|
||||
foreach (PipelineNodeInPort item in _linkerSet) { }
|
||||
}
|
||||
|
||||
public static void WaitAll(IEnumerable<PipelineNodeOutPort> ports)
|
||||
public static void WaitAll(
|
||||
IEnumerable<PipelineNodeOutPort> ports
|
||||
)
|
||||
{
|
||||
if (ports is null) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user