source: Generics/NativeGenerics/Generic/GenericTree.pas

Last change on this file was 496, checked in by chronos, 7 years ago
  • Modified: New native generics classes working under FPC 3.0 transformed from TemplateGenerics package.
File size: 550 bytes
Line 
1unit GenericTree;
2
3{$mode delphi}
4
5interface
6
7uses
8 GenericList;
9{
10type
11 TGTreeNode<T> = class
12 type
13 TTreeNodeType = TGTreeNode<T>;
14 var
15 Childs: TGList<TTreeNodeType>;
16 Value: T;
17 procedure Clear;
18 end;
19
20 TGTree<T> = class
21 TopItem: TGTreeNode<T>;
22 procedure Clear;
23 end;
24}
25
26implementation
27
28(*
29{ TGTreeNode }
30
31procedure TGTreeNode<T>.Clear;
32begin
33 Childs.Clear;
34end;
35
36{ TGTree }
37
38procedure TGTree<T>.Clear;
39begin
40 if Assigned(TopItem) then TopItem.Clear;
41end;
42
43*)
44
45end.
Note: See TracBrowser for help on using the repository browser.