daily update on 20241002 by nitload youmu, intrinsic function rebuild, syntax style arrange

This commit is contained in:
Nitload
2024-10-03 04:03:06 +08:00
parent 0979123ac0
commit 6e2f93b053
265 changed files with 26732 additions and 19058 deletions
+23 -26
View File
@@ -40,7 +40,6 @@ using System.Threading.Tasks;
namespace StgSharp.BluePrint
{
public class BlueprintPipeline
{
@@ -49,11 +48,12 @@ namespace StgSharp.BluePrint
private BlueprintPipelineArgs args;
private SemaphoreSlim formerCompleteSemaphore;
public BlueprintPipeline(BlueprintNode former, BlueprintNode after)
public BlueprintPipeline( BlueprintNode former, BlueprintNode after )
{
this.former = former;
this.after = after;
formerCompleteSemaphore = new SemaphoreSlim(initialCount: 0, maxCount: 1);
formerCompleteSemaphore = new SemaphoreSlim(
initialCount: 0, maxCount: 1 );
}
public BlueprintNode After => after;
@@ -68,31 +68,27 @@ namespace StgSharp.BluePrint
public int Level => former.Level;
public static void SkipAll(Dictionary<string, BlueprintPipeline> ports)
public static void SkipAll(
Dictionary<string, BlueprintPipeline> ports )
{
if (ports == null)
{
throw new ArgumentNullException(nameof(ports));
if( ports == null ) {
throw new ArgumentNullException( nameof( ports ) );
}
foreach (KeyValuePair<string, BlueprintPipeline> item in ports)
{
if (item.Value != null)
{
foreach( KeyValuePair<string, BlueprintPipeline> item in ports ) {
if( item.Value != null ) {
item.Value.CompleteAndSkip();
}
}
}
public static void WaitAll(Dictionary<string, BlueprintPipeline> ports)
public static void WaitAll(
Dictionary<string, BlueprintPipeline> ports )
{
if (ports == null)
{
throw new ArgumentNullException(nameof(ports));
if( ports == null ) {
throw new ArgumentNullException( nameof( ports ) );
}
foreach (KeyValuePair<string, BlueprintPipeline> item in ports)
{
if (item.Value != null)
{
foreach( KeyValuePair<string, BlueprintPipeline> item in ports ) {
if( item.Value != null ) {
item.Value.WaitForStart();
}
}
@@ -111,30 +107,31 @@ namespace StgSharp.BluePrint
#region pipline op
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public void CompleteAndSkip()
{
//Console.WriteLine($"Complete\t{former.Name}\t->\t{after.Name}");
formerCompleteSemaphore.Release();
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void CompleteAndWriteData(BlueprintPipelineArgs args)
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public void CompleteAndWriteData( BlueprintPipelineArgs args )
{
this.args = args;
CompleteAndSkip();
}
#endregion
}
public abstract class BlueprintPipelineArgs
{
public object? Value { get; set; }
public object? Value
{
get;
set;
}
}
}