Navigation
API > API/Runtime > API/Runtime/uLangCore
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_.
| Name | TQueueG |
| Type | class |
| Header File | /Engine/Source/Runtime/Solaris/uLangCore/Public/uLang/Common/Containers/Queue.h |
| Include Path | #include "uLang/Common/Containers/Queue.h" |
Syntax
template<typename InElementType, EQueueMode Mode>
class TQueueG
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TQueueG () |
uLang/Common/Containers/Queue.h | ||
| Hidden copy constructor. | uLang/Common/Containers/Queue.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~TQueueG() |
uLang/Common/Containers/Queue.h |
Structs
| Name | Remarks |
|---|---|
| TNode | Structure for the internal linked list. |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Head | std::atomic< TNode * > | Holds a pointer to the head of the list. | uLang/Common/Containers/Queue.h | |
| Tail | TNode * | Holds a pointer to the tail of the list. | uLang/Common/Containers/Queue.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool Dequeue
(
InElementType& OutElement |
Removes and returns the item from the tail of the queue. | uLang/Common/Containers/Queue.h | |
void Empty() |
Empty the queue, discarding all items. | uLang/Common/Containers/Queue.h | |
bool Enqueue
(
const InElementType& InElement |
Adds an item to the head of the queue. | uLang/Common/Containers/Queue.h | |
bool Enqueue
(
const InElementType&& InElement |
uLang/Common/Containers/Queue.h | ||
bool IsEmpty() |
Checks whether the queue is empty. | uLang/Common/Containers/Queue.h | |
bool Pop() |
Removes the item from the tail of the queue. | uLang/Common/Containers/Queue.h |
Protected
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Hidden assignment operator. | uLang/Common/Containers/Queue.h |