TLazFifoQueue class
Implements a First-In-First-Out queue for entries using a generic item type.
Declaration
TLazFifoQueue<T> = classDescription
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
QueueSize | public | Size (or depth) for the queue. |
TotalItemsPopped | public | Total number of entries that have been popped off of the queue. |
TotalItemsPushed | public | Total number of entries that have been pushed onto the queue. |
IsEmpty | public | Indicates if none of the internal storage slots have been used in the queue storage. |
IsFull | public | Indicates if all of the internal storage slots have been used in the queue storage. |
Methods
GetIsEmpty | protected | Gets the value for the IsEmpty property. |
GetIsFull | protected | Gets the value for the IsFull property. |
create | public | Constructor for the class instance. |
Grow | public | Resizes the internal storage for the queue by the specified Delta value. |
PushItem | public | Pushes an item of the specified type onto the tail of the queue. |
PopItem | public | Pops an item of the specified type off of the head of the queue. |
Fields
FTotalItemsPopped | protected | Member with the total number of items removed from the FIFO queue. |
FTotalItemsPushed | protected | Member 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.
