#cp.collect.Queue
A "double-ended queue" implementation. This allows pushing and popping values to the left or right side of the queue. This can be used for classic 'stack' and 'queue' uses - for a stack, push and pop from one end, for a queue, push and pop from opposite ends.
#
will always return the size of the queue.
The left-most item in the queue wil always be at index 1
, the right-most will be at index #
.
You can iterate via ipairs
, but as with all tables, the queue contains any nil
values, it will stop at that point. To iterate the whole queue, you need to use the #
operator. Eg:
#API Overview
Functions - API calls offered directly by the extension
Constructors - API calls which return an object, typically one that offers API methods
Methods - API calls which can only be made on an object returned by a constructor