[Overview][Types][Classes][Index] Reference for unit 'LazCollections' (#lazutils)

TLazFifoQueue

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Implements a First-In-First-Out queue for entries using a generic item type.

Declaration

Source position: lazcollections.pas line 59

type generic TLazFifoQueue <T>= class

protected

  FTotalItemsPopped: QWord;

  

Member with the total number of items removed from the FIFO queue.

  FTotalItemsPushed: QWord;

  

Member with the total number of items stored on the FIFO queue.

  function GetIsEmpty; virtual;

  

Gets the value for the IsEmpty property.

  function GetIsFull; virtual;

  

Gets the value for the IsFull property.

public

  constructor create();

  

Constructor for the class instance.

  procedure Grow();

  

Resizes the internal storage for the queue by the specified Delta value.

  function PushItem(); virtual;

  

Pushes an item of the specified type onto the tail of the queue.

  function PopItem(); virtual;

  

Pops an item of the specified type off of the head of the queue.

  property QueueSize: Integer; [r]

  

Size (or depth) for the queue.

  property TotalItemsPopped: QWord; [r]

  

Total number of entries that have been popped off of the queue.

  property TotalItemsPushed: QWord; [r]

  

Total number of entries that have been pushed onto the queue.

  property IsEmpty: Boolean; [r]

  

Indicates if none of the internal storage slots have been used in the queue storage.

  property IsFull: Boolean; [r]

  

Indicates if all of the internal storage slots have been used in the queue storage.

end;

Inheritance

TLazFifoQueue

  

Implements a First-In-First-Out queue for entries using a generic item type.

|

TObject

Description

TLazFifoQueue implements a FIFO queue using a generic type for the items in the queue. A FIFO queue processes the oldest (first) entry, or head of the queue, before any subsequent items added to the buffer.

TLazFifoQueue uses an internal array to store the queue items with the type used in the specialization. The queue size (or depth) can be specified when the class instance is created, and adjusted using the Grow method.

Use the PushItem and PopItem methods to add or remove entries in the queue.

Elements in the internal array are reused when the entry is popped off of the head of the queue. The head is moved to the next element in the internal array.


Version 4.0 Generated 2025-05-03 Home