| Description | Hierarchy | Fields | Methods | Properties |
type TDynArray_2 = class(TDynArrayBase)
![]() |
constructor Create; overload; |
![]() |
constructor Create(InitialLength: Integer); overload; |
![]() |
procedure AppendItem(const Item: TDynArrayItem_2); |
![]() |
procedure AppendArray(const NewItems: array of TDynArrayItem_2); overload; |
![]() |
procedure AppendArray(const NewItems: array of TDynArrayItem_2; NewItemsAddCount: integer); overload; |
![]() |
procedure AppendDynArray(Arr: TDynArray_2); |
![]() |
procedure Assign(Source: TDynArray_2); |
![]() |
procedure AssignArray(const NewItems: array of TDynArrayItem_2); |
![]() |
function EqualItems(const Item1, Item2: TDynArrayItem_2): boolean; |
![]() |
function Equal(DynArr: TDynArray_2): boolean; overload; |
![]() |
function Equal(const Arr: array of TDynArrayItem_2): boolean; overload; |
![]() |
function Equal(const Arr: array of TDynArrayItem_2; ArrCount: Integer): boolean; overload; |
![]() |
function IndexOf(const Item: TDynArrayItem_2): Integer; |
![]() |
function IndexInRange(const Item: TDynArrayItem_2; BeginIndex, EndIndex: Integer): Integer; |
![]() |
procedure DeleteFirstEqual(const Value: TDynArrayItem_2); |
![]() |
procedure DeleteAllEqual(const Value: TDynArrayItem_2); |
![]() |
procedure Delete(Index, DelCount: integer); |
![]() |
procedure Insert(Index: integer; const Item: TDynArrayItem_2); |
![]() |
procedure SetAll(const Item: TDynArrayItem_2); |
![]() |
procedure Sort(IsSmallerFunc: TDynArrayItemIsSmallerFunc_2; CountToUseSimpleSort: Integer = DefaultCountToUseSimpleSort); overload; |
![]() |
procedure Sort(IsSmallerFunc: TDynArrayItemIsSmallerFunc_2; FirstIndex, LastIndex: integer; CountToUseSimpleSort: Integer = DefaultCountToUseSimpleSort); overload; |
![]() |
procedure SortByObject(IsSmallerFunc: TDynArrayItemIsSmallerFuncByObject_2; CountToUseSimpleSort: Integer = DefaultCountToUseSimpleSort); overload; |
![]() |
procedure SortByObject(IsSmallerFunc: TDynArrayItemIsSmallerFuncByObject_2; FirstIndex, LastIndex: integer; CountToUseSimpleSort: Integer = DefaultCountToUseSimpleSort); overload; |
![]() |
property Items: PInfiniteArray_2 read GetItems; |
![]() |
property ItemsArray: PInfiniteArray_2 read GetItemsArray; |
![]() |
property Pointers[ItemNum: integer]: PDynArrayItem_2 read GetPointers; |
![]() |
property Values[ItemNum: integer]: TDynArrayItem_2
read GetValues write SetValues; |
![]() |
constructor Create; overload; |
![]() |
constructor Create(InitialLength: Integer); overload; |
![]() |
procedure AppendItem(const Item: TDynArrayItem_2); |
|
| |
![]() |
procedure AppendArray(const NewItems: array of TDynArrayItem_2); overload; |
![]() |
procedure AppendArray(const NewItems: array of TDynArrayItem_2; NewItemsAddCount: integer); overload; |
![]() |
procedure AppendDynArray(Arr: TDynArray_2); |
![]() |
procedure Assign(Source: TDynArray_2); |
|
Copies contents of Source to this object. This is equivalent to doing Remember that this is *not* a so-called deep copy, because if Source contains some pointers we're simply copying these pointers (not duplicating their content constructing new objects or something like that). This is just a simple copy of memory contents (well, with proper Initialize/Finalize in case DYNARRAY_2_IS_INIT_FINI_TYPE). | |
![]() |
procedure AssignArray(const NewItems: array of TDynArrayItem_2); |
|
This is equivalent to | |
![]() |
function EqualItems(const Item1, Item2: TDynArrayItem_2): boolean; |
![]() |
function Equal(DynArr: TDynArray_2): boolean; overload; |
![]() |
function Equal(const Arr: array of TDynArrayItem_2): boolean; overload; |
![]() |
function Equal(const Arr: array of TDynArrayItem_2; ArrCount: Integer): boolean; overload; |
![]() |
function IndexOf(const Item: TDynArrayItem_2): Integer; |
|
Returns -1 if not found | |
![]() |
function IndexInRange(const Item: TDynArrayItem_2; BeginIndex, EndIndex: Integer): Integer; |
|
Returns -1 if not found, searches within Items[BeginIndex] .. Items[EndIndex]. BeginIndex may be < 0 and EndIndex may be > High, it doesn't matter, the range will be "clamped" as it should. | |
![]() |
procedure DeleteFirstEqual(const Value: TDynArrayItem_2); |
|
Searches for and deletes first item equal to Value. | |
![]() |
procedure DeleteAllEqual(const Value: TDynArrayItem_2); |
|
Searches for and deletes all items equal to Value. | |
![]() |
procedure Delete(Index, DelCount: integer); |
|
Just like Note that Index and DelCount parameters will be checked for correctness and eventually corrected. So if Index is >= Count then nothing will be removed. And if DelCount items from Index would be larger than Count then DelCount will be corrected to be smaller. | |
![]() |
procedure Insert(Index: integer; const Item: TDynArrayItem_2); |
|
Inserts Item at position Index into array. Index must be in range 0 .. Count (yes, we can insert element at the end of the array). After insertion array has Count increased by 1, Items[Index] = Item and all items that were on positions [Index..old High] are now at [Index+1..new High]. | |
![]() |
procedure SetAll(const Item: TDynArrayItem_2); |
![]() |
procedure Sort(IsSmallerFunc: TDynArrayItemIsSmallerFunc_2; CountToUseSimpleSort: Integer = DefaultCountToUseSimpleSort); overload; |
|
Sorts items. All you have to do is to pass some IsSmallerFunc – see KambiUtils.Sort for specification what it should do, but note that TDynArrayItemIsSmallerFunc_2 here gets parameter types already casted to TDynArrayItem_2, instead of dirty pointers (like IsSmallerFunc that must be passed to KambiUtils.Sort). If you don't give First/LastIndex it assumes FirstIndex = 0 and LastIndex = High, so the whole array will be sorted. | |
![]() |
procedure Sort(IsSmallerFunc: TDynArrayItemIsSmallerFunc_2; FirstIndex, LastIndex: integer; CountToUseSimpleSort: Integer = DefaultCountToUseSimpleSort); overload; |
![]() |
procedure SortByObject(IsSmallerFunc: TDynArrayItemIsSmallerFuncByObject_2; CountToUseSimpleSort: Integer = DefaultCountToUseSimpleSort); overload; |
![]() |
procedure SortByObject(IsSmallerFunc: TDynArrayItemIsSmallerFuncByObject_2; FirstIndex, LastIndex: integer; CountToUseSimpleSort: Integer = DefaultCountToUseSimpleSort); overload; |
![]() |
property Items: PInfiniteArray_2 read GetItems; |
|
This is a comfortable Items property, that allows you to both read and write items in this array. Note that it has different types: for Delphi (and FPC Delphi mode) it has PInfiniteArray_2 type, for ObjFpc mode is has PDynArrayItem_2. This way you can always access items like | |
![]() |
property ItemsArray: PInfiniteArray_2 read GetItemsArray; |
|
This is like Items, but it has always (both for FPC ObjFpc mode and Delphi) type PInfiniteArray_2. This means that you can always read/write items like | |
![]() |
property Pointers[ItemNum: integer]: PDynArrayItem_2 read GetPointers; |
![]() |
property Values[ItemNum: integer]: TDynArrayItem_2
read GetValues write SetValues; |