![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
A generic queue template class for moveable objects eg. structs or fundamental data types like UInt32, Real, etc.
The Queue class works for moveable objects only, use ObjectQueue class for storing non-moveable objects.
This class is based on the NTL BiVector container, see http://www.ultimatepp.org
Construct an empty queue.
Murl.Queue.SInt16 new()
Construct a queue from an already existing one, performing a deep copy.
Murl.Queue.SInt16 new(Murl.Queue.SInt16 other)
other | The queue to copy. |
Get the number of items in the queue.
Integer GetCount()
Check if the queue is empty.
Boolean IsEmpty()
Clear the queue and remove the underlying storage.
Clear()
Empty the queue, but keep the underlying storage.
Empty()
Add a new item at the head of the queue. The new item entry is initialized using the value type's default constructor. The new item will be at position 0.
Integer AddHead()
Add a given item at the head of the queue. The new item entry is initialized using the given item's copy constructor. The new item will be at position 0.
item | The given item to be inserted at the head of the queue. |
Add a new item at the tail of the queue. The new item entry is initialized using the value type's default constructor. The new item will be at position GetCount() - 1.
Integer AddTail()
Add a given item at the tail of the queue. The new item entry is initialized using the given item's copy constructor. The new item will be at position GetCount() - 1.
item | The given item to be inserted at the tail of the queue. |
Get the item at the head of the queue.
Integer Head()
Get the item at the tail of the queue.
Integer Tail()
Drop the item from the head of the queue and get a copy of the item.
Integer DropGetHead()
Drop the item from the tail of the queue and get a copy of the item.
Integer DropGetTail()
Drop the item from the head of the queue.
DropHead()
Drop a specified number of items from the head of the queue.
DropHead(Integer n)
n | The number of items to remove from the head. |
Drop the item from the tail of the queue.
DropTail()
Drop a specified number of items from the tail of the queue.
DropTail(Integer n)
n | The number of items to remove from the tail. |
Get the item at a given position from the queue.
index | The zero-based index of the item to retrieve. |
Shrink the queue so that the underlying storage is only as large as necessary.
Shrink()
Reserve storage space. If the given size is less than the actual size, nothing is done.
Reserve(Integer n)
n | The number of items the underlying storage should hold. |
Get the number of actually allocated items.
Integer GetAlloc()
Compare the queue to another one.
Boolean IsEqual(Murl.Queue.SInt16 other)
other | The queue to compare. |
Exchange the content of the queue with a given second one.
Murl.Queue.SInt16 Swap(Murl.Queue.SInt16 other)
other | The second queue. |
The length operator is denoted by the unary prefix operator #.
Retrieve the item at a given position from the queue.
index | The zero-based index of the item to retrieve. |
The "equal to" comparison operator, calls IsEqual().