This commit is contained in:
Michael Schimmel
2025-07-03 21:27:10 +02:00
parent 58ce84e567
commit 644b6074d6
11 changed files with 1646 additions and 775 deletions
+11 -1
View File
@@ -18,9 +18,13 @@ type
end;
TMycNullFuture<T> = class(TMycFuture<T>)
private
FValue: T;
protected
function GetValue: T; override;
function GetDone: TState; override;
public
constructor Create(const AValue: T);
end;
TMycGateFuncFuture<T> = class(TMycFuture<T>)
@@ -56,6 +60,12 @@ begin
Assert(GetDone.IsSet, 'Trying to destroy an unfinished future');
end;
constructor TMycNullFuture<T>.Create(const AValue: T);
begin
inherited Create;
FValue := AValue;
end;
{ TMycNullFuture<T> }
function TMycNullFuture<T>.GetDone: TState;
@@ -65,7 +75,7 @@ end;
function TMycNullFuture<T>.GetValue: T;
begin
Result := Default(T);
Result := FValue;
end;
{ TMycGateFuncFuture<T> }