Class TQueue (unit SandQue)

Inherits from

TObject

Next element

Constructors


constructor Create;

We want to be able to store a LOT of grains

----------------------- TQueue -----------------------



Functions

function Dequeue(var Itm: Pointer): Boolean;

We need a record for the user item

destructor Destroy;

Queue is empty

procedure Enqueue(Itm: Pointer);

Remove any remaining elements before destroying the queue.

function Peek(Idx: Word; var Itm: Pointer): Boolean;

Same as: if Top <> NIL

Properties

Events

Variables

Size : Longint;


Bottom : PQueueElem;


Current : PQueueElem;


Position : Word;


Top : PQueueElem;



Constructors


constructor Create;

We want to be able to store a LOT of grains

----------------------- TQueue -----------------------


Functions


function Dequeue(var Itm: Pointer): Boolean;

We need a record for the user item


destructor Destroy;

Queue is empty


procedure Enqueue(Itm: Pointer);

Remove any remaining elements before destroying the queue. Note that user items are NOT disposed as TQueue doesn't know their types. Therefore user should always empty the queue himself and dispose the items before destroying the queue.


function Peek(Idx: Word; var Itm: Pointer): Boolean;

Same as: if Top <> NIL


Properties


Events


Variables


Size : Longint;


Bottom : PQueueElem;


Current : PQueueElem;


Position : Word;


Top : PQueueElem;