Class TStructList
Unit
Declaration
type TStructList<T> = class(TList<T>)
Description
List of structures. This is just TList class from Generics.Collections, with some useful helpers.
Hierarchy
- TObject
- TList
- TStructList
Overview
Nested Types
![]() |
PtrT = ˆT; |
![]() |
PTypeList = ˆTTypeList; |
![]() |
TTypeList = array [0 .. MaxInt div SizeOf(T) - 1 ] of T; |
Methods
![]() |
function List: PTypeList; |
![]() |
function L: PtrT; |
![]() |
function Add: PtrT; overload; |
![]() |
function Ptr(I: Integer): PtrT; |
![]() |
procedure Assign(const Source: TStructList <T>); overload; |
![]() |
procedure Assign(const A: array of T); overload; |
![]() |
function ItemSize: SizeInt; |
![]() |
procedure AddArray(const A: array of T); deprecated 'use AddRange'; |
![]() |
procedure AddList(const Source: TStructList <T>); deprecated 'use AddRange'; |
![]() |
procedure AssignArray(const A: array of T); deprecated 'use Assign'; |
Description
Nested Types
![]() |
PtrT = ˆT; |
![]() |
PTypeList = ˆTTypeList; |
![]() |
TTypeList = array [0 .. MaxInt div SizeOf(T) - 1 ] of T; |
Methods
![]() |
function List: PTypeList; |
|
Access the list contents directly through a pointer. This is useful if you have a list of records and you would like to set their fields. This will not work correctly: type TMyRecord = record MyField: Integer; end; TMyRecordList = specialize TGenericStructList<TMyRecord>; var MyList: TMyRecordList; begin // ... MyList[I].MyField := 123;
(It will not work OK because you would modify only a temporary record returned by the MyList.Listˆ[I].MyField := 123;
will work OK. Or you can use (only in FPC ObjFpc mode) even shorter this: MyList.L[I].MyField := 123;
See also
| |
![]() |
function L: PtrT; |
|
Access the list contents directly through a pointer to T structure. This is exactly the same pointer as List, but the type is different: this points to a single item. This is useful if you have a list of records and you would like to set their fields. This allows to use See the List description for a more detailed explanation and example. See also
| |
![]() |
function Add: PtrT; overload; |
|
Increase Count and return pointer to new item. Comfortable and efficient way to add a new item that you want to immediately initialize. | |
![]() |
function Ptr(I: Integer): PtrT; |
|
Pointer to ith item. | |
![]() |
procedure Assign(const Source: TStructList <T>); overload; |
![]() |
procedure Assign(const A: array of T); overload; |
![]() |
function ItemSize: SizeInt; |
![]() |
procedure AddArray(const A: array of T); deprecated 'use AddRange'; |
|
Warning: this symbol is deprecated: use AddRange | |
![]() |
procedure AddList(const Source: TStructList <T>); deprecated 'use AddRange'; |
|
Warning: this symbol is deprecated: use AddRange | |
![]() |
procedure AssignArray(const A: array of T); deprecated 'use Assign'; |
|
Warning: this symbol is deprecated: use Assign | |
Generated by PasDoc 0.16.0.
