-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathuConstantTable.pas
More file actions
62 lines (44 loc) · 1.21 KB
/
uConstantTable.pas
File metadata and controls
62 lines (44 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
unit uConstantTable;
// Ths source is distributed under Apache 2.0
// Copyright (C) 2019-2020 Herbert M Sauro
// Author Contact Information:
// email: hsauro@gmail.com
interface
Uses Generics.Collections, uStringObject;
type
TConstantValueType = (cpDouble, cpString);
TConstantValueElement = class (TObject)
valueType : TConstantValueType;
dValue : double;
sValue : TStringObject;
constructor Create (value : double); overload;
constructor Create (value : string); overload;
destructor Destroy; override;
end;
TConstantValueTable = TObjectList<TConstantValueElement>;
var
constantValueTable : TConstantValueTable;
implementation
Uses uMemoryManager;
constructor TConstantValueElement.Create (value : double);
begin
inherited Create;
dValue := value;
valueType := cpDouble;
end;
constructor TConstantValueElement.Create (value : string);
begin
inherited Create;
sValue := TStringObject.createConstantObj (value);
valueType := cpString;
end;
destructor TConstantValueElement.Destroy;
begin
sValue.Free;
inherited;
end;
initialization
constantValueTable := TObjectList<TConstantValueElement>.Create;
finalization
constantValueTable.Free;
end.