Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/Containers
References
| Module | Core |
| Header | /Engine/Source/Runtime/Core/Public/Containers/SpscQueue.h |
| Include | #include "Containers/SpscQueue.h" |
Syntax
template<typename T, typename AllocatorType>
class TSpscQueue
Remarks
Fast single-producer/single-consumer unbounded concurrent queue. Doesn't free memory until destruction but recycles consumed items. Based on http://www.1024cores.net/home/lock-free-algorithms/queues/unbounded-spsc-queue
Constructors
| Type | Name | Description | |
|---|---|---|---|
TSpscQueue () |
|||
TSpscQueue
(
TSpscQueue&& |
|||
TSpscQueue
(
const TSpscQueue& |
Destructors
| Type | Name | Description | |
|---|---|---|---|
~TSpscQueue () |
Functions
| Type | Name | Description | |
|---|---|---|---|
| TOptional< ElementType > | Dequeue () |
Returns empty TOptional if queue is empty | |
| bool | Dequeue
(
ElementType& OutElem |
||
| void | Enqueue
(
ArgTypes&&... Args |
||
| bool | IsEmpty () |
||
| ElementType * | Peek () |
As there can be only one consumer, a consumer can safely "peek" the tail of the queue. |
Operators
| Type | Name | Description | |
|---|---|---|---|
| TSpscQueue & | operator=
(
const TSpscQueue& |
||
| TSpscQueue & | operator=
(
TSpscQueue&& |
Typedefs
| Name | Description |
|---|---|
| ElementType |