unit Myc.Data.POD; interface uses Myc.Data.Series; type // POD: Plain old data (that fits into a 64 bit register) TScalarKind = (skInteger, skInt64, skUInt64, skSingle, skDouble, skTimestamp, skBoolean, skChar, skString, skBytes); TScalarValue = record case TScalarKind of skInteger: (AsInteger: Integer); skInt64: (AsInt64: Int64); skUInt64: (AsUInt64: UInt64); skSingle: (AsSingle: Single); skDouble: (AsDouble: Double); skTimestamp: (AsTimeStamp: TDateTime); skBoolean: (AsBoolean: Boolean); skChar: (AsChar: Char); skString: (AsString: String[15]); skBytes: (AsBytes: array[0..15] of Byte); end; TScalar = record Kind: TScalarKind; Value: TScalarValue; end; // Basic data structures using the scalar type (these ar not POD of course) TScalarArray = record Kind: TScalarKind; Items: TArray; end; TScalarTuple = TArray; TScalarRecordField = record Name: String; Kind: TScalarKind; end; TScalarRecordDefinition = record Fields: TArray; end; TScalarRecord = record Def: TScalarRecordDefinition; Fields: TArray; end; TScalarSeries = record Kind: TScalarKind; Items: TSeries; end; implementation initialization Assert(sizeof(TScalarValue) = 16); end.