TFPSList

[Properties (by Name)][Methods (by Name)][Events (by Name)]

Basic list of memory blocks

Declaration

Source position: fgl.pp line 46

Type
  TFPSList = class (TObject)
  protected
    FList : PByte;
    FCount : Integer;
    FCapacity : Integer;
    FItemSize : Integer;
    procedure CopyItem(Src: Pointer; Dest: Pointer);  Virtual;
    procedure CopyItems(Src: Pointer; Dest: Pointer; aCount: Integer)
                       ;  Virtual;
    procedure Deref(Item: Pointer);  Virtual;  Overload;
    procedure Deref(FromIndex: Integer; ToIndex: Integer);  Overload;
    function Get(Index: Integer) : Pointer;
    procedure InternalExchange(Index1: Integer; Index2: Integer);
    function InternalGet(Index: Integer) : Pointer;
    procedure InternalPut(Index: Integer; NewItem: Pointer);
    procedure Put(Index: Integer; Item: Pointer);
    procedure QuickSort(L: Integer; R: Integer; 
                       Compare: TFPSListCompareFunc);
    procedure SetCapacity(NewCapacity: Integer);
    procedure SetCount(NewCount: Integer);
    procedure RaiseIndexError(Index: Integer);
    InternalItems[Index: Integer]: Pointer;
    function GetLast : Pointer;
    procedure SetLast(const Value: Pointer);
    function GetFirst : Pointer;
    procedure SetFirst(const Value: Pointer);
    procedure CheckIndex(AIndex: Integer);
  public
    constructor Create(AItemSize: Integer);
    destructor Destroy;  Override;
    class function ItemIsManaged : Boolean;  Virtual;
    function Add(Item: Pointer) : Integer;
    procedure Clear;
    procedure Delete(Index: Integer);
    procedure DeleteRange(IndexFrom: Integer; IndexTo: Integer);
    class procedure Error(const Msg: string; Data: PtrInt);
    procedure Exchange(Index1: Integer; Index2: Integer);
    function Expand : TFPSList;
    procedure Extract(Item: Pointer; ResultPtr: Pointer);
    function IndexOf(Item: Pointer) : Integer;
    procedure Insert(Index: Integer; Item: Pointer);
    function Insert(Index: Integer) : Pointer;
    procedure Move(CurIndex: Integer; NewIndex: Integer);
    procedure Assign(Obj: TFPSList);
    procedure AddList(Obj: TFPSList);
    function Remove(Item: Pointer) : Integer;
    procedure Pack;
    procedure Sort(Compare: TFPSListCompareFunc);
    procedure Sort(Compare: TFPSListCompareFunc; 
                  SortingAlgorithm: PSortingAlgorithm);
    Capacity : Integer;
    Count : Integer;
    Items[Index: Integer]: Pointer; default;
    ItemSize : Integer;
    List : PByte;
    First : Pointer;
    Last : Pointer;
  end
  ;

Description

TFPSList can be seen as the generalized equivalent of the classes unit TFPList list. It is used as a base class for the TFPGList , TFPGMap , TFPGObjectList , TFPGInterfacedObjectList and TFPGMapInterfacedObjectData generic classes.

This list is not meant to be used directly, it is an auxiliary class for the actual generic list classes.

Members

Member Type Visibility Description
Add Method public Add a new item to the list
AddList Method public Adds the elements from another list
Assign Method public Copy one list to another
Capacity Property public Current capacity of the list
CheckIndex Method protected
Clear Method public Clear the list
CopyItem Method protected
CopyItems Method protected
Count Property public Current element count
Create Method public Create a new instance of TFPSList
Delete Method public Delete an item from the list
DeleteRange Method public Delete a range of elements
Deref Method protected
Destroy Method public Destroy the list instance.
Error Method public Raise an EListError exception.
Exchange Method public Exchange two items in the list
Expand Method public Expand the capacity of the list
Extract Method public delete an element from the list
FCapacity Field protected
FCount Field protected
First Property public Pointer to first non-empty item in the list
FItemSize Field protected
FList Field protected
Get Method protected
GetFirst Method protected
GetLast Method protected
IndexOf Method public Search an item in the list
Insert Method public Insert a new item in the list.
InternalExchange Method protected
InternalGet Method protected
InternalItems Property protected
InternalPut Method protected
ItemIsManaged Method public
Items Property public Items in the list
ItemSize Property public Size of the items in the list
Last Property public Pointer to last non-empty item in the list
List Property public Internal list pointer
Move Method public Moves an item from one position in the list to another.
Pack Method public Remove empty items from the list
Put Method protected
QuickSort Method protected
RaiseIndexError Method protected
Remove Method public Remove the item from the list
SetCapacity Method protected
SetCount Method protected
SetFirst Method protected
SetLast Method protected
Sort Method public Sort the list

Inheritance

Class Description
TFPSList Basic list of memory blocks

See also

Name Description
classes.TFPList Class to manage collections of pointers.
Integer A signed 16-bits integer
Integer A signed 16-bits integer
Integer A signed 16-bits integer
Integer A signed 16-bits integer
Integer A signed 16-bits integer
Integer A signed 16-bits integer
PByte Pointer to byte type
PByte Pointer to byte type
TFPGInterfacedObjectList Generic interfaced object list
TFPGMap Generic map
TFPGMapInterfacedObjectData Generic map for reference counted objects
TFPGObjectList Generic object list