Generic indicator factory
This commit is contained in:
@@ -35,7 +35,6 @@ type
|
||||
|
||||
procedure Copy(Src, Dst: Pointer);
|
||||
|
||||
function GetSize: Integer; inline;
|
||||
function GetAlignedSize: Integer; inline;
|
||||
|
||||
public
|
||||
@@ -44,7 +43,7 @@ type
|
||||
|
||||
property FieldType: TFieldType read FFieldType;
|
||||
property Name: string read FName;
|
||||
property Size: Integer read GetSize;
|
||||
property Size: Integer read FSize;
|
||||
property AlignedSize: Integer read GetAlignedSize;
|
||||
property TypeInfo: PTypeInfo read FTypeInfo;
|
||||
end;
|
||||
@@ -286,17 +285,9 @@ begin
|
||||
Copy(@Src, @Buffer[FOffset]);
|
||||
end;
|
||||
|
||||
function TDataRecord.TField.GetSize: Integer;
|
||||
const
|
||||
DataSize: array[TDataRecord.TFieldType] of Integer =
|
||||
(sizeof(Double), sizeof(Int64), sizeof(String), sizeof(TDateTime), sizeof(TDataRecord));
|
||||
begin
|
||||
Result := DataSize[FFieldType];
|
||||
end;
|
||||
|
||||
function TDataRecord.TField.GetAlignedSize: Integer;
|
||||
begin
|
||||
Result := (GetSize + (Align - 1)) and not (Align - 1);
|
||||
Result := (FSize + (Align - 1)) and not (Align - 1);
|
||||
end;
|
||||
|
||||
procedure TDataRecord.TField.ToType(const [ref] Buffer: TBytes; var Dst);
|
||||
|
||||
Reference in New Issue
Block a user