Skip to content

TFPGObjectList

Generic object list.

Declaration

Source position: fgl.pp line 177

type

  TFPGObjectList = class(TFPSList)
  public
    constructor Create;
    function Add : Integer;
    function Extract : T;
    property First: T; {rw}
    function GetEnumerator : TFPGListEnumeratorSpec;
    function IndexOf : Integer;
    procedure Insert;
    property Last: T; {rw}
    procedure AddList;
    procedure Assign;
    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}
    property FreeObjects: Boolean; {rw}
  end;

Description

TFPGList can be used to specialize a list for any class 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 or TFPObjectList

Properties

Member Visibility Description
First public First non-nil item.
FreeObjects public Does the list own the objects or not?
Items public Indexed access to objects in the list.
Last public Last non-Nil object.
List read only public Internal list pointer.
See all Properties

Methods

Member Visibility Description
Add public Add new object of class T to the list.
AddList public Adds the elements from another list.
Assign public Copy objects from Source list.
Create public Instantiate a new object 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 object in the list.
Remove public Remove an object from the list.
Sort public Sort the objects in 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.