tbucketlist

TObjectBucketList

TObjectBucketList is a simple hash table that stores objects that are identified by other objects.

TObjectBucketList is in Unit Contnrs.

Description

Use TObjectBucketList as a simple hash table to store objects that are indexed by other objects. TObjectBucketList includes methods to add, remove, and locate items in the list, as well as a method that executes a callback for every item in the list.

 

TObjectList

TObjectList maintains a list of (owned) objects.

TObjectList is in Unit Contnrs.

Description

Use TObjectList to store and maintain a list of objects. TObjectList provides properties and methods to add, delete, rearrange, locate, access, and sort objects. If the OwnsObjects property is set to true (the default), TObjectList controls the memory of its objects, freeing an object when its index is reassigned; when it is removed from the list with the Delete, Remove, or Clear method; or when the TObjectList instance is itself destroyed.

 

TComponentList

TComponentList maintains a list of components, updating itself when a component is freed.

TComponentList is in Unit Contnrs.

Description

Use TComponentList to store and maintain a list of components. TComponentList provides properties and methods to add, delete, rearrange, locate, access, and sort components. Like TObjectList, TComponentList controls the memory of its components; unless the OwnsObjects property is set to false (or the components are removed with the Extract method). TComponentList frees its components when they are removed from the list or when the TComponentList instance is itself destroyed.

In addition, TComponentList tracks its components. When a component is freed, TComponentList automatically updates itself by deleting the reference to the freed component and packing the list.

 

TClassList

TClassList maintains a list of classes.

TClassList is in Unit Contnrs.

Description

Use a TClassList object to store and maintain a list of classes.

 

TInterfaceList

TInterfaceList represents a list of interfaces.

TInterfaceList is in Unit Classes.

Description

Use TInterfaceList to manage a list of interfaces.

 

TQueue

TQueue maintains a first-in first-out array of pointers.

TQueue is in Unit Contnrs.

Description

Use a TQueue object to store and maintain a first-in first-out list.

 

TStack

TStack maintains a last-in first-out array of pointers.

TStack is in Unit Contnrs.

Description

Use a TStack object to store and maintain a last-in first-out list.

 

TObjectQueue

TObjectQueue maintains a first-in first-out list of objects.

TObjectQueue is in Unit Contnrs.

Description

Use a TObjectQueue to store and maintain a first-in first-out list of objects.

 

TObjectStack

TObjectStack maintains a last-in first-out list of objects.

TObjectStack is in Unit Contnrs.

Description

Use TObjectStack to store and maintain a last-in first-out list of objects.

 

BaseCLX includes many classes that represents lists or collections of items. They vary depending on the types of items they contain, what operations they support, and whether they are persistent.

The following table lists various list classes, and indicates the types of items they contain:BaseCLX includes many classes that represents lists or collections of items. They vary depending on the types of items they contain, what operations they support, and whether they are persistent.

The following table lists various list classes, and indicates the types of items they contain:

Object Maintains
TList  A list of pointers
TThreadList  A thread-safe list of pointers
TBucketList  A hashed list of pointers
TObjectBucketList  A hashed list of object instances
TObjectList  A memory-managed list of object instances
TComponentList  A memory-managed list of components (that is, instances of classes descended from TComponent)
TClassList A list of class references (metaclasses)
TInterfaceList A list of interface pointers.
TQueue  A first-in first-out list of pointers
TStack  A last-in first-out list of pointers
TObjectQueue A first-in first-out list of objects
TObjectStack A last-in first-out list of objects
TCollection  Base class for many specialized classes of typed items.
TStringList  A list of strings
THashedStringList A list of strings with the form Name=Value, hashed for performance.

TList Description.

TList is in Classes Unit.

TList, which stores an array of pointers, is often used to maintain lists of objects. TList introduces properties and methods to

Add or delete the objects in the list.
 Rearrange the objects in the list.
 Locate and access objects in the list.
 Sort the objects in the list.

TThreadList Description.

TThreadList is in Classes Unit.

A TThreadList object is a thread-safe list. Each TThreadList maintains a private TList (a list of pointers to objects). You can add or remove items in a TThreadList from multiple threads without explicit locks.

To access the actual TList object managed by the thread list, first lock the list by calling the LockList method.  Unlock the list by calling the Unlock method when done.

Tip: By default, TThreadList ignores attempts to add duplicate entries to the list. If the list is large, this default is computationally expensive. For better performance, you may want to change the Duplicates property to dupAccept where possible.

TBucketList Description.

TBucketList is a simple hash table that stores pointers indexed by pointers.

TBucketList is in Contnrs Unit.

Use TBucketList as a simple hash table to store data pointers using identifiers that can be represented as pointers. TBucketList includes methods to add, remove, and locate items in the list, as well as a method that executes a callback for every item in the list.