|
| uint32 | Count () const |
| | Gets the number of elements in the queue. 更多...
|
| |
| bool | Dequeue () |
| | Removes an item from the front of the queue. 更多...
|
| |
| bool | Dequeue (ElementType &OutElement) |
| | Removes an item from the front of the queue. 更多...
|
| |
| void | Empty () |
| | Empties the queue. 更多...
|
| |
| bool | Enqueue (const ElementType &Element) |
| | Adds an item to the end of the queue. 更多...
|
| |
| bool | Enqueue (ElementType &&Element) |
| | Adds an item to the end of the queue. 更多...
|
| |
| FORCEINLINE bool | IsEmpty () const |
| | Checks whether the queue is empty. 更多...
|
| |
| bool | IsFull () const |
| | Checks whether the queue is full. 更多...
|
| |
| const ElementType * | Peek () const |
| | Returns the oldest item in the queue without removing it. 更多...
|
| |
| bool | Peek (ElementType &OutItem) const |
| | Returns the oldest item in the queue without removing it. 更多...
|
| |
| | TCircularQueue (uint32 CapacityPlusOne) |
| | Constructor. 更多...
|
| |
template<typename ElementType>
class TCircularQueue< ElementType >
Implements a lock-free first-in first-out queue using a circular array.
This class is thread safe only in single-producer single-consumer scenarios.
The number of items that can be enqueued is one less than the queue's capacity, because one item will be used for detecting full and empty states.
There is some room for optimization via using fine grained memory fences, but the implications for all of our target platforms need further analysis, so we're using the simpler sequentially consistent model for now.
- 参数
-
| ElementType | The type of elements held in the queue. |