Beef Corlib
|
A simple Queue of generic items. More...
Classes | |
struct | Enumerator |
Implements an enumerator for a Queue. More... | |
Public Member Functions | |
Queue () | |
Creates a queue with room for capacity objects. More... | |
Queue (int capacity) | |
Creates a queue with room for capacity objects. More... | |
Queue (IEnumerator< T > enumerator) | |
void | Clear () |
Removes all items from the queue. | |
void | CopyTo (Span< T > span) |
CopyTo copies a collection into an Array, starting at a particular index into the array. | |
void | Enqueue (T item) |
Adds item to the tail of the queue. | |
void | Add (T item) |
Adds item to the tail of the queue. | |
void | AddFront (T item) |
Adds item to the head of the queue. | |
Enumerator | GetEnumerator () |
GetEnumerator returns an enumerator over this Queue which supports removing. | |
T | Dequeue () |
Removes the object at the head of the queue and returns it. More... | |
Result< T > | TryPopFront () |
Removes the object at the head of the queue and returns it. More... | |
T | PopFront () |
Removes the object at the head of the queue and returns it. More... | |
Result< T > | TryPopBack () |
Removes the object at the tail of the queue and returns it. More... | |
T | PopBack () |
Removes the object at the tail of the queue and returns it. More... | |
Result< T > | TryPeek () |
Returns the object at the head of the queue. More... | |
T | Peek () |
Returns the object at the head of the queue. More... | |
bool | Contains (T item) |
Returns true if the queue contains at least one object equal to 'item'. | |
bool | ContainsStrict (T item) |
Returns true if the queue contains at least one object equal to 'item'. | |
void | RemoveAt (int index) |
void | TrimExcess () |
Protected Member Functions | |
virtual T * | Alloc (int size) |
virtual void | Free (T *val) |
override void | GCMarkMembers () |
Properties | |
ref T | this[int index] [get, set] |
ref T | this[Index index] [get, set] |
ref T | Front [get] |
ref T | Back [get] |
int | AllocSize [get] |
bool | IsDynAlloc [get] |
int | Count [get] |
bool | IsEmpty [get] |
A simple Queue of generic items.
Internally it is implemented as a circular buffer, so Enqueue can be O(n). Dequeue is O(1).
|
inline |
Creates a queue with room for capacity objects.
The default initial capacity and grow factor are used.
|
inline |
Creates a queue with room for capacity objects.
The default grow factor is used.
|
inline |
Removes the object at the head of the queue and returns it.
If the queue is empty, this method returns an error
|
inline |
Returns the object at the head of the queue.
The object remains in the queue. If the queue is empty, this method fails
|
inline |
Removes the object at the tail of the queue and returns it.
If the queue is empty, this method fails
|
inline |
Removes the object at the head of the queue and returns it.
If the queue is empty, this method fails
|
inline |
Returns the object at the head of the queue.
The object remains in the queue. If the queue is empty, this method returns an error
|
inline |
Removes the object at the tail of the queue and returns it.
If the queue is empty, this method returns an error
|
inline |
Removes the object at the head of the queue and returns it.
If the queue is empty, this method returns an error