7#include "Misc/Optional.h"
28template<
typename T,
typename AllocatorType = FMemory>
38 FNode* Node = ::new(AllocatorType::Malloc(
sizeof(FNode),
alignof(FNode))) FNode;
39 Head = First = Tail = TailCopy = Node;
53 FNode*
Next = Node->Next;
55 AllocatorType::Free(Node);
61 while (Node !=
nullptr)
63 FNode*
Next = Node->Next;
65 AllocatorType::Free(Node);
73 FNode* Node = AllocNode();
145 FNode*
Next =
nullptr;
150 FNode* AllocFromCache()
155 Node->Next =
nullptr;
164 if (First != TailCopy)
166 return AllocFromCache();
170 if (First != TailCopy)
172 return AllocFromCache();
177 return ::new(AllocatorType::Malloc(
sizeof(FNode),
alignof(FNode))) FNode();
constexpr FNullOpt NullOpt
Definition Optional.h:15
FORCEINLINE constexpr void DestructItem(ElementType *Element)
Definition MemoryOps.h:56
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTempIfPossible(T &&Obj) noexcept
Definition UnrealTemplate.h:538
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
FRWLock Lock
Definition UnversionedPropertySerialization.cpp:921
Definition TransactionallySafeSpscQueue.h:30
TTransactionallySafeSpscQueue()
Definition TransactionallySafeSpscQueue.h:36
T ElementType
Definition TransactionallySafeSpscQueue.h:32
TOptional< ElementType > Dequeue()
Definition TransactionallySafeSpscQueue.h:84
UE_NONCOPYABLE(TTransactionallySafeSpscQueue)
bool IsEmpty() const
Definition TransactionallySafeSpscQueue.h:119
void Enqueue(ArgTypes &&... Args)
Definition TransactionallySafeSpscQueue.h:71
bool Dequeue(ElementType &OutElem)
Definition TransactionallySafeSpscQueue.h:107
ElementType * Peek() const
Definition TransactionallySafeSpscQueue.h:131
~TTransactionallySafeSpscQueue()
Definition TransactionallySafeSpscQueue.h:42
void Lock()
Definition Mutex.h:43
void Unlock()
Definition Mutex.h:53
Definition ScopeLock.h:21
Definition Optional.h:131
Definition TypeCompatibleBytes.h:24