Queue

No GC FIFO queue of fixed maximal size

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

Constructors

this
this(Type[] initItems)

Construct a Queue already filled with supplied items.

Members

Aliases

ItemType
alias ItemType = Type

Alias for the item type used by the queue

Functions

peek
const(Type) peek()

Get reference to item at head of the queue.

pop
Type pop()

Pop a single element from the queue

push
void push(Type item)

Pushes one item to the queue. Queue must have room for new item.

push
Type* push()

Pushes an uninitialized item to the queue.

pushHead
void pushHead(Type item)
Undocumented in source. Be warned that the author may not have intended to support it.
removeAll
void removeAll()

Remove all items from the queue

removeAll
uint removeAll(Type item)

Remove all items that compare equal to provided item.

removeHead
void removeHead()

Delete the head element

toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Manifest constants

capacity
enum capacity;

Reports the capacity of the queue

Properties

empty
bool empty [@property getter]

Returns true if queue is empty

full
bool full [@property getter]

Returns true if queue is full

length
auto length [@property getter]

Report current queue's length

Parameters

Type

the types to be stored in the queue. Must have .init

MaxSize

the maximal number of entries the queue can hold.

Meta