-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathUnitMapping.pas
58 lines (49 loc) · 1.27 KB
/
UnitMapping.pas
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
unit UnitMapping;
interface
uses
Classes, Types, Generics.Collections, LineMapping, BreakPoint;
type
TUnitMapping = class
private
FD16UnitName: string;
FNullLine: TLineMapping;
FMapping: TObjectList<TLineMapping>;
FBreakPoints: TObjectList<TBreakPoint>;
public
constructor Create();
destructor Destroy(); override;
function GetLineMappingByUnitLine(ALine: Integer): TLineMapping;
property D16UnitName: string read FD16UnitName write FD16UnitName;
property Mapping: TObjectList<TLineMapping> read FMapping;
property BreakPoints: TObjectList<TBreakPoint> read FBreakPoints;
end;
implementation
{ TUnitMapping }
constructor TUnitMapping.Create;
begin
FMapping := TObjectList<TLineMapping>.Create();
FBreakPoints := TObjectList<TBreakPoint>.Create();
FNullLine := TLineMapping.Create();
end;
destructor TUnitMapping.Destroy;
begin
FMapping.Free;
FBreakPoints.Free;
FNullLine.Free;
inherited;
end;
function TUnitMapping.GetLineMappingByUnitLine(ALine: Integer): TLineMapping;
var
LLine: TLineMapping;
begin
Result := FNullLine;
for LLine in FMapping do
begin
if LLine.UnitLine = ALine then
begin
Result := LLine;
Break;
end;
end;
end;
end.