Changeset 426 for Generics


Ignore:
Timestamp:
Sep 24, 2012, 1:47:39 PM (12 years ago)
Author:
chronos
Message:
Location:
Generics/TemplateGenerics
Files:
2 added
20 edited

Legend:

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

    r196 r426  
    88{$DEFINE TGMatrixRow := TGBitmapRow}
    99{$DEFINE TGMatrix := TGBitmapMatrix}
    10 {$DEFINE TGMatrixSortCompare := TGBitmapSortCompare}
    11 {$DEFINE TGMatrixToStringConverter := TGBitmapToStringConverter}
    12 {$DEFINE TGMatrixFromStringConverter := TGBitmapFromStringConverter}
    13 {$DEFINE TGMatrixMerge := TGBitmapMerge}
    1410{$DEFINE INTERFACE}
    1511{$I 'GenericMatrix.inc'}
     
    4945{$DEFINE TGMatrixRow := TGBitmapRow}
    5046{$DEFINE TGMatrix := TGBitmapMatrix}
    51 {$DEFINE TGMatrixSortCompare := TGBitmapSortCompare}
    52 {$DEFINE TGMatrixToStringConverter := TGBitmapToStringConverter}
    53 {$DEFINE TGMatrixFromStringConverter := TGBitmapFromStringConverter}
    54 {$DEFINE TGMatrixMerge := TGBitmapMerge}
    5547{$DEFINE IMPLEMENTATION}
    5648{$I 'GenericMatrix.inc'}
  • Generics/TemplateGenerics/Generic/GenericDictionary.inc

    r301 r426  
    1111{$DEFINE TGListItem := TGPair}
    1212{$DEFINE TGList := TGDictionaryList}
    13 {$DEFINE TGListSortCompare := TGDictionarySortCompare}
    14 {$DEFINE TGListToStringConverter := TGDictionaryToStringConverter}
    15 {$DEFINE TGListFromStringConverter := TGDictionaryFromStringConverter}
    16 {$DEFINE TGListItemArray := TGDictionaryItemArray}
    1713{$DEFINE INTERFACE}
    1814{$I 'GenericList.inc'}
     
    4945{$DEFINE TGListItem := TGPair}
    5046{$DEFINE TGList := TGDictionaryList}
    51 {$DEFINE TGListSortCompare := TGDictionarySortCompare}
    52 {$DEFINE TGListToStringConverter := TGDictionaryToStringConverter}
    53 {$DEFINE TGListFromStringConverter := TGDictionaryFromStringConverter}
    54 {$DEFINE TGListItemArray := TGDictionaryItemArray}
    5547{$DEFINE IMPLEMENTATION}
    5648{$I 'GenericList.inc'}
  • Generics/TemplateGenerics/Generic/GenericList.inc

    r414 r426  
    1212  // - all items operations (Clear, Reverse, Sort)
    1313
    14   TGList = class;
    15 
    16   TGListSortCompare = function(Item1, Item2: TGListItem): Integer of object;
    17   TGListToStringConverter = function(Item: TGListItem): string;
    18   TGListFromStringConverter = function(Text: string): TGListItem;
    19   TGListItemArray = array of TGListItem;
     14  TGAbstractList = class
     15
     16  end;
    2017
    2118  // TGList<TGListIndex, TGListItem> = class
    22   TGList = class
     19  TGList = class(TGAbstractList)
     20  public
     21    type
     22      PItem = ^TGListItem;
     23      TSortCompare = function(Item1, Item2: TGListItem): Integer of object;
     24      TToStringConverter = function(Item: TGListItem): string;
     25      TFromStringConverter = function(Text: string): TGListItem;
     26      TItemArray = array of TGListItem;
    2327  private
    2428    FItems: array of TGListItem;
     
    3438    procedure SetLast(AValue: TGListItem);
    3539    procedure SetFirst(AValue: TGListItem);
    36     procedure QuickSort(L, R : TGListIndex; Compare: TGListSortCompare);
     40    procedure QuickSort(L, R : TGListIndex; Compare: TSortCompare);
    3741  protected
    3842    procedure Put(Index: TGListIndex; const AValue: TGListItem); virtual;
    3943    procedure SetCount(const AValue: TGListIndex); virtual;
    4044  public
    41     type
    42       PItem = ^TGListItem;
    4345    function CompareMem(P1, P2: Pointer; Length: cardinal): Boolean; inline;
    4446    function Add(Item: TGListItem): TGListIndex;
     
    5355    function EqualTo(List: TGList): Boolean;
    5456    procedure Exchange(Index1, Index2: TGListIndex);
    55     procedure Explode(Text, Separator: string; Converter: TGListFromStringConverter; SlicesCount: Integer = -1);
     57    procedure Explode(Text, Separator: string; Converter: TFromStringConverter; SlicesCount: Integer = -1);
    5658    function Extract(Item: TGListItem): TGListItem;
    5759    property First: TGListItem read GetFirst write SetFirst;
    5860    procedure Fill(Start, Count: TGListIndex; Value: TGListItem);
    59     function GetArray(Index, ACount: TGListIndex): TGListItemArray;
     61    function GetArray(Index, ACount: TGListIndex): TItemArray;
    6062    procedure GetList(List: TGList; Index, ACount: TGListIndex);
    6163    procedure GetBuffer(Index: TGListIndex; var Buffer; Count: TGListIndex);
    62     function Implode(Separator: string; Converter: TGListToStringConverter): string;
     64    function Implode(Separator: string; Converter: TToStringConverter): string;
    6365    function IndexOf(Item: TGListItem; Start: TGListIndex = 0): TGListIndex; virtual;
    6466    function IndexOfList(List: TGList; Start: TGListIndex = 0): TGListIndex;
     
    7779      SourceIndex, SourceCount: TGListIndex);
    7880    procedure ReplaceBuffer(Index: TGListIndex; var Buffer; Count: TGListIndex);
    79     procedure Sort(Compare: TGListSortCompare);
     81    procedure Sort(Compare: TSortCompare);
    8082    procedure SetArray(Values: array of TGListItem);
    8183    procedure BeginUpdate;
     
    8890    property OnUpdate: TNotifyEvent read FOnUpdate write FOnUpdate;
    8991  end;
    90  
     92
    9193{$UNDEF INTERFACE}
    9294{$ENDIF}
     
    237239end;
    238240
    239 function TGList.GetArray(Index, ACount: TGListIndex): TGListItemArray;
     241function TGList.GetArray(Index, ACount: TGListIndex): TItemArray;
    240242var
    241243  I: Integer;
     
    255257end;
    256258
    257 procedure TGList.QuickSort(L, R: TGListIndex; Compare: TGListSortCompare);
     259procedure TGList.QuickSort(L, R: TGListIndex; Compare: TSortCompare);
    258260var
    259261  I, J: TGListIndex;
     
    524526end;
    525527
    526 procedure TGList.Sort(Compare: TGListSortCompare);
     528procedure TGList.Sort(Compare: TSortCompare);
    527529begin
    528530  if FCount > 1 then
     
    571573end;
    572574
    573 function TGList.Implode(Separator: string; Converter: TGListToStringConverter): string;
     575function TGList.Implode(Separator: string; Converter: TToStringConverter): string;
    574576var
    575577  I: TGListIndex;
     
    585587end;
    586588
    587 procedure TGList.Explode(Text, Separator: string; Converter: TGListFromStringConverter; SlicesCount: Integer = -1);
     589procedure TGList.Explode(Text, Separator: string; Converter: TFromStringConverter; SlicesCount: Integer = -1);
    588590begin
    589591  Clear;
  • Generics/TemplateGenerics/Generic/GenericListObject.inc

    r382 r426  
    44{$DEFINE TGListItem := TGListObjectItem}
    55{$DEFINE TGList := TGListObjectList}
    6 {$DEFINE TGListSortCompare := TGListObjectSortCompare}
    7 {$DEFINE TGListToStringConverter := TGListObjectToStringConverter}
    8 {$DEFINE TGListFromStringConverter := TGListObjectFromStringConverter}
    9 {$DEFINE TGListItemArray := TGListObjectItemArray}
    106{$DEFINE INTERFACE}
    117{$I 'GenericList.inc'}
     
    4238{$DEFINE TGListItem := TGListObjectItem}
    4339{$DEFINE TGList := TGListObjectList}
    44 {$DEFINE TGListSortCompare := TGListObjectSortCompare}
    45 {$DEFINE TGListToStringConverter := TGListObjectToStringConverter}
    46 {$DEFINE TGListFromStringConverter := TGListObjectFromStringConverter}
    47 {$DEFINE TGListItemArray := TGListObjectItemArray}
    4840{$DEFINE IMPLEMENTATION}
    4941{$I 'GenericList.inc'}
     
    108100begin
    109101  Clear;
    110   inherited Destroy;
     102  inherited;
    111103end;
    112104
  • Generics/TemplateGenerics/Generic/GenericListString.inc

    r312 r426  
    44{$DEFINE TGListItem := TGListStringItem}
    55{$DEFINE TGList := TGListStringList}
    6 {$DEFINE TGListSortCompare := TGListStringSortCompare}
    7 {$DEFINE TGListToStringConverter := TGListStringToStringConverter}
    8 {$DEFINE TGListFromStringConverter := TGListStringFromStringConverter}
    9 {$DEFINE TGListItemArray := TGListStringItemArray}
    106{$DEFINE INTERFACE}
    117{$I 'GenericList.inc'}
     
    3935{$DEFINE TGListItem := TGListStringItem}
    4036{$DEFINE TGList := TGListStringList}
    41 {$DEFINE TGListSortCompare := TGListStringSortCompare}
    42 {$DEFINE TGListToStringConverter := TGListStringToStringConverter}
    43 {$DEFINE TGListFromStringConverter := TGListStringFromStringConverter}
    44 {$DEFINE TGListItemArray := TGListStringItemArray}
    4537{$DEFINE IMPLEMENTATION}
    4638{$I 'GenericList.inc'}
  • Generics/TemplateGenerics/Generic/GenericMatrix.inc

    r196 r426  
     1// Work in progress...
     2
    13{$IFDEF INTERFACE}
    2 
    3   TGMatrix = class;
    4 
    5   TGMatrixSortCompare = function(const Item1, Item2: TGMatrixItem): Integer of object;
    6   TGMatrixToStringConverter = function(Item: TGMatrixItem): string;
    7   TGMatrixFromStringConverter = function(Text: string): TGMatrixItem;
    8   TGMatrixRow = array of TGMatrixItem;
    9   TGMatrixMerge = function(Item1, Item2: TGMatrixItem): TGMatrixItem of object;
    10 
    11   TGMatrixIndex = record
    12     X: TGMatrixIndexX;
    13     Y: TGMatrixIndexY;
    14   end;
    154
    165  // TGMatrix<TGMatrixIndex, TGMatrixIndex, TGMatrixItem> = class
    176  TGMatrix = class
     7  public
     8    type
     9      TSortCompare = function(const Item1, Item2: TGMatrixItem): Integer of object;
     10      TToStringConverter = function(Item: TGMatrixItem): string;
     11      TFromStringConverter = function(Text: string): TGMatrixItem;
     12      TRow = array of TGMatrixItem;
     13      TMerge = function(Item1, Item2: TGMatrixItem): TGMatrixItem of object;
     14
     15      TIndex = record
     16        X: TGMatrixIndexX;
     17        Y: TGMatrixIndexY;
     18      end;
    1819  private
    1920    FItems: array of array of TGMatrixItem;
    20     FCount: TGMatrixIndex;
     21    FCount: TIndex;
    2122    function GetItemXY(X: TGMatrixIndexX; Y: TGMatrixIndexY): TGMatrixItem;
    22     function GetItem(Index: TGMatrixIndex): TGMatrixItem;
    23     function GetCapacity: TGMatrixIndex;
     23    function GetItem(Index: TIndex): TGMatrixItem;
     24    function GetCapacity: TIndex;
    2425    function GetLast: TGMatrixItem;
    2526    function GetFirst: TGMatrixItem;
    26     procedure SetCapacity(const AValue: TGMatrixIndex);
     27    procedure SetCapacity(const AValue: TIndex);
    2728    procedure SetLast(AValue: TGMatrixItem);
    2829    procedure SetFirst(AValue: TGMatrixItem);
    2930    procedure PutItemXY(X: TGMatrixIndexX; Y: TGMatrixIndexY; const AValue: TGMatrixItem); virtual;
    30     procedure PutItem(Index: TGMatrixIndex; const AValue: TGMatrixItem); virtual;
    31     procedure SetCount(const AValue: TGMatrixIndex);
     31    procedure PutItem(Index: TIndex; const AValue: TGMatrixItem); virtual;
     32    procedure SetCount(const AValue: TIndex);
    3233  public
    33     function Add(Item: TGMatrixItem): TGMatrixIndex;
    34     procedure AddMatrix(Values: array of TGMatrixRow);
     34    function Add(Item: TGMatrixItem): TIndex;
     35    procedure AddMatrix(Values: array of TRow);
    3536    procedure AddList(List: TGMatrix);
    3637    procedure Assign(Source: TGMatrix);
    3738    procedure Clear; virtual;
    3839    procedure Contract;
    39     function CreateIndex(X: TGMatrixIndexY; Y: TGMatrixIndexX): TGMatrixIndex;
    40     procedure Delete(Index: TGMatrixIndex); virtual;
    41     procedure DeleteItems(Index, Count: TGMatrixIndex);
     40    function CreateIndex(X: TGMatrixIndexY; Y: TGMatrixIndexX): TIndex;
     41    procedure Delete(Index: TIndex); virtual;
     42    procedure DeleteItems(Index, Count: TIndex);
    4243    function EqualTo(List: TGMatrix): Boolean;
    4344    procedure Expand;
    4445    function Extract(Item: TGMatrixItem): TGMatrixItem;
    45     procedure Exchange(Index1, Index2: TGMatrixIndex);
     46    procedure Exchange(Index1, Index2: TIndex);
    4647    property First: TGMatrixItem read GetFirst write SetFirst;
    4748    procedure FillAll(Value: TGMatrixItem);
    48     procedure Fill(Start, Count: TGMatrixIndex; Value: TGMatrixItem);
    49     function Implode(RowSeparator, ColSeparator: string; Converter: TGMatrixToStringConverter): string;
    50     procedure Explode(Text, Separator: string; Converter: TGMatrixFromStringConverter; SlicesCount: Integer = -1);
    51     function IndexOf(Item: TGMatrixItem; Start: TGMatrixIndex = 0): TGMatrixIndex;
    52     function IndexOfList(List: TGMatrix; Start: TGMatrixIndex = 0): TGMatrixIndex;
    53     procedure Insert(Index: TGMatrixIndex; Item: TGMatrixItem);
    54     procedure InsertList(Index: TGMatrixIndex; List: TGMatrix);
    55     procedure InsertArray(Index: TGMatrixIndex; Values: array of TGMatrixItem);
    56     procedure Move(CurIndex, NewIndex: TGMatrixIndex);
    57     procedure MoveItems(CurIndex, NewIndex, Count: TGMatrixIndex);
    58     procedure Merge(Index: TGMatrixIndex; Source: TGMatrix; Proc: TGMatrixMerge);
    59     procedure Replace(Index: TGMatrixIndex; Source: TGMatrix);
    60     function Remove(Item: TGMatrixItem): TGMatrixIndex;
     49    procedure Fill(Start, Count: TIndex; Value: TGMatrixItem);
     50    function Implode(RowSeparator, ColSeparator: string; Converter: TToStringConverter): string;
     51    procedure Explode(Text, Separator: string; Converter: TFromStringConverter; SlicesCount: Integer = -1);
     52    function IndexOf(Item: TGMatrixItem; Start: TIndex = 0): TIndex;
     53    function IndexOfList(List: TGMatrix; Start: TIndex = 0): TIndex;
     54    procedure Insert(Index: TIndex; Item: TGMatrixItem);
     55    procedure InsertList(Index: TIndex; List: TGMatrix);
     56    procedure InsertArray(Index: TIndex; Values: array of TGMatrixItem);
     57    procedure Move(CurIndex, NewIndex: TIndex);
     58    procedure MoveItems(CurIndex, NewIndex, Count: TIndex);
     59    procedure Merge(Index: TIndex; Source: TGMatrix; Proc: TMerge);
     60    procedure Replace(Index: TIndex; Source: TGMatrix);
     61    function Remove(Item: TGMatrixItem): TIndex;
    6162    procedure Reverse;
    6263    procedure ReverseHorizontal;
    6364    procedure ReverseVertical;
    64     procedure Sort(Compare: TGMatrixSortCompare);
     65    procedure Sort(Compare: TSortCompare);
    6566    procedure SetArray(Values: array of TGMatrixItem);
    66     property Count: TGMatrixIndex read FCount write SetCount;
    67     property Capacity: TGMatrixIndex read GetCapacity write SetCapacity;
     67    property Count: TIndex read FCount write SetCount;
     68    property Capacity: TIndex read GetCapacity write SetCapacity;
    6869    property ItemsXY[X: TGMatrixIndexX; Y: TGMatrixIndexY]: TGMatrixItem
    6970      read GetItemXY write PutItemXY; default;
    70     property Items[Index: TGMatrixIndex]: TGMatrixItem
     71    property Items[Index: TIndex]: TGMatrixItem
    7172      read GetItem write PutItem;
    7273    property Last: TGMatrixItem read GetLast write SetLast;
     
    9192{ TGMatrix }
    9293
    93 procedure TGMatrix.Replace(Index: TGMatrixIndex; Source: TGMatrix);
     94procedure TGMatrix.Replace(Index: TIndex; Source: TGMatrix);
    9495var
    9596  X: TGMatrixIndexX;
     
    107108end;
    108109
    109 procedure TGMatrix.Merge(Index: TGMatrixIndex; Source: TGMatrix; Proc: TGMatrixMerge);
     110procedure TGMatrix.Merge(Index: TIndex; Source: TGMatrix; Proc: TMerge);
    110111var
    111112  X: TGMatrixIndexX;
     
    123124end;
    124125
    125 function TGMatrix.CreateIndex(X: TGMatrixIndexY; Y: TGMatrixIndexX): TGMatrixIndex;
     126function TGMatrix.CreateIndex(X: TGMatrixIndexY; Y: TGMatrixIndexX): TIndex;
    126127begin
    127128  Result.X := X;
     
    129130end;
    130131
    131 function TGMatrix.GetCapacity: TGMatrixIndex;
     132function TGMatrix.GetCapacity: TIndex;
    132133begin
    133134  Result.Y := Length(FItems);
     
    135136end;
    136137
    137 procedure TGMatrix.SetCapacity(const AValue: TGMatrixIndex);
     138procedure TGMatrix.SetCapacity(const AValue: TIndex);
    138139var
    139140  Y: TGMatrixIndexY;
     
    160161end;
    161162
    162 function TGMatrix.GetItem(Index: TGMatrixIndex): TGMatrixItem;
     163function TGMatrix.GetItem(Index: TIndex): TGMatrixItem;
    163164begin
    164165  if (Index.X < 0) or (Index.X >= Count.X) or
     
    176177end;
    177178
    178 procedure TGMatrix.PutItem(Index: TGMatrixIndex; const AValue: TGMatrixItem);
     179procedure TGMatrix.PutItem(Index: TIndex; const AValue: TGMatrixItem);
    179180begin
    180181  if (Index.X < 0) or (Index.X >= Count.X) or
     
    184185end;
    185186
    186 procedure TGMatrix.SetCount(const AValue: TGMatrixIndex);
     187procedure TGMatrix.SetCount(const AValue: TIndex);
    187188begin
    188189  Capacity := AValue;
     
    192193procedure TGMatrix.Assign(Source: TGMatrix);
    193194var
    194   Index: TGMatrixIndex;
     195  Index: TIndex;
    195196begin
    196197  Count := Source.Count;
     
    208209procedure TGMatrix.Expand;
    209210var
    210   IncSize: TGMatrixIndex;
    211   NewCapacity: TGMatrixIndex;
     211  IncSize: TIndex;
     212  NewCapacity: TIndex;
    212213begin
    213214  if (FCount.X = Capacity.X) then begin
     
    230231procedure TGMatrix.Contract;
    231232var
    232   NewCapacity: TGMatrixIndex;
     233  NewCapacity: TIndex;
    233234begin
    234235  if (Capacity.X > 256) and (FCount.X < Capacity.X shr 2) then
     
    245246function TGMatrix.Extract(Item: TGMatrixItem): TGMatrixItem;
    246247var
    247   I: TGMatrixIndex;
     248  I: TIndex;
    248249begin
    249250(*  I := IndexOf(Item);
     
    256257end;
    257258
    258 function TGMatrix.IndexOf(Item: TGMatrixItem; Start: TGMatrixIndex): TGMatrixIndex;
     259function TGMatrix.IndexOf(Item: TGMatrixItem; Start: TIndex): TIndex;
    259260begin
    260261(*  Result := Start;
     
    266267end;
    267268
    268 procedure TGMatrix.Insert(Index: TGMatrixIndex; Item: TGMatrixItem);
     269procedure TGMatrix.Insert(Index: TIndex; Item: TGMatrixItem);
    269270begin
    270271(*  if (Index < 0) or (Index > FCount ) then
     
    278279end;
    279280
    280 procedure TGMatrix.InsertList(Index: TGMatrixIndex; List: TGMatrix);
    281 var
    282   I: TGMatrixIndex;
     281procedure TGMatrix.InsertList(Index: TIndex; List: TGMatrix);
     282var
     283  I: TIndex;
    283284begin
    284285(*  I := 0;
     
    290291end;
    291292
    292 function TGMatrix.IndexOfList(List: TGMatrix; Start: TGMatrixIndex): TGMatrixIndex;
    293 var
    294   I: TGMatrixIndex;
     293function TGMatrix.IndexOfList(List: TGMatrix; Start: TIndex): TIndex;
     294var
     295  I: TIndex;
    295296begin
    296297(*  if List.Count > 0 then begin
     
    346347end;
    347348
    348 procedure TGMatrix.Move(CurIndex, NewIndex: TGMatrixIndex);
     349procedure TGMatrix.Move(CurIndex, NewIndex: TIndex);
    349350var
    350351  Temp: TGMatrixItem;
     
    366367end;
    367368
    368 procedure TGMatrix.MoveItems(CurIndex, NewIndex, Count: TGMatrixIndex);
     369procedure TGMatrix.MoveItems(CurIndex, NewIndex, Count: TIndex);
    369370var
    370371  S: Integer;
     
    391392end;
    392393
    393 function TGMatrix.Remove(Item: TGMatrixItem): TGMatrixIndex;
     394function TGMatrix.Remove(Item: TGMatrixItem): TIndex;
    394395begin
    395396(*  Result := IndexOf(Item);
     
    400401function TGMatrix.EqualTo(List: TGMatrix): Boolean;
    401402var
    402   I: TGMatrixIndex;
     403  I: TIndex;
    403404begin
    404405(*  Result := Count = List.Count;
     
    463464end;
    464465
    465 procedure TGMatrix.Sort(Compare: TGMatrixSortCompare);
     466procedure TGMatrix.Sort(Compare: TSortCompare);
    466467begin
    467468(*  if FCount > 1 then
     
    469470end;
    470471
    471 procedure TGMatrix.AddMatrix(Values: array of TGMatrixRow);
    472 var
    473   I: TGMatrixIndex;
     472procedure TGMatrix.AddMatrix(Values: array of TRow);
     473var
     474  I: TIndex;
    474475begin
    475476(*  I := 0;
     
    482483procedure TGMatrix.SetArray(Values: array of TGMatrixItem);
    483484var
    484   I: TGMatrixIndex;
     485  I: TIndex;
    485486begin
    486487(*  Clear;
     
    492493end;
    493494
    494 procedure TGMatrix.InsertArray(Index: TGMatrixIndex; Values: array of TGMatrixItem);
    495 var
    496   I: TGMatrixIndex;
     495procedure TGMatrix.InsertArray(Index: TIndex; Values: array of TGMatrixItem);
     496var
     497  I: TIndex;
    497498begin
    498499(*  I := 0;
     
    503504end;
    504505
    505 function TGMatrix.Implode(RowSeparator, ColSeparator: string; Converter: TGMatrixToStringConverter): string;
     506function TGMatrix.Implode(RowSeparator, ColSeparator: string; Converter: TToStringConverter): string;
    506507var
    507508  Y: TGMatrixIndexY;
     
    524525end;
    525526
    526 procedure TGMatrix.Explode(Text, Separator: string; Converter: TGMatrixFromStringConverter; SlicesCount: Integer = -1);
     527procedure TGMatrix.Explode(Text, Separator: string; Converter: TFromStringConverter; SlicesCount: Integer = -1);
    527528begin
    528529(*  Clear;
     
    535536end;
    536537
    537 function TGMatrix.Add(Item: TGMatrixItem): TGMatrixIndex;
     538function TGMatrix.Add(Item: TGMatrixItem): TIndex;
    538539begin
    539540(*  if FCount = Capacity then
     
    546547procedure TGMatrix.AddList(List: TGMatrix);
    547548var
    548   I: TGMatrixIndex;
     549  I: TIndex;
    549550begin
    550551(*  I := 0;
     
    561562end;
    562563
    563 procedure TGMatrix.Delete(Index: TGMatrixIndex);
     564procedure TGMatrix.Delete(Index: TIndex);
    564565begin
    565566(*  if (Index < 0) or (Index >= FCount) then
     
    571572end;
    572573
    573 procedure TGMatrix.DeleteItems(Index, Count: TGMatrixIndex);
    574 var
    575   I: TGMatrixIndex;
     574procedure TGMatrix.DeleteItems(Index, Count: TIndex);
     575var
     576  I: TIndex;
    576577begin
    577578(*  I := Index;
     
    583584end;
    584585
    585 procedure TGMatrix.Fill(Start, Count: TGMatrixIndex; Value: TGMatrixItem);
     586procedure TGMatrix.Fill(Start, Count: TIndex; Value: TGMatrixItem);
    586587var
    587588  X: TGMatrixIndexX;
     
    604605end;
    605606
    606 procedure TGMatrix.Exchange(Index1, Index2: TGMatrixIndex);
     607procedure TGMatrix.Exchange(Index1, Index2: TIndex);
    607608var
    608609  Temp: TGMatrixItem;
  • Generics/TemplateGenerics/Generic/GenericQueue.inc

    r312 r426  
    44{$DEFINE TGListItem := TGQueueItem}
    55{$DEFINE TGList := TGQueueList}
    6 {$DEFINE TGListSortCompare := TGQueueSortCompare}
    7 {$DEFINE TGListToStringConverter := TGQueueToStringConverter}
    8 {$DEFINE TGListFromStringConverter := TGQueueFromStringConverter}
    9 {$DEFINE TGListItemArray := TGQueueItemArray}
    106{$DEFINE INTERFACE}
    117{$I 'GenericList.inc'}
     
    4440{$DEFINE TGListItem := TGQueueItem}
    4541{$DEFINE TGList := TGQueueList}
    46 {$DEFINE TGListSortCompare := TGQueueSortCompare}
    47 {$DEFINE TGListToStringConverter := TGQueueToStringConverter}
    48 {$DEFINE TGListFromStringConverter := TGQueueFromStringConverter}
    49 {$DEFINE TGListItemArray := TGQueueItemArray}
    5042{$DEFINE IMPLEMENTATION}
    5143{$I 'GenericList.inc'}
  • Generics/TemplateGenerics/Generic/GenericSet.inc

    r112 r426  
    44{$DEFINE TGListItem := TGSetItem}
    55{$DEFINE TGList := TGSetList}
    6 {$DEFINE TGListSortCompare := TGSetSortCompare}
    7 {$DEFINE TGListToStringConverter := TGSetToStringConverter}
    8 {$DEFINE TGListFromStringConverter := TGSetFromStringConverter}
    9 {$DEFINE TGListItemArray := TGSetItemArray}
    106{$DEFINE INTERFACE}
    117{$I 'GenericList.inc'}
     
    3834{$DEFINE TGListItem := TGSetItem}
    3935{$DEFINE TGList := TGSetList}
    40 {$DEFINE TGListSortCompare := TGSetSortCompare}
    41 {$DEFINE TGListToStringConverter := TGSetToStringConverter}
    42 {$DEFINE TGListFromStringConverter := TGSetFromStringConverter}
    43 {$DEFINE TGListItemArray := TGSetItemArray}
    4436{$DEFINE IMPLEMENTATION}
    4537{$I 'GenericList.inc'}
  • Generics/TemplateGenerics/Generic/GenericStack.inc

    r112 r426  
    44{$DEFINE TGListItem := TGStackItem}
    55{$DEFINE TGList := TGStackList}
    6 {$DEFINE TGListSortCompare := TGStackSortCompare}
    7 {$DEFINE TGListToStringConverter := TGStackToStringConverter}
    8 {$DEFINE TGListFromStringConverter := TGStackFromStringConverter}
    9 {$DEFINE TGListItemArray := TGStackItemArray}
    106{$DEFINE INTERFACE}
    117{$I 'GenericList.inc'}
     
    3935{$DEFINE TGListItem := TGStackItem}
    4036{$DEFINE TGList := TGStackList}
    41 {$DEFINE TGListSortCompare := TGStackSortCompare}
    42 {$DEFINE TGListToStringConverter := TGStackToStringConverter}
    43 {$DEFINE TGListFromStringConverter := TGStackFromStringConverter}
    44 {$DEFINE TGListItemArray := TGStackItemArray}
    4537{$DEFINE IMPLEMENTATION}
    4638{$I 'GenericList.inc'}
  • Generics/TemplateGenerics/Generic/GenericStream.inc

    r342 r426  
    11{$IFDEF INTERFACE}
    22
    3 TGStreamItemArray = array of TGStreamItem;
    43
    54// TGStream<TGStreamIndex, TGStreamItem> = class
    65TGStream = class
    7   procedure SetSize(AValue: TGStreamIndex);
     6public
     7  type
     8    TItemArray = array of TGStreamItem;
     9private
     10procedure SetSize(AValue: TGStreamIndex);
    811  function GetSize: TGStreamIndex;
    912  procedure SetPosition(AValue: TGStreamIndex);
     
    1518  procedure WriteStream(Stream: TGStream; Count: TGStreamIndex); virtual; abstract;
    1619  function Read: TGStreamItem; virtual; abstract;
    17   function ReadArray(Count: TGStreamIndex): TGStreamItemArray; virtual; abstract;
     20  function ReadArray(Count: TGStreamIndex): TItemArray; virtual; abstract;
    1821  function ReadStream(Stream: TGStream; Count: TGStreamIndex): TGStreamIndex; virtual; abstract;
    1922  function Insert(Count: TGStreamIndex): TGStreamIndex; virtual; abstract;
  • Generics/TemplateGenerics/Generic/GenericTree.inc

    r112 r426  
    66{$DEFINE TGListItem := TGTreeNode}
    77{$DEFINE TGList := TGTreeNodeList}
    8 {$DEFINE TGListSortCompare := TGTreeSortCompare}
    9 {$DEFINE TGListToStringConverter := TGTreeToStringConverter}
    10 {$DEFINE TGListFromStringConverter := TGTreeFromStringConverter}
    11 {$DEFINE TGListItemArray := TGTreeItemArray}
    128{$DEFINE INTERFACE}
    139{$I 'GenericList.inc'}
     
    4440{$DEFINE TGListItem := TGTreeNode}
    4541{$DEFINE TGList := TGTreeNodeList}
    46 {$DEFINE TGListSortCompare := TGTreeSortCompare}
    47 {$DEFINE TGListToStringConverter := TGTreeToStringConverter}
    48 {$DEFINE TGListFromStringConverter := TGTreeFromStringConverter}
    49 {$DEFINE TGListItemArray := TGTreeItemArray}
    5042{$DEFINE IMPLEMENTATION}
    5143{$I 'GenericList.inc'}
  • Generics/TemplateGenerics/Specialized/SpecializedDictionary.pas

    r301 r426  
    1818{$DEFINE TGDictionary := TDictionaryStringString}
    1919{$DEFINE TGDictionaryList := TDictionaryStringStringList}
    20 {$DEFINE TGDictionarySortCompare := TDictionaryStringStringSortCompare}
    21 {$DEFINE TGDictionaryToStringConverter := TDictionaryStringStringToStringConverter}
    22 {$DEFINE TGDictionaryFromStringConverter := TDictionaryStringStringFromStringConverter}
    23 {$DEFINE TGDictionaryItemArray := TDictionaryStringStringItemArray}
    2420{$DEFINE INTERFACE}
    2521{$I 'GenericDictionary.inc'}
     
    3228{$DEFINE TGDictionary := TDictionaryIntegerString}
    3329{$DEFINE TGDictionaryList := TDictionaryIntegerStringList}
    34 {$DEFINE TGDictionarySortCompare := TDictionaryIntegerStringSortCompare}
    35 {$DEFINE TGDictionaryToStringConverter := TDictionaryIntegerStringToStringConverter}
    36 {$DEFINE TGDictionaryFromStringConverter := TDictionaryIntegerStringFromStringConverter}
    37 {$DEFINE TGDictionaryItemArray := TDictionaryIntegerStringItemArray}
    3830{$DEFINE INTERFACE}
    3931{$I 'GenericDictionary.inc'}
     
    5345{$DEFINE TGDictionary := TDictionaryStringString}
    5446{$DEFINE TGDictionaryList := TDictionaryStringStringList}
    55 {$DEFINE TGDictionarySortCompare := TDictionaryStringStringSortCompare}
    56 {$DEFINE TGDictionaryToStringConverter := TDictionaryStringStringToStringConverter}
    57 {$DEFINE TGDictionaryFromStringConverter := TDictionaryStringStringFromStringConverter}
    58 {$DEFINE TGDictionaryItemArray := TDictionaryStringStringItemArray}
    5947{$DEFINE IMPLEMENTATION}
    6048{$I 'GenericDictionary.inc'}
     
    6755{$DEFINE TGDictionary := TDictionaryIntegerString}
    6856{$DEFINE TGDictionaryList := TDictionaryIntegerStringList}
    69 {$DEFINE TGDictionarySortCompare := TDictionaryIntegerStringSortCompare}
    70 {$DEFINE TGDictionaryToStringConverter := TDictionaryIntegerStringToStringConverter}
    71 {$DEFINE TGDictionaryFromStringConverter := TDictionaryIntegerStringFromStringConverter}
    72 {$DEFINE TGDictionaryItemArray := TDictionaryIntegerStringItemArray}
    7357{$DEFINE IMPLEMENTATION}
    7458{$I 'GenericDictionary.inc'}
  • Generics/TemplateGenerics/Specialized/SpecializedList.pas

    r398 r426  
    1515{$DEFINE TGListItem := Integer}
    1616{$DEFINE TGList := TListInteger}
    17 {$DEFINE TGListSortCompare := TListIntegerSortCompare}
    18 {$DEFINE TGListToStringConverter := TListIntegerToStringConverter}
    19 {$DEFINE TGListFromStringConverter := TListIntegerFromStringConverter}
    20 {$DEFINE TGListItemArray := TListIntegerItemArray}
    2117{$DEFINE INTERFACE}
    2218{$I 'GenericList.inc'}
     
    2622{$DEFINE TGListItem := Boolean}
    2723{$DEFINE TGList := TListBoolean}
    28 {$DEFINE TGListSortCompare := TListBooleanSortCompare}
    29 {$DEFINE TGListToStringConverter := TListBooleanToStringConverter}
    30 {$DEFINE TGListFromStringConverter := TListBooleanFromStringConverter}
    31 {$DEFINE TGListItemArray := TListBooleanItemArray}
    3224{$DEFINE INTERFACE}
    3325{$I 'GenericList.inc'}
     
    3729{$DEFINE TGListItem := SmallInt}
    3830{$DEFINE TGList := TListSmallInt}
    39 {$DEFINE TGListSortCompare := TListSmallIntSortCompare}
    40 {$DEFINE TGListToStringConverter := TListSmallIntToStringConverter}
    41 {$DEFINE TGListFromStringConverter := TListSmallIntFromStringConverter}
    42 {$DEFINE TGListItemArray := TListSmallIntItemArray}
    4331{$DEFINE INTERFACE}
    4432{$I 'GenericList.inc'}
     
    4836{$DEFINE TGListItem := Double}
    4937{$DEFINE TGList := TListDouble}
    50 {$DEFINE TGListSortCompare := TListDoubleSortCompare}
    51 {$DEFINE TGListToStringConverter := TListDoubleToStringConverter}
    52 {$DEFINE TGListFromStringConverter := TListDoubleFromStringConverter}
    53 {$DEFINE TGListItemArray := TListDoubleItemArray}
    5438{$DEFINE INTERFACE}
    5539{$INCLUDE '..\Generic\GenericList.inc'}
     
    5943{$DEFINE TGListItem := Pointer}
    6044{$DEFINE TGList := TListPointer}
    61 {$DEFINE TGListSortCompare := TListPointerSortCompare}
    62 {$DEFINE TGListToStringConverter := TListPointerToStringConverter}
    63 {$DEFINE TGListFromStringConverter := TListPointerFromStringConverter}
    64 {$DEFINE TGListItemArray := TListPointerItemArray}
    6545{$DEFINE INTERFACE}
    6646{$I 'GenericList.inc'}
     
    7050{$DEFINE TGListStringItem := string}
    7151{$DEFINE TGListString := TListString}
    72 {$DEFINE TGListStringSortCompare := TListStringSortCompare}
    73 {$DEFINE TGListStringToStringConverter := TListStringToStringConverter}
    74 {$DEFINE TGListStringFromStringConverter := TListStringFromStringConverter}
    75 {$DEFINE TGListItemArray := TListStringItemArray}
    7652{$DEFINE INTERFACE}
    7753{$I 'GenericListString.inc'}
     
    8157{$DEFINE TGListItem := Byte}
    8258{$DEFINE TGList := TListByteBase}
    83 {$DEFINE TGListSortCompare := TListByteSortCompare}
    84 {$DEFINE TGListToStringConverter := TListByteToStringConverter}
    85 {$DEFINE TGListFromStringConverter := TListByteFromStringConverter}
    86 {$DEFINE TGListItemArray := TListByteItemArray}
    8759{$DEFINE INTERFACE}
    8860{$I 'GenericList.inc'}
     
    10375{$DEFINE TGListItem := Char}
    10476{$DEFINE TGList := TListCharBase}
    105 {$DEFINE TGListSortCompare := TListSortCompareChar}
    106 {$DEFINE TGListToStringConverter := TListToStringConverterChar}
    107 {$DEFINE TGListFromStringConverter := TListFromStringConverterChar}
    108 {$DEFINE TGListItemArray := TListStringItemArray}
    10977{$DEFINE INTERFACE}
    11078{$I 'GenericList.inc'}
     
    11583{$DEFINE TGListObjectList := TListObjectList}
    11684{$DEFINE TGListObject := TListObject}
    117 {$DEFINE TGListObjectSortCompare := TListObjectSortCompare}
    118 {$DEFINE TGListObjectToStringConverter := TListObjectToStringConverter}
    119 {$DEFINE TGListObjectFromStringConverter := TListObjectFromStringConverter}
    120 {$DEFINE TGListItemArray := TListObjectItemArray}
    12185{$DEFINE INTERFACE}
    12286{$I 'GenericListObject.inc'}
     
    138102{$DEFINE TGListItem := TMethod}
    139103{$DEFINE TGList := TListMethodBase}
    140 {$DEFINE TGListSortCompare := TListMethodSortCompare}
    141 {$DEFINE TGListToStringConverter := TListMethodToStringConverter}
    142 {$DEFINE TGListFromStringConverter := TListMethodFromStringConverter}
    143 {$DEFINE TGListItemArray := TListMethodItemArray}
    144104{$DEFINE INTERFACE}
    145105{$I 'GenericList.inc'}
     
    154114{$DEFINE TGListItem := TNotifyEvent}
    155115{$DEFINE TGList := TListNotifyEventBase}
    156 {$DEFINE TGListSortCompare := TListNotifyEventSortCompare}
    157 {$DEFINE TGListToStringConverter := TListNotifyEventToStringConverter}
    158 {$DEFINE TGListFromStringConverter := TListNotifyEventFromStringConverter}
    159 {$DEFINE TGListItemArray := TListNotifyEventItemArray}
    160116{$DEFINE INTERFACE}
    161117{$I 'GenericList.inc'}
     
    173129{$DEFINE TGListItem := TBaseEvent}
    174130{$DEFINE TGList := TListSimpleEventBase}
    175 {$DEFINE TGListSortCompare := TListSimpleEventSortCompare}
    176 {$DEFINE TGListToStringConverter := TListSimpleEventToStringConverter}
    177 {$DEFINE TGListFromStringConverter := TListSimpleEventFromStringConverter}
    178 {$DEFINE TGListItemArray := TListSimpleEventItemArray}
    179131{$DEFINE INTERFACE}
    180132{$I 'GenericList.inc'}
     
    186138
    187139
     140// TFileListByte<Integer, Byte>
     141{$DEFINE TGFileListIndex := Integer}
     142{$DEFINE TGFileListItem := Byte}
     143{$DEFINE TGFileListList := TFileListListByte}
     144{$DEFINE TGFileList := TFileListByte}
     145{$DEFINE INTERFACE}
     146{$I 'GenericFileList.inc'}
     147
    188148function StrToStr(Value: string): string;
     149
     150
     151
     152
    189153
    190154implementation
     
    197161{$DEFINE TGListItem := Integer}
    198162{$DEFINE TGList := TListInteger}
    199 {$DEFINE TGListSortCompare := TListIntegerSortCompare}
    200 {$DEFINE TGListToStringConverter := TListIntegerToStringConverter}
    201 {$DEFINE TGListFromStringConverter := TListIntegerFromStringConverter}
    202 {$DEFINE TGListItemArray := TListIntegerItemArray}
    203163{$DEFINE IMPLEMENTATION}
    204164{$I 'GenericList.inc'}
     
    208168{$DEFINE TGListItem := SmallInt}
    209169{$DEFINE TGList := TListSmallInt}
    210 {$DEFINE TGListSortCompare := TListSmallIntSortCompare}
    211 {$DEFINE TGListToStringConverter := TListSmallIntToStringConverter}
    212 {$DEFINE TGListFromStringConverter := TListSmallIntFromStringConverter}
    213 {$DEFINE TGListItemArray := TListSmallIntItemArray}
    214170{$DEFINE IMPLEMENTATION}
    215171{$I 'GenericList.inc'}
     
    219175{$DEFINE TGListItem := Boolean}
    220176{$DEFINE TGList := TListBoolean}
    221 {$DEFINE TGListSortCompare := TListBooleanSortCompare}
    222 {$DEFINE TGListToStringConverter := TListBooleanToStringConverter}
    223 {$DEFINE TGListFromStringConverter := TListBooleanFromStringConverter}
    224 {$DEFINE TGListItemArray := TListBooleanItemArray}
    225177{$DEFINE IMPLEMENTATION}
    226178{$I 'GenericList.inc'}
     
    230182{$DEFINE TGListItem := Double}
    231183{$DEFINE TGList := TListDouble}
    232 {$DEFINE TGListSortCompare := TListDoubleSortCompare}
    233 {$DEFINE TGListToStringConverter := TListDoubleToStringConverter}
    234 {$DEFINE TGListFromStringConverter := TListDoubleFromStringConverter}
    235 {$DEFINE TGListItemArray := TListDoubleItemArray}
    236184{$DEFINE IMPLEMENTATION}
    237185{$I 'GenericList.inc'}
     
    241189{$DEFINE TGListItem := Pointer}
    242190{$DEFINE TGList := TListPointer}
    243 {$DEFINE TGListSortCompare := TListPointerSortCompare}
    244 {$DEFINE TGListToStringConverter := TListPointerToStringConverter}
    245 {$DEFINE TGListFromStringConverter := TListPointerFromStringConverter}
    246 {$DEFINE TGListItemArray := TListPointerItemArray}
    247191{$DEFINE IMPLEMENTATION}
    248192{$I 'GenericList.inc'}
     
    252196{$DEFINE TGListStringItem := string}
    253197{$DEFINE TGListString := TListString}
    254 {$DEFINE TGListStringSortCompare := TListStringSortCompare}
    255 {$DEFINE TGListStringToStringConverter := TListStringToStringConverter}
    256 {$DEFINE TGListStringFromStringConverter := TListStringFromStringConverter}
    257 {$DEFINE TGListItemArray := TListStringItemArray}
    258198{$DEFINE IMPLEMENTATION}
    259199{$I 'GenericListString.inc'}
     
    263203{$DEFINE TGListItem := Byte}
    264204{$DEFINE TGList := TListByteBase}
    265 {$DEFINE TGListSortCompare := TListByteSortCompare}
    266 {$DEFINE TGListToStringConverter := TListByteToStringConverter}
    267 {$DEFINE TGListFromStringConverter := TListByteFromStringConverter}
    268 {$DEFINE TGListItemArray := TListByteItemArray}
    269205{$DEFINE IMPLEMENTATION}
    270206{$I 'GenericList.inc'}
     
    274210{$DEFINE TGListItem := Char}
    275211{$DEFINE TGList := TListCharBase}
    276 {$DEFINE TGListSortCompare := TListSortCompareChar}
    277 {$DEFINE TGListToStringConverter := TListToStringConverterChar}
    278 {$DEFINE TGListFromStringConverter := TListFromStringConverterChar}
    279 {$DEFINE TGListItemArray := TListStringItemArray}
    280212{$DEFINE IMPLEMENTATION}
    281213{$I 'GenericList.inc'}
     
    286218{$DEFINE TGListObjectList := TListObjectList}
    287219{$DEFINE TGListObject := TListObject}
    288 {$DEFINE TGListObjectSortCompare := TListObjectSortCompare}
    289 {$DEFINE TGListObjectToStringConverter := TListObjectToStringConverter}
    290 {$DEFINE TGListObjectFromStringConverter := TListObjectFromStringConverter}
    291 {$DEFINE TGListItemArray := TListObjectItemArray}
    292220{$DEFINE IMPLEMENTATION}
    293221{$I 'GenericListObject.inc'}
     
    297225{$DEFINE TGListItem := TMethod}
    298226{$DEFINE TGList := TListMethodBase}
    299 {$DEFINE TGListSortCompare := TListMethodSortCompare}
    300 {$DEFINE TGListToStringConverter := TListMethodToStringConverter}
    301 {$DEFINE TGListFromStringConverter := TListMethodFromStringConverter}
    302 {$DEFINE TGListItemArray := TListMethodItemArray}
    303227{$DEFINE IMPLEMENTATION}
    304228{$I 'GenericList.inc'}
     
    308232{$DEFINE TGListItem := TNotifyEvent}
    309233{$DEFINE TGList := TListNotifyEventBase}
    310 {$DEFINE TGListSortCompare := TListNotifyEventSortCompare}
    311 {$DEFINE TGListToStringConverter := TListNotifyEventToStringConverter}
    312 {$DEFINE TGListFromStringConverter := TListNotifyEventFromStringConverter}
    313 {$DEFINE TGListItemArray := TListNotifyEventItemArray}
    314234{$DEFINE IMPLEMENTATION}
    315235{$I 'GenericList.inc'}
     
    319239{$DEFINE TGListItem := TBaseEvent}
    320240{$DEFINE TGList := TListSimpleEventBase}
    321 {$DEFINE TGListSortCompare := TListSimpleEventSortCompare}
    322 {$DEFINE TGListToStringConverter := TListSimpleEventToStringConverter}
    323 {$DEFINE TGListFromStringConverter := TListSimpleEventFromStringConverter}
    324 {$DEFINE TGListItemArray := TListSimpleEventItemArray}
    325 {$DEFINE IMPLEMENTATION}
    326 {$I 'GenericList.inc'}
    327 
     241{$DEFINE IMPLEMENTATION}
     242{$I 'GenericList.inc'}
     243
     244// TFileListByte<Integer, Byte>
     245{$DEFINE TGFileListIndex := Integer}
     246{$DEFINE TGFileListItem := Byte}
     247{$DEFINE TGFileListList := TFileListListByte}
     248{$DEFINE TGFileList := TFileListByte}
     249{$DEFINE IMPLEMENTATION}
     250{$I 'GenericFileList.inc'}
    328251
    329252
     
    501424end;
    502425
     426
    503427end.
  • Generics/TemplateGenerics/Specialized/SpecializedMatrix.pas

    r175 r426  
    1818{$DEFINE TGMatrixRow := TMatrixIntegerRow}
    1919{$DEFINE TGMatrix := TMatrixInteger}
    20 {$DEFINE TGMatrixSortCompare := TMatrixIntegerSortCompare}
    21 {$DEFINE TGMatrixToStringConverter := TMatrixIntegerToStringConverter}
    22 {$DEFINE TGMatrixFromStringConverter := TMatrixIntegerFromStringConverter}
    23 {$DEFINE TGMatrixMerge := TMatrixIntegerMerge}
    2420{$DEFINE INTERFACE}
    2521{$I 'GenericMatrix.inc'}
     
    3228{$DEFINE TGMatrixRow := TMatrixByteRow}
    3329{$DEFINE TGMatrix := TMatrixByte}
    34 {$DEFINE TGMatrixSortCompare := TMatrixByteSortCompare}
    35 {$DEFINE TGMatrixToStringConverter := TMatrixByteToStringConverter}
    36 {$DEFINE TGMatrixFromStringConverter := TMatrixByteFromStringConverter}
    37 {$DEFINE TGMatrixMerge := TMatrixByteMerge}
    3830{$DEFINE INTERFACE}
    3931{$I 'GenericMatrix.inc'}
     
    4638{$DEFINE TGMatrixRow := TMatrixObjectRow}
    4739{$DEFINE TGMatrix := TMatrixObject}
    48 {$DEFINE TGMatrixSortCompare := TMatrixObjectSortCompare}
    49 {$DEFINE TGMatrixToStringConverter := TMatrixObjectToStringConverter}
    50 {$DEFINE TGMatrixFromStringConverter := TMatrixObjectFromStringConverter}
    51 {$DEFINE TGMatrixMerge := TMatrixStringMerge}
    5240{$DEFINE INTERFACE}
    5341{$I 'GenericMatrix.inc'}
     
    6553{$DEFINE TGMatrixRow := TMatrixIntegerRow}
    6654{$DEFINE TGMatrix := TMatrixInteger}
    67 {$DEFINE TGMatrixSortCompare := TMatrixIntegerSortCompare}
    68 {$DEFINE TGMatrixToStringConverter := TMatrixIntegerToStringConverter}
    69 {$DEFINE TGMatrixFromStringConverter := TMatrixIntegerFromStringConverter}
    70 {$DEFINE TGMatrixMerge := TMatrixIntegerMerge}
    7155{$DEFINE IMPLEMENTATION}
    7256{$I 'GenericMatrix.inc'}
     
    7963{$DEFINE TGMatrixRow := TMatrixByteRow}
    8064{$DEFINE TGMatrix := TMatrixByte}
    81 {$DEFINE TGMatrixSortCompare := TMatrixByteSortCompare}
    82 {$DEFINE TGMatrixToStringConverter := TMatrixByteToStringConverter}
    83 {$DEFINE TGMatrixFromStringConverter := TMatrixByteFromStringConverter}
    84 {$DEFINE TGMatrixMerge := TMatrixByteMerge}
    8565{$DEFINE IMPLEMENTATION}
    8666{$I 'GenericMatrix.inc'}
     
    9373{$DEFINE TGMatrixRow := TMatrixObjectRow}
    9474{$DEFINE TGMatrix := TMatrixObject}
    95 {$DEFINE TGMatrixSortCompare := TMatrixObjectSortCompare}
    96 {$DEFINE TGMatrixToStringConverter := TMatrixObjectToStringConverter}
    97 {$DEFINE TGMatrixFromStringConverter := TMatrixObjectFromStringConverter}
    98 {$DEFINE TGMatrixMerge := TMatrixStringMerge}
    9975{$DEFINE IMPLEMENTATION}
    10076{$I 'GenericMatrix.inc'}
  • Generics/TemplateGenerics/Specialized/SpecializedQueue.pas

    r112 r426  
    1616{$DEFINE TGQueue := TQueueInteger}
    1717{$DEFINE TGQueueList := TQueueListInteger}
    18 {$DEFINE TGQueueSortCompare := TQueueSortCompareInteger}
    19 {$DEFINE TGQueueToStringConverter := TQueueToStringConverterInteger}
    20 {$DEFINE TGQueueFromStringConverter := TQueueFromStringConverterInteger}
    21 {$DEFINE TGQueueItemArray := TQueueIntegerItemArray}
    2218{$DEFINE INTERFACE}
    2319{$I 'GenericQueue.inc'}
     
    2824{$DEFINE TGQueue := TQueuePointer}
    2925{$DEFINE TGQueueList := TQueueListPointer}
    30 {$DEFINE TGQueueSortCompare := TQueueSortComparePointer}
    31 {$DEFINE TGQueueToStringConverter := TQueueToStringConverterPointer}
    32 {$DEFINE TGQueueFromStringConverter := TQueueFromStringConverterPointer}
    33 {$DEFINE TGQueueItemArray := TQueuePointerItemArray}
    3426{$DEFINE INTERFACE}
    3527{$I 'GenericQueue.inc'}
     
    4032{$DEFINE TGQueue := TQueueByte}
    4133{$DEFINE TGQueueList := TQueueListByte}
    42 {$DEFINE TGQueueSortCompare := TQueueSortCompareByte}
    43 {$DEFINE TGQueueToStringConverter := TQueueToStringConverterByte}
    44 {$DEFINE TGQueueFromStringConverter := TQueueFromStringConverterByte}
    45 {$DEFINE TGQueueItemArray := TQueueByteItemArray}
    4634{$DEFINE INTERFACE}
    4735{$I 'GenericQueue.inc'}
     
    5745{$DEFINE TGQueue := TQueueInteger}
    5846{$DEFINE TGQueueList := TQueueListInteger}
    59 {$DEFINE TGQueueSortCompare := TQueueSortCompareInteger}
    60 {$DEFINE TGQueueToStringConverter := TQueueToStringConverterInteger}
    61 {$DEFINE TGQueueFromStringConverter := TQueueFromStringConverterInteger}
    62 {$DEFINE TGQueueItemArray := TQueueIntegerItemArray}
    6347{$DEFINE IMPLEMENTATION}
    6448{$I '..\Generic\GenericQueue.inc'}
     
    6953{$DEFINE TGQueue := TQueuePointer}
    7054{$DEFINE TGQueueList := TQueueListPointer}
    71 {$DEFINE TGQueueSortCompare := TQueueSortComparePointer}
    72 {$DEFINE TGQueueToStringConverter := TQueueToStringConverterPointer}
    73 {$DEFINE TGQueueFromStringConverter := TQueueFromStringConverterPointer}
    74 {$DEFINE TGQueueItemArray := TQueuePointerItemArray}
    7555{$DEFINE IMPLEMENTATION}
    7656{$I 'GenericQueue.inc'}
     
    8161{$DEFINE TGQueue := TQueueByte}
    8262{$DEFINE TGQueueList := TQueueListByte}
    83 {$DEFINE TGQueueSortCompare := TQueueSortCompareByte}
    84 {$DEFINE TGQueueToStringConverter := TQueueToStringConverterByte}
    85 {$DEFINE TGQueueFromStringConverter := TQueueFromStringConverterByte}
    86 {$DEFINE TGQueueItemArray := TQueueByteItemArray}
    8763{$DEFINE IMPLEMENTATION}
    8864{$I 'GenericQueue.inc'}
  • Generics/TemplateGenerics/Specialized/SpecializedSet.pas

    r112 r426  
    1616{$DEFINE TGSetList := TSetListInteger}
    1717{$DEFINE TGSet := TSetInteger}
    18 {$DEFINE TGSetSortCompare := TSetSortCompareInteger}
    19 {$DEFINE TGSetToStringConverter := TSetToStringConverterInteger}
    20 {$DEFINE TGSetFromStringConverter := TSetFromStringConverterInteger}
    21 {$DEFINE TGSetItemArray := TSetIntegerItemArray}
    2218{$DEFINE INTERFACE}
    2319{$I 'GenericSet.inc'}
     
    2824{$DEFINE TGSetList := TSetListPointer}
    2925{$DEFINE TGSet := TSetPointer}
    30 {$DEFINE TGSetSortCompare := TSetSortComparePointer}
    31 {$DEFINE TGSetToStringConverter := TSetToStringConverterPointer}
    32 {$DEFINE TGSetFromStringConverter := TSetFromStringConverterPointer}
    33 {$DEFINE TGSetItemArray := TSetPointerItemArray}
    3426{$DEFINE INTERFACE}
    3527{$I 'GenericSet.inc'}
     
    4537{$DEFINE TGSetList := TSetListInteger}
    4638{$DEFINE TGSet := TSetInteger}
    47 {$DEFINE TGSetSortCompare := TSetSortCompareInteger}
    48 {$DEFINE TGSetToStringConverter := TSetToStringConverterInteger}
    49 {$DEFINE TGSetFromStringConverter := TSetFromStringConverterInteger}
    50 {$DEFINE TGSetItemArray := TSetIntegerItemArray}
    5139{$DEFINE IMPLEMENTATION}
    5240{$I 'GenericSet.inc'}
     
    5745{$DEFINE TGSetList := TSetListPointer}
    5846{$DEFINE TGSet := TSetPointer}
    59 {$DEFINE TGSetSortCompare := TSetSortComparePointer}
    60 {$DEFINE TGSetToStringConverter := TSetToStringConverterPointer}
    61 {$DEFINE TGSetFromStringConverter := TSetFromStringConverterPointer}
    62 {$DEFINE TGSetItemArray := TSetPointerItemArray}
    6347{$DEFINE IMPLEMENTATION}
    6448{$I 'GenericSet.inc'}
  • Generics/TemplateGenerics/Specialized/SpecializedStack.pas

    r112 r426  
    1616{$DEFINE TGStackList := TListStackInteger}
    1717{$DEFINE TGStack := TStackInteger}
    18 {$DEFINE TGStackSortCompare := TStackSortCompareInteger}
    19 {$DEFINE TGStackToStringConverter := TStackToStringConverterInteger}
    20 {$DEFINE TGStackFromStringConverter := TStackFromStringConverterInteger}
    21 {$DEFINE TGStackItemArray := TStackIntegerItemArray}
    2218{$DEFINE INTERFACE}
    2319{$I 'GenericStack.inc'}
     
    2824{$DEFINE TGStackList := TListStackPointer}
    2925{$DEFINE TGStack := TStackPointer}
    30 {$DEFINE TGStackSortCompare := TStackSortComparePointer}
    31 {$DEFINE TGStackToStringConverter := TStackToStringConverterPointer}
    32 {$DEFINE TGStackFromStringConverter := TStackFromStringConverterPointer}
    33 {$DEFINE TGStackItemArray := TStackStringItemArray}
    3426{$DEFINE INTERFACE}
    3527{$I 'GenericStack.inc'}
     
    4638{$DEFINE TGStackList := TListStackInteger}
    4739{$DEFINE TGStack := TStackInteger}
    48 {$DEFINE TGStackSortCompare := TStackSortCompareInteger}
    49 {$DEFINE TGStackToStringConverter := TStackToStringConverterInteger}
    50 {$DEFINE TGStackFromStringConverter := TStackFromStringConverterInteger}
    51 {$DEFINE TGStackItemArray := TStackIntegerItemArray}
    5240{$DEFINE IMPLEMENTATION}
    5341{$I 'GenericStack.inc'}
     
    5846{$DEFINE TGStackList := TListStackPointer}
    5947{$DEFINE TGStack := TStackPointer}
    60 {$DEFINE TGStackSortCompare := TStackSortComparePointer}
    61 {$DEFINE TGStackToStringConverter := TStackToStringConverterPointer}
    62 {$DEFINE TGStackFromStringConverter := TStackFromStringConverterPointer}
    63 {$DEFINE TGStackItemArray := TStackStringItemArray}
    6448{$DEFINE IMPLEMENTATION}
    6549{$I 'GenericStack.inc'}
  • Generics/TemplateGenerics/Specialized/SpecializedStream.pas

    r342 r426  
    1818{$DEFINE TGStreamList := TListStreamInteger}
    1919{$DEFINE TGStream := TStreamInteger}
    20 {$DEFINE TGStreamSortCompare := TStreamIntegerSortCompare}
    21 {$DEFINE TGStreamToStringConverter := TStreamIntegerToStringConverter}
    22 {$DEFINE TGStreamFromStringConverter := TStreamIntegerFromStringConverter}
    23 {$DEFINE TGStreamItemArray := TStreamIntegerItemArray}
    2420{$DEFINE INTERFACE}
    2521{$I 'GenericStream.inc'}
     
    3026{$DEFINE TGStreamList := TListStreamByte}
    3127{$DEFINE TGStream := TBaseStreamByte}
    32 {$DEFINE TGStreamSortCompare := TStreamByteSortCompare}
    33 {$DEFINE TGStreamToStringConverter := TStreamByteToStringConverter}
    34 {$DEFINE TGStreamFromStringConverter := TStreamByteFromStringConverter}
    35 {$DEFINE TGStreamItemArray := TStreamByteItemArray}
    3628{$DEFINE INTERFACE}
    3729{$I 'GenericStream.inc'}
     
    4234{$DEFINE TGStreamList := TListStreamPointer}
    4335{$DEFINE TGStream := TStreamPointer}
    44 {$DEFINE TGStreamSortCompare := TStreamPointerSortCompare}
    45 {$DEFINE TGStreamToStringConverter := TStreamPointerToStringConverter}
    46 {$DEFINE TGStreamFromStringConverter := TStreamPointerFromStringConverter}
    47 {$DEFINE TGStreamItemArray := TStreamPointerItemArray}
    4836{$DEFINE INTERFACE}
    4937{$I 'GenericStream.inc'}
     
    6957    procedure WriteStream(Stream: TBaseStreamByte; Count: Integer); override;
    7058    function Read: Byte; override;
    71     function ReadArray(Count: Integer): TStreamByteItemArray; override;
     59    function ReadArray(Count: Integer): TItemArray; override;
    7260    function ReadList(List: TListByte; Count: Integer): Integer;
    7361    function ReadBuffer(var Buffer; Count: Integer): Integer; override;
     
    134122end;
    135123
    136 function TMemoryStreamByte.ReadArray(Count: Integer): TStreamByteItemArray;
     124function TMemoryStreamByte.ReadArray(Count: Integer): TItemArray;
    137125begin
    138126  Result := FList.GetArray(FPosition, Count);
     
    211199{$DEFINE TGStreamList := TListStreamInteger}
    212200{$DEFINE TGStream := TStreamInteger}
    213 {$DEFINE TGStreamSortCompare := TStreamIntegerSortCompare}
    214 {$DEFINE TGStreamToStringConverter := TStreamIntegerToStringConverter}
    215 {$DEFINE TGStreamFromStringConverter := TStreamIntegerFromStringConverter}
    216 {$DEFINE TGStreamItemArray := TStreamIntegerItemArray}
    217201{$DEFINE IMPLEMENTATION}
    218202{$I 'GenericStream.inc'}
     
    223207{$DEFINE TGStreamList := TListStreamByte}
    224208{$DEFINE TGStream := TBaseStreamByte}
    225 {$DEFINE TGStreamSortCompare := TStreamByteSortCompare}
    226 {$DEFINE TGStreamToStringConverter := TStreamByteToStringConverter}
    227 {$DEFINE TGStreamFromStringConverter := TStreamByteFromStringConverter}
    228 {$DEFINE TGStreamItemArray := TStreamByteItemArray}
    229209{$DEFINE IMPLEMENTATION}
    230210{$I 'GenericStream.inc'}
     
    235215{$DEFINE TGStreamList := TListStreamPointer}
    236216{$DEFINE TGStream := TStreamPointer}
    237 {$DEFINE TGStreamSortCompare := TStreamPointerSortCompare}
    238 {$DEFINE TGStreamToStringConverter := TStreamPointerToStringConverter}
    239 {$DEFINE TGStreamFromStringConverter := TStreamPointerFromStringConverter}
    240 {$DEFINE TGStreamItemArray := TStreamPointerItemArray}
    241217{$DEFINE IMPLEMENTATION}
    242218{$I 'GenericStream.inc'}
  • Generics/TemplateGenerics/Specialized/SpecializedTree.pas

    r112 r426  
    1616{$DEFINE TGTreeNode := TTreeNodeInteger}
    1717{$DEFINE TGTreeNodeList := TTreeNodeListInteger}
    18 {$DEFINE TGTreeSortCompare := TTreeSortCompareInteger}
    19 {$DEFINE TGTreeToStringConverter := TTreeToStringConverterInteger}
    20 {$DEFINE TGTreeFromStringConverter := TTreeFromStringConverterInteger}
    21 {$DEFINE TGTreeItemArray := TTreeIntegerItemArray}
    2218{$DEFINE INTERFACE}
    2319{$I 'GenericTree.inc'}
     
    2925{$DEFINE TGTreeNode := TTreeNodeString}
    3026{$DEFINE TGTreeNodeList := TTreeNodeListString}
    31 {$DEFINE TGTreeSortCompare := TTreeSortCompareString}
    32 {$DEFINE TGTreeToStringConverter := TTreeToStringConverterString}
    33 {$DEFINE TGTreeFromStringConverter := TTreeFromStringConverterString}
    34 {$DEFINE TGTreeItemArray := TTreeStringItemArray}
    3527{$DEFINE INTERFACE}
    3628{$I 'GenericTree.inc'}
     
    4234{$DEFINE TGTreeNode := TTreeNodePointer}
    4335{$DEFINE TGTreeNodeList := TTreeNodeListPointer}
    44 {$DEFINE TGTreeSortCompare := TTreeSortComparePointer}
    45 {$DEFINE TGTreeToStringConverter := TTreeToStringConverterPointer}
    46 {$DEFINE TGTreeFromStringConverter := TTreeFromStringConverterPointer}
    47 {$DEFINE TGTreeItemArray := TTreePointerItemArray}
    4836{$DEFINE INTERFACE}
    4937{$I 'GenericTree.inc'}
     
    6048{$DEFINE TGTreeNode := TTreeNodeInteger}
    6149{$DEFINE TGTreeNodeList := TTreeNodeListInteger}
    62 {$DEFINE TGTreeSortCompare := TTreeSortCompareInteger}
    63 {$DEFINE TGTreeToStringConverter := TTreeToStringConverterInteger}
    64 {$DEFINE TGTreeFromStringConverter := TTreeFromStringConverterInteger}
    65 {$DEFINE TGTreeItemArray := TTreeIntegerItemArray}
    6650{$DEFINE IMPLEMENTATION}
    6751{$I 'GenericTree.inc'}
     
    7357{$DEFINE TGTreeNode := TTreeNodeString}
    7458{$DEFINE TGTreeNodeList := TTreeNodeListString}
    75 {$DEFINE TGTreeSortCompare := TTreeSortCompareString}
    76 {$DEFINE TGTreeToStringConverter := TTreeToStringConverterString}
    77 {$DEFINE TGTreeFromStringConverter := TTreeFromStringConverterString}
    78 {$DEFINE TGTreeItemArray := TTreeStringItemArray}
    7959{$DEFINE IMPLEMENTATION}
    8060{$I 'GenericTree.inc'}
     
    8666{$DEFINE TGTreeNode := TTreeNodePointer}
    8767{$DEFINE TGTreeNodeList := TTreeNodeListPointer}
    88 {$DEFINE TGTreeSortCompare := TTreeSortComparePointer}
    89 {$DEFINE TGTreeToStringConverter := TTreeToStringConverterPointer}
    90 {$DEFINE TGTreeFromStringConverter := TTreeFromStringConverterPointer}
    91 {$DEFINE TGTreeItemArray := TTreePointerItemArray}
    9268{$DEFINE IMPLEMENTATION}
    9369{$I 'GenericTree.inc'}
  • Generics/TemplateGenerics/TemplateGenerics.lpk

    r379 r426  
    2929    <Description Value="Generic classes implemented as templates."/>
    3030    <Version Minor="4"/>
    31     <Files Count="27">
     31    <Files Count="28">
    3232      <Item1>
    3333        <Filename Value="ReadMe.txt"/>
     
    4747      </Item4>
    4848      <Item5>
    49         <Filename Value="Generic\GenericQueue.inc"/>
    50         <Type Value="Include"/>
     49        <Filename Value="Generic\GenericFileList.inc"/>
    5150      </Item5>
    5251      <Item6>
    53         <Filename Value="Generic\GenericRange.inc"/>
     52        <Filename Value="Generic\GenericQueue.inc"/>
    5453        <Type Value="Include"/>
    5554      </Item6>
    5655      <Item7>
    57         <Filename Value="Generic\GenericSet.inc"/>
     56        <Filename Value="Generic\GenericRange.inc"/>
    5857        <Type Value="Include"/>
    5958      </Item7>
    6059      <Item8>
    61         <Filename Value="Generic\GenericStack.inc"/>
     60        <Filename Value="Generic\GenericSet.inc"/>
    6261        <Type Value="Include"/>
    6362      </Item8>
    6463      <Item9>
    65         <Filename Value="Generic\GenericTree.inc"/>
     64        <Filename Value="Generic\GenericStack.inc"/>
    6665        <Type Value="Include"/>
    6766      </Item9>
    6867      <Item10>
     68        <Filename Value="Generic\GenericTree.inc"/>
     69        <Type Value="Include"/>
     70      </Item10>
     71      <Item11>
    6972        <Filename Value="Generic\GenericMatrix.inc"/>
    7073        <UnitName Value="GenericMatrix"/>
    71       </Item10>
    72       <Item11>
     74      </Item11>
     75      <Item12>
    7376        <Filename Value="Generic\GenericListString.inc"/>
    7477        <UnitName Value="GenericListString"/>
    75       </Item11>
    76       <Item12>
     78      </Item12>
     79      <Item13>
    7780        <Filename Value="Generic\GenericBitmap.inc"/>
    7881        <UnitName Value="GenericBitmap"/>
    79       </Item12>
    80       <Item13>
     82      </Item13>
     83      <Item14>
    8184        <Filename Value="Generic\GenericPoint.inc"/>
    8285        <Type Value="Include"/>
    83       </Item13>
    84       <Item14>
     86      </Item14>
     87      <Item15>
    8588        <Filename Value="Generic\GenericStream.inc"/>
    8689        <UnitName Value="GenericStream"/>
    87       </Item14>
    88       <Item15>
     90      </Item15>
     91      <Item16>
    8992        <Filename Value="Generic\GenericRectangle.inc"/>
    9093        <UnitName Value="GenericRectangle"/>
    91       </Item15>
    92       <Item16>
     94      </Item16>
     95      <Item17>
    9396        <Filename Value="Specialized\SpecializedList.pas"/>
    9497        <UnitName Value="SpecializedList"/>
    95       </Item16>
    96       <Item17>
     98      </Item17>
     99      <Item18>
    97100        <Filename Value="Specialized\SpecializedDictionary.pas"/>
    98101        <UnitName Value="SpecializedDictionary"/>
    99       </Item17>
    100       <Item18>
     102      </Item18>
     103      <Item19>
    101104        <Filename Value="Specialized\SpecializedStack.pas"/>
    102105        <UnitName Value="SpecializedStack"/>
    103       </Item18>
    104       <Item19>
     106      </Item19>
     107      <Item20>
    105108        <Filename Value="Specialized\SpecializedTree.pas"/>
    106109        <UnitName Value="SpecializedTree"/>
    107       </Item19>
    108       <Item20>
     110      </Item20>
     111      <Item21>
    109112        <Filename Value="Specialized\SpecializedQueue.pas"/>
    110113        <UnitName Value="SpecializedQueue"/>
    111       </Item20>
    112       <Item21>
     114      </Item21>
     115      <Item22>
    113116        <Filename Value="Specialized\SpecializedSet.pas"/>
    114117        <UnitName Value="SpecializedSet"/>
    115       </Item21>
    116       <Item22>
     118      </Item22>
     119      <Item23>
    117120        <Filename Value="Specialized\SpecializedPoint.pas"/>
    118121        <UnitName Value="SpecializedPoint"/>
    119       </Item22>
    120       <Item23>
     122      </Item23>
     123      <Item24>
    121124        <Filename Value="Specialized\SpecializedMatrix.pas"/>
    122125        <UnitName Value="SpecializedMatrix"/>
    123       </Item23>
    124       <Item24>
     126      </Item24>
     127      <Item25>
    125128        <Filename Value="Specialized\SpecializedBitmap.pas"/>
    126129        <UnitName Value="SpecializedBitmap"/>
    127       </Item24>
    128       <Item25>
     130      </Item25>
     131      <Item26>
    129132        <Filename Value="Specialized\SpecializedStream.pas"/>
    130133        <UnitName Value="SpecializedStream"/>
    131       </Item25>
    132       <Item26>
     134      </Item26>
     135      <Item27>
    133136        <Filename Value="Specialized\SpecializedRectangle.pas"/>
    134137        <UnitName Value="SpecializedRectangle"/>
    135       </Item26>
    136       <Item27>
     138      </Item27>
     139      <Item28>
    137140        <Filename Value="Additional\UBinarySerializer.pas"/>
    138141        <UnitName Value="UBinarySerializer"/>
    139       </Item27>
     142      </Item28>
    140143    </Files>
    141144    <Type Value="RunAndDesignTime"/>
Note: See TracChangeset for help on using the changeset viewer.