Changeset 481 for Generics/NativeGenerics/Units/GenericList.pas
- Timestamp:
- Feb 23, 2016, 10:30:36 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Generics/NativeGenerics/Units/GenericList.pas
r458 r481 96 96 function GetInternal(Index: TIndex): TItem; override; 97 97 function GetCount: TIndex; override; 98 function GetCapacity: TIndex; 98 function GetCapacity: TIndex; virtual; 99 99 procedure SetCount(const AValue: TIndex); override; 100 procedure SetCapacity(const AValue: TIndex); 100 procedure SetCapacity(const AValue: TIndex); virtual; 101 101 procedure SetCapacityOptimized(const NewCapacity: TIndex); 102 102 procedure Put(Index: TIndex; const AValue: TItem); override; … … 115 115 TGObjectList<TItem> = class(TGList<TItem>) 116 116 protected 117 procedure Put(Index: Integer; const AValue: TItem); override;117 procedure Put(Index: TIndex; const AValue: TItem); override; 118 118 public 119 119 OwnsObjects: Boolean; 120 120 procedure SetCount(const AValue: TIndex); override; 121 121 function AddNew(NewObject: TItem = nil): TItem; 122 procedure Delete(const Index: Integer); override;122 procedure Delete(const Index: TIndex); override; 123 123 procedure Clear; override; 124 124 procedure Assign(Source: TGAbstractList<TItem>); override; … … 130 130 private 131 131 public 132 procedure Delete(const Index: Integer); override;132 procedure Delete(const Index: TIndex); override; 133 133 procedure Clear; override; 134 134 procedure Assign(Source: TGAbstractList<TItem>); override; … … 157 157 procedure Open; 158 158 procedure Close; 159 constructor Create; 159 constructor Create; override; 160 160 destructor Destroy; override; 161 161 property FileName: string read FFileName write SetFileName; … … 328 328 end; 329 329 330 procedure TGObjectList<TItem>.Put(Index: Integer; const AValue: TItem);330 procedure TGObjectList<TItem>.Put(Index: TIndex; const AValue: TItem); 331 331 begin 332 332 if OwnsObjects and Assigned(FItems[Index]) then FItems[Index].Free; … … 348 348 end; 349 349 350 procedure TGObjectList<TItem>.Delete(const Index: Integer);350 procedure TGObjectList<TItem>.Delete(const Index: TIndex); 351 351 begin 352 352 (*if OwnsObjects then begin … … 383 383 end; 384 384 385 procedure TGStringList<TItem>.Delete(const Index: Integer);385 procedure TGStringList<TItem>.Delete(const Index: TIndex); 386 386 begin 387 387 FItems[Index] := ''; … … 720 720 end else 721 721 if NewIndex < CurIndex then begin 722 Temp.AddListPart(Self, CurIndex, ACount);722 Temp.AddListPart(Self, CurIndex, ACount); 723 723 CopyItems(NewIndex, NewIndex + ACount, CurIndex - NewIndex); 724 724 ReplaceList(NewIndex, Temp);
Note:
See TracChangeset
for help on using the changeset viewer.