New Test-Startegy

This commit is contained in:
Michael Schimmel
2025-07-22 17:21:59 +02:00
parent c530f2fc0b
commit e6d41260f9
6 changed files with 311 additions and 42 deletions
+14
View File
@@ -67,6 +67,8 @@ type
property Sender: TDataProvider<T>.IDataProvider read GetSender;
end;
TBroadcastProc = reference to function(const Value: T): TState;
strict private
class var
FNull: IConverter;
@@ -82,7 +84,9 @@ type
class operator Implicit(const A: IConverter): TConverter<S, T>; overload;
class operator Implicit(const A: TConverter<S, T>): IConverter; overload;
class function Construct(const Processor: IMycProcessor<S>; const DataProvider: TDataProvider<T>): TConverter<S, T>; static;
class function CreateGeneric(const Func: TConstFunc<S, T>): TConverter<S, T>; static;
class function CreateAggregation(const Func: TConstFunc<S, TBroadcastProc, TState>): TConverter<S, T>; static;
class function CreateParallel(const Func: TConstFunc<S, T>): TConverter<S, T>; static;
function Chain<R>(const Next: TConverter<T, R>): TConverter<T, R>; overload; inline;
@@ -221,6 +225,16 @@ begin
Result := Chain<R>(TMycGenericParallelConverter<T, R>.Create(Func));
end;
class function TConverter<S, T>.Construct(const Processor: IMycProcessor<S>; const DataProvider: TDataProvider<T>): TConverter<S, T>;
begin
Result := TMycComposedConverter<S, T>.Create(Processor, DataProvider);
end;
class function TConverter<S, T>.CreateAggregation(const Func: TConstFunc<S, TBroadcastProc, TState>): TConverter<S, T>;
begin
Result := TMycGenericAggregator<S, T>.Create(Func);
end;
class function TConverter<S, T>.CreateGeneric(const Func: TConstFunc<S, T>): TConverter<S, T>;
begin
Result := TMycGenericConverter<S, T>.Create(Func);