Struct Queue

No GC FIFO queue of fixed maximal size

struct Queue(Type, ushort MaxSize) ;

Performance of queue is better if MaxSize is a power of 2.

Constructors

NameDescription
this Construct a Queue already filled with supplied items.

Properties

NameTypeDescription
empty[get] boolReturns true if queue is empty
full[get] boolReturns true if queue is full
length[get] autoReport current queue's length

Methods

NameDescription
peek Get reference to item at head of the queue.
pop Pop a single element from the queue
push Pushes one item to the queue. Queue must have room for new item.
push Pushes an uninitialized item to the queue.
removeAll Remove all items from the queue
removeAll Remove all items that compare equal to provided item.
removeHead Delete the head element

Aliases

NameDescription
ItemType Alias for the item type used by the queue

Parameters

NameDescription
Type the types to be stored in the queue. Must have .init
MaxSize the maximal number of entries the queue can hold.