Class: Queue
@include <Queue>
The Queue class provides a simple queue implementation in Bash++.
Data Members
@Queue.head
- Type:
QueueNode*
-
Scope:
protected
- A pointer to the head of the queue.
- Type:
@Queue.tail
- Type:
QueueNode*
-
Scope:
protected
- A pointer to the tail of the queue.
- Type:
@Queue.queueSize
- Type:
primitive
-
Scope:
protected
- The number of elements in the queue.
- Type:
Methods
@Queue.size
Scope: public
Echoes the number of elements in the queue.
Usage: @Queue.size
Parameters
@Queue.empty
Scope: public
Echoes “true” if the queue is empty, “false” otherwise.
Usage: @Queue.empty
Parameters
@Queue.enqueue
Scope: public
Adds a value to the end of the queue.
Usage: @Queue.enqueue $value
Parameters
value
- Type:
primitive
- The value to add to the queue.
- Type:
@Queue.dequeue
Scope: public
Removes and echoes the value at the front of the queue.
Usage: @Queue.dequeue
Parameters
@Queue.front
Scope: public
Echoes the value at the front of the queue.
Usage: @Queue.front
Parameters
@Queue.back
Scope: public
Echoes the value at the back of the queue.
Usage: @Queue.back
Parameters
@Queue.clear
Scope: public
Removes all elements from the queue.
Usage: @Queue.clear