Programming Delphi A Glance to the "LISTS"--Lists Objcets Introduction in Delphi/C++Builder
Notice: Undefined variable: relatedArticlesCount in /home/wwwroot/codeback.net/plugins/content/tags.php on line 149

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.


Add comment


Security code
Refresh

Programming - Delphi