System.Generics.Collections.TThreadedQueue.PopItem

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function PopItem: T; overload;
function PopItem(out AQueueSize: NativeInt): T; overload;
function PopItem(out AQueueSize: NativeInt; var AItem: T): TWaitResult; overload;
function PopItem(var AItem: T): TWaitResult; overload;

C++

T __fastcall PopItem()/* overload */;
T __fastcall PopItem(/* out */ System::NativeInt &AQueueSize)/* overload */;
System::Types::TWaitResult __fastcall PopItem(/* out */ System::NativeInt &AQueueSize, T &AItem)/* overload */;
System::Types::TWaitResult __fastcall PopItem(T &AItem)/* overload */;

Properties

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

Description

Pops an item from the queue.

Use PopItem to pop an item from the queue according to the First In, First Out data management method.

There are 4 overloaded PopItem methods:

  • Without parameters: This method returns the popped item.
  • With a AQueueSize parameter: This method also returns the popped item.
  • With AQueueSize and AItem parameters: AQueueSize specifies the position of the AItem item.
  • With an AItem parameter.

The last two methods return a TWaitResult. If the queue is empty, then the monitor waits for it to push an element. If no element is pushed in PopTimeout, the method returns wrTimeout; otherwise, the method returns wrSignaled.

Use the last two methods when you need to know whether the pop was successfully completed.

See Also