- Timestamp:
- Sep 24, 2012, 1:47:39 PM (12 years ago)
- Location:
- Generics/TemplateGenerics
- Files:
-
- 2 added
- 20 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'} -
Generics/TemplateGenerics/Specialized/SpecializedDictionary.pas
r301 r426 18 18 {$DEFINE TGDictionary := TDictionaryStringString} 19 19 {$DEFINE TGDictionaryList := TDictionaryStringStringList} 20 {$DEFINE TGDictionarySortCompare := TDictionaryStringStringSortCompare}21 {$DEFINE TGDictionaryToStringConverter := TDictionaryStringStringToStringConverter}22 {$DEFINE TGDictionaryFromStringConverter := TDictionaryStringStringFromStringConverter}23 {$DEFINE TGDictionaryItemArray := TDictionaryStringStringItemArray}24 20 {$DEFINE INTERFACE} 25 21 {$I 'GenericDictionary.inc'} … … 32 28 {$DEFINE TGDictionary := TDictionaryIntegerString} 33 29 {$DEFINE TGDictionaryList := TDictionaryIntegerStringList} 34 {$DEFINE TGDictionarySortCompare := TDictionaryIntegerStringSortCompare}35 {$DEFINE TGDictionaryToStringConverter := TDictionaryIntegerStringToStringConverter}36 {$DEFINE TGDictionaryFromStringConverter := TDictionaryIntegerStringFromStringConverter}37 {$DEFINE TGDictionaryItemArray := TDictionaryIntegerStringItemArray}38 30 {$DEFINE INTERFACE} 39 31 {$I 'GenericDictionary.inc'} … … 53 45 {$DEFINE TGDictionary := TDictionaryStringString} 54 46 {$DEFINE TGDictionaryList := TDictionaryStringStringList} 55 {$DEFINE TGDictionarySortCompare := TDictionaryStringStringSortCompare}56 {$DEFINE TGDictionaryToStringConverter := TDictionaryStringStringToStringConverter}57 {$DEFINE TGDictionaryFromStringConverter := TDictionaryStringStringFromStringConverter}58 {$DEFINE TGDictionaryItemArray := TDictionaryStringStringItemArray}59 47 {$DEFINE IMPLEMENTATION} 60 48 {$I 'GenericDictionary.inc'} … … 67 55 {$DEFINE TGDictionary := TDictionaryIntegerString} 68 56 {$DEFINE TGDictionaryList := TDictionaryIntegerStringList} 69 {$DEFINE TGDictionarySortCompare := TDictionaryIntegerStringSortCompare}70 {$DEFINE TGDictionaryToStringConverter := TDictionaryIntegerStringToStringConverter}71 {$DEFINE TGDictionaryFromStringConverter := TDictionaryIntegerStringFromStringConverter}72 {$DEFINE TGDictionaryItemArray := TDictionaryIntegerStringItemArray}73 57 {$DEFINE IMPLEMENTATION} 74 58 {$I 'GenericDictionary.inc'} -
Generics/TemplateGenerics/Specialized/SpecializedList.pas
r398 r426 15 15 {$DEFINE TGListItem := Integer} 16 16 {$DEFINE TGList := TListInteger} 17 {$DEFINE TGListSortCompare := TListIntegerSortCompare}18 {$DEFINE TGListToStringConverter := TListIntegerToStringConverter}19 {$DEFINE TGListFromStringConverter := TListIntegerFromStringConverter}20 {$DEFINE TGListItemArray := TListIntegerItemArray}21 17 {$DEFINE INTERFACE} 22 18 {$I 'GenericList.inc'} … … 26 22 {$DEFINE TGListItem := Boolean} 27 23 {$DEFINE TGList := TListBoolean} 28 {$DEFINE TGListSortCompare := TListBooleanSortCompare}29 {$DEFINE TGListToStringConverter := TListBooleanToStringConverter}30 {$DEFINE TGListFromStringConverter := TListBooleanFromStringConverter}31 {$DEFINE TGListItemArray := TListBooleanItemArray}32 24 {$DEFINE INTERFACE} 33 25 {$I 'GenericList.inc'} … … 37 29 {$DEFINE TGListItem := SmallInt} 38 30 {$DEFINE TGList := TListSmallInt} 39 {$DEFINE TGListSortCompare := TListSmallIntSortCompare}40 {$DEFINE TGListToStringConverter := TListSmallIntToStringConverter}41 {$DEFINE TGListFromStringConverter := TListSmallIntFromStringConverter}42 {$DEFINE TGListItemArray := TListSmallIntItemArray}43 31 {$DEFINE INTERFACE} 44 32 {$I 'GenericList.inc'} … … 48 36 {$DEFINE TGListItem := Double} 49 37 {$DEFINE TGList := TListDouble} 50 {$DEFINE TGListSortCompare := TListDoubleSortCompare}51 {$DEFINE TGListToStringConverter := TListDoubleToStringConverter}52 {$DEFINE TGListFromStringConverter := TListDoubleFromStringConverter}53 {$DEFINE TGListItemArray := TListDoubleItemArray}54 38 {$DEFINE INTERFACE} 55 39 {$INCLUDE '..\Generic\GenericList.inc'} … … 59 43 {$DEFINE TGListItem := Pointer} 60 44 {$DEFINE TGList := TListPointer} 61 {$DEFINE TGListSortCompare := TListPointerSortCompare}62 {$DEFINE TGListToStringConverter := TListPointerToStringConverter}63 {$DEFINE TGListFromStringConverter := TListPointerFromStringConverter}64 {$DEFINE TGListItemArray := TListPointerItemArray}65 45 {$DEFINE INTERFACE} 66 46 {$I 'GenericList.inc'} … … 70 50 {$DEFINE TGListStringItem := string} 71 51 {$DEFINE TGListString := TListString} 72 {$DEFINE TGListStringSortCompare := TListStringSortCompare}73 {$DEFINE TGListStringToStringConverter := TListStringToStringConverter}74 {$DEFINE TGListStringFromStringConverter := TListStringFromStringConverter}75 {$DEFINE TGListItemArray := TListStringItemArray}76 52 {$DEFINE INTERFACE} 77 53 {$I 'GenericListString.inc'} … … 81 57 {$DEFINE TGListItem := Byte} 82 58 {$DEFINE TGList := TListByteBase} 83 {$DEFINE TGListSortCompare := TListByteSortCompare}84 {$DEFINE TGListToStringConverter := TListByteToStringConverter}85 {$DEFINE TGListFromStringConverter := TListByteFromStringConverter}86 {$DEFINE TGListItemArray := TListByteItemArray}87 59 {$DEFINE INTERFACE} 88 60 {$I 'GenericList.inc'} … … 103 75 {$DEFINE TGListItem := Char} 104 76 {$DEFINE TGList := TListCharBase} 105 {$DEFINE TGListSortCompare := TListSortCompareChar}106 {$DEFINE TGListToStringConverter := TListToStringConverterChar}107 {$DEFINE TGListFromStringConverter := TListFromStringConverterChar}108 {$DEFINE TGListItemArray := TListStringItemArray}109 77 {$DEFINE INTERFACE} 110 78 {$I 'GenericList.inc'} … … 115 83 {$DEFINE TGListObjectList := TListObjectList} 116 84 {$DEFINE TGListObject := TListObject} 117 {$DEFINE TGListObjectSortCompare := TListObjectSortCompare}118 {$DEFINE TGListObjectToStringConverter := TListObjectToStringConverter}119 {$DEFINE TGListObjectFromStringConverter := TListObjectFromStringConverter}120 {$DEFINE TGListItemArray := TListObjectItemArray}121 85 {$DEFINE INTERFACE} 122 86 {$I 'GenericListObject.inc'} … … 138 102 {$DEFINE TGListItem := TMethod} 139 103 {$DEFINE TGList := TListMethodBase} 140 {$DEFINE TGListSortCompare := TListMethodSortCompare}141 {$DEFINE TGListToStringConverter := TListMethodToStringConverter}142 {$DEFINE TGListFromStringConverter := TListMethodFromStringConverter}143 {$DEFINE TGListItemArray := TListMethodItemArray}144 104 {$DEFINE INTERFACE} 145 105 {$I 'GenericList.inc'} … … 154 114 {$DEFINE TGListItem := TNotifyEvent} 155 115 {$DEFINE TGList := TListNotifyEventBase} 156 {$DEFINE TGListSortCompare := TListNotifyEventSortCompare}157 {$DEFINE TGListToStringConverter := TListNotifyEventToStringConverter}158 {$DEFINE TGListFromStringConverter := TListNotifyEventFromStringConverter}159 {$DEFINE TGListItemArray := TListNotifyEventItemArray}160 116 {$DEFINE INTERFACE} 161 117 {$I 'GenericList.inc'} … … 173 129 {$DEFINE TGListItem := TBaseEvent} 174 130 {$DEFINE TGList := TListSimpleEventBase} 175 {$DEFINE TGListSortCompare := TListSimpleEventSortCompare}176 {$DEFINE TGListToStringConverter := TListSimpleEventToStringConverter}177 {$DEFINE TGListFromStringConverter := TListSimpleEventFromStringConverter}178 {$DEFINE TGListItemArray := TListSimpleEventItemArray}179 131 {$DEFINE INTERFACE} 180 132 {$I 'GenericList.inc'} … … 186 138 187 139 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 188 148 function StrToStr(Value: string): string; 149 150 151 152 189 153 190 154 implementation … … 197 161 {$DEFINE TGListItem := Integer} 198 162 {$DEFINE TGList := TListInteger} 199 {$DEFINE TGListSortCompare := TListIntegerSortCompare}200 {$DEFINE TGListToStringConverter := TListIntegerToStringConverter}201 {$DEFINE TGListFromStringConverter := TListIntegerFromStringConverter}202 {$DEFINE TGListItemArray := TListIntegerItemArray}203 163 {$DEFINE IMPLEMENTATION} 204 164 {$I 'GenericList.inc'} … … 208 168 {$DEFINE TGListItem := SmallInt} 209 169 {$DEFINE TGList := TListSmallInt} 210 {$DEFINE TGListSortCompare := TListSmallIntSortCompare}211 {$DEFINE TGListToStringConverter := TListSmallIntToStringConverter}212 {$DEFINE TGListFromStringConverter := TListSmallIntFromStringConverter}213 {$DEFINE TGListItemArray := TListSmallIntItemArray}214 170 {$DEFINE IMPLEMENTATION} 215 171 {$I 'GenericList.inc'} … … 219 175 {$DEFINE TGListItem := Boolean} 220 176 {$DEFINE TGList := TListBoolean} 221 {$DEFINE TGListSortCompare := TListBooleanSortCompare}222 {$DEFINE TGListToStringConverter := TListBooleanToStringConverter}223 {$DEFINE TGListFromStringConverter := TListBooleanFromStringConverter}224 {$DEFINE TGListItemArray := TListBooleanItemArray}225 177 {$DEFINE IMPLEMENTATION} 226 178 {$I 'GenericList.inc'} … … 230 182 {$DEFINE TGListItem := Double} 231 183 {$DEFINE TGList := TListDouble} 232 {$DEFINE TGListSortCompare := TListDoubleSortCompare}233 {$DEFINE TGListToStringConverter := TListDoubleToStringConverter}234 {$DEFINE TGListFromStringConverter := TListDoubleFromStringConverter}235 {$DEFINE TGListItemArray := TListDoubleItemArray}236 184 {$DEFINE IMPLEMENTATION} 237 185 {$I 'GenericList.inc'} … … 241 189 {$DEFINE TGListItem := Pointer} 242 190 {$DEFINE TGList := TListPointer} 243 {$DEFINE TGListSortCompare := TListPointerSortCompare}244 {$DEFINE TGListToStringConverter := TListPointerToStringConverter}245 {$DEFINE TGListFromStringConverter := TListPointerFromStringConverter}246 {$DEFINE TGListItemArray := TListPointerItemArray}247 191 {$DEFINE IMPLEMENTATION} 248 192 {$I 'GenericList.inc'} … … 252 196 {$DEFINE TGListStringItem := string} 253 197 {$DEFINE TGListString := TListString} 254 {$DEFINE TGListStringSortCompare := TListStringSortCompare}255 {$DEFINE TGListStringToStringConverter := TListStringToStringConverter}256 {$DEFINE TGListStringFromStringConverter := TListStringFromStringConverter}257 {$DEFINE TGListItemArray := TListStringItemArray}258 198 {$DEFINE IMPLEMENTATION} 259 199 {$I 'GenericListString.inc'} … … 263 203 {$DEFINE TGListItem := Byte} 264 204 {$DEFINE TGList := TListByteBase} 265 {$DEFINE TGListSortCompare := TListByteSortCompare}266 {$DEFINE TGListToStringConverter := TListByteToStringConverter}267 {$DEFINE TGListFromStringConverter := TListByteFromStringConverter}268 {$DEFINE TGListItemArray := TListByteItemArray}269 205 {$DEFINE IMPLEMENTATION} 270 206 {$I 'GenericList.inc'} … … 274 210 {$DEFINE TGListItem := Char} 275 211 {$DEFINE TGList := TListCharBase} 276 {$DEFINE TGListSortCompare := TListSortCompareChar}277 {$DEFINE TGListToStringConverter := TListToStringConverterChar}278 {$DEFINE TGListFromStringConverter := TListFromStringConverterChar}279 {$DEFINE TGListItemArray := TListStringItemArray}280 212 {$DEFINE IMPLEMENTATION} 281 213 {$I 'GenericList.inc'} … … 286 218 {$DEFINE TGListObjectList := TListObjectList} 287 219 {$DEFINE TGListObject := TListObject} 288 {$DEFINE TGListObjectSortCompare := TListObjectSortCompare}289 {$DEFINE TGListObjectToStringConverter := TListObjectToStringConverter}290 {$DEFINE TGListObjectFromStringConverter := TListObjectFromStringConverter}291 {$DEFINE TGListItemArray := TListObjectItemArray}292 220 {$DEFINE IMPLEMENTATION} 293 221 {$I 'GenericListObject.inc'} … … 297 225 {$DEFINE TGListItem := TMethod} 298 226 {$DEFINE TGList := TListMethodBase} 299 {$DEFINE TGListSortCompare := TListMethodSortCompare}300 {$DEFINE TGListToStringConverter := TListMethodToStringConverter}301 {$DEFINE TGListFromStringConverter := TListMethodFromStringConverter}302 {$DEFINE TGListItemArray := TListMethodItemArray}303 227 {$DEFINE IMPLEMENTATION} 304 228 {$I 'GenericList.inc'} … … 308 232 {$DEFINE TGListItem := TNotifyEvent} 309 233 {$DEFINE TGList := TListNotifyEventBase} 310 {$DEFINE TGListSortCompare := TListNotifyEventSortCompare}311 {$DEFINE TGListToStringConverter := TListNotifyEventToStringConverter}312 {$DEFINE TGListFromStringConverter := TListNotifyEventFromStringConverter}313 {$DEFINE TGListItemArray := TListNotifyEventItemArray}314 234 {$DEFINE IMPLEMENTATION} 315 235 {$I 'GenericList.inc'} … … 319 239 {$DEFINE TGListItem := TBaseEvent} 320 240 {$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'} 328 251 329 252 … … 501 424 end; 502 425 426 503 427 end. -
Generics/TemplateGenerics/Specialized/SpecializedMatrix.pas
r175 r426 18 18 {$DEFINE TGMatrixRow := TMatrixIntegerRow} 19 19 {$DEFINE TGMatrix := TMatrixInteger} 20 {$DEFINE TGMatrixSortCompare := TMatrixIntegerSortCompare}21 {$DEFINE TGMatrixToStringConverter := TMatrixIntegerToStringConverter}22 {$DEFINE TGMatrixFromStringConverter := TMatrixIntegerFromStringConverter}23 {$DEFINE TGMatrixMerge := TMatrixIntegerMerge}24 20 {$DEFINE INTERFACE} 25 21 {$I 'GenericMatrix.inc'} … … 32 28 {$DEFINE TGMatrixRow := TMatrixByteRow} 33 29 {$DEFINE TGMatrix := TMatrixByte} 34 {$DEFINE TGMatrixSortCompare := TMatrixByteSortCompare}35 {$DEFINE TGMatrixToStringConverter := TMatrixByteToStringConverter}36 {$DEFINE TGMatrixFromStringConverter := TMatrixByteFromStringConverter}37 {$DEFINE TGMatrixMerge := TMatrixByteMerge}38 30 {$DEFINE INTERFACE} 39 31 {$I 'GenericMatrix.inc'} … … 46 38 {$DEFINE TGMatrixRow := TMatrixObjectRow} 47 39 {$DEFINE TGMatrix := TMatrixObject} 48 {$DEFINE TGMatrixSortCompare := TMatrixObjectSortCompare}49 {$DEFINE TGMatrixToStringConverter := TMatrixObjectToStringConverter}50 {$DEFINE TGMatrixFromStringConverter := TMatrixObjectFromStringConverter}51 {$DEFINE TGMatrixMerge := TMatrixStringMerge}52 40 {$DEFINE INTERFACE} 53 41 {$I 'GenericMatrix.inc'} … … 65 53 {$DEFINE TGMatrixRow := TMatrixIntegerRow} 66 54 {$DEFINE TGMatrix := TMatrixInteger} 67 {$DEFINE TGMatrixSortCompare := TMatrixIntegerSortCompare}68 {$DEFINE TGMatrixToStringConverter := TMatrixIntegerToStringConverter}69 {$DEFINE TGMatrixFromStringConverter := TMatrixIntegerFromStringConverter}70 {$DEFINE TGMatrixMerge := TMatrixIntegerMerge}71 55 {$DEFINE IMPLEMENTATION} 72 56 {$I 'GenericMatrix.inc'} … … 79 63 {$DEFINE TGMatrixRow := TMatrixByteRow} 80 64 {$DEFINE TGMatrix := TMatrixByte} 81 {$DEFINE TGMatrixSortCompare := TMatrixByteSortCompare}82 {$DEFINE TGMatrixToStringConverter := TMatrixByteToStringConverter}83 {$DEFINE TGMatrixFromStringConverter := TMatrixByteFromStringConverter}84 {$DEFINE TGMatrixMerge := TMatrixByteMerge}85 65 {$DEFINE IMPLEMENTATION} 86 66 {$I 'GenericMatrix.inc'} … … 93 73 {$DEFINE TGMatrixRow := TMatrixObjectRow} 94 74 {$DEFINE TGMatrix := TMatrixObject} 95 {$DEFINE TGMatrixSortCompare := TMatrixObjectSortCompare}96 {$DEFINE TGMatrixToStringConverter := TMatrixObjectToStringConverter}97 {$DEFINE TGMatrixFromStringConverter := TMatrixObjectFromStringConverter}98 {$DEFINE TGMatrixMerge := TMatrixStringMerge}99 75 {$DEFINE IMPLEMENTATION} 100 76 {$I 'GenericMatrix.inc'} -
Generics/TemplateGenerics/Specialized/SpecializedQueue.pas
r112 r426 16 16 {$DEFINE TGQueue := TQueueInteger} 17 17 {$DEFINE TGQueueList := TQueueListInteger} 18 {$DEFINE TGQueueSortCompare := TQueueSortCompareInteger}19 {$DEFINE TGQueueToStringConverter := TQueueToStringConverterInteger}20 {$DEFINE TGQueueFromStringConverter := TQueueFromStringConverterInteger}21 {$DEFINE TGQueueItemArray := TQueueIntegerItemArray}22 18 {$DEFINE INTERFACE} 23 19 {$I 'GenericQueue.inc'} … … 28 24 {$DEFINE TGQueue := TQueuePointer} 29 25 {$DEFINE TGQueueList := TQueueListPointer} 30 {$DEFINE TGQueueSortCompare := TQueueSortComparePointer}31 {$DEFINE TGQueueToStringConverter := TQueueToStringConverterPointer}32 {$DEFINE TGQueueFromStringConverter := TQueueFromStringConverterPointer}33 {$DEFINE TGQueueItemArray := TQueuePointerItemArray}34 26 {$DEFINE INTERFACE} 35 27 {$I 'GenericQueue.inc'} … … 40 32 {$DEFINE TGQueue := TQueueByte} 41 33 {$DEFINE TGQueueList := TQueueListByte} 42 {$DEFINE TGQueueSortCompare := TQueueSortCompareByte}43 {$DEFINE TGQueueToStringConverter := TQueueToStringConverterByte}44 {$DEFINE TGQueueFromStringConverter := TQueueFromStringConverterByte}45 {$DEFINE TGQueueItemArray := TQueueByteItemArray}46 34 {$DEFINE INTERFACE} 47 35 {$I 'GenericQueue.inc'} … … 57 45 {$DEFINE TGQueue := TQueueInteger} 58 46 {$DEFINE TGQueueList := TQueueListInteger} 59 {$DEFINE TGQueueSortCompare := TQueueSortCompareInteger}60 {$DEFINE TGQueueToStringConverter := TQueueToStringConverterInteger}61 {$DEFINE TGQueueFromStringConverter := TQueueFromStringConverterInteger}62 {$DEFINE TGQueueItemArray := TQueueIntegerItemArray}63 47 {$DEFINE IMPLEMENTATION} 64 48 {$I '..\Generic\GenericQueue.inc'} … … 69 53 {$DEFINE TGQueue := TQueuePointer} 70 54 {$DEFINE TGQueueList := TQueueListPointer} 71 {$DEFINE TGQueueSortCompare := TQueueSortComparePointer}72 {$DEFINE TGQueueToStringConverter := TQueueToStringConverterPointer}73 {$DEFINE TGQueueFromStringConverter := TQueueFromStringConverterPointer}74 {$DEFINE TGQueueItemArray := TQueuePointerItemArray}75 55 {$DEFINE IMPLEMENTATION} 76 56 {$I 'GenericQueue.inc'} … … 81 61 {$DEFINE TGQueue := TQueueByte} 82 62 {$DEFINE TGQueueList := TQueueListByte} 83 {$DEFINE TGQueueSortCompare := TQueueSortCompareByte}84 {$DEFINE TGQueueToStringConverter := TQueueToStringConverterByte}85 {$DEFINE TGQueueFromStringConverter := TQueueFromStringConverterByte}86 {$DEFINE TGQueueItemArray := TQueueByteItemArray}87 63 {$DEFINE IMPLEMENTATION} 88 64 {$I 'GenericQueue.inc'} -
Generics/TemplateGenerics/Specialized/SpecializedSet.pas
r112 r426 16 16 {$DEFINE TGSetList := TSetListInteger} 17 17 {$DEFINE TGSet := TSetInteger} 18 {$DEFINE TGSetSortCompare := TSetSortCompareInteger}19 {$DEFINE TGSetToStringConverter := TSetToStringConverterInteger}20 {$DEFINE TGSetFromStringConverter := TSetFromStringConverterInteger}21 {$DEFINE TGSetItemArray := TSetIntegerItemArray}22 18 {$DEFINE INTERFACE} 23 19 {$I 'GenericSet.inc'} … … 28 24 {$DEFINE TGSetList := TSetListPointer} 29 25 {$DEFINE TGSet := TSetPointer} 30 {$DEFINE TGSetSortCompare := TSetSortComparePointer}31 {$DEFINE TGSetToStringConverter := TSetToStringConverterPointer}32 {$DEFINE TGSetFromStringConverter := TSetFromStringConverterPointer}33 {$DEFINE TGSetItemArray := TSetPointerItemArray}34 26 {$DEFINE INTERFACE} 35 27 {$I 'GenericSet.inc'} … … 45 37 {$DEFINE TGSetList := TSetListInteger} 46 38 {$DEFINE TGSet := TSetInteger} 47 {$DEFINE TGSetSortCompare := TSetSortCompareInteger}48 {$DEFINE TGSetToStringConverter := TSetToStringConverterInteger}49 {$DEFINE TGSetFromStringConverter := TSetFromStringConverterInteger}50 {$DEFINE TGSetItemArray := TSetIntegerItemArray}51 39 {$DEFINE IMPLEMENTATION} 52 40 {$I 'GenericSet.inc'} … … 57 45 {$DEFINE TGSetList := TSetListPointer} 58 46 {$DEFINE TGSet := TSetPointer} 59 {$DEFINE TGSetSortCompare := TSetSortComparePointer}60 {$DEFINE TGSetToStringConverter := TSetToStringConverterPointer}61 {$DEFINE TGSetFromStringConverter := TSetFromStringConverterPointer}62 {$DEFINE TGSetItemArray := TSetPointerItemArray}63 47 {$DEFINE IMPLEMENTATION} 64 48 {$I 'GenericSet.inc'} -
Generics/TemplateGenerics/Specialized/SpecializedStack.pas
r112 r426 16 16 {$DEFINE TGStackList := TListStackInteger} 17 17 {$DEFINE TGStack := TStackInteger} 18 {$DEFINE TGStackSortCompare := TStackSortCompareInteger}19 {$DEFINE TGStackToStringConverter := TStackToStringConverterInteger}20 {$DEFINE TGStackFromStringConverter := TStackFromStringConverterInteger}21 {$DEFINE TGStackItemArray := TStackIntegerItemArray}22 18 {$DEFINE INTERFACE} 23 19 {$I 'GenericStack.inc'} … … 28 24 {$DEFINE TGStackList := TListStackPointer} 29 25 {$DEFINE TGStack := TStackPointer} 30 {$DEFINE TGStackSortCompare := TStackSortComparePointer}31 {$DEFINE TGStackToStringConverter := TStackToStringConverterPointer}32 {$DEFINE TGStackFromStringConverter := TStackFromStringConverterPointer}33 {$DEFINE TGStackItemArray := TStackStringItemArray}34 26 {$DEFINE INTERFACE} 35 27 {$I 'GenericStack.inc'} … … 46 38 {$DEFINE TGStackList := TListStackInteger} 47 39 {$DEFINE TGStack := TStackInteger} 48 {$DEFINE TGStackSortCompare := TStackSortCompareInteger}49 {$DEFINE TGStackToStringConverter := TStackToStringConverterInteger}50 {$DEFINE TGStackFromStringConverter := TStackFromStringConverterInteger}51 {$DEFINE TGStackItemArray := TStackIntegerItemArray}52 40 {$DEFINE IMPLEMENTATION} 53 41 {$I 'GenericStack.inc'} … … 58 46 {$DEFINE TGStackList := TListStackPointer} 59 47 {$DEFINE TGStack := TStackPointer} 60 {$DEFINE TGStackSortCompare := TStackSortComparePointer}61 {$DEFINE TGStackToStringConverter := TStackToStringConverterPointer}62 {$DEFINE TGStackFromStringConverter := TStackFromStringConverterPointer}63 {$DEFINE TGStackItemArray := TStackStringItemArray}64 48 {$DEFINE IMPLEMENTATION} 65 49 {$I 'GenericStack.inc'} -
Generics/TemplateGenerics/Specialized/SpecializedStream.pas
r342 r426 18 18 {$DEFINE TGStreamList := TListStreamInteger} 19 19 {$DEFINE TGStream := TStreamInteger} 20 {$DEFINE TGStreamSortCompare := TStreamIntegerSortCompare}21 {$DEFINE TGStreamToStringConverter := TStreamIntegerToStringConverter}22 {$DEFINE TGStreamFromStringConverter := TStreamIntegerFromStringConverter}23 {$DEFINE TGStreamItemArray := TStreamIntegerItemArray}24 20 {$DEFINE INTERFACE} 25 21 {$I 'GenericStream.inc'} … … 30 26 {$DEFINE TGStreamList := TListStreamByte} 31 27 {$DEFINE TGStream := TBaseStreamByte} 32 {$DEFINE TGStreamSortCompare := TStreamByteSortCompare}33 {$DEFINE TGStreamToStringConverter := TStreamByteToStringConverter}34 {$DEFINE TGStreamFromStringConverter := TStreamByteFromStringConverter}35 {$DEFINE TGStreamItemArray := TStreamByteItemArray}36 28 {$DEFINE INTERFACE} 37 29 {$I 'GenericStream.inc'} … … 42 34 {$DEFINE TGStreamList := TListStreamPointer} 43 35 {$DEFINE TGStream := TStreamPointer} 44 {$DEFINE TGStreamSortCompare := TStreamPointerSortCompare}45 {$DEFINE TGStreamToStringConverter := TStreamPointerToStringConverter}46 {$DEFINE TGStreamFromStringConverter := TStreamPointerFromStringConverter}47 {$DEFINE TGStreamItemArray := TStreamPointerItemArray}48 36 {$DEFINE INTERFACE} 49 37 {$I 'GenericStream.inc'} … … 69 57 procedure WriteStream(Stream: TBaseStreamByte; Count: Integer); override; 70 58 function Read: Byte; override; 71 function ReadArray(Count: Integer): T StreamByteItemArray; override;59 function ReadArray(Count: Integer): TItemArray; override; 72 60 function ReadList(List: TListByte; Count: Integer): Integer; 73 61 function ReadBuffer(var Buffer; Count: Integer): Integer; override; … … 134 122 end; 135 123 136 function TMemoryStreamByte.ReadArray(Count: Integer): T StreamByteItemArray;124 function TMemoryStreamByte.ReadArray(Count: Integer): TItemArray; 137 125 begin 138 126 Result := FList.GetArray(FPosition, Count); … … 211 199 {$DEFINE TGStreamList := TListStreamInteger} 212 200 {$DEFINE TGStream := TStreamInteger} 213 {$DEFINE TGStreamSortCompare := TStreamIntegerSortCompare}214 {$DEFINE TGStreamToStringConverter := TStreamIntegerToStringConverter}215 {$DEFINE TGStreamFromStringConverter := TStreamIntegerFromStringConverter}216 {$DEFINE TGStreamItemArray := TStreamIntegerItemArray}217 201 {$DEFINE IMPLEMENTATION} 218 202 {$I 'GenericStream.inc'} … … 223 207 {$DEFINE TGStreamList := TListStreamByte} 224 208 {$DEFINE TGStream := TBaseStreamByte} 225 {$DEFINE TGStreamSortCompare := TStreamByteSortCompare}226 {$DEFINE TGStreamToStringConverter := TStreamByteToStringConverter}227 {$DEFINE TGStreamFromStringConverter := TStreamByteFromStringConverter}228 {$DEFINE TGStreamItemArray := TStreamByteItemArray}229 209 {$DEFINE IMPLEMENTATION} 230 210 {$I 'GenericStream.inc'} … … 235 215 {$DEFINE TGStreamList := TListStreamPointer} 236 216 {$DEFINE TGStream := TStreamPointer} 237 {$DEFINE TGStreamSortCompare := TStreamPointerSortCompare}238 {$DEFINE TGStreamToStringConverter := TStreamPointerToStringConverter}239 {$DEFINE TGStreamFromStringConverter := TStreamPointerFromStringConverter}240 {$DEFINE TGStreamItemArray := TStreamPointerItemArray}241 217 {$DEFINE IMPLEMENTATION} 242 218 {$I 'GenericStream.inc'} -
Generics/TemplateGenerics/Specialized/SpecializedTree.pas
r112 r426 16 16 {$DEFINE TGTreeNode := TTreeNodeInteger} 17 17 {$DEFINE TGTreeNodeList := TTreeNodeListInteger} 18 {$DEFINE TGTreeSortCompare := TTreeSortCompareInteger}19 {$DEFINE TGTreeToStringConverter := TTreeToStringConverterInteger}20 {$DEFINE TGTreeFromStringConverter := TTreeFromStringConverterInteger}21 {$DEFINE TGTreeItemArray := TTreeIntegerItemArray}22 18 {$DEFINE INTERFACE} 23 19 {$I 'GenericTree.inc'} … … 29 25 {$DEFINE TGTreeNode := TTreeNodeString} 30 26 {$DEFINE TGTreeNodeList := TTreeNodeListString} 31 {$DEFINE TGTreeSortCompare := TTreeSortCompareString}32 {$DEFINE TGTreeToStringConverter := TTreeToStringConverterString}33 {$DEFINE TGTreeFromStringConverter := TTreeFromStringConverterString}34 {$DEFINE TGTreeItemArray := TTreeStringItemArray}35 27 {$DEFINE INTERFACE} 36 28 {$I 'GenericTree.inc'} … … 42 34 {$DEFINE TGTreeNode := TTreeNodePointer} 43 35 {$DEFINE TGTreeNodeList := TTreeNodeListPointer} 44 {$DEFINE TGTreeSortCompare := TTreeSortComparePointer}45 {$DEFINE TGTreeToStringConverter := TTreeToStringConverterPointer}46 {$DEFINE TGTreeFromStringConverter := TTreeFromStringConverterPointer}47 {$DEFINE TGTreeItemArray := TTreePointerItemArray}48 36 {$DEFINE INTERFACE} 49 37 {$I 'GenericTree.inc'} … … 60 48 {$DEFINE TGTreeNode := TTreeNodeInteger} 61 49 {$DEFINE TGTreeNodeList := TTreeNodeListInteger} 62 {$DEFINE TGTreeSortCompare := TTreeSortCompareInteger}63 {$DEFINE TGTreeToStringConverter := TTreeToStringConverterInteger}64 {$DEFINE TGTreeFromStringConverter := TTreeFromStringConverterInteger}65 {$DEFINE TGTreeItemArray := TTreeIntegerItemArray}66 50 {$DEFINE IMPLEMENTATION} 67 51 {$I 'GenericTree.inc'} … … 73 57 {$DEFINE TGTreeNode := TTreeNodeString} 74 58 {$DEFINE TGTreeNodeList := TTreeNodeListString} 75 {$DEFINE TGTreeSortCompare := TTreeSortCompareString}76 {$DEFINE TGTreeToStringConverter := TTreeToStringConverterString}77 {$DEFINE TGTreeFromStringConverter := TTreeFromStringConverterString}78 {$DEFINE TGTreeItemArray := TTreeStringItemArray}79 59 {$DEFINE IMPLEMENTATION} 80 60 {$I 'GenericTree.inc'} … … 86 66 {$DEFINE TGTreeNode := TTreeNodePointer} 87 67 {$DEFINE TGTreeNodeList := TTreeNodeListPointer} 88 {$DEFINE TGTreeSortCompare := TTreeSortComparePointer}89 {$DEFINE TGTreeToStringConverter := TTreeToStringConverterPointer}90 {$DEFINE TGTreeFromStringConverter := TTreeFromStringConverterPointer}91 {$DEFINE TGTreeItemArray := TTreePointerItemArray}92 68 {$DEFINE IMPLEMENTATION} 93 69 {$I 'GenericTree.inc'} -
Generics/TemplateGenerics/TemplateGenerics.lpk
r379 r426 29 29 <Description Value="Generic classes implemented as templates."/> 30 30 <Version Minor="4"/> 31 <Files Count="2 7">31 <Files Count="28"> 32 32 <Item1> 33 33 <Filename Value="ReadMe.txt"/> … … 47 47 </Item4> 48 48 <Item5> 49 <Filename Value="Generic\GenericQueue.inc"/> 50 <Type Value="Include"/> 49 <Filename Value="Generic\GenericFileList.inc"/> 51 50 </Item5> 52 51 <Item6> 53 <Filename Value="Generic\Generic Range.inc"/>52 <Filename Value="Generic\GenericQueue.inc"/> 54 53 <Type Value="Include"/> 55 54 </Item6> 56 55 <Item7> 57 <Filename Value="Generic\Generic Set.inc"/>56 <Filename Value="Generic\GenericRange.inc"/> 58 57 <Type Value="Include"/> 59 58 </Item7> 60 59 <Item8> 61 <Filename Value="Generic\GenericS tack.inc"/>60 <Filename Value="Generic\GenericSet.inc"/> 62 61 <Type Value="Include"/> 63 62 </Item8> 64 63 <Item9> 65 <Filename Value="Generic\Generic Tree.inc"/>64 <Filename Value="Generic\GenericStack.inc"/> 66 65 <Type Value="Include"/> 67 66 </Item9> 68 67 <Item10> 68 <Filename Value="Generic\GenericTree.inc"/> 69 <Type Value="Include"/> 70 </Item10> 71 <Item11> 69 72 <Filename Value="Generic\GenericMatrix.inc"/> 70 73 <UnitName Value="GenericMatrix"/> 71 </Item1 0>72 <Item1 1>74 </Item11> 75 <Item12> 73 76 <Filename Value="Generic\GenericListString.inc"/> 74 77 <UnitName Value="GenericListString"/> 75 </Item1 1>76 <Item1 2>78 </Item12> 79 <Item13> 77 80 <Filename Value="Generic\GenericBitmap.inc"/> 78 81 <UnitName Value="GenericBitmap"/> 79 </Item1 2>80 <Item1 3>82 </Item13> 83 <Item14> 81 84 <Filename Value="Generic\GenericPoint.inc"/> 82 85 <Type Value="Include"/> 83 </Item1 3>84 <Item1 4>86 </Item14> 87 <Item15> 85 88 <Filename Value="Generic\GenericStream.inc"/> 86 89 <UnitName Value="GenericStream"/> 87 </Item1 4>88 <Item1 5>90 </Item15> 91 <Item16> 89 92 <Filename Value="Generic\GenericRectangle.inc"/> 90 93 <UnitName Value="GenericRectangle"/> 91 </Item1 5>92 <Item1 6>94 </Item16> 95 <Item17> 93 96 <Filename Value="Specialized\SpecializedList.pas"/> 94 97 <UnitName Value="SpecializedList"/> 95 </Item1 6>96 <Item1 7>98 </Item17> 99 <Item18> 97 100 <Filename Value="Specialized\SpecializedDictionary.pas"/> 98 101 <UnitName Value="SpecializedDictionary"/> 99 </Item1 7>100 <Item1 8>102 </Item18> 103 <Item19> 101 104 <Filename Value="Specialized\SpecializedStack.pas"/> 102 105 <UnitName Value="SpecializedStack"/> 103 </Item1 8>104 <Item 19>106 </Item19> 107 <Item20> 105 108 <Filename Value="Specialized\SpecializedTree.pas"/> 106 109 <UnitName Value="SpecializedTree"/> 107 </Item 19>108 <Item2 0>110 </Item20> 111 <Item21> 109 112 <Filename Value="Specialized\SpecializedQueue.pas"/> 110 113 <UnitName Value="SpecializedQueue"/> 111 </Item2 0>112 <Item2 1>114 </Item21> 115 <Item22> 113 116 <Filename Value="Specialized\SpecializedSet.pas"/> 114 117 <UnitName Value="SpecializedSet"/> 115 </Item2 1>116 <Item2 2>118 </Item22> 119 <Item23> 117 120 <Filename Value="Specialized\SpecializedPoint.pas"/> 118 121 <UnitName Value="SpecializedPoint"/> 119 </Item2 2>120 <Item2 3>122 </Item23> 123 <Item24> 121 124 <Filename Value="Specialized\SpecializedMatrix.pas"/> 122 125 <UnitName Value="SpecializedMatrix"/> 123 </Item2 3>124 <Item2 4>126 </Item24> 127 <Item25> 125 128 <Filename Value="Specialized\SpecializedBitmap.pas"/> 126 129 <UnitName Value="SpecializedBitmap"/> 127 </Item2 4>128 <Item2 5>130 </Item25> 131 <Item26> 129 132 <Filename Value="Specialized\SpecializedStream.pas"/> 130 133 <UnitName Value="SpecializedStream"/> 131 </Item2 5>132 <Item2 6>134 </Item26> 135 <Item27> 133 136 <Filename Value="Specialized\SpecializedRectangle.pas"/> 134 137 <UnitName Value="SpecializedRectangle"/> 135 </Item2 6>136 <Item2 7>138 </Item27> 139 <Item28> 137 140 <Filename Value="Additional\UBinarySerializer.pas"/> 138 141 <UnitName Value="UBinarySerializer"/> 139 </Item2 7>142 </Item28> 140 143 </Files> 141 144 <Type Value="RunAndDesignTime"/>
Note:
See TracChangeset
for help on using the changeset viewer.