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
Name | Description |
this
|
Construct a Queue already filled with supplied items.
|
Properties
Name | Type | Description |
empty [get]
|
bool | Returns true if queue is empty
|
full [get]
|
bool | Returns true if queue is full
|
length [get]
|
auto | Report current queue's length
|
Methods
Name | Description |
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
Name | Description |
ItemType
|
Alias for the item type used by the queue
|
Parameters
Name | Description |
Type | the types to be stored in the queue. Must have .init |
MaxSize | the maximal number of entries the queue can hold. |