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

TDynamicDataQueue.Pop

Removes an item from the top of the FIFO queue.

Declaration

Source position: dynqueue.pas line 67

public function TDynamicDataQueue.Pop(

  var Buffer;

  Count: Integer

):Integer;

function TDynamicDataQueue.Pop(

  AStream: TStream;

  Count: Integer

):Integer;

Arguments

Buffer

  

Untyped buffer where the queue item is stored after removal.

Count

  

Number of bytes for the item data.

Function result

Number of bytes needed for item data removed from the queue.

Arguments

AStream

  

TStream instance where the item data removed from the queue is stored.

Count

  

Number of bytes for the item data.

Description

Pop is an overloaded Integer function used to remove an item from the top of the FIFO queue. Overloaded variants are provided to get item data and store them as a sequence of arbitrary byte values, either in an untyped buffer or in a TStream instance.

Remark: Pop assumes that AStream is already positioned where the item data will be written. It does not reposition the stream instance. Be aware that writing to a stream can raise an exception.

Pop calls the PopTopInternal method to perform the actions needed to get the data for the queue item, and to removed the entry from the top of FIFO queue.

The return value contains the number of bytes needed for the item data, and removed from the internal storage for the queue.

Use Push to enqueue a new item to the bottom of the FIFO queue. Use Top to get the item data at the top of the queue without removing it from the queue.

See also

TDynamicDataQueue.Push

  

Adds the specified content to the FIFO queue.

TDynamicDataQueue.Top

  

Gets the data for the first queue entry, but does not remove it from the queue.

TDynamicDataQueue.Size

  

Total memory required for item data stored in the queue.


Version 4.0 Generated 2025-05-03 Home