-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from do-i-know-it/release/2.0.0
Release version 2.0.0
- Loading branch information
Showing
317 changed files
with
8,983 additions
and
13,121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using YggdrAshill.Nuadha.Signalization; | ||
|
||
namespace YggdrAshill.Nuadha.Conduction | ||
{ | ||
/// <summary> | ||
/// Implementation of <see cref="ISignal"/> for accuracy of <typeparamref name="TSignal"/>. | ||
/// </summary> | ||
/// <typeparam name="TSignal"> | ||
/// Type of <see cref="ISignal"/> for accuracy. | ||
/// </typeparam> | ||
public struct Accuracy<TSignal> : | ||
ISignal | ||
where TSignal : ISignal | ||
{ | ||
/// <summary> | ||
/// Original <typeparamref name="TSignal"/>. | ||
/// </summary> | ||
public TSignal Original { get; } | ||
|
||
/// <summary> | ||
/// Error of <typeparamref name="TSignal"/> contained in <see cref="Original"/>. | ||
/// </summary> | ||
public TSignal Error { get; } | ||
|
||
public Accuracy(TSignal original, TSignal error) | ||
{ | ||
Original = original; | ||
|
||
Error = error; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using YggdrAshill.Nuadha.Signalization; | ||
|
||
namespace YggdrAshill.Nuadha.Conduction | ||
{ | ||
/// <summary> | ||
/// Implementation of <see cref="ISignal"/> for analysis of <typeparamref name="TSignal"/>. | ||
/// </summary> | ||
/// <typeparam name="TSignal"> | ||
/// Type of <see cref="ISignal"/> of analysis. | ||
/// </typeparam> | ||
public struct Analysis<TSignal> : | ||
ISignal | ||
where TSignal : ISignal | ||
{ | ||
/// <summary> | ||
/// Expeted <typeparamref name="TSignal"/>. | ||
/// </summary> | ||
public TSignal Expected { get; } | ||
|
||
/// <summary> | ||
/// Actual <typeparamref name="TSignal"/>. | ||
/// </summary> | ||
public TSignal Actual { get; } | ||
|
||
/// <summary> | ||
/// Constructor. | ||
/// </summary> | ||
/// <param name="expected"> | ||
/// <typeparamref name="TSignal"/> for <see cref="Expected"/>. | ||
/// </param> | ||
/// <param name="actual"> | ||
/// <typeparamref name="TSignal"/> for <see cref="Actual"/>. | ||
/// </param> | ||
public Analysis(TSignal expected, TSignal actual) | ||
{ | ||
Expected = expected; | ||
|
||
Actual = actual; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public override string ToString() | ||
{ | ||
return $"{Expected}/{Actual}"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using YggdrAshill.Nuadha.Signalization; | ||
using System; | ||
|
||
namespace YggdrAshill.Nuadha.Conduction | ||
{ | ||
/// <summary> | ||
/// Defines implementations of <see cref="ICancellation"/>. | ||
/// </summary> | ||
public static class Cancel | ||
{ | ||
/// <summary> | ||
/// Cancels with <paramref name="cancellation"/>. | ||
/// </summary> | ||
/// <param name="cancellation"> | ||
/// <see cref="Action"/> to cancel. | ||
/// </param> | ||
/// <returns> | ||
/// <see cref="ICancellation"/>. | ||
/// </returns> | ||
/// <exception cref="ArgumentNullException"> | ||
/// Thrown if <paramref name="cancellation"/> is null. | ||
/// </exception> | ||
public static ICancellation With(Action cancellation) | ||
{ | ||
if (cancellation == null) | ||
{ | ||
throw new ArgumentNullException(nameof(cancellation)); | ||
} | ||
|
||
return new CancelWith(cancellation); | ||
} | ||
private sealed class CancelWith : | ||
ICancellation | ||
{ | ||
private readonly Action onCancelled; | ||
|
||
public CancelWith(Action onCancelled) | ||
{ | ||
this.onCancelled = onCancelled; | ||
} | ||
|
||
public void Cancel() | ||
{ | ||
onCancelled.Invoke(); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Cancels none. | ||
/// </summary> | ||
public static ICancellation None { get; } = With(() => { }); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using YggdrAshill.Nuadha.Signalization; | ||
using System; | ||
|
||
namespace YggdrAshill.Nuadha.Conduction | ||
{ | ||
/// <summary> | ||
/// Defines implementations of <see cref="IConsumption{TSignal}"/> for <typeparamref name="TSignal"/>. | ||
/// </summary> | ||
/// <typeparam name="TSignal"> | ||
/// Type of <see cref="ISignal"/> to consume. | ||
/// </typeparam> | ||
public static class Consume<TSignal> | ||
where TSignal : ISignal | ||
{ | ||
/// <summary> | ||
/// Consumes <typeparamref name="TSignal"/> like <paramref name="consumption"/>. | ||
/// </summary> | ||
/// <param name="consumption"> | ||
/// <see cref="Action{T}"/> to consume <typeparamref name="TSignal"/>. | ||
/// </param> | ||
/// <returns> | ||
/// <see cref="IConsumption{TSignal}"/> for <typeparamref name="TSignal"/>. | ||
/// </returns> | ||
/// <exception cref="ArgumentNullException"> | ||
/// Thrown if <paramref name="consumption"/> is null. | ||
/// </exception> | ||
public static IConsumption<TSignal> Like(Action<TSignal> consumption) | ||
{ | ||
if (consumption == null) | ||
{ | ||
throw new ArgumentNullException(nameof(consumption)); | ||
} | ||
|
||
return new ConsumeSignalLike(consumption); | ||
} | ||
private sealed class ConsumeSignalLike : | ||
IConsumption<TSignal> | ||
{ | ||
private readonly Action<TSignal> onConsumed; | ||
|
||
public ConsumeSignalLike(Action<TSignal> onConsumed) | ||
{ | ||
this.onConsumed = onConsumed; | ||
} | ||
|
||
public void Consume(TSignal signal) | ||
{ | ||
onConsumed.Invoke(signal); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using YggdrAshill.Nuadha.Signalization; | ||
using YggdrAshill.Nuadha.Transformation; | ||
using System; | ||
|
||
namespace YggdrAshill.Nuadha.Conduction | ||
{ | ||
/// <summary> | ||
/// Defines implementations of <see cref="IConsumption{TSignal}"/> for <see cref="Pulse"/>. | ||
/// </summary> | ||
public static class ConsumePulse | ||
{ | ||
/// <summary> | ||
/// Receives <see cref="Pulse"/> to consume like <paramref name="consumption"/>. | ||
/// </summary> | ||
/// <param name="consumption"> | ||
/// <see cref="Action"/> to consume <see cref="Pulse"/>. | ||
/// </param> | ||
/// <returns> | ||
/// <see cref="IConsumption{TSignal}"/> for <see cref="Pulse"/>. | ||
/// </returns> | ||
/// <exception cref="ArgumentNullException"> | ||
/// Thrown if <paramref name="consumption"/> is null. | ||
/// </exception> | ||
public static IConsumption<Pulse> Like(Action consumption) | ||
{ | ||
if (consumption == null) | ||
{ | ||
throw new ArgumentNullException(nameof(consumption)); | ||
} | ||
|
||
return Consume<Pulse>.Like(_ => | ||
{ | ||
consumption.Invoke(); | ||
}); | ||
} | ||
|
||
/// <summary> | ||
/// Receives <see cref="Pulse"/> to do nothing. | ||
/// </summary> | ||
public static IConsumption<Pulse> None { get; } = Like(() => { }); | ||
} | ||
} |
Oops, something went wrong.