Pipes and test scripts

This commit is contained in:
Michael Schimmel
2025-12-26 13:47:10 +01:00
parent 8b765487ae
commit 185f8273dd
23 changed files with 1477 additions and 572 deletions
+14 -2
View File
@@ -26,6 +26,8 @@ type
// The 8-byte storage for the scalar value
PValue = ^TValue;
TValue = record
class operator Implicit(A: Int64): TValue; overload;
class operator Implicit(A: Double): TValue; overload;
case TKind of
TKind.Ordinal, TKind.Keyword, TKind.Boolean: (AsInt64: Int64);
TKind.Float, TKind.DateTime: (AsDouble: Double);
@@ -190,19 +192,19 @@ type
IScalarRecordSeries = interface(IKeywordMapping<ISeries>)
{$region 'private'}
function GetDef: IScalarRecordDefinition;
function GetTotalCount: Int64;
{$endregion}
property Def: IScalarRecordDefinition read GetDef;
property TotalCount: Int64 read GetTotalCount;
end;
IWriteableScalarRecordSeries = interface(IScalarRecordSeries)
{$region 'private'}
function GetRecordCount: Int64;
function GetTotalCount: Int64;
{$endregion}
procedure Add(const Item: IKeywordMapping<TScalar>; Lookback: Int64 = -1); overload;
procedure Add(const Items: array of TScalar.TValue; Lookback: Int64 = -1); overload;
property RecordCount: Int64 read GetRecordCount;
property TotalCount: Int64 read GetTotalCount;
end;
// A series of scalar records, optimized for memory and access speed.
@@ -1071,6 +1073,16 @@ begin
Result := FDef.IndexOf(Key);
end;
class operator TScalar.TValue.Implicit(A: Int64): TValue;
begin
Result.AsInt64 := A;
end;
class operator TScalar.TValue.Implicit(A: Double): TValue;
begin
Result.AsDouble := A;
end;
initialization
Assert(sizeof(TScalar.TValue) = 8);