System.Generics.Collections.TQueue.Extract

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function Extract: T; inline;

C++

T __fastcall Extract();

Properties

Type Visibility Source Unit Parent
function public
System.Generics.Collections.pas
System.Generics.Collections.hpp
System.Generics.Collections TQueue

Description

Removes the item from the beginning of the queue.

Extract removes and returns the beginning element of the queue. Count is decremented by 1. If Count is already 0, an error is raised.

An OnNotify event occurs indicating an item was removed from the queue.

Extract functions similarly to Peek except that Extract removes an element from the queue.

Extract is the same as Dequeue except for the event code indicating an element was extracted rather than removed. Extract is a more generic method, common to all collections, whereas Dequeue is specialized for TQueue. You can use either of the two functions to obtain and remove the item at the beginning of the queue.

This is a O(1) operation.

See Also

Code Examples