Sign in Join
FPDoc Onlineexperiment

TLazFifoQueue class

In unit LazCollections

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

Declaration

pascal
TLazFifoQueue<T> = class

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.

Properties

QueueSizepublicSize (or depth) for the queue.
TotalItemsPoppedpublicTotal number of entries that have been popped off of the queue.
TotalItemsPushedpublicTotal number of entries that have been pushed onto the queue.
IsEmptypublicIndicates if none of the internal storage slots have been used in the queue storage.
IsFullpublicIndicates if all of the internal storage slots have been used in the queue storage.

Methods

GetIsEmptyprotectedGets the value for the IsEmpty property.
GetIsFullprotectedGets the value for the IsFull property.
createpublicConstructor for the class instance.
GrowpublicResizes the internal storage for the queue by the specified Delta value.
PushItempublicPushes an item of the specified type onto the tail of the queue.
PopItempublicPops an item of the specified type off of the head of the queue.

Fields

FTotalItemsPoppedprotectedMember with the total number of items removed from the FIFO queue.
FTotalItemsPushedprotectedMember with the total number of items stored on the FIFO queue.

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