daily update on 20250122 by nitload youmu, architect rearrange

This commit is contained in:
Nitload
2025-01-22 11:34:49 +08:00
parent 6cfaa42ff3
commit 190d67a034
192 changed files with 25177 additions and 3156 deletions
@@ -1,6 +1,6 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="Blueprint.cs"
// file="BlueprintSchedueler.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
@@ -42,13 +42,13 @@ using System.Threading;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace StgSharp.BluePrint
namespace StgSharp.Blueprint
{
/// <summary>
/// A sets of complex logic designed for running in multi threads environment. Warning: do not
/// run a <see cref="Blueprint" /> instance in multi threads more than once.
/// run a <see cref="BlueprintSchedueler" /> instance in multi threads more than once.
/// </summary>
public partial class Blueprint : IConvertableToBlueprintNode
public partial class BlueprintSchedueler : IConvertableToBlueprintNode
{
private BeginningNode beginNode;
@@ -64,7 +64,7 @@ namespace StgSharp.BluePrint
internal int currentGlobalNodeIndex;
internal int currentNativeNodeIndex;
public Blueprint()
public BlueprintSchedueler()
{
allNode = new Dictionary<string, BlueprintNode>();
globalNodeList = new List<BlueprintNode>();
@@ -83,13 +83,22 @@ namespace StgSharp.BluePrint
get => runningStat.CurrentCount == 0;
}
/**/
internal Func<bool> ShouldClose
public ReadOnlySpan<string> InputInterfacesName
{
get => terminate;
set => terminate = value;
get { return beginNode.OutputInterfaces
.Select( p => p.Key )
.ToArray(); }
}
public ReadOnlySpan<string> OutputInterfacesName
{
get { return beginNode.OutputInterfaces
.Select( p => p.Key )
.ToArray(); }
}
/**/
internal SemaphoreSlim RunningStat
{
get => runningStat;
@@ -103,11 +112,17 @@ namespace StgSharp.BluePrint
allNode.Add( node.Name, node );
}
public void ExecuteMain(
in Dictionary<string, BlueprintPipeline> input,
in Dictionary<string, BlueprintPipeline> output )
in Dictionary<string, BlueprintPipeline> input,
in Dictionary<string, BlueprintPipeline> output )
{
BlueprintRunner.Run( this, () => true );
BlueprintRunner.Run( this );
}
public BlueprintNodeOperation Operation
{
get => ExecuteMain;
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
@@ -131,7 +146,7 @@ namespace StgSharp.BluePrint
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public void SetInput(
params (string name, BlueprintPipelineArgs arg)[] parameters )
params (string name, BlueprintPipelineArgs arg)[] parameters )
{
beginNode.InputData = parameters;
}
@@ -164,18 +179,9 @@ namespace StgSharp.BluePrint
return false;
}
string[] IConvertableToBlueprintNode.InputInterfacesName
~BlueprintSchedueler()
{
get { return beginNode.OutputInterfaces
.Select( p => p.Key )
.ToArray(); }
}
string[] IConvertableToBlueprintNode.OutputInterfacesName
{
get { return beginNode.OutputInterfaces
.Select( p => p.Key )
.ToArray(); }
runningStat.Dispose();
}
}