Keyword mapping refactoring

This commit is contained in:
Michael Schimmel
2025-12-09 12:59:36 +01:00
parent 43afbd6050
commit f8dc5b945c
13 changed files with 257 additions and 188 deletions
+10 -9
View File
@@ -180,14 +180,7 @@ begin
inherited Create;
FPath := APath;
FCachedFiles :=
TDataFileCache<TArray<TArray<TDataPoint<T>>>>.Create(
function(const Filename: String): TFuture<TArray<TArray<TDataPoint<T>>>>
begin
// Pass the private load gate to the virtual DoLoad method.
Result := DoLoad(Filename, FLoadGate);
end
);
FCachedFiles := TDataFileCache<TArray<TArray<TDataPoint<T>>>>.Create;
end;
destructor TDataServer<T>.Destroy;
@@ -349,7 +342,15 @@ end;
function TDataServer<T>.LoadDataFile(const DataFile: TDataFile): TFuture<TArray<TArray<TDataPoint<T>>>>;
begin
if DataFile.IsValid then
Result := FCachedFiles.GetOrAdd(DataFile.GetFullFileName)
Result :=
FCachedFiles.GetOrAdd(
DataFile.GetFullFileName,
function(const Filename: String): TFuture<TArray<TArray<TDataPoint<T>>>>
begin
// Pass the private load gate to the virtual DoLoad method.
Result := DoLoad(Filename, FLoadGate);
end
)
else
Result := TFuture<TArray<TArray<TDataPoint<T>>>>.Construct(TArray<TArray<TDataPoint<T>>>(nil));
end;