Skip to content

TFPGInterfacedObjectList

Generic interfaced object list.

Declaration

Source position: fgl.pp line 222

type

  TFPGInterfacedObjectList = 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 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 class type T that requires reference counting (all objects that implement IInterface or IUnknown)). It will specialize to a list with the same methods as TFPSList or classes.TFPList or TFPObjectList

Classes that implement IInterface or IUnknown require special care to maintain the reference count. The TFPGInterfacedObjectList list provides the necessary functionality to deal with this.

Properties

Member Visibility Description
First public First non-nil object.
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 interfaced object list.
Extract public Extract an item from the list.
GetEnumerator public Return a list enumerator for T.
IndexOf public Index of object.
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.