add a scanner, but this seems to be a wrong solution. Change open-source head
This commit is contained in:
@@ -1,30 +1,9 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
// file="PipelineNode"
|
||||
// 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;
|
||||
@@ -61,7 +40,11 @@ namespace StgSharp.PipeLine
|
||||
private protected Dictionary<string, PipelineNodeOutPort> _output;
|
||||
private protected int _level, _count;
|
||||
|
||||
internal PipelineNode(PipelineNodeLabel label, IConvertableToPipelineNode node, bool isNative)
|
||||
internal PipelineNode(
|
||||
PipelineNodeLabel label,
|
||||
IConvertableToPipelineNode node,
|
||||
bool isNative
|
||||
)
|
||||
{
|
||||
_label = label;
|
||||
_nativeRequested = isNative;
|
||||
@@ -82,7 +65,8 @@ namespace StgSharp.PipeLine
|
||||
PipelineNodeLabel name,
|
||||
bool isNative,
|
||||
string[] inputNames,
|
||||
string[] outputNames)
|
||||
string[] outputNames
|
||||
)
|
||||
#pragma warning restore CS8618
|
||||
{
|
||||
if ((inputNames == null) || (inputNames.Length == 0)) {
|
||||
@@ -148,7 +132,12 @@ namespace StgSharp.PipeLine
|
||||
|
||||
internal int RemainingIncreaseCount => Previous.Count - _count;
|
||||
|
||||
public static void Connect(PipelineNode front, string frontNodePort, string backNodePort, PipelineNode back)
|
||||
public static void Connect(
|
||||
PipelineNode front,
|
||||
string frontNodePort,
|
||||
string backNodePort,
|
||||
PipelineNode back
|
||||
)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(front);
|
||||
ArgumentNullException.ThrowIfNull(back);
|
||||
@@ -191,7 +180,9 @@ namespace StgSharp.PipeLine
|
||||
}
|
||||
}
|
||||
|
||||
internal bool TryIncreaseLevelTo(int level)
|
||||
internal bool TryIncreaseLevelTo(
|
||||
int level
|
||||
)
|
||||
{
|
||||
_count++;
|
||||
if (_count > Previous.Count) {
|
||||
@@ -203,14 +194,17 @@ namespace StgSharp.PipeLine
|
||||
|
||||
protected static void DefaultOperation(
|
||||
in Dictionary<string, PipelineNodeInPort> input,
|
||||
in Dictionary<string, PipelineNodeOutPort> output)
|
||||
in Dictionary<string, PipelineNodeOutPort> output
|
||||
)
|
||||
{
|
||||
PipelineNodeOutPort.SkipAll(output);
|
||||
}
|
||||
|
||||
#region port operation
|
||||
|
||||
public PipelineNodeInPort GetInputPort(string lable)
|
||||
public PipelineNodeInPort GetInputPort(
|
||||
string lable
|
||||
)
|
||||
{
|
||||
if (!InputPorts.TryGetValue(lable, out PipelineNodeInPort? ret)) {
|
||||
throw new ArgumentOutOfRangeException(
|
||||
@@ -219,7 +213,9 @@ namespace StgSharp.PipeLine
|
||||
return ret;
|
||||
}
|
||||
|
||||
public PipelineNodeOutPort GetOutputPort(string lable)
|
||||
public PipelineNodeOutPort GetOutputPort(
|
||||
string lable
|
||||
)
|
||||
{
|
||||
if (!OutputPorts.TryGetValue(lable, out PipelineNodeOutPort? ret)) {
|
||||
throw new ArgumentOutOfRangeException(
|
||||
@@ -228,7 +224,9 @@ namespace StgSharp.PipeLine
|
||||
return ret;
|
||||
}
|
||||
|
||||
public PipelineNodeInPort? DefineCertainInputPort(string label)
|
||||
public PipelineNodeInPort? DefineCertainInputPort(
|
||||
string label
|
||||
)
|
||||
{
|
||||
if (InputPorts.ContainsKey(label)) {
|
||||
return null;
|
||||
@@ -238,7 +236,9 @@ namespace StgSharp.PipeLine
|
||||
return port;
|
||||
}
|
||||
|
||||
public PipelineNodeOutPort? DefineCertainOutputPort(string label)
|
||||
public PipelineNodeOutPort? DefineCertainOutputPort(
|
||||
string label
|
||||
)
|
||||
{
|
||||
if (OutputPorts.ContainsKey(label)) {
|
||||
return null;
|
||||
@@ -256,11 +256,21 @@ namespace StgSharp.PipeLine
|
||||
|
||||
public PipelineNodeRunException() { }
|
||||
|
||||
public PipelineNodeRunException(Exception ex) : base(string.Empty, ex) { }
|
||||
public PipelineNodeRunException(
|
||||
Exception ex
|
||||
)
|
||||
: base(string.Empty, ex) { }
|
||||
|
||||
public PipelineNodeRunException(string message) : base(message) { }
|
||||
public PipelineNodeRunException(
|
||||
string message
|
||||
)
|
||||
: base(message) { }
|
||||
|
||||
public PipelineNodeRunException(string message, Exception innerException) : base(message, innerException) { }
|
||||
public PipelineNodeRunException(
|
||||
string message,
|
||||
Exception innerException
|
||||
)
|
||||
: base(message, innerException) { }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user