-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathLMS._class.Network.pas
More file actions
69 lines (50 loc) · 1.05 KB
/
LMS._class.Network.pas
File metadata and controls
69 lines (50 loc) · 1.05 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
63
64
65
66
67
68
69
unit LMS._class.Network;
interface
uses
Generics.Collections,
LMS._interface.LMS,
LMS._class.LMS;
type
TLMSNetwork = class
private
fLMSList: TList<ILMS>;
function GetLMS(index: integer): ILMS;
public
constructor Create;
destructor Destroy; override;
procedure Add(aLMS: ILMS);
function Count: cardinal;
property Items[index: integer]: ILMS read GetLMS; default;
end;
function GetGlobalNetwork: TLMSNetwork;
implementation
var
_GlobalLMSNetWork: TLMSNetwork;
function GetGlobalNetwork: TLMSNetwork;
begin
if _GlobalLMSNetWork = nil then
_GlobalLMSNetWork := TLMSNetwork.Create;
result := _GlobalLMSNetWork
end;
procedure TLMSNetwork.Add(aLMS: ILMS);
begin
fLMSList.Add(aLMS);
end;
function TLMSNetwork.Count: cardinal;
begin
result := fLMSList.Count;
end;
constructor TLMSNetwork.Create;
begin
fLMSList := TList<ILMS>.Create;
end;
destructor TLMSNetwork.Destroy;
begin
fLMSList.free;
inherited;
end;
function TLMSNetwork.GetLMS(index: integer): ILMS;
begin
result := fLMSList[index];
end;
end.