Skip to content

TOrderedList

Base class for queues and stacks.

Declaration

Source position: contnrs.pp line 139

type

  TOrderedList = class(TObject)
  public
    constructor Create;
    destructor Destroy;
    function Count : Integer;
    function AtLeast : Boolean;
    function Push : Pointer;
    function Pop : Pointer;
    function Peek : Pointer;
  end;

Description

TOrderedList provides the base class for TQueue and TStack. It provides an interface for pushing and popping elements on or off the list, and manages the internal list of pointers.

Note that TOrderedList does not manage objects on the stack, i.e. objects are not freed when the ordered list is destroyed.

Methods

Member Visibility Description
AtLeast public Check whether the list contains a certain number of elements.
Count public Number of elements on the list.
Create public Create a new ordered list.
Destroy public Free an ordered list.
Peek public Return the next element to be popped from the list.
Pop public Remove an element from the list.
Push public Push another element on the list.
See all Methods

See also

Name Description
TQueue Pointer queue.
TStack Pointer Stack.