Changeset 93 for trunk/Packages/TemplateGenerics
- Timestamp:
- Jul 20, 2018, 10:25:06 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 1 deleted
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 6 6 compiled 7 7 heaptrclog.trc 8 LazFuck.dbg
-
- Property svn:ignore
-
trunk/Packages/TemplateGenerics/Additional/UBinarySerializer.pas
r72 r93 1 1 unit UBinarySerializer; 2 2 3 {$mode objfpc}{$H+}3 {$mode delphi}{$H+} 4 4 5 5 interface … … 15 15 TBinarySerializer = class 16 16 private 17 FStream: TStreamByte; 17 FGrow: Boolean; 18 FList: TListByte; 18 19 FEndianness: TEndianness; 19 20 SwapData: Boolean; 21 procedure SetList(const AValue: TListByte); 20 22 procedure SetEndianness(const AValue: TEndianness); 21 23 procedure ReverseByteOrder(var Buffer; Count: Integer); 22 24 public 25 Position: Integer; 26 OwnsList: Boolean; 27 procedure Write(var Buffer; Count: Integer); //inline; 28 procedure Read(var Buffer; Count: Integer); //inline; 29 23 30 procedure Assign(Source: TBinarySerializer); 24 31 procedure WriteByte(Data: Byte); … … 48 55 procedure ReadStream(AStream: TStream; Count: Integer); 49 56 procedure ReadStreamPart(AStream: TStream; Count: Integer); 57 procedure ReadList(List: TListByte; StartIndex, Count: Integer); 50 58 constructor Create; overload; 51 constructor Create(AStream: TStreamByte); overload;52 59 procedure Clear; 53 60 destructor Destroy; override; 54 61 property Endianness: TEndianness read FEndianness write SetEndianness; 55 property Stream: TStreamByte read FStream write FStream; 62 property List: TListByte read FList write SetList; 63 property Grow: Boolean read FGrow write FGrow; 56 64 end; 57 65 … … 65 73 StringLength: Longint; 66 74 begin 67 StringLength 68 FStream.ReadBuffer(StringLength, SizeOf(StringLength));75 StringLength := 0; 76 Read(StringLength, SizeOf(StringLength)); 69 77 Result := ReadString(StringLength); 70 78 end; … … 76 84 OldPosition: Integer; 77 85 begin 78 OldPosition := FStream.Position;86 OldPosition := Position; 79 87 Result := ''; 80 88 I := 1; 81 89 repeat 82 if FStream.Position >= FStream.Sizethen Break;90 if Position >= FList.Count then Break; 83 91 Data := Chr(ReadByte); 84 92 if Data <> Terminator[I] then begin … … 89 97 if not (I > Length(Terminator)) then begin 90 98 Result := ''; 91 FStream.Position := OldPosition;99 Position := OldPosition; 92 100 end; 93 101 end; … … 96 104 begin 97 105 Result := 0; 98 FStream.ReadBuffer(Result, SizeOf(Byte));106 Read(Result, SizeOf(Byte)); 99 107 end; 100 108 … … 102 110 begin 103 111 Result := 0; 104 FStream.ReadBuffer(Result, SizeOf(Cardinal));112 Read(Result, SizeOf(Cardinal)); 105 113 if SwapData then Result := SwapEndian(Result); 106 114 end; … … 109 117 begin 110 118 Result := 0; 111 FStream.ReadBuffer(Result, SizeOf(Int64));119 Read(Result, SizeOf(Int64)); 112 120 if SwapData then Result := SwapEndian(Result); 113 121 end; … … 117 125 if Length > 0 then begin 118 126 SetLength(Result, Length); 119 FStream.ReadBuffer(Result[1], Length);127 Read(Result[1], Length); 120 128 end else Result := ''; 121 129 end; … … 126 134 begin 127 135 Count := 0; 128 FStream.ReadBuffer(Count, 1);136 Read(Count, 1); 129 137 Result := ReadString(Count); 130 138 end; … … 136 144 if Count > 0 then begin 137 145 SetLength(Buffer, Count); 138 FStream.ReadBuffer(Buffer[0], Count);146 Read(Buffer[0], Count); 139 147 AStream.Size := Count; 140 148 AStream.Position := 0; … … 149 157 if Count > 0 then begin 150 158 SetLength(Buffer, Count); 151 FStream.ReadBuffer(Buffer[0], Count);159 Read(Buffer[0], Count); 152 160 if AStream.Size < (AStream.Position + Count) then 153 161 AStream.Size := AStream.Position + Count; 154 AStream.Write(Buffer[0], Count); 162 Write(Buffer[0], Count); 163 end; 164 end; 165 166 procedure TBinarySerializer.ReadList(List: TListByte; StartIndex, Count: Integer 167 ); 168 var 169 Buffer: array of Byte; 170 begin 171 if Count > (List.Count - StartIndex) then Count := (List.Count - StartIndex); // Limit max. stream size 172 if Count > 0 then begin 173 SetLength(Buffer, Count); 174 Read(Pointer(Buffer)^, Count); 175 List.ReplaceBuffer(StartIndex, Pointer(Buffer)^, Count); 155 176 end; 156 177 end; … … 164 185 SetLength(Buffer, Count); 165 186 AStream.ReadBuffer(Pointer(Buffer)^, Count); 166 FStream.WriteBuffer(Pointer(Buffer)^, Count);187 Write(Pointer(Buffer)^, Count); 167 188 end; 168 189 end; … … 172 193 Buffer: array of Byte; 173 194 begin 174 if Count > (List.Count - StartIndex) then Count := (List.Count - StartIndex); // Limit max. stream size175 if Count > 0 then begin 176 SetLength(Buffer, Count); 177 List. ReadBuffer(Pointer(Buffer)^, Count);178 FStream.WriteBuffer(Pointer(Buffer)^, Count);195 // if Count > (List.Count - StartIndex) then Count := (List.Count - StartIndex); // Limit max. stream size 196 if Count > 0 then begin 197 SetLength(Buffer, Count); 198 List.GetBuffer(StartIndex, PByte(Buffer)^, Count); 199 Write(Pointer(Buffer)^, Count); 179 200 end; 180 201 end; … … 184 205 inherited; 185 206 Endianness := enLittle; 186 FStream := nil; 187 end; 188 189 constructor TBinarySerializer.Create(AStream: TStreamByte); 190 begin 191 inherited Create; 192 Endianness := enLittle; 193 FStream := AStream; 207 FList := nil; 208 FGrow := True; 194 209 end; 195 210 196 211 procedure TBinarySerializer.Clear; 197 212 begin 198 Stream.Size := 0; 213 FList.Count := 0; 214 Position := 0; 199 215 end; 200 216 201 217 destructor TBinarySerializer.Destroy; 202 218 begin 219 if OwnsList then FList.Free; 203 220 inherited Destroy; 204 221 end; … … 212 229 begin 213 230 Result := 0; 214 FStream.ReadBuffer(Result, SizeOf(Double));231 Read(Result, SizeOf(Double)); 215 232 end; 216 233 … … 218 235 begin 219 236 Result := 0; 220 FStream.ReadBuffer(Result, SizeOf(Single));237 Read(Result, SizeOf(Single)); 221 238 end; 222 239 … … 224 241 begin 225 242 Result := 0; 226 FStream.ReadBuffer(Result, SizeOf(Word));243 Read(Result, SizeOf(Word)); 227 244 if SwapData then Result := SwapEndian(Result); 245 end; 246 247 procedure TBinarySerializer.SetList(const AValue: TListByte); 248 begin 249 if OwnsList then FList.Free; 250 FList := AValue; 228 251 end; 229 252 … … 254 277 end; 255 278 279 procedure TBinarySerializer.Write(var Buffer; Count: Integer); 280 var 281 NewCount: Integer; 282 begin 283 if FGrow then begin 284 NewCount := Position + Count; 285 if FList.Count < NewCount then 286 FList.Count := NewCount; 287 end; 288 FList.ReplaceBuffer(Position, Buffer, Count); 289 Inc(Position, Count); 290 end; 291 292 procedure TBinarySerializer.Read(var Buffer; Count: Integer); 293 begin 294 FList.GetBuffer(Position, Buffer, Count); 295 Inc(Position, Count); 296 end; 297 256 298 procedure TBinarySerializer.Assign(Source: TBinarySerializer); 257 299 begin 258 F Stream := Source.FStream;300 FList := Source.FList; 259 301 end; 260 302 … … 270 312 procedure TBinarySerializer.WriteByte(Data: Byte); 271 313 begin 272 Data := 0; 273 FStream.WriteBuffer(Data, SizeOf(Byte)); 314 Write(Data, SizeOf(Byte)); 274 315 end; 275 316 … … 307 348 SetLength(Buffer, Count); 308 349 AStream.ReadBuffer(Pointer(Buffer)^, Count); 309 FStream.WriteBuffer(Pointer(Buffer)^, Count);350 Write(Pointer(Buffer)^, Count); 310 351 end; 311 352 end; -
trunk/Packages/TemplateGenerics/Generic/GenericBitmap.inc
r54 r93 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'} -
trunk/Packages/TemplateGenerics/Generic/GenericDictionary.inc
r54 r93 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'} -
trunk/Packages/TemplateGenerics/Generic/GenericList.inc
r54 r93 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: TGListSortCompare); 40 procedure QuickSort(L, R : TGListIndex; Compare: TSortCompare); 41 procedure DoUpdate; 37 42 protected 38 43 procedure Put(Index: TGListIndex; const AValue: TGListItem); virtual; … … 51 56 function EqualTo(List: TGList): Boolean; 52 57 procedure Exchange(Index1, Index2: TGListIndex); 53 procedure Explode(Text, Separator: string; Converter: T GListFromStringConverter; SlicesCount: Integer = -1);58 procedure Explode(Text, Separator: string; Converter: TFromStringConverter; SlicesCount: Integer = -1); 54 59 function Extract(Item: TGListItem): TGListItem; 55 60 property First: TGListItem read GetFirst write SetFirst; 56 61 procedure Fill(Start, Count: TGListIndex; Value: TGListItem); 57 function GetArray(Index, ACount: TGListIndex): T GListItemArray;62 function GetArray(Index, ACount: TGListIndex): TItemArray; 58 63 procedure GetList(List: TGList; Index, ACount: TGListIndex); 59 function Implode(Separator: string; Converter: TGListToStringConverter): string; 64 procedure GetBuffer(Index: TGListIndex; var Buffer; Count: TGListIndex); 65 function Implode(Separator: string; Converter: TToStringConverter): string; 60 66 function IndexOf(Item: TGListItem; Start: TGListIndex = 0): TGListIndex; virtual; 61 67 function IndexOfList(List: TGList; Start: TGListIndex = 0): TGListIndex; … … 73 79 procedure ReplaceListPart(Index: TGListIndex; Source: TGList; 74 80 SourceIndex, SourceCount: TGListIndex); 75 procedure Sort(Compare: TGListSortCompare); 81 procedure ReplaceBuffer(Index: TGListIndex; var Buffer; Count: TGListIndex); 82 procedure Sort(Compare: TSortCompare); 76 83 procedure SetArray(Values: array of TGListItem); 77 84 procedure BeginUpdate; … … 82 89 property Items[Index: TGListIndex]: TGListItem read Get write Put; default; 83 90 property Last: TGListItem read GetLast write SetLast; 84 end; 85 91 property OnUpdate: TNotifyEvent read FOnUpdate write FOnUpdate; 92 end; 93 86 94 {$UNDEF INTERFACE} 87 95 {$ENDIF} … … 102 110 begin 103 111 FCount := 0; 112 FUpdateCount := 0; 113 end; 114 115 procedure TGList.GetBuffer(Index: TGListIndex; var Buffer; Count: TGListIndex); 116 var 117 P: PItem; 118 I: TGListIndex; 119 begin 120 if (Index + Count) > FCount then 121 raise EListError.CreateFmt(SListIndexError, [Index + Count]); 122 P := PItem(@Buffer); 123 I := 0; 124 while I < Count do begin 125 P^ := Items[Index + I]; 126 Inc(P, 1); 127 I := I + 1; 128 end; 129 end; 130 131 procedure TGList.ReplaceBuffer(Index: TGListIndex; var Buffer; Count: TGListIndex); 132 var 133 P: PItem; 134 I: TGListIndex; 135 begin 136 if (Index + Count) > FCount then 137 raise EListError.CreateFmt(SListIndexError, [Index + Count]); 138 P := PItem(@Buffer); 139 I := 0; 140 while I < Count do begin 141 Items[Index + I] := P^; 142 Inc(P, 1); 143 I := I + 1; 144 end; 104 145 end; 105 146 … … 200 241 end; 201 242 202 function TGList.GetArray(Index, ACount: TGListIndex): T GListItemArray;243 function TGList.GetArray(Index, ACount: TGListIndex): TItemArray; 203 244 var 204 245 I: Integer; … … 218 259 end; 219 260 220 procedure TGList.QuickSort(L, R: TGListIndex; Compare: T GListSortCompare);261 procedure TGList.QuickSort(L, R: TGListIndex; Compare: TSortCompare); 221 262 var 222 263 I, J: TGListIndex; … … 302 343 if (Index < 0) or (Index > FCount) then 303 344 raise EListError.CreateFmt(SListIndexError, [Index]); 304 InsertCount(Index, 1); 305 FItems[Index] := Item; 306 Update; 345 try 346 BeginUpdate; 347 InsertCount(Index, 1); 348 FItems[Index] := Item; 349 finally 350 EndUpdate; 351 end; 307 352 end; 308 353 … … 487 532 end; 488 533 489 procedure TGList.Sort(Compare: T GListSortCompare);534 procedure TGList.Sort(Compare: TSortCompare); 490 535 begin 491 536 if FCount > 1 then … … 525 570 procedure TGList.EndUpdate; 526 571 begin 527 Dec(FUpdateCount); 528 Update; 572 if FUpdateCount > 0 then Dec(FUpdateCount); 573 if FUpdateCount = 0 then DoUpdate; 574 end; 575 576 procedure TGList.DoUpdate; 577 begin 578 if Assigned(FOnUpdate) then FOnUpdate(Self); 529 579 end; 530 580 531 581 procedure TGList.Update; 532 582 begin 533 if Assigned(FOnUpdate) and (FUpdateCount = 0) then FOnUpdate(Self);534 end; 535 536 function TGList.Implode(Separator: string; Converter: T GListToStringConverter): string;583 if FUpdateCount = 0 then DoUpdate; 584 end; 585 586 function TGList.Implode(Separator: string; Converter: TToStringConverter): string; 537 587 var 538 588 I: TGListIndex; … … 548 598 end; 549 599 550 procedure TGList.Explode(Text, Separator: string; Converter: T GListFromStringConverter; SlicesCount: Integer = -1);600 procedure TGList.Explode(Text, Separator: string; Converter: TFromStringConverter; SlicesCount: Integer = -1); 551 601 begin 552 602 Clear; -
trunk/Packages/TemplateGenerics/Generic/GenericListObject.inc
r54 r93 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'} … … 96 88 end; 97 89 end; 90 I := FCount; 98 91 inherited; 92 // Nil newly allocated items 93 while I < AValue do begin 94 FItems[I] := nil; 95 I := I + 1; 96 end; 99 97 end; 100 98 … … 108 106 begin 109 107 Clear; 110 inherited Destroy;108 inherited; 111 109 end; 112 110 -
trunk/Packages/TemplateGenerics/Generic/GenericListString.inc
r54 r93 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'} -
trunk/Packages/TemplateGenerics/Generic/GenericMatrix.inc
r72 r93 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): TGMatrixIndex;52 function IndexOfList(List: TGMatrix; Start: T GMatrixIndex): 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): TIndex; 53 function IndexOfList(List: TGMatrix; Start: TIndex): 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; -
trunk/Packages/TemplateGenerics/Generic/GenericQueue.inc
r54 r93 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'} -
trunk/Packages/TemplateGenerics/Generic/GenericSet.inc
r54 r93 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'} -
trunk/Packages/TemplateGenerics/Generic/GenericStack.inc
r54 r93 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'} -
trunk/Packages/TemplateGenerics/Generic/GenericStream.inc
r54 r93 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; -
trunk/Packages/TemplateGenerics/Generic/GenericTree.inc
r54 r93 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'} -
trunk/Packages/TemplateGenerics/Specialized/SpecializedDictionary.pas
r54 r93 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'} -
trunk/Packages/TemplateGenerics/Specialized/SpecializedList.pas
r54 r93 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'} … … 95 67 procedure AddStream(Stream: TStream); 96 68 procedure AddStreamPart(Stream: TStream; ItemCount: TGListIndex); 97 procedure WriteBuffer(var Buffer; Count: Integer);98 procedure ReadBuffer(var Buffer; Count: Integer);99 69 end; 100 70 … … 103 73 {$DEFINE TGListItem := Char} 104 74 {$DEFINE TGList := TListCharBase} 105 {$DEFINE TGListSortCompare := TListSortCompareChar}106 {$DEFINE TGListToStringConverter := TListToStringConverterChar}107 {$DEFINE TGListFromStringConverter := TListFromStringConverterChar}108 {$DEFINE TGListItemArray := TListStringItemArray}109 75 {$DEFINE INTERFACE} 110 76 {$I 'GenericList.inc'} … … 115 81 {$DEFINE TGListObjectList := TListObjectList} 116 82 {$DEFINE TGListObject := TListObject} 117 {$DEFINE TGListObjectSortCompare := TListObjectSortCompare}118 {$DEFINE TGListObjectToStringConverter := TListObjectToStringConverter}119 {$DEFINE TGListObjectFromStringConverter := TListObjectFromStringConverter}120 {$DEFINE TGListItemArray := TListObjectItemArray}121 83 {$DEFINE INTERFACE} 122 84 {$I 'GenericListObject.inc'} … … 138 100 {$DEFINE TGListItem := TMethod} 139 101 {$DEFINE TGList := TListMethodBase} 140 {$DEFINE TGListSortCompare := TListMethodSortCompare}141 {$DEFINE TGListToStringConverter := TListMethodToStringConverter}142 {$DEFINE TGListFromStringConverter := TListMethodFromStringConverter}143 {$DEFINE TGListItemArray := TListMethodItemArray}144 102 {$DEFINE INTERFACE} 145 103 {$I 'GenericList.inc'} … … 154 112 {$DEFINE TGListItem := TNotifyEvent} 155 113 {$DEFINE TGList := TListNotifyEventBase} 156 {$DEFINE TGListSortCompare := TListNotifyEventSortCompare}157 {$DEFINE TGListToStringConverter := TListNotifyEventToStringConverter}158 {$DEFINE TGListFromStringConverter := TListNotifyEventFromStringConverter}159 {$DEFINE TGListItemArray := TListNotifyEventItemArray}160 114 {$DEFINE INTERFACE} 161 115 {$I 'GenericList.inc'} … … 166 120 end; 167 121 122 123 TBaseEvent = procedure of object; 124 125 // TListSimpleEventBase<Integer, TBaseEvent> 126 {$DEFINE TGListIndex := Integer} 127 {$DEFINE TGListItem := TBaseEvent} 128 {$DEFINE TGList := TListSimpleEventBase} 129 {$DEFINE INTERFACE} 130 {$I 'GenericList.inc'} 131 132 // TListSimpleEvent<Integer, TSimpleEvent> 133 TListSimpleEvent = class(TListSimpleEventBase) 134 procedure CallAll; 135 end; 136 137 138 // TFileListByte<Integer, Byte> 139 {$DEFINE TGFileListIndex := Integer} 140 {$DEFINE TGFileListItem := Byte} 141 {$DEFINE TGFileListList := TFileListListByte} 142 {$DEFINE TGFileList := TFileListByte} 143 {$DEFINE INTERFACE} 144 {$I 'GenericFileList.inc'} 145 168 146 function StrToStr(Value: string): string; 147 148 149 150 169 151 170 152 implementation … … 177 159 {$DEFINE TGListItem := Integer} 178 160 {$DEFINE TGList := TListInteger} 179 {$DEFINE TGListSortCompare := TListIntegerSortCompare}180 {$DEFINE TGListToStringConverter := TListIntegerToStringConverter}181 {$DEFINE TGListFromStringConverter := TListIntegerFromStringConverter}182 {$DEFINE TGListItemArray := TListIntegerItemArray}183 161 {$DEFINE IMPLEMENTATION} 184 162 {$I 'GenericList.inc'} … … 188 166 {$DEFINE TGListItem := SmallInt} 189 167 {$DEFINE TGList := TListSmallInt} 190 {$DEFINE TGListSortCompare := TListSmallIntSortCompare}191 {$DEFINE TGListToStringConverter := TListSmallIntToStringConverter}192 {$DEFINE TGListFromStringConverter := TListSmallIntFromStringConverter}193 {$DEFINE TGListItemArray := TListSmallIntItemArray}194 168 {$DEFINE IMPLEMENTATION} 195 169 {$I 'GenericList.inc'} … … 199 173 {$DEFINE TGListItem := Boolean} 200 174 {$DEFINE TGList := TListBoolean} 201 {$DEFINE TGListSortCompare := TListBooleanSortCompare}202 {$DEFINE TGListToStringConverter := TListBooleanToStringConverter}203 {$DEFINE TGListFromStringConverter := TListBooleanFromStringConverter}204 {$DEFINE TGListItemArray := TListBooleanItemArray}205 175 {$DEFINE IMPLEMENTATION} 206 176 {$I 'GenericList.inc'} … … 210 180 {$DEFINE TGListItem := Double} 211 181 {$DEFINE TGList := TListDouble} 212 {$DEFINE TGListSortCompare := TListDoubleSortCompare}213 {$DEFINE TGListToStringConverter := TListDoubleToStringConverter}214 {$DEFINE TGListFromStringConverter := TListDoubleFromStringConverter}215 {$DEFINE TGListItemArray := TListDoubleItemArray}216 182 {$DEFINE IMPLEMENTATION} 217 183 {$I 'GenericList.inc'} … … 221 187 {$DEFINE TGListItem := Pointer} 222 188 {$DEFINE TGList := TListPointer} 223 {$DEFINE TGListSortCompare := TListPointerSortCompare}224 {$DEFINE TGListToStringConverter := TListPointerToStringConverter}225 {$DEFINE TGListFromStringConverter := TListPointerFromStringConverter}226 {$DEFINE TGListItemArray := TListPointerItemArray}227 189 {$DEFINE IMPLEMENTATION} 228 190 {$I 'GenericList.inc'} … … 232 194 {$DEFINE TGListStringItem := string} 233 195 {$DEFINE TGListString := TListString} 234 {$DEFINE TGListStringSortCompare := TListStringSortCompare}235 {$DEFINE TGListStringToStringConverter := TListStringToStringConverter}236 {$DEFINE TGListStringFromStringConverter := TListStringFromStringConverter}237 {$DEFINE TGListItemArray := TListStringItemArray}238 196 {$DEFINE IMPLEMENTATION} 239 197 {$I 'GenericListString.inc'} … … 243 201 {$DEFINE TGListItem := Byte} 244 202 {$DEFINE TGList := TListByteBase} 245 {$DEFINE TGListSortCompare := TListByteSortCompare}246 {$DEFINE TGListToStringConverter := TListByteToStringConverter}247 {$DEFINE TGListFromStringConverter := TListByteFromStringConverter}248 {$DEFINE TGListItemArray := TListByteItemArray}249 203 {$DEFINE IMPLEMENTATION} 250 204 {$I 'GenericList.inc'} … … 254 208 {$DEFINE TGListItem := Char} 255 209 {$DEFINE TGList := TListCharBase} 256 {$DEFINE TGListSortCompare := TListSortCompareChar}257 {$DEFINE TGListToStringConverter := TListToStringConverterChar}258 {$DEFINE TGListFromStringConverter := TListFromStringConverterChar}259 {$DEFINE TGListItemArray := TListStringItemArray}260 210 {$DEFINE IMPLEMENTATION} 261 211 {$I 'GenericList.inc'} … … 266 216 {$DEFINE TGListObjectList := TListObjectList} 267 217 {$DEFINE TGListObject := TListObject} 268 {$DEFINE TGListObjectSortCompare := TListObjectSortCompare}269 {$DEFINE TGListObjectToStringConverter := TListObjectToStringConverter}270 {$DEFINE TGListObjectFromStringConverter := TListObjectFromStringConverter}271 {$DEFINE TGListItemArray := TListObjectItemArray}272 218 {$DEFINE IMPLEMENTATION} 273 219 {$I 'GenericListObject.inc'} … … 277 223 {$DEFINE TGListItem := TMethod} 278 224 {$DEFINE TGList := TListMethodBase} 279 {$DEFINE TGListSortCompare := TListMethodSortCompare}280 {$DEFINE TGListToStringConverter := TListMethodToStringConverter}281 {$DEFINE TGListFromStringConverter := TListMethodFromStringConverter}282 {$DEFINE TGListItemArray := TListMethodItemArray}283 225 {$DEFINE IMPLEMENTATION} 284 226 {$I 'GenericList.inc'} … … 288 230 {$DEFINE TGListItem := TNotifyEvent} 289 231 {$DEFINE TGList := TListNotifyEventBase} 290 {$DEFINE TGListSortCompare := TListNotifyEventSortCompare} 291 {$DEFINE TGListToStringConverter := TListNotifyEventToStringConverter} 292 {$DEFINE TGListFromStringConverter := TListNotifyEventFromStringConverter} 293 {$DEFINE TGListItemArray := TListNotifyEventItemArray} 294 {$DEFINE IMPLEMENTATION} 295 {$I 'GenericList.inc'} 232 {$DEFINE IMPLEMENTATION} 233 {$I 'GenericList.inc'} 234 235 // TListSimpleEventBase<Integer, TBaseEvent> 236 {$DEFINE TGListIndex := Integer} 237 {$DEFINE TGListItem := TBaseEvent} 238 {$DEFINE TGList := TListSimpleEventBase} 239 {$DEFINE IMPLEMENTATION} 240 {$I 'GenericList.inc'} 241 242 // TFileListByte<Integer, Byte> 243 {$DEFINE TGFileListIndex := Integer} 244 {$DEFINE TGFileListItem := Byte} 245 {$DEFINE TGFileListList := TFileListListByte} 246 {$DEFINE TGFileList := TFileListByte} 247 {$DEFINE IMPLEMENTATION} 248 {$I 'GenericFileList.inc'} 296 249 297 250 … … 300 253 Result := Value; 301 254 end; 255 256 { TListSimpleEvent } 257 258 procedure TListSimpleEvent.CallAll; 259 var 260 I: TGListIndex; 261 begin 262 I := 0; 263 while (I < Count) do begin 264 TBaseEvent(Items[I])(); 265 I := I + 1; 266 end; 267 end; 268 302 269 303 270 { TListChar } … … 364 331 I: TGListIndex; 365 332 begin 366 I := 0;367 while (I < Count) do begin333 I := Count - 1; 334 while (I >= 0) do begin 368 335 TNotifyEvent(Items[I])(Sender); 369 I := I +1;336 I := I - 1; 370 337 end; 371 338 end; … … 445 412 end; 446 413 447 procedure TListByte.WriteBuffer(var Buffer; Count: Integer);448 begin449 450 end;451 452 procedure TListByte.ReadBuffer(var Buffer; Count: Integer);453 begin454 455 end;456 414 457 415 end. -
trunk/Packages/TemplateGenerics/Specialized/SpecializedMatrix.pas
r54 r93 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'} -
trunk/Packages/TemplateGenerics/Specialized/SpecializedPoint.pas
r54 r93 1 1 unit SpecializedPoint; 2 2 3 {$mode objfpc}{$H+}3 {$mode Delphi}{$H+} 4 4 5 5 interface -
trunk/Packages/TemplateGenerics/Specialized/SpecializedQueue.pas
r54 r93 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'} -
trunk/Packages/TemplateGenerics/Specialized/SpecializedSet.pas
r54 r93 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'} -
trunk/Packages/TemplateGenerics/Specialized/SpecializedStack.pas
r54 r93 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'} -
trunk/Packages/TemplateGenerics/Specialized/SpecializedStream.pas
r54 r93 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'} -
trunk/Packages/TemplateGenerics/Specialized/SpecializedTree.pas
r54 r93 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'} -
trunk/Packages/TemplateGenerics/TemplateGenerics.lpk
r82 r93 1 <?xml version="1.0" encoding="UTF-8"?>1 <?xml version="1.0"?> 2 2 <CONFIG> 3 3 <Package Version="4"> 4 4 <PathDelim Value="\"/> 5 5 <Name Value="TemplateGenerics"/> 6 <Type Value="RunAndDesignTime"/>7 6 <AddToProjectUsesSection Value="True"/> 8 7 <Author Value="Chronos (robie@centrum.cz)"/> … … 17 16 <CodeGeneration> 18 17 <Optimizations> 18 <VariablesInRegisters Value="True"/> 19 19 <OptimizationLevel Value="3"/> 20 <VariablesInRegisters Value="True"/>21 20 </Optimizations> 22 21 </CodeGeneration> 23 22 <Other> 24 23 <CompilerMessages> 25 < IgnoredMessages idx5024="True"/>24 <UseMsgFile Value="True"/> 26 25 </CompilerMessages> 26 <CompilerPath Value="$(CompPath)"/> 27 27 </Other> 28 28 </CompilerOptions> 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> 144 <Type Value="RunAndDesignTime"/> 141 145 <RequiredPkgs Count="2"> 142 146 <Item1>
Note:
See TracChangeset
for help on using the changeset viewer.