Sign in Join
FPDoc Onlineexperiment

TLinkList class

In unit LazLinkedList

Defines a simple doubly linked list class.

Declaration

pascal
TLinkList = class

Description

TLinkList is a class which defines a navigational interface for a simple doubly linked list.

TLinkList provides properties used to access the First and Last items in the linked list, the number of list items in Count, and the first free item in the linked list. Items in the linked list are represented using the TLinkListItem class, which provides Prior and Next properties for navigation of items in the list.

TLinkList contains an abstract virtual CreateItem method that is used to create new items for the linked list. The method must be implemented in a descendent class to provided implementation details that address storage and ownership of the linked list items. See TGtkMessageQueue for an example of a concrete implementation of the TLinkList class.

Properties

FirstpublicFirst item in the doubly linked list.
LastpublicLast item in the doubly linked list.
CountpublicTotal number of items used in the doubly linked list.

Methods

CreateItemprotectedSpecifies the interface used to create a new linked list item for the class.
GetNewItemprotectedGets a new linked list item by reusing a free item or creating a new one.
AddAsLastprotectedConfigures and adds the specified item as the terminal node for the doubly linked list.
DeletepublicRemoves the specified list item from the doubly linked list.
MoveToLastpublicRelocates the specified list item to the last (or terminal) node for the linked list.
ClearpublicRemoves all items in the doubly linked list.
ConsistencyCheckpublicChecks the validity of traversal nodes and node counts in the doubly linked list.
CreatepublicConstructor for the class instance.
DestroypublicDestructor for the class instance.

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