Skip to content

TFPGList

Generic list.

Declaration

Source position: fgl.pp line 131

type

  TFPGList = class(TFPSList)
  public
    TFPGListEnumeratorSpec;
    constructor Create;
    class function ItemIsManaged : Boolean;
    function Add : Integer;
    function Extract : T;
    property First: T; {rw}
    function GetEnumerator : TFPGListEnumeratorSpec;
    function IndexOf : Integer;
    procedure Insert;
    property Last: T; {rw}
    procedure Assign;
    procedure AddList;
    function Remove : Integer;
    procedure Sort(Compare: TCompareFunc);
    procedure Sort(Compare: TCompareFunc; 
              SortingAlgorithm: PSortingAlgorithm);
    procedure SortRange(aStartIndex: Integer; aEndIndex: Integer; 
                   aCompare: TCompareFunc);
    procedure SortRange(aStartIndex: Integer; aEndIndex: Integer; 
                   aCompare: TCompareFunc; 
                   aSortingAlgorithm: PSortingAlgorithm);
    property Items[Index : Integer]: T; {rw}
    property List: PTypeList; {r}
  end;

Description

TFPGList can be used to specialize a list for any type T that does not require reference counting (such as interfaced objects). It will specialize to a list with the same methods as TFPSList or classes.TFPList

Properties

Member Visibility Description
First public First non-empty item.
Items public Indexed access to items in the list.
Last public Last non-empty item.
List read only public Internal list object.
See all Properties

Methods

Member Visibility Description
Add public Add new item of type T to the list.
AddList public Adds the elements from another list.
Assign public Copy elements from Source list.
Create public Instantiate a new list.
Extract public Extract an item from the list.
GetEnumerator public Return a list enumerator for T.
IndexOf public Index of item.
Insert public Insert a new item in the list.
ItemIsManaged public Indicates whether the list item is a managed type or not.
Remove public Remove an item from the list.
Sort public Sort the list.
SortRange public
See all Methods

See also

Name Description
TFPSList Basic list of memory blocks.
classes.TFPList Class to manage collections of pointers.