Ignore:
Timestamp:
Sep 24, 2012, 1:47:39 PM (12 years ago)
Author:
chronos
Message:
Location:
Generics/TemplateGenerics/Generic
Files:
2 added
11 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'}
Note: See TracChangeset for help on using the changeset viewer.