daily uodate on 20240626 by nitload youmu[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[p
This commit is contained in:
@@ -52,26 +52,26 @@ namespace StgSharp.Logic
|
||||
/// </summary>
|
||||
public partial class Blueprint : IConvertableToBlueprintNode
|
||||
{
|
||||
private int runningFlag;
|
||||
|
||||
private BeginningNode beginNode;
|
||||
private Dictionary<string, BlueprintNode> allNode;
|
||||
private EndingNode endNode;
|
||||
|
||||
private Func<bool> terminate;
|
||||
private List<BlueprintNode> globalNodeList;
|
||||
private List<BlueprintNode> nativeNodeList;
|
||||
|
||||
private SemaphoreSlim runningStat;
|
||||
|
||||
internal int currentGlobalNodeIndex;
|
||||
internal int currentNativeNodeIndex;
|
||||
|
||||
private List<BlueprintNode> nativeNodeList;
|
||||
private List<BlueprintNode> globalNodeList;
|
||||
|
||||
public Blueprint()
|
||||
{
|
||||
allNode = new Dictionary<string, BlueprintNode>();
|
||||
globalNodeList = new List<BlueprintNode>();
|
||||
nativeNodeList = new List<BlueprintNode>();
|
||||
//terminate = () => true;
|
||||
runningStat = new SemaphoreSlim(1, 1);
|
||||
beginNode = new BeginningNode(this);
|
||||
endNode = new EndingNode(this);
|
||||
}
|
||||
@@ -79,10 +79,14 @@ namespace StgSharp.Logic
|
||||
public BlueprintNode BeginLayer => beginNode;
|
||||
public BlueprintNode EndLayer => endNode;
|
||||
|
||||
internal SemaphoreSlim RunningStat
|
||||
{
|
||||
get => runningStat;
|
||||
}
|
||||
|
||||
public bool IsRunning
|
||||
{
|
||||
get => runningFlag == 1;
|
||||
internal set => Interlocked.Exchange(ref runningFlag ,(value ? 1 : 0));
|
||||
get => runningStat.CurrentCount == 0;
|
||||
}
|
||||
|
||||
/**/
|
||||
@@ -100,6 +104,12 @@ namespace StgSharp.Logic
|
||||
allNode.Add(node.Name, node);
|
||||
}
|
||||
|
||||
public void ExecuteMain(in Dictionary<string, BlueprintPipeline> input,
|
||||
in Dictionary<string, BlueprintPipeline> output)
|
||||
{
|
||||
BlueprintRunner.Run(this, () => true);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public (string name, BlueprintPipelineArgs arg)[] GetOutput()
|
||||
{
|
||||
@@ -123,18 +133,18 @@ namespace StgSharp.Logic
|
||||
globalNodeList.Sort();
|
||||
}
|
||||
|
||||
public void ExecuteMain(in Dictionary<string, BlueprintPipeline> input,
|
||||
in Dictionary<string, BlueprintPipeline> output)
|
||||
{
|
||||
BlueprintRunner.Run(this, () => true);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void SetInput(params (string name, BlueprintPipelineArgs arg)[] parameters)
|
||||
{
|
||||
beginNode.InputData = parameters;
|
||||
}
|
||||
|
||||
public void Terminate()
|
||||
{
|
||||
Interlocked.Exchange(ref currentGlobalNodeIndex, int.MaxValue);
|
||||
Interlocked.Exchange(ref currentNativeNodeIndex, int.MaxValue);
|
||||
}
|
||||
|
||||
internal bool RequestNexGlobalNode(out BlueprintNode node)
|
||||
{
|
||||
if (currentGlobalNodeIndex < globalNodeList.Count)
|
||||
@@ -170,12 +180,6 @@ namespace StgSharp.Logic
|
||||
get { return beginNode.OutputInterfaces.Select(p => p.Key).ToArray(); }
|
||||
}
|
||||
|
||||
public void Terminate()
|
||||
{
|
||||
Interlocked.Exchange(ref currentGlobalNodeIndex, int.MaxValue);
|
||||
Interlocked.Exchange(ref currentNativeNodeIndex, int.MaxValue);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user