Ignore:
Timestamp:
Oct 31, 2010, 3:14:23 PM (14 years ago)
Author:
george
Message:
  • Modified: Thanks to compiler directives and simple macros specialized types was moved to one unit per base generic class. Directive $DEFINE is used to specify generic class template parameters which will be included to code. This approach enable to define more specialized types per unit.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Generics/TemplateGenerics/Generic/GenericTree.inc

    r83 r84  
    33  TGTreeNode = class;
    44
    5   TListIndex = TTreeIndex;
    6   TListItem = TGTreeNode;
    7   {$DEFINE INTERFACE}
    8   {$INCLUDE 'GenericList.inc'}
     5{$DEFINE TGListIndex := TGTreeIndex}
     6{$DEFINE TGListItem := TGTreeNode}
     7{$DEFINE TGList := TGTreeNodeList}
     8{$DEFINE TGListSortCompare := TGTreeSortCompare}
     9{$DEFINE TGListStringConverter := TGTreeStringConverter}
     10{$DEFINE INTERFACE}
     11{$INCLUDE 'GenericList.inc'}
    912
    10   TTreeNodeList = class(TGList)
    11   end;
    12 
    13   // TGTreeNode<TTreeIndex, TTreeItem> = class
     13  // TGTreeNode<TGTreeIndex, TGTreeItem> = class
    1414  TGTreeNode = class
    15     Childs: TTreeNodeList;
    16     Value: TTreeItem;
     15    Childs: TGTreeNodeList;
     16    Value: TGTreeItem;
    1717    procedure Clear;
    1818  end;
    1919
    20   // TGTree<TTreeIndex, TTreeItem> = class
     20  // TGTree<TGTreeIndex, TGTreeItem> = class
    2121  TGTree = class
    2222    TopItem: TGTreeNode;
     
    2727{$ENDIF}
    2828
     29{$IFDEF IMPLEMENTATION_USES}
     30
     31  {$DEFINE IMPLEMENTATION_USES}
     32  {$INCLUDE 'GenericList.inc'}
     33
     34{$UNDEF INTERFACE_USES}
     35{$ENDIF}
     36
     37
    2938{$IFDEF IMPLEMENTATION}
     39{$UNDEF IMPLEMENTATION}
    3040
     41{$DEFINE TGListIndex := TGTreeIndex}
     42{$DEFINE TGListItem := TGTreeNode}
     43{$DEFINE TGList := TGTreeNodeList}
     44{$DEFINE TGListSortCompare := TGTreeSortCompare}
     45{$DEFINE TGListStringConverter := TGTreeStringConverter}
    3146{$DEFINE IMPLEMENTATION}
    3247{$INCLUDE 'GenericList.inc'}
     
    4661end;
    4762
     63{$UNDEF IMPLEMENTATION}
    4864{$ENDIF}
Note: See TracChangeset for help on using the changeset viewer.