Sign in Join
FPDoc Onlineexperiment

TFPObjectList class

In unit Contnrs

TFPList descendent which manages objects.

Declaration

pascal
TFPObjectList = class(TObject)

Inheritance

  1. TFPObjectList
  2. TObject

Description

TFPObjectList is a TFPList based list which has as the default array property TObjects instead of pointers. By default it also manages the objects: when an object is deleted or removed from the list, it is automatically freed. This behaviour can be disabled when the list is created.

In difference with TObjectList, TFPObjectList offers no notification mechanism of list operations, allowing it to be faster than TObjectList. For the same reason, it is also not a descendent of TFPList (although it uses one internally).

See also

Properties

CapacitypublicCapacity of the list.
CountpublicNumber of elements in the list.
OwnsObjectspublicShould the list free elements when they are removed.
ItemspublicIndexed access to the elements of the list.
ListpublicInternal list used to keep the objects.

Methods

GetItemprotected
SetItemprotected
SetCapacityprotected
GetCapacityprotected
CreatepublicCreate a new object list.
DestroypublicClears the list and destroys the list instance.
ClearpublicClear all elements in the list.
AddpublicAdd an object to the list.
DeletepublicDelete an element from the list.
ExchangepublicExchange the location of two objects.
ExpandpublicExpand the capacity of the list.
ExtractpublicExtract an object from the list.
RemovepublicRemove an item from the list.
IndexOfpublicSearch for an object in the list.
FindInstanceOfpublicSearch for an instance of a certain class.
InsertpublicInsert a new object in the list.
FirstpublicReturn the first non-nil object in the list.
LastpublicReturn the last non-nil object in the list.
MovepublicMove an object to another location in the list.
AssignpublicCopy the contents of a list.
PackpublicRemove all Nil references from the list.
SortpublicSort the list of objects.
ForEachCallpublicFor each object in the list, call a method or procedure, passing it the object.

Inherited

From TObject (40)

AfterConstruction BeforeDestruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName SafeCallException StringMessageTable SystemHasExtendedRTTI ToString UnitName

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.