DataServer 1st Version

This commit is contained in:
Michael Schimmel
2025-06-06 12:43:51 +02:00
parent f70cfe0ec1
commit 98de7176c3
9 changed files with 271 additions and 50 deletions
+50
View File
@@ -0,0 +1,50 @@
unit Myc.Trade.DataServer;
interface
uses
System.SysUtils,
System.Generics.Collections,
Myc.Lazy,
Myc.Trade.DataPoint,
Myc.Trade.DataSeries;
type
IDataProvider = interface
['{B2A9996C-724B-4416-A882-595B7E58066D}']
procedure Fetch;
end;
IDataServer<T> = interface
['{A6E246A2-E84E-49AB-A63E-333E561E488C}']
function GetData: TMutable<TArray<T>>;
function GetIsLiveData: TMutable<Boolean>;
property Data: TMutable<TArray<T>> read GetData;
property IsLiveData: TMutable<Boolean> read GetIsLiveData;
end;
TDataServer<T> = class(TInterfacedObject, IDataServer<T>, IDataProvider)
protected
function GetData: TMutable<TArray<T>>; virtual; abstract;
function GetIsLiveData: TMutable<Boolean>; virtual; abstract;
procedure Fetch; virtual; abstract;
end;
IDataServerNode<T> = interface
['{DA3531F1-158E-4A63-8E5A-34089C537B1B}']
function CreateDataServer: IDataServer<T>;
end;
TDataServerNode<T> = class(TInterfacedObject, IDataServerNode<T>)
public
// Factory method to create the actual data server instance.
function CreateDataServer: IDataServer<T>; virtual; abstract;
end;
TFileStreamServerNode<T> = class(TDataServerNode<T>)
end;
implementation
end.