41 lines
1.3 KiB
C#
41 lines
1.3 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Process.Interface;
|
|
|
|
/// <summary>
|
|
/// Common interface for <see cref="IProcessor"/>s, which
|
|
/// are able to manipulate input data and generate an output
|
|
/// </summary>
|
|
public interface IProcessor
|
|
{
|
|
/// <summary>
|
|
/// Returns an <seealso cref="IEnumerable"/>,
|
|
/// containing the manipulated data after this processing step
|
|
/// </summary>
|
|
/// <returns>The processed data</returns>
|
|
IEnumerable Process(IEnumerable inputs);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Common interface for <see cref="IProcessor"/>s, which
|
|
/// are able to manipulate <typeparamref name="TInput"/> data and generate an <typeparamref name="TOutput"/>
|
|
/// </summary>
|
|
/// <typeparam name="TInput">The data type to input</typeparam>
|
|
/// <typeparam name="TOutput">The resulting data type</typeparam>
|
|
public interface IProcessor<in TInput, out TOutput> : IProcessor
|
|
{
|
|
/// <summary>
|
|
/// Returns an <seealso cref="IEnumerable{T}"/>,
|
|
/// containing the manipulated <typeparamref name="TInput"/> data after this processing step
|
|
/// </summary>
|
|
/// <returns>The processed <typeparamref name="TOutput"/> data</returns>
|
|
IEnumerable<TOutput> Process(IEnumerable<TInput> inputs);
|
|
|
|
/// <inheritdoc cref="IProcessor.Process(IEnumerable)"/>
|
|
new IEnumerable Process(IEnumerable inputs)
|
|
{
|
|
return Process((IEnumerable<TInput>)inputs);
|
|
}
|
|
}
|