Changeset 426 for Generics/TemplateGenerics/Generic
- Timestamp:
- Sep 24, 2012, 1:47:39 PM (12 years ago)
- Location:
- Generics/TemplateGenerics/Generic
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
Generics/TemplateGenerics/Generic/GenericBitmap.inc
r196 r426 8 8 {$DEFINE TGMatrixRow := TGBitmapRow} 9 9 {$DEFINE TGMatrix := TGBitmapMatrix} 10 {$DEFINE TGMatrixSortCompare := TGBitmapSortCompare}11 {$DEFINE TGMatrixToStringConverter := TGBitmapToStringConverter}12 {$DEFINE TGMatrixFromStringConverter := TGBitmapFromStringConverter}13 {$DEFINE TGMatrixMerge := TGBitmapMerge}14 10 {$DEFINE INTERFACE} 15 11 {$I 'GenericMatrix.inc'} … … 49 45 {$DEFINE TGMatrixRow := TGBitmapRow} 50 46 {$DEFINE TGMatrix := TGBitmapMatrix} 51 {$DEFINE TGMatrixSortCompare := TGBitmapSortCompare}52 {$DEFINE TGMatrixToStringConverter := TGBitmapToStringConverter}53 {$DEFINE TGMatrixFromStringConverter := TGBitmapFromStringConverter}54 {$DEFINE TGMatrixMerge := TGBitmapMerge}55 47 {$DEFINE IMPLEMENTATION} 56 48 {$I 'GenericMatrix.inc'} -
Generics/TemplateGenerics/Generic/GenericDictionary.inc
r301 r426 11 11 {$DEFINE TGListItem := TGPair} 12 12 {$DEFINE TGList := TGDictionaryList} 13 {$DEFINE TGListSortCompare := TGDictionarySortCompare}14 {$DEFINE TGListToStringConverter := TGDictionaryToStringConverter}15 {$DEFINE TGListFromStringConverter := TGDictionaryFromStringConverter}16 {$DEFINE TGListItemArray := TGDictionaryItemArray}17 13 {$DEFINE INTERFACE} 18 14 {$I 'GenericList.inc'} … … 49 45 {$DEFINE TGListItem := TGPair} 50 46 {$DEFINE TGList := TGDictionaryList} 51 {$DEFINE TGListSortCompare := TGDictionarySortCompare}52 {$DEFINE TGListToStringConverter := TGDictionaryToStringConverter}53 {$DEFINE TGListFromStringConverter := TGDictionaryFromStringConverter}54 {$DEFINE TGListItemArray := TGDictionaryItemArray}55 47 {$DEFINE IMPLEMENTATION} 56 48 {$I 'GenericList.inc'} -
Generics/TemplateGenerics/Generic/GenericList.inc
r414 r426 12 12 // - all items operations (Clear, Reverse, Sort) 13 13 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; 20 17 21 18 // 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; 23 27 private 24 28 FItems: array of TGListItem; … … 34 38 procedure SetLast(AValue: TGListItem); 35 39 procedure SetFirst(AValue: TGListItem); 36 procedure QuickSort(L, R : TGListIndex; Compare: T GListSortCompare);40 procedure QuickSort(L, R : TGListIndex; Compare: TSortCompare); 37 41 protected 38 42 procedure Put(Index: TGListIndex; const AValue: TGListItem); virtual; 39 43 procedure SetCount(const AValue: TGListIndex); virtual; 40 44 public 41 type42 PItem = ^TGListItem;43 45 function CompareMem(P1, P2: Pointer; Length: cardinal): Boolean; inline; 44 46 function Add(Item: TGListItem): TGListIndex; … … 53 55 function EqualTo(List: TGList): Boolean; 54 56 procedure Exchange(Index1, Index2: TGListIndex); 55 procedure Explode(Text, Separator: string; Converter: T GListFromStringConverter; SlicesCount: Integer = -1);57 procedure Explode(Text, Separator: string; Converter: TFromStringConverter; SlicesCount: Integer = -1); 56 58 function Extract(Item: TGListItem): TGListItem; 57 59 property First: TGListItem read GetFirst write SetFirst; 58 60 procedure Fill(Start, Count: TGListIndex; Value: TGListItem); 59 function GetArray(Index, ACount: TGListIndex): T GListItemArray;61 function GetArray(Index, ACount: TGListIndex): TItemArray; 60 62 procedure GetList(List: TGList; Index, ACount: TGListIndex); 61 63 procedure GetBuffer(Index: TGListIndex; var Buffer; Count: TGListIndex); 62 function Implode(Separator: string; Converter: T GListToStringConverter): string;64 function Implode(Separator: string; Converter: TToStringConverter): string; 63 65 function IndexOf(Item: TGListItem; Start: TGListIndex = 0): TGListIndex; virtual; 64 66 function IndexOfList(List: TGList; Start: TGListIndex = 0): TGListIndex; … … 77 79 SourceIndex, SourceCount: TGListIndex); 78 80 procedure ReplaceBuffer(Index: TGListIndex; var Buffer; Count: TGListIndex); 79 procedure Sort(Compare: T GListSortCompare);81 procedure Sort(Compare: TSortCompare); 80 82 procedure SetArray(Values: array of TGListItem); 81 83 procedure BeginUpdate; … … 88 90 property OnUpdate: TNotifyEvent read FOnUpdate write FOnUpdate; 89 91 end; 90 92 91 93 {$UNDEF INTERFACE} 92 94 {$ENDIF} … … 237 239 end; 238 240 239 function TGList.GetArray(Index, ACount: TGListIndex): T GListItemArray;241 function TGList.GetArray(Index, ACount: TGListIndex): TItemArray; 240 242 var 241 243 I: Integer; … … 255 257 end; 256 258 257 procedure TGList.QuickSort(L, R: TGListIndex; Compare: T GListSortCompare);259 procedure TGList.QuickSort(L, R: TGListIndex; Compare: TSortCompare); 258 260 var 259 261 I, J: TGListIndex; … … 524 526 end; 525 527 526 procedure TGList.Sort(Compare: T GListSortCompare);528 procedure TGList.Sort(Compare: TSortCompare); 527 529 begin 528 530 if FCount > 1 then … … 571 573 end; 572 574 573 function TGList.Implode(Separator: string; Converter: T GListToStringConverter): string;575 function TGList.Implode(Separator: string; Converter: TToStringConverter): string; 574 576 var 575 577 I: TGListIndex; … … 585 587 end; 586 588 587 procedure TGList.Explode(Text, Separator: string; Converter: T GListFromStringConverter; SlicesCount: Integer = -1);589 procedure TGList.Explode(Text, Separator: string; Converter: TFromStringConverter; SlicesCount: Integer = -1); 588 590 begin 589 591 Clear; -
Generics/TemplateGenerics/Generic/GenericListObject.inc
r382 r426 4 4 {$DEFINE TGListItem := TGListObjectItem} 5 5 {$DEFINE TGList := TGListObjectList} 6 {$DEFINE TGListSortCompare := TGListObjectSortCompare}7 {$DEFINE TGListToStringConverter := TGListObjectToStringConverter}8 {$DEFINE TGListFromStringConverter := TGListObjectFromStringConverter}9 {$DEFINE TGListItemArray := TGListObjectItemArray}10 6 {$DEFINE INTERFACE} 11 7 {$I 'GenericList.inc'} … … 42 38 {$DEFINE TGListItem := TGListObjectItem} 43 39 {$DEFINE TGList := TGListObjectList} 44 {$DEFINE TGListSortCompare := TGListObjectSortCompare}45 {$DEFINE TGListToStringConverter := TGListObjectToStringConverter}46 {$DEFINE TGListFromStringConverter := TGListObjectFromStringConverter}47 {$DEFINE TGListItemArray := TGListObjectItemArray}48 40 {$DEFINE IMPLEMENTATION} 49 41 {$I 'GenericList.inc'} … … 108 100 begin 109 101 Clear; 110 inherited Destroy;102 inherited; 111 103 end; 112 104 -
Generics/TemplateGenerics/Generic/GenericListString.inc
r312 r426 4 4 {$DEFINE TGListItem := TGListStringItem} 5 5 {$DEFINE TGList := TGListStringList} 6 {$DEFINE TGListSortCompare := TGListStringSortCompare}7 {$DEFINE TGListToStringConverter := TGListStringToStringConverter}8 {$DEFINE TGListFromStringConverter := TGListStringFromStringConverter}9 {$DEFINE TGListItemArray := TGListStringItemArray}10 6 {$DEFINE INTERFACE} 11 7 {$I 'GenericList.inc'} … … 39 35 {$DEFINE TGListItem := TGListStringItem} 40 36 {$DEFINE TGList := TGListStringList} 41 {$DEFINE TGListSortCompare := TGListStringSortCompare}42 {$DEFINE TGListToStringConverter := TGListStringToStringConverter}43 {$DEFINE TGListFromStringConverter := TGListStringFromStringConverter}44 {$DEFINE TGListItemArray := TGListStringItemArray}45 37 {$DEFINE IMPLEMENTATION} 46 38 {$I 'GenericList.inc'} -
Generics/TemplateGenerics/Generic/GenericMatrix.inc
r196 r426 1 // Work in progress... 2 1 3 {$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 = record12 X: TGMatrixIndexX;13 Y: TGMatrixIndexY;14 end;15 4 16 5 // TGMatrix<TGMatrixIndex, TGMatrixIndex, TGMatrixItem> = class 17 6 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; 18 19 private 19 20 FItems: array of array of TGMatrixItem; 20 FCount: T GMatrixIndex;21 FCount: TIndex; 21 22 function GetItemXY(X: TGMatrixIndexX; Y: TGMatrixIndexY): TGMatrixItem; 22 function GetItem(Index: T GMatrixIndex): TGMatrixItem;23 function GetCapacity: T GMatrixIndex;23 function GetItem(Index: TIndex): TGMatrixItem; 24 function GetCapacity: TIndex; 24 25 function GetLast: TGMatrixItem; 25 26 function GetFirst: TGMatrixItem; 26 procedure SetCapacity(const AValue: T GMatrixIndex);27 procedure SetCapacity(const AValue: TIndex); 27 28 procedure SetLast(AValue: TGMatrixItem); 28 29 procedure SetFirst(AValue: TGMatrixItem); 29 30 procedure PutItemXY(X: TGMatrixIndexX; Y: TGMatrixIndexY; const AValue: TGMatrixItem); virtual; 30 procedure PutItem(Index: T GMatrixIndex; const AValue: TGMatrixItem); virtual;31 procedure SetCount(const AValue: T GMatrixIndex);31 procedure PutItem(Index: TIndex; const AValue: TGMatrixItem); virtual; 32 procedure SetCount(const AValue: TIndex); 32 33 public 33 function Add(Item: TGMatrixItem): T GMatrixIndex;34 procedure AddMatrix(Values: array of T GMatrixRow);34 function Add(Item: TGMatrixItem): TIndex; 35 procedure AddMatrix(Values: array of TRow); 35 36 procedure AddList(List: TGMatrix); 36 37 procedure Assign(Source: TGMatrix); 37 38 procedure Clear; virtual; 38 39 procedure Contract; 39 function CreateIndex(X: TGMatrixIndexY; Y: TGMatrixIndexX): T GMatrixIndex;40 procedure Delete(Index: T GMatrixIndex); virtual;41 procedure DeleteItems(Index, Count: T GMatrixIndex);40 function CreateIndex(X: TGMatrixIndexY; Y: TGMatrixIndexX): TIndex; 41 procedure Delete(Index: TIndex); virtual; 42 procedure DeleteItems(Index, Count: TIndex); 42 43 function EqualTo(List: TGMatrix): Boolean; 43 44 procedure Expand; 44 45 function Extract(Item: TGMatrixItem): TGMatrixItem; 45 procedure Exchange(Index1, Index2: T GMatrixIndex);46 procedure Exchange(Index1, Index2: TIndex); 46 47 property First: TGMatrixItem read GetFirst write SetFirst; 47 48 procedure FillAll(Value: TGMatrixItem); 48 procedure Fill(Start, Count: T GMatrixIndex; Value: TGMatrixItem);49 function Implode(RowSeparator, ColSeparator: string; Converter: T GMatrixToStringConverter): string;50 procedure Explode(Text, Separator: string; Converter: T GMatrixFromStringConverter; SlicesCount: Integer = -1);51 function IndexOf(Item: TGMatrixItem; Start: T GMatrixIndex = 0): TGMatrixIndex;52 function IndexOfList(List: TGMatrix; Start: T GMatrixIndex = 0): TGMatrixIndex;53 procedure Insert(Index: T GMatrixIndex; Item: TGMatrixItem);54 procedure InsertList(Index: T GMatrixIndex; List: TGMatrix);55 procedure InsertArray(Index: T GMatrixIndex; Values: array of TGMatrixItem);56 procedure Move(CurIndex, NewIndex: T GMatrixIndex);57 procedure MoveItems(CurIndex, NewIndex, Count: T GMatrixIndex);58 procedure Merge(Index: T GMatrixIndex; Source: TGMatrix; Proc: TGMatrixMerge);59 procedure Replace(Index: T GMatrixIndex; Source: TGMatrix);60 function Remove(Item: TGMatrixItem): T GMatrixIndex;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; 61 62 procedure Reverse; 62 63 procedure ReverseHorizontal; 63 64 procedure ReverseVertical; 64 procedure Sort(Compare: T GMatrixSortCompare);65 procedure Sort(Compare: TSortCompare); 65 66 procedure SetArray(Values: array of TGMatrixItem); 66 property Count: T GMatrixIndex read FCount write SetCount;67 property Capacity: T GMatrixIndex read GetCapacity write SetCapacity;67 property Count: TIndex read FCount write SetCount; 68 property Capacity: TIndex read GetCapacity write SetCapacity; 68 69 property ItemsXY[X: TGMatrixIndexX; Y: TGMatrixIndexY]: TGMatrixItem 69 70 read GetItemXY write PutItemXY; default; 70 property Items[Index: T GMatrixIndex]: TGMatrixItem71 property Items[Index: TIndex]: TGMatrixItem 71 72 read GetItem write PutItem; 72 73 property Last: TGMatrixItem read GetLast write SetLast; … … 91 92 { TGMatrix } 92 93 93 procedure TGMatrix.Replace(Index: T GMatrixIndex; Source: TGMatrix);94 procedure TGMatrix.Replace(Index: TIndex; Source: TGMatrix); 94 95 var 95 96 X: TGMatrixIndexX; … … 107 108 end; 108 109 109 procedure TGMatrix.Merge(Index: T GMatrixIndex; Source: TGMatrix; Proc: TGMatrixMerge);110 procedure TGMatrix.Merge(Index: TIndex; Source: TGMatrix; Proc: TMerge); 110 111 var 111 112 X: TGMatrixIndexX; … … 123 124 end; 124 125 125 function TGMatrix.CreateIndex(X: TGMatrixIndexY; Y: TGMatrixIndexX): T GMatrixIndex;126 function TGMatrix.CreateIndex(X: TGMatrixIndexY; Y: TGMatrixIndexX): TIndex; 126 127 begin 127 128 Result.X := X; … … 129 130 end; 130 131 131 function TGMatrix.GetCapacity: T GMatrixIndex;132 function TGMatrix.GetCapacity: TIndex; 132 133 begin 133 134 Result.Y := Length(FItems); … … 135 136 end; 136 137 137 procedure TGMatrix.SetCapacity(const AValue: T GMatrixIndex);138 procedure TGMatrix.SetCapacity(const AValue: TIndex); 138 139 var 139 140 Y: TGMatrixIndexY; … … 160 161 end; 161 162 162 function TGMatrix.GetItem(Index: T GMatrixIndex): TGMatrixItem;163 function TGMatrix.GetItem(Index: TIndex): TGMatrixItem; 163 164 begin 164 165 if (Index.X < 0) or (Index.X >= Count.X) or … … 176 177 end; 177 178 178 procedure TGMatrix.PutItem(Index: T GMatrixIndex; const AValue: TGMatrixItem);179 procedure TGMatrix.PutItem(Index: TIndex; const AValue: TGMatrixItem); 179 180 begin 180 181 if (Index.X < 0) or (Index.X >= Count.X) or … … 184 185 end; 185 186 186 procedure TGMatrix.SetCount(const AValue: T GMatrixIndex);187 procedure TGMatrix.SetCount(const AValue: TIndex); 187 188 begin 188 189 Capacity := AValue; … … 192 193 procedure TGMatrix.Assign(Source: TGMatrix); 193 194 var 194 Index: T GMatrixIndex;195 Index: TIndex; 195 196 begin 196 197 Count := Source.Count; … … 208 209 procedure TGMatrix.Expand; 209 210 var 210 IncSize: T GMatrixIndex;211 NewCapacity: T GMatrixIndex;211 IncSize: TIndex; 212 NewCapacity: TIndex; 212 213 begin 213 214 if (FCount.X = Capacity.X) then begin … … 230 231 procedure TGMatrix.Contract; 231 232 var 232 NewCapacity: T GMatrixIndex;233 NewCapacity: TIndex; 233 234 begin 234 235 if (Capacity.X > 256) and (FCount.X < Capacity.X shr 2) then … … 245 246 function TGMatrix.Extract(Item: TGMatrixItem): TGMatrixItem; 246 247 var 247 I: T GMatrixIndex;248 I: TIndex; 248 249 begin 249 250 (* I := IndexOf(Item); … … 256 257 end; 257 258 258 function TGMatrix.IndexOf(Item: TGMatrixItem; Start: T GMatrixIndex): TGMatrixIndex;259 function TGMatrix.IndexOf(Item: TGMatrixItem; Start: TIndex): TIndex; 259 260 begin 260 261 (* Result := Start; … … 266 267 end; 267 268 268 procedure TGMatrix.Insert(Index: T GMatrixIndex; Item: TGMatrixItem);269 procedure TGMatrix.Insert(Index: TIndex; Item: TGMatrixItem); 269 270 begin 270 271 (* if (Index < 0) or (Index > FCount ) then … … 278 279 end; 279 280 280 procedure TGMatrix.InsertList(Index: T GMatrixIndex; List: TGMatrix);281 var 282 I: T GMatrixIndex;281 procedure TGMatrix.InsertList(Index: TIndex; List: TGMatrix); 282 var 283 I: TIndex; 283 284 begin 284 285 (* I := 0; … … 290 291 end; 291 292 292 function TGMatrix.IndexOfList(List: TGMatrix; Start: T GMatrixIndex): TGMatrixIndex;293 var 294 I: T GMatrixIndex;293 function TGMatrix.IndexOfList(List: TGMatrix; Start: TIndex): TIndex; 294 var 295 I: TIndex; 295 296 begin 296 297 (* if List.Count > 0 then begin … … 346 347 end; 347 348 348 procedure TGMatrix.Move(CurIndex, NewIndex: T GMatrixIndex);349 procedure TGMatrix.Move(CurIndex, NewIndex: TIndex); 349 350 var 350 351 Temp: TGMatrixItem; … … 366 367 end; 367 368 368 procedure TGMatrix.MoveItems(CurIndex, NewIndex, Count: T GMatrixIndex);369 procedure TGMatrix.MoveItems(CurIndex, NewIndex, Count: TIndex); 369 370 var 370 371 S: Integer; … … 391 392 end; 392 393 393 function TGMatrix.Remove(Item: TGMatrixItem): T GMatrixIndex;394 function TGMatrix.Remove(Item: TGMatrixItem): TIndex; 394 395 begin 395 396 (* Result := IndexOf(Item); … … 400 401 function TGMatrix.EqualTo(List: TGMatrix): Boolean; 401 402 var 402 I: T GMatrixIndex;403 I: TIndex; 403 404 begin 404 405 (* Result := Count = List.Count; … … 463 464 end; 464 465 465 procedure TGMatrix.Sort(Compare: T GMatrixSortCompare);466 procedure TGMatrix.Sort(Compare: TSortCompare); 466 467 begin 467 468 (* if FCount > 1 then … … 469 470 end; 470 471 471 procedure TGMatrix.AddMatrix(Values: array of T GMatrixRow);472 var 473 I: T GMatrixIndex;472 procedure TGMatrix.AddMatrix(Values: array of TRow); 473 var 474 I: TIndex; 474 475 begin 475 476 (* I := 0; … … 482 483 procedure TGMatrix.SetArray(Values: array of TGMatrixItem); 483 484 var 484 I: T GMatrixIndex;485 I: TIndex; 485 486 begin 486 487 (* Clear; … … 492 493 end; 493 494 494 procedure TGMatrix.InsertArray(Index: T GMatrixIndex; Values: array of TGMatrixItem);495 var 496 I: T GMatrixIndex;495 procedure TGMatrix.InsertArray(Index: TIndex; Values: array of TGMatrixItem); 496 var 497 I: TIndex; 497 498 begin 498 499 (* I := 0; … … 503 504 end; 504 505 505 function TGMatrix.Implode(RowSeparator, ColSeparator: string; Converter: T GMatrixToStringConverter): string;506 function TGMatrix.Implode(RowSeparator, ColSeparator: string; Converter: TToStringConverter): string; 506 507 var 507 508 Y: TGMatrixIndexY; … … 524 525 end; 525 526 526 procedure TGMatrix.Explode(Text, Separator: string; Converter: T GMatrixFromStringConverter; SlicesCount: Integer = -1);527 procedure TGMatrix.Explode(Text, Separator: string; Converter: TFromStringConverter; SlicesCount: Integer = -1); 527 528 begin 528 529 (* Clear; … … 535 536 end; 536 537 537 function TGMatrix.Add(Item: TGMatrixItem): T GMatrixIndex;538 function TGMatrix.Add(Item: TGMatrixItem): TIndex; 538 539 begin 539 540 (* if FCount = Capacity then … … 546 547 procedure TGMatrix.AddList(List: TGMatrix); 547 548 var 548 I: T GMatrixIndex;549 I: TIndex; 549 550 begin 550 551 (* I := 0; … … 561 562 end; 562 563 563 procedure TGMatrix.Delete(Index: T GMatrixIndex);564 procedure TGMatrix.Delete(Index: TIndex); 564 565 begin 565 566 (* if (Index < 0) or (Index >= FCount) then … … 571 572 end; 572 573 573 procedure TGMatrix.DeleteItems(Index, Count: T GMatrixIndex);574 var 575 I: T GMatrixIndex;574 procedure TGMatrix.DeleteItems(Index, Count: TIndex); 575 var 576 I: TIndex; 576 577 begin 577 578 (* I := Index; … … 583 584 end; 584 585 585 procedure TGMatrix.Fill(Start, Count: T GMatrixIndex; Value: TGMatrixItem);586 procedure TGMatrix.Fill(Start, Count: TIndex; Value: TGMatrixItem); 586 587 var 587 588 X: TGMatrixIndexX; … … 604 605 end; 605 606 606 procedure TGMatrix.Exchange(Index1, Index2: T GMatrixIndex);607 procedure TGMatrix.Exchange(Index1, Index2: TIndex); 607 608 var 608 609 Temp: TGMatrixItem; -
Generics/TemplateGenerics/Generic/GenericQueue.inc
r312 r426 4 4 {$DEFINE TGListItem := TGQueueItem} 5 5 {$DEFINE TGList := TGQueueList} 6 {$DEFINE TGListSortCompare := TGQueueSortCompare}7 {$DEFINE TGListToStringConverter := TGQueueToStringConverter}8 {$DEFINE TGListFromStringConverter := TGQueueFromStringConverter}9 {$DEFINE TGListItemArray := TGQueueItemArray}10 6 {$DEFINE INTERFACE} 11 7 {$I 'GenericList.inc'} … … 44 40 {$DEFINE TGListItem := TGQueueItem} 45 41 {$DEFINE TGList := TGQueueList} 46 {$DEFINE TGListSortCompare := TGQueueSortCompare}47 {$DEFINE TGListToStringConverter := TGQueueToStringConverter}48 {$DEFINE TGListFromStringConverter := TGQueueFromStringConverter}49 {$DEFINE TGListItemArray := TGQueueItemArray}50 42 {$DEFINE IMPLEMENTATION} 51 43 {$I 'GenericList.inc'} -
Generics/TemplateGenerics/Generic/GenericSet.inc
r112 r426 4 4 {$DEFINE TGListItem := TGSetItem} 5 5 {$DEFINE TGList := TGSetList} 6 {$DEFINE TGListSortCompare := TGSetSortCompare}7 {$DEFINE TGListToStringConverter := TGSetToStringConverter}8 {$DEFINE TGListFromStringConverter := TGSetFromStringConverter}9 {$DEFINE TGListItemArray := TGSetItemArray}10 6 {$DEFINE INTERFACE} 11 7 {$I 'GenericList.inc'} … … 38 34 {$DEFINE TGListItem := TGSetItem} 39 35 {$DEFINE TGList := TGSetList} 40 {$DEFINE TGListSortCompare := TGSetSortCompare}41 {$DEFINE TGListToStringConverter := TGSetToStringConverter}42 {$DEFINE TGListFromStringConverter := TGSetFromStringConverter}43 {$DEFINE TGListItemArray := TGSetItemArray}44 36 {$DEFINE IMPLEMENTATION} 45 37 {$I 'GenericList.inc'} -
Generics/TemplateGenerics/Generic/GenericStack.inc
r112 r426 4 4 {$DEFINE TGListItem := TGStackItem} 5 5 {$DEFINE TGList := TGStackList} 6 {$DEFINE TGListSortCompare := TGStackSortCompare}7 {$DEFINE TGListToStringConverter := TGStackToStringConverter}8 {$DEFINE TGListFromStringConverter := TGStackFromStringConverter}9 {$DEFINE TGListItemArray := TGStackItemArray}10 6 {$DEFINE INTERFACE} 11 7 {$I 'GenericList.inc'} … … 39 35 {$DEFINE TGListItem := TGStackItem} 40 36 {$DEFINE TGList := TGStackList} 41 {$DEFINE TGListSortCompare := TGStackSortCompare}42 {$DEFINE TGListToStringConverter := TGStackToStringConverter}43 {$DEFINE TGListFromStringConverter := TGStackFromStringConverter}44 {$DEFINE TGListItemArray := TGStackItemArray}45 37 {$DEFINE IMPLEMENTATION} 46 38 {$I 'GenericList.inc'} -
Generics/TemplateGenerics/Generic/GenericStream.inc
r342 r426 1 1 {$IFDEF INTERFACE} 2 2 3 TGStreamItemArray = array of TGStreamItem;4 3 5 4 // TGStream<TGStreamIndex, TGStreamItem> = class 6 5 TGStream = class 7 procedure SetSize(AValue: TGStreamIndex); 6 public 7 type 8 TItemArray = array of TGStreamItem; 9 private 10 procedure SetSize(AValue: TGStreamIndex); 8 11 function GetSize: TGStreamIndex; 9 12 procedure SetPosition(AValue: TGStreamIndex); … … 15 18 procedure WriteStream(Stream: TGStream; Count: TGStreamIndex); virtual; abstract; 16 19 function Read: TGStreamItem; virtual; abstract; 17 function ReadArray(Count: TGStreamIndex): T GStreamItemArray; virtual; abstract;20 function ReadArray(Count: TGStreamIndex): TItemArray; virtual; abstract; 18 21 function ReadStream(Stream: TGStream; Count: TGStreamIndex): TGStreamIndex; virtual; abstract; 19 22 function Insert(Count: TGStreamIndex): TGStreamIndex; virtual; abstract; -
Generics/TemplateGenerics/Generic/GenericTree.inc
r112 r426 6 6 {$DEFINE TGListItem := TGTreeNode} 7 7 {$DEFINE TGList := TGTreeNodeList} 8 {$DEFINE TGListSortCompare := TGTreeSortCompare}9 {$DEFINE TGListToStringConverter := TGTreeToStringConverter}10 {$DEFINE TGListFromStringConverter := TGTreeFromStringConverter}11 {$DEFINE TGListItemArray := TGTreeItemArray}12 8 {$DEFINE INTERFACE} 13 9 {$I 'GenericList.inc'} … … 44 40 {$DEFINE TGListItem := TGTreeNode} 45 41 {$DEFINE TGList := TGTreeNodeList} 46 {$DEFINE TGListSortCompare := TGTreeSortCompare}47 {$DEFINE TGListToStringConverter := TGTreeToStringConverter}48 {$DEFINE TGListFromStringConverter := TGTreeFromStringConverter}49 {$DEFINE TGListItemArray := TGTreeItemArray}50 42 {$DEFINE IMPLEMENTATION} 51 43 {$I 'GenericList.inc'}
Note:
See TracChangeset
for help on using the changeset viewer.