Ignore:
Timestamp:
Jul 20, 2018, 10:25:06 AM (6 years ago)
Author:
chronos
Message:
Location:
trunk
Files:
2 added
1 deleted
23 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        66compiled
        77heaptrclog.trc
         8LazFuck.dbg
  • trunk/Packages/TemplateGenerics/Additional/UBinarySerializer.pas

    r72 r93  
    11unit UBinarySerializer;
    22
    3 {$mode objfpc}{$H+}
     3{$mode delphi}{$H+}
    44
    55interface
     
    1515  TBinarySerializer = class
    1616  private
    17     FStream: TStreamByte;
     17    FGrow: Boolean;
     18    FList: TListByte;
    1819    FEndianness: TEndianness;
    1920    SwapData: Boolean;
     21    procedure SetList(const AValue: TListByte);
    2022    procedure SetEndianness(const AValue: TEndianness);
    2123    procedure ReverseByteOrder(var Buffer; Count: Integer);
    2224  public
     25    Position: Integer;
     26    OwnsList: Boolean;
     27    procedure Write(var Buffer; Count: Integer); //inline;
     28    procedure Read(var Buffer; Count: Integer); //inline;
     29
    2330    procedure Assign(Source: TBinarySerializer);
    2431    procedure WriteByte(Data: Byte);
     
    4855    procedure ReadStream(AStream: TStream; Count: Integer);
    4956    procedure ReadStreamPart(AStream: TStream; Count: Integer);
     57    procedure ReadList(List: TListByte; StartIndex, Count: Integer);
    5058    constructor Create; overload;
    51     constructor Create(AStream: TStreamByte); overload;
    5259    procedure Clear;
    5360    destructor Destroy; override;
    5461    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;
    5664  end;
    5765
     
    6573  StringLength: Longint;
    6674begin
    67   StringLength  := 0;
    68   FStream.ReadBuffer(StringLength, SizeOf(StringLength));
     75  StringLength := 0;
     76  Read(StringLength, SizeOf(StringLength));
    6977  Result := ReadString(StringLength);
    7078end;
     
    7684  OldPosition: Integer;
    7785begin
    78   OldPosition := FStream.Position;
     86  OldPosition := Position;
    7987  Result := '';
    8088  I := 1;
    8189  repeat
    82     if FStream.Position >= FStream.Size then Break;
     90    if Position >= FList.Count then Break;
    8391    Data := Chr(ReadByte);
    8492    if Data <> Terminator[I] then begin
     
    8997  if not (I > Length(Terminator)) then begin
    9098    Result := '';
    91     FStream.Position := OldPosition;
     99    Position := OldPosition;
    92100  end;
    93101end;
     
    96104begin
    97105  Result := 0;
    98   FStream.ReadBuffer(Result, SizeOf(Byte));
     106  Read(Result, SizeOf(Byte));
    99107end;
    100108
     
    102110begin
    103111  Result := 0;
    104   FStream.ReadBuffer(Result, SizeOf(Cardinal));
     112  Read(Result, SizeOf(Cardinal));
    105113  if SwapData then Result := SwapEndian(Result);
    106114end;
     
    109117begin
    110118  Result := 0;
    111   FStream.ReadBuffer(Result, SizeOf(Int64));
     119  Read(Result, SizeOf(Int64));
    112120  if SwapData then Result := SwapEndian(Result);
    113121end;
     
    117125  if Length > 0 then begin
    118126    SetLength(Result, Length);
    119     FStream.ReadBuffer(Result[1], Length);
     127    Read(Result[1], Length);
    120128  end else Result := '';
    121129end;
     
    126134begin
    127135  Count := 0;
    128   FStream.ReadBuffer(Count, 1);
     136  Read(Count, 1);
    129137  Result := ReadString(Count);
    130138end;
     
    136144  if Count > 0 then begin
    137145    SetLength(Buffer, Count);
    138     FStream.ReadBuffer(Buffer[0], Count);
     146    Read(Buffer[0], Count);
    139147    AStream.Size := Count;
    140148    AStream.Position := 0;
     
    149157  if Count > 0 then begin
    150158    SetLength(Buffer, Count);
    151     FStream.ReadBuffer(Buffer[0], Count);
     159    Read(Buffer[0], Count);
    152160    if AStream.Size < (AStream.Position + Count) then
    153161      AStream.Size := AStream.Position + Count;
    154     AStream.Write(Buffer[0], Count);
     162    Write(Buffer[0], Count);
     163  end;
     164end;
     165
     166procedure TBinarySerializer.ReadList(List: TListByte; StartIndex, Count: Integer
     167  );
     168var
     169  Buffer: array of Byte;
     170begin
     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);
    155176  end;
    156177end;
     
    164185    SetLength(Buffer, Count);
    165186    AStream.ReadBuffer(Pointer(Buffer)^, Count);
    166     FStream.WriteBuffer(Pointer(Buffer)^, Count);
     187    Write(Pointer(Buffer)^, Count);
    167188  end;
    168189end;
     
    172193  Buffer: array of Byte;
    173194begin
    174   if Count > (List.Count - StartIndex) then Count := (List.Count - StartIndex); // Limit max. stream size
    175   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);
    179200  end;
    180201end;
     
    184205  inherited;
    185206  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;
    194209end;
    195210
    196211procedure TBinarySerializer.Clear;
    197212begin
    198   Stream.Size := 0;
     213  FList.Count := 0;
     214  Position := 0;
    199215end;
    200216
    201217destructor TBinarySerializer.Destroy;
    202218begin
     219  if OwnsList then FList.Free;
    203220  inherited Destroy;
    204221end;
     
    212229begin
    213230  Result := 0;
    214   FStream.ReadBuffer(Result, SizeOf(Double));
     231  Read(Result, SizeOf(Double));
    215232end;
    216233
     
    218235begin
    219236  Result := 0;
    220   FStream.ReadBuffer(Result, SizeOf(Single));
     237  Read(Result, SizeOf(Single));
    221238end;
    222239
     
    224241begin
    225242  Result := 0;
    226   FStream.ReadBuffer(Result, SizeOf(Word));
     243  Read(Result, SizeOf(Word));
    227244  if SwapData then Result := SwapEndian(Result);
     245end;
     246
     247procedure TBinarySerializer.SetList(const AValue: TListByte);
     248begin
     249  if OwnsList then FList.Free;
     250  FList := AValue;
    228251end;
    229252
     
    254277end;
    255278
     279procedure TBinarySerializer.Write(var Buffer; Count: Integer);
     280var
     281  NewCount: Integer;
     282begin
     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);
     290end;
     291
     292procedure TBinarySerializer.Read(var Buffer; Count: Integer);
     293begin
     294  FList.GetBuffer(Position, Buffer, Count);
     295  Inc(Position, Count);
     296end;
     297
    256298procedure TBinarySerializer.Assign(Source: TBinarySerializer);
    257299begin
    258   FStream := Source.FStream;
     300  FList := Source.FList;
    259301end;
    260302
     
    270312procedure TBinarySerializer.WriteByte(Data: Byte);
    271313begin
    272   Data := 0;
    273   FStream.WriteBuffer(Data, SizeOf(Byte));
     314  Write(Data, SizeOf(Byte));
    274315end;
    275316
     
    307348    SetLength(Buffer, Count);
    308349    AStream.ReadBuffer(Pointer(Buffer)^, Count);
    309     FStream.WriteBuffer(Pointer(Buffer)^, Count);
     350    Write(Pointer(Buffer)^, Count);
    310351  end;
    311352end;
  • trunk/Packages/TemplateGenerics/Generic/GenericBitmap.inc

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

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

    r54 r93  
    1212  // - all items operations (Clear, Reverse, Sort)
    1313
    14   TGList = class;
    15 
    16   TGListSortCompare = function(Item1, Item2: TGListItem): Integer of object;
    17   TGListToStringConverter = function(Item: TGListItem): string;
    18   TGListFromStringConverter = function(Text: string): TGListItem;
    19   TGListItemArray = array of TGListItem;
     14  //TGAbstractList = class
     15
     16  //end;
    2017
    2118  // TGList<TGListIndex, TGListItem> = class
    22   TGList = class
     19  TGList = class//(TGAbstractList)
     20  public
     21    type
     22      PItem = ^TGListItem;
     23      TSortCompare = function(Item1, Item2: TGListItem): Integer of object;
     24      TToStringConverter = function(Item: TGListItem): string;
     25      TFromStringConverter = function(Text: string): TGListItem;
     26      TItemArray = array of TGListItem;
    2327  private
    2428    FItems: array of TGListItem;
     
    3438    procedure SetLast(AValue: TGListItem);
    3539    procedure SetFirst(AValue: TGListItem);
    36     procedure QuickSort(L, R : TGListIndex; Compare: TGListSortCompare);
     40    procedure QuickSort(L, R : TGListIndex; Compare: TSortCompare);
     41    procedure DoUpdate;
    3742  protected
    3843    procedure Put(Index: TGListIndex; const AValue: TGListItem); virtual;
     
    5156    function EqualTo(List: TGList): Boolean;
    5257    procedure Exchange(Index1, Index2: TGListIndex);
    53     procedure Explode(Text, Separator: string; Converter: TGListFromStringConverter; SlicesCount: Integer = -1);
     58    procedure Explode(Text, Separator: string; Converter: TFromStringConverter; SlicesCount: Integer = -1);
    5459    function Extract(Item: TGListItem): TGListItem;
    5560    property First: TGListItem read GetFirst write SetFirst;
    5661    procedure Fill(Start, Count: TGListIndex; Value: TGListItem);
    57     function GetArray(Index, ACount: TGListIndex): TGListItemArray;
     62    function GetArray(Index, ACount: TGListIndex): TItemArray;
    5863    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;
    6066    function IndexOf(Item: TGListItem; Start: TGListIndex = 0): TGListIndex; virtual;
    6167    function IndexOfList(List: TGList; Start: TGListIndex = 0): TGListIndex;
     
    7379    procedure ReplaceListPart(Index: TGListIndex; Source: TGList;
    7480      SourceIndex, SourceCount: TGListIndex);
    75     procedure Sort(Compare: TGListSortCompare);
     81    procedure ReplaceBuffer(Index: TGListIndex; var Buffer; Count: TGListIndex);
     82    procedure Sort(Compare: TSortCompare);
    7683    procedure SetArray(Values: array of TGListItem);
    7784    procedure BeginUpdate;
     
    8289    property Items[Index: TGListIndex]: TGListItem read Get write Put; default;
    8390    property Last: TGListItem read GetLast write SetLast;
    84   end;
    85  
     91    property OnUpdate: TNotifyEvent read FOnUpdate write FOnUpdate;
     92  end;
     93
    8694{$UNDEF INTERFACE}
    8795{$ENDIF}
     
    102110begin
    103111  FCount := 0;
     112  FUpdateCount := 0;
     113end;
     114
     115procedure TGList.GetBuffer(Index: TGListIndex; var Buffer; Count: TGListIndex);
     116var
     117  P: PItem;
     118  I: TGListIndex;
     119begin
     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;
     129end;
     130
     131procedure TGList.ReplaceBuffer(Index: TGListIndex; var Buffer; Count: TGListIndex);
     132var
     133  P: PItem;
     134  I: TGListIndex;
     135begin
     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;
    104145end;
    105146
     
    200241end;
    201242
    202 function TGList.GetArray(Index, ACount: TGListIndex): TGListItemArray;
     243function TGList.GetArray(Index, ACount: TGListIndex): TItemArray;
    203244var
    204245  I: Integer;
     
    218259end;
    219260
    220 procedure TGList.QuickSort(L, R: TGListIndex; Compare: TGListSortCompare);
     261procedure TGList.QuickSort(L, R: TGListIndex; Compare: TSortCompare);
    221262var
    222263  I, J: TGListIndex;
     
    302343  if (Index < 0) or (Index > FCount) then
    303344    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;
    307352end;
    308353
     
    487532end;
    488533
    489 procedure TGList.Sort(Compare: TGListSortCompare);
     534procedure TGList.Sort(Compare: TSortCompare);
    490535begin
    491536  if FCount > 1 then
     
    525570procedure TGList.EndUpdate;
    526571begin
    527   Dec(FUpdateCount);
    528   Update;
     572  if FUpdateCount > 0 then Dec(FUpdateCount);
     573  if FUpdateCount = 0 then DoUpdate;
     574end;
     575
     576procedure TGList.DoUpdate;
     577begin
     578  if Assigned(FOnUpdate) then FOnUpdate(Self);
    529579end;
    530580
    531581procedure TGList.Update;
    532582begin
    533   if Assigned(FOnUpdate) and (FUpdateCount = 0) then FOnUpdate(Self);
    534 end;
    535 
    536 function TGList.Implode(Separator: string; Converter: TGListToStringConverter): string;
     583  if FUpdateCount = 0 then DoUpdate;
     584end;
     585
     586function TGList.Implode(Separator: string; Converter: TToStringConverter): string;
    537587var
    538588  I: TGListIndex;
     
    548598end;
    549599
    550 procedure TGList.Explode(Text, Separator: string; Converter: TGListFromStringConverter; SlicesCount: Integer = -1);
     600procedure TGList.Explode(Text, Separator: string; Converter: TFromStringConverter; SlicesCount: Integer = -1);
    551601begin
    552602  Clear;
  • trunk/Packages/TemplateGenerics/Generic/GenericListObject.inc

    r54 r93  
    44{$DEFINE TGListItem := TGListObjectItem}
    55{$DEFINE TGList := TGListObjectList}
    6 {$DEFINE TGListSortCompare := TGListObjectSortCompare}
    7 {$DEFINE TGListToStringConverter := TGListObjectToStringConverter}
    8 {$DEFINE TGListFromStringConverter := TGListObjectFromStringConverter}
    9 {$DEFINE TGListItemArray := TGListObjectItemArray}
    106{$DEFINE INTERFACE}
    117{$I 'GenericList.inc'}
     
    4238{$DEFINE TGListItem := TGListObjectItem}
    4339{$DEFINE TGList := TGListObjectList}
    44 {$DEFINE TGListSortCompare := TGListObjectSortCompare}
    45 {$DEFINE TGListToStringConverter := TGListObjectToStringConverter}
    46 {$DEFINE TGListFromStringConverter := TGListObjectFromStringConverter}
    47 {$DEFINE TGListItemArray := TGListObjectItemArray}
    4840{$DEFINE IMPLEMENTATION}
    4941{$I 'GenericList.inc'}
     
    9688    end;
    9789  end;
     90  I := FCount;
    9891  inherited;
     92  // Nil newly allocated items
     93  while I < AValue do begin
     94    FItems[I] := nil;
     95    I := I + 1;
     96  end;
    9997end;
    10098
     
    108106begin
    109107  Clear;
    110   inherited Destroy;
     108  inherited;
    111109end;
    112110
  • trunk/Packages/TemplateGenerics/Generic/GenericListString.inc

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

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

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

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

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

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

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

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

    r54 r93  
    1515{$DEFINE TGListItem := Integer}
    1616{$DEFINE TGList := TListInteger}
    17 {$DEFINE TGListSortCompare := TListIntegerSortCompare}
    18 {$DEFINE TGListToStringConverter := TListIntegerToStringConverter}
    19 {$DEFINE TGListFromStringConverter := TListIntegerFromStringConverter}
    20 {$DEFINE TGListItemArray := TListIntegerItemArray}
    2117{$DEFINE INTERFACE}
    2218{$I 'GenericList.inc'}
     
    2622{$DEFINE TGListItem := Boolean}
    2723{$DEFINE TGList := TListBoolean}
    28 {$DEFINE TGListSortCompare := TListBooleanSortCompare}
    29 {$DEFINE TGListToStringConverter := TListBooleanToStringConverter}
    30 {$DEFINE TGListFromStringConverter := TListBooleanFromStringConverter}
    31 {$DEFINE TGListItemArray := TListBooleanItemArray}
    3224{$DEFINE INTERFACE}
    3325{$I 'GenericList.inc'}
     
    3729{$DEFINE TGListItem := SmallInt}
    3830{$DEFINE TGList := TListSmallInt}
    39 {$DEFINE TGListSortCompare := TListSmallIntSortCompare}
    40 {$DEFINE TGListToStringConverter := TListSmallIntToStringConverter}
    41 {$DEFINE TGListFromStringConverter := TListSmallIntFromStringConverter}
    42 {$DEFINE TGListItemArray := TListSmallIntItemArray}
    4331{$DEFINE INTERFACE}
    4432{$I 'GenericList.inc'}
     
    4836{$DEFINE TGListItem := Double}
    4937{$DEFINE TGList := TListDouble}
    50 {$DEFINE TGListSortCompare := TListDoubleSortCompare}
    51 {$DEFINE TGListToStringConverter := TListDoubleToStringConverter}
    52 {$DEFINE TGListFromStringConverter := TListDoubleFromStringConverter}
    53 {$DEFINE TGListItemArray := TListDoubleItemArray}
    5438{$DEFINE INTERFACE}
    5539{$INCLUDE '..\Generic\GenericList.inc'}
     
    5943{$DEFINE TGListItem := Pointer}
    6044{$DEFINE TGList := TListPointer}
    61 {$DEFINE TGListSortCompare := TListPointerSortCompare}
    62 {$DEFINE TGListToStringConverter := TListPointerToStringConverter}
    63 {$DEFINE TGListFromStringConverter := TListPointerFromStringConverter}
    64 {$DEFINE TGListItemArray := TListPointerItemArray}
    6545{$DEFINE INTERFACE}
    6646{$I 'GenericList.inc'}
     
    7050{$DEFINE TGListStringItem := string}
    7151{$DEFINE TGListString := TListString}
    72 {$DEFINE TGListStringSortCompare := TListStringSortCompare}
    73 {$DEFINE TGListStringToStringConverter := TListStringToStringConverter}
    74 {$DEFINE TGListStringFromStringConverter := TListStringFromStringConverter}
    75 {$DEFINE TGListItemArray := TListStringItemArray}
    7652{$DEFINE INTERFACE}
    7753{$I 'GenericListString.inc'}
     
    8157{$DEFINE TGListItem := Byte}
    8258{$DEFINE TGList := TListByteBase}
    83 {$DEFINE TGListSortCompare := TListByteSortCompare}
    84 {$DEFINE TGListToStringConverter := TListByteToStringConverter}
    85 {$DEFINE TGListFromStringConverter := TListByteFromStringConverter}
    86 {$DEFINE TGListItemArray := TListByteItemArray}
    8759{$DEFINE INTERFACE}
    8860{$I 'GenericList.inc'}
     
    9567  procedure AddStream(Stream: TStream);
    9668  procedure AddStreamPart(Stream: TStream; ItemCount: TGListIndex);
    97   procedure WriteBuffer(var Buffer; Count: Integer);
    98   procedure ReadBuffer(var Buffer; Count: Integer);
    9969end;
    10070
     
    10373{$DEFINE TGListItem := Char}
    10474{$DEFINE TGList := TListCharBase}
    105 {$DEFINE TGListSortCompare := TListSortCompareChar}
    106 {$DEFINE TGListToStringConverter := TListToStringConverterChar}
    107 {$DEFINE TGListFromStringConverter := TListFromStringConverterChar}
    108 {$DEFINE TGListItemArray := TListStringItemArray}
    10975{$DEFINE INTERFACE}
    11076{$I 'GenericList.inc'}
     
    11581{$DEFINE TGListObjectList := TListObjectList}
    11682{$DEFINE TGListObject := TListObject}
    117 {$DEFINE TGListObjectSortCompare := TListObjectSortCompare}
    118 {$DEFINE TGListObjectToStringConverter := TListObjectToStringConverter}
    119 {$DEFINE TGListObjectFromStringConverter := TListObjectFromStringConverter}
    120 {$DEFINE TGListItemArray := TListObjectItemArray}
    12183{$DEFINE INTERFACE}
    12284{$I 'GenericListObject.inc'}
     
    138100{$DEFINE TGListItem := TMethod}
    139101{$DEFINE TGList := TListMethodBase}
    140 {$DEFINE TGListSortCompare := TListMethodSortCompare}
    141 {$DEFINE TGListToStringConverter := TListMethodToStringConverter}
    142 {$DEFINE TGListFromStringConverter := TListMethodFromStringConverter}
    143 {$DEFINE TGListItemArray := TListMethodItemArray}
    144102{$DEFINE INTERFACE}
    145103{$I 'GenericList.inc'}
     
    154112{$DEFINE TGListItem := TNotifyEvent}
    155113{$DEFINE TGList := TListNotifyEventBase}
    156 {$DEFINE TGListSortCompare := TListNotifyEventSortCompare}
    157 {$DEFINE TGListToStringConverter := TListNotifyEventToStringConverter}
    158 {$DEFINE TGListFromStringConverter := TListNotifyEventFromStringConverter}
    159 {$DEFINE TGListItemArray := TListNotifyEventItemArray}
    160114{$DEFINE INTERFACE}
    161115{$I 'GenericList.inc'}
     
    166120end;
    167121
     122
     123TBaseEvent = 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>
     133TListSimpleEvent = class(TListSimpleEventBase)
     134  procedure CallAll;
     135end;
     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
    168146function StrToStr(Value: string): string;
     147
     148
     149
     150
    169151
    170152implementation
     
    177159{$DEFINE TGListItem := Integer}
    178160{$DEFINE TGList := TListInteger}
    179 {$DEFINE TGListSortCompare := TListIntegerSortCompare}
    180 {$DEFINE TGListToStringConverter := TListIntegerToStringConverter}
    181 {$DEFINE TGListFromStringConverter := TListIntegerFromStringConverter}
    182 {$DEFINE TGListItemArray := TListIntegerItemArray}
    183161{$DEFINE IMPLEMENTATION}
    184162{$I 'GenericList.inc'}
     
    188166{$DEFINE TGListItem := SmallInt}
    189167{$DEFINE TGList := TListSmallInt}
    190 {$DEFINE TGListSortCompare := TListSmallIntSortCompare}
    191 {$DEFINE TGListToStringConverter := TListSmallIntToStringConverter}
    192 {$DEFINE TGListFromStringConverter := TListSmallIntFromStringConverter}
    193 {$DEFINE TGListItemArray := TListSmallIntItemArray}
    194168{$DEFINE IMPLEMENTATION}
    195169{$I 'GenericList.inc'}
     
    199173{$DEFINE TGListItem := Boolean}
    200174{$DEFINE TGList := TListBoolean}
    201 {$DEFINE TGListSortCompare := TListBooleanSortCompare}
    202 {$DEFINE TGListToStringConverter := TListBooleanToStringConverter}
    203 {$DEFINE TGListFromStringConverter := TListBooleanFromStringConverter}
    204 {$DEFINE TGListItemArray := TListBooleanItemArray}
    205175{$DEFINE IMPLEMENTATION}
    206176{$I 'GenericList.inc'}
     
    210180{$DEFINE TGListItem := Double}
    211181{$DEFINE TGList := TListDouble}
    212 {$DEFINE TGListSortCompare := TListDoubleSortCompare}
    213 {$DEFINE TGListToStringConverter := TListDoubleToStringConverter}
    214 {$DEFINE TGListFromStringConverter := TListDoubleFromStringConverter}
    215 {$DEFINE TGListItemArray := TListDoubleItemArray}
    216182{$DEFINE IMPLEMENTATION}
    217183{$I 'GenericList.inc'}
     
    221187{$DEFINE TGListItem := Pointer}
    222188{$DEFINE TGList := TListPointer}
    223 {$DEFINE TGListSortCompare := TListPointerSortCompare}
    224 {$DEFINE TGListToStringConverter := TListPointerToStringConverter}
    225 {$DEFINE TGListFromStringConverter := TListPointerFromStringConverter}
    226 {$DEFINE TGListItemArray := TListPointerItemArray}
    227189{$DEFINE IMPLEMENTATION}
    228190{$I 'GenericList.inc'}
     
    232194{$DEFINE TGListStringItem := string}
    233195{$DEFINE TGListString := TListString}
    234 {$DEFINE TGListStringSortCompare := TListStringSortCompare}
    235 {$DEFINE TGListStringToStringConverter := TListStringToStringConverter}
    236 {$DEFINE TGListStringFromStringConverter := TListStringFromStringConverter}
    237 {$DEFINE TGListItemArray := TListStringItemArray}
    238196{$DEFINE IMPLEMENTATION}
    239197{$I 'GenericListString.inc'}
     
    243201{$DEFINE TGListItem := Byte}
    244202{$DEFINE TGList := TListByteBase}
    245 {$DEFINE TGListSortCompare := TListByteSortCompare}
    246 {$DEFINE TGListToStringConverter := TListByteToStringConverter}
    247 {$DEFINE TGListFromStringConverter := TListByteFromStringConverter}
    248 {$DEFINE TGListItemArray := TListByteItemArray}
    249203{$DEFINE IMPLEMENTATION}
    250204{$I 'GenericList.inc'}
     
    254208{$DEFINE TGListItem := Char}
    255209{$DEFINE TGList := TListCharBase}
    256 {$DEFINE TGListSortCompare := TListSortCompareChar}
    257 {$DEFINE TGListToStringConverter := TListToStringConverterChar}
    258 {$DEFINE TGListFromStringConverter := TListFromStringConverterChar}
    259 {$DEFINE TGListItemArray := TListStringItemArray}
    260210{$DEFINE IMPLEMENTATION}
    261211{$I 'GenericList.inc'}
     
    266216{$DEFINE TGListObjectList := TListObjectList}
    267217{$DEFINE TGListObject := TListObject}
    268 {$DEFINE TGListObjectSortCompare := TListObjectSortCompare}
    269 {$DEFINE TGListObjectToStringConverter := TListObjectToStringConverter}
    270 {$DEFINE TGListObjectFromStringConverter := TListObjectFromStringConverter}
    271 {$DEFINE TGListItemArray := TListObjectItemArray}
    272218{$DEFINE IMPLEMENTATION}
    273219{$I 'GenericListObject.inc'}
     
    277223{$DEFINE TGListItem := TMethod}
    278224{$DEFINE TGList := TListMethodBase}
    279 {$DEFINE TGListSortCompare := TListMethodSortCompare}
    280 {$DEFINE TGListToStringConverter := TListMethodToStringConverter}
    281 {$DEFINE TGListFromStringConverter := TListMethodFromStringConverter}
    282 {$DEFINE TGListItemArray := TListMethodItemArray}
    283225{$DEFINE IMPLEMENTATION}
    284226{$I 'GenericList.inc'}
     
    288230{$DEFINE TGListItem := TNotifyEvent}
    289231{$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'}
    296249
    297250
     
    300253  Result := Value;
    301254end;
     255
     256{ TListSimpleEvent }
     257
     258procedure TListSimpleEvent.CallAll;
     259var
     260  I: TGListIndex;
     261begin
     262  I := 0;
     263  while (I < Count) do begin
     264    TBaseEvent(Items[I])();
     265    I := I + 1;
     266  end;
     267end;
     268
    302269
    303270{ TListChar }
     
    364331  I: TGListIndex;
    365332begin
    366   I := 0;
    367   while (I < Count) do begin
     333  I := Count - 1;
     334  while (I >= 0) do begin
    368335    TNotifyEvent(Items[I])(Sender);
    369     I := I + 1;
     336    I := I - 1;
    370337  end;
    371338end;
     
    445412end;
    446413
    447 procedure TListByte.WriteBuffer(var Buffer; Count: Integer);
    448 begin
    449 
    450 end;
    451 
    452 procedure TListByte.ReadBuffer(var Buffer; Count: Integer);
    453 begin
    454 
    455 end;
    456414
    457415end.
  • trunk/Packages/TemplateGenerics/Specialized/SpecializedMatrix.pas

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

    r54 r93  
    11unit SpecializedPoint;
    22
    3 {$mode objfpc}{$H+}
     3{$mode Delphi}{$H+}
    44
    55interface
  • trunk/Packages/TemplateGenerics/Specialized/SpecializedQueue.pas

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

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

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

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

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

    r82 r93  
    1 <?xml version="1.0" encoding="UTF-8"?>
     1<?xml version="1.0"?>
    22<CONFIG>
    33  <Package Version="4">
    44    <PathDelim Value="\"/>
    55    <Name Value="TemplateGenerics"/>
    6     <Type Value="RunAndDesignTime"/>
    76    <AddToProjectUsesSection Value="True"/>
    87    <Author Value="Chronos (robie@centrum.cz)"/>
     
    1716      <CodeGeneration>
    1817        <Optimizations>
     18          <VariablesInRegisters Value="True"/>
    1919          <OptimizationLevel Value="3"/>
    20           <VariablesInRegisters Value="True"/>
    2120        </Optimizations>
    2221      </CodeGeneration>
    2322      <Other>
    2423        <CompilerMessages>
    25           <IgnoredMessages idx5024="True"/>
     24          <UseMsgFile Value="True"/>
    2625        </CompilerMessages>
     26        <CompilerPath Value="$(CompPath)"/>
    2727      </Other>
    2828    </CompilerOptions>
    2929    <Description Value="Generic classes implemented as templates."/>
    3030    <Version Minor="4"/>
    31     <Files Count="27">
     31    <Files Count="28">
    3232      <Item1>
    3333        <Filename Value="ReadMe.txt"/>
     
    4747      </Item4>
    4848      <Item5>
    49         <Filename Value="Generic\GenericQueue.inc"/>
    50         <Type Value="Include"/>
     49        <Filename Value="Generic\GenericFileList.inc"/>
    5150      </Item5>
    5251      <Item6>
    53         <Filename Value="Generic\GenericRange.inc"/>
     52        <Filename Value="Generic\GenericQueue.inc"/>
    5453        <Type Value="Include"/>
    5554      </Item6>
    5655      <Item7>
    57         <Filename Value="Generic\GenericSet.inc"/>
     56        <Filename Value="Generic\GenericRange.inc"/>
    5857        <Type Value="Include"/>
    5958      </Item7>
    6059      <Item8>
    61         <Filename Value="Generic\GenericStack.inc"/>
     60        <Filename Value="Generic\GenericSet.inc"/>
    6261        <Type Value="Include"/>
    6362      </Item8>
    6463      <Item9>
    65         <Filename Value="Generic\GenericTree.inc"/>
     64        <Filename Value="Generic\GenericStack.inc"/>
    6665        <Type Value="Include"/>
    6766      </Item9>
    6867      <Item10>
     68        <Filename Value="Generic\GenericTree.inc"/>
     69        <Type Value="Include"/>
     70      </Item10>
     71      <Item11>
    6972        <Filename Value="Generic\GenericMatrix.inc"/>
    7073        <UnitName Value="GenericMatrix"/>
    71       </Item10>
    72       <Item11>
     74      </Item11>
     75      <Item12>
    7376        <Filename Value="Generic\GenericListString.inc"/>
    7477        <UnitName Value="GenericListString"/>
    75       </Item11>
    76       <Item12>
     78      </Item12>
     79      <Item13>
    7780        <Filename Value="Generic\GenericBitmap.inc"/>
    7881        <UnitName Value="GenericBitmap"/>
    79       </Item12>
    80       <Item13>
     82      </Item13>
     83      <Item14>
    8184        <Filename Value="Generic\GenericPoint.inc"/>
    8285        <Type Value="Include"/>
    83       </Item13>
    84       <Item14>
     86      </Item14>
     87      <Item15>
    8588        <Filename Value="Generic\GenericStream.inc"/>
    8689        <UnitName Value="GenericStream"/>
    87       </Item14>
    88       <Item15>
     90      </Item15>
     91      <Item16>
    8992        <Filename Value="Generic\GenericRectangle.inc"/>
    9093        <UnitName Value="GenericRectangle"/>
    91       </Item15>
    92       <Item16>
     94      </Item16>
     95      <Item17>
    9396        <Filename Value="Specialized\SpecializedList.pas"/>
    9497        <UnitName Value="SpecializedList"/>
    95       </Item16>
    96       <Item17>
     98      </Item17>
     99      <Item18>
    97100        <Filename Value="Specialized\SpecializedDictionary.pas"/>
    98101        <UnitName Value="SpecializedDictionary"/>
    99       </Item17>
    100       <Item18>
     102      </Item18>
     103      <Item19>
    101104        <Filename Value="Specialized\SpecializedStack.pas"/>
    102105        <UnitName Value="SpecializedStack"/>
    103       </Item18>
    104       <Item19>
     106      </Item19>
     107      <Item20>
    105108        <Filename Value="Specialized\SpecializedTree.pas"/>
    106109        <UnitName Value="SpecializedTree"/>
    107       </Item19>
    108       <Item20>
     110      </Item20>
     111      <Item21>
    109112        <Filename Value="Specialized\SpecializedQueue.pas"/>
    110113        <UnitName Value="SpecializedQueue"/>
    111       </Item20>
    112       <Item21>
     114      </Item21>
     115      <Item22>
    113116        <Filename Value="Specialized\SpecializedSet.pas"/>
    114117        <UnitName Value="SpecializedSet"/>
    115       </Item21>
    116       <Item22>
     118      </Item22>
     119      <Item23>
    117120        <Filename Value="Specialized\SpecializedPoint.pas"/>
    118121        <UnitName Value="SpecializedPoint"/>
    119       </Item22>
    120       <Item23>
     122      </Item23>
     123      <Item24>
    121124        <Filename Value="Specialized\SpecializedMatrix.pas"/>
    122125        <UnitName Value="SpecializedMatrix"/>
    123       </Item23>
    124       <Item24>
     126      </Item24>
     127      <Item25>
    125128        <Filename Value="Specialized\SpecializedBitmap.pas"/>
    126129        <UnitName Value="SpecializedBitmap"/>
    127       </Item24>
    128       <Item25>
     130      </Item25>
     131      <Item26>
    129132        <Filename Value="Specialized\SpecializedStream.pas"/>
    130133        <UnitName Value="SpecializedStream"/>
    131       </Item25>
    132       <Item26>
     134      </Item26>
     135      <Item27>
    133136        <Filename Value="Specialized\SpecializedRectangle.pas"/>
    134137        <UnitName Value="SpecializedRectangle"/>
    135       </Item26>
    136       <Item27>
     138      </Item27>
     139      <Item28>
    137140        <Filename Value="Additional\UBinarySerializer.pas"/>
    138141        <UnitName Value="UBinarySerializer"/>
    139       </Item27>
     142      </Item28>
    140143    </Files>
     144    <Type Value="RunAndDesignTime"/>
    141145    <RequiredPkgs Count="2">
    142146      <Item1>
Note: See TracChangeset for help on using the changeset viewer.