@include <Queue>

The Queue class provides a simple queue implementation in Bash++.

Methods

@Queue.size

Scope: public

Echoes the number of elements in the queue.

Usage: @Queue.size

@Queue.empty

Scope: public

Echoes “true” if the queue is empty, “false” otherwise.

Usage: @Queue.empty

@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.

@Queue.dequeue

Scope: public

Removes and echoes the value at the front of the queue.

Usage: @Queue.dequeue

@Queue.front

Scope: public

Echoes the value at the front of the queue.

Usage: @Queue.front

@Queue.back

Scope: public

Echoes the value at the back of the queue.

Usage: @Queue.back

@Queue.clear

Scope: public

Removes all elements from the queue.

Usage: @Queue.clear