Navigation
API > API/Runtime > API/Runtime/uLangCore > API/Runtime/uLangCore/uLang > API/Runtime/uLangCore/uLang/Common > API/Runtime/uLangCore/uLang/Common/Containers
References
| Module | uLangCore |
| Header | /Engine/Source/Runtime/Solaris/uLangCore/Public/uLang/Common/Containers/Queue.h |
| Include | #include "uLang/Common/Containers/Queue.h" |
Syntax
template<typename InElementType, EQueueMode Mode>
class TQueueG
Remarks
Simple templated queue following Unreal's TQueue_ implementation using a lock-free linked list. We're doing this instead of using a simple array/etc. since it matches Unreal's implementation 1:1 apart from usage of the standard library for atomics. TODO: (yiliang.siew) Allow for custom allocators as the rest of uLang_ does. TODO: (yiliang.siew) See if some of the memory ordering requirements can be relaxed. For now since it guarantees an MFENCE_ instruction on x86-64 arch. Unreal issues a mm_sfence intrinsic, which I'm not sure if I can guarantee via `std::atomic_.
Constructors
Destructors
| Type | Name | Description | |
|---|---|---|---|
~TQueueG () |
Functions
| Type | Name | Description | |
|---|---|---|---|
| bool | Dequeue
(
InElementType& OutElement |
Removes and returns the item from the tail of the queue. | |
| void | Empty () |
Empty the queue, discarding all items. | |
| bool | Enqueue
(
const InElementType& InElement |
Adds an item to the head of the queue. | |
| bool | Enqueue
(
const InElementType&& InElement |
||
| bool | IsEmpty () |
Checks whether the queue is empty. | |
| bool | Pop () |
Removes the item from the tail of the queue. |