Simple ResizableCircularQueue. 更多...
#include <ResizableCircularQueue.h>
Public 成员函数 | |
| SIZE_T | AllocatedCapacity () const |
| Current allocated Capacity | |
| SIZE_T | Count () const |
| Gets the number of elements in the queue. | |
| void | Empty () |
| Empty queue and release memory | |
| ElementT & | Enqueue () |
| Push single element to the back of the Queue, returning a reference to it. 更多... | |
| void | Enqueue (const ElementT &SrcData) |
| Push single element to the back of the Queue | |
| ElementT & | Enqueue_GetRef () |
| Push single element to the back of the Queue, returning a reference to it. 更多... | |
| ElementT & | EnqueueDefaulted_GetRef () |
| Push single default constructed element to the back of the Queue, returning a reference to it. 更多... | |
| bool | IsEmpty () const |
| Returns true if the queue is empty | |
| const ElementT & | Peek () const |
| Peek at front element | |
| const ElementT & | PeekAtOffset (SIZE_T Offset=0) const |
| Peek with the given offset from the front of the queue | |
| const ElementT & | PeekAtOffsetNoCheck (SIZE_T Offset=0) const |
| Unchecked version, Peek with the given offset from the front of the queue | |
| const ElementT & | PeekNoCheck () const |
| Peek at front element with no check | |
| ElementT & | Poke () |
| Peek at front element | |
| ElementT & | PokeAtOffset (SIZE_T Offset=0) |
| Poke at the element with the given offset from the front of the queue | |
| ElementT & | PokeAtOffsetNoCheck (SIZE_T Offset=0) |
| Unchecked version, Peek with the given offset from the front of the queue | |
| void | Pop () |
| Pop elements from the front of the queue | |
| void | Pop (SIZE_T Count) |
| Pop Count elements from the front of the queue | |
| void | PopNoCheck () |
| Unchecked version, Pop a single element from the front of the queue | |
| void | PopNoCheck (SIZE_T Count) |
| Unchecked version, Pop Count elements from the front of the queue | |
| void | Reset () |
| Empty queue without releasing memory | |
| TResizableCircularQueue (SIZE_T InitialCapacity) | |
| Construct Empty Queue with the given initial Capacity, Capacity must be a power of two since we rely on unsigned arithmetics for wraparound | |
| void | Trim () |
| Trim memory usage to the next power of two for the current size | |
Simple ResizableCircularQueue.
Relies on unsigned arithmetics and ever increasing head and tail indices to avoid having to store an extra element or maintain explicit empty state.
InitialCapacity must be a power of two.
| TResizableCircularQueue< T, AllocatorT >::ElementT & TResizableCircularQueue< T, AllocatorT >::Enqueue |
Push single element to the back of the Queue, returning a reference to it.
POD types will not be initialized.
| TResizableCircularQueue< T, AllocatorT >::ElementT & TResizableCircularQueue< T, AllocatorT >::Enqueue_GetRef |
Push single element to the back of the Queue, returning a reference to it.
POD types will not be initialized.
| TResizableCircularQueue< T, AllocatorT >::ElementT & TResizableCircularQueue< T, AllocatorT >::EnqueueDefaulted_GetRef |
Push single default constructed element to the back of the Queue, returning a reference to it.