![]() |
TrinityCore
|
#include <Queue.h>
Public Member Functions | |
| Queue () | |
| Queue (const Queue &other) | |
| virtual | ~Queue () |
| void | pushFront (const T &e) |
| void | pushBack (const T &e) |
| void | enqueue (const T &e) |
| T | popBack () |
| T | popFront () |
| T | dequeue () |
| void | clear (bool freeStorage=true) |
| void | fastClear () |
| Queue & | operator= (const Queue &other) |
| int | size () const |
| int | length () const |
| T & | operator[] (int n) |
| const T & | operator[] (int n) const |
| const T & | last () const |
| T & | last () |
| bool | empty () const |
| bool | contains (const T &e) const |
| void | deleteAll () |
Private Member Functions | |
| void | _copy (const Queue &other) |
| int | index (int i) const |
| void | repackAndRealloc (int newSize) |
| void | reserveSpace () |
Private Attributes | |
| T * | data |
| int | head |
| int | num |
| int | numAllocated |
Dynamic queue that uses a circular buffer for performance.
Faster than std::deque for objects with constructors.
|
inline |
|
inline |
Copy constructor
Here is the call graph for this function:
|
inlinevirtual |
Destructor does not delete() the objects if T is a pointer type (e.g. T = int*) instead, it deletes the pointers themselves and leaves the objects. Call deleteAll if you want to dealocate the objects referenced.
Here is the call graph for this function:
|
inlineprivate |
If a clear was needed, assumes it already occured
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Removes all elements (invoking their destructors).
| freeStorage | If false, the underlying array is not deallocated (allowing fast push in the future), however, the size of the Queue is reported as zero. |
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Returns true if the given element is in the queue.
Here is the call graph for this function:
|
inline |
Calls delete on all objects[0...size-1] and sets the queue size to zero.
Here is the call graph for this function:
|
inline |
popFront
Here is the call graph for this function:
|
inline |
Here is the call graph for this function:
|
inline |
pushBack
Here is the call graph for this function:
|
inline |
Clear without freeing the underlying array.
Here is the call graph for this function:
|
inlineprivate |
Computes a data array index from a queue position. The queue position may be negative.
Here is the caller graph for this function:
|
inline |
Returns the back element
Here is the call graph for this function:
|
inline |
Here is the call graph for this function:
|
inline |
Number of elements in the queue.
Here is the call graph for this function:
|
inline |
Assignment operator.
Here is the call graph for this function:
|
inline |
Performs bounds checks in debug mode
Here is the call graph for this function:
|
inline |
Performs bounds checks in debug mode
Here is the call graph for this function:
|
inline |
Remove the last element from the queue. The queue will never shrink in size. (A typical queue only uses popFront).
Here is the call graph for this function:
|
inline |
Remove the next element from the head of the queue. The queue will never shrink in size.
Here is the caller graph for this function:
|
inline |
Insert a new element at the end of the queue.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Insert a new element into the front of the queue (a traditional queue only uses pushBack).
Here is the call graph for this function:
|
inlineprivate |
Allocates newSize elements and repacks the array.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprivate |
Ensure that there is at least one element between the tail and head, wrapping around in the circular buffer.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Number of elements in the queue.
Here is the caller graph for this function:
|
private |
Only num elements are initialized.
|
private |
Index of the next element to be dequeue-d in data.
|
private |
Number of elements (including head) that are visible and initialized.
|
private |
Size of data array in elements.
1.8.8