UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TSpscQueue< T, AllocatorType > Class Template Referencefinal

#include <SpscQueue.h>

Classes

struct  FIterator
 

Public Types

using ElementType = T
 

Public Member Functions

 UE_NONCOPYABLE (TSpscQueue)
 
 TSpscQueue ()
 
 ~TSpscQueue ()
 
template<typename... ArgTypes>
void Enqueue (ArgTypes &&... Args)
 
TOptional< ElementTypeDequeue ()
 
bool Dequeue (ElementType &OutElem)
 
bool IsEmpty () const
 
int32 Num () const
 
ElementTypePeek () const
 
FIterator begin () const
 
std::nullptr_t end () const
 

Detailed Description

template<typename T, typename AllocatorType = FMemory>
class TSpscQueue< T, AllocatorType >

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

Member Typedef Documentation

◆ ElementType

template<typename T , typename AllocatorType = FMemory>
using TSpscQueue< T, AllocatorType >::ElementType = T

Constructor & Destructor Documentation

◆ TSpscQueue()

template<typename T , typename AllocatorType = FMemory>
TSpscQueue< T, AllocatorType >::TSpscQueue ( )
inline

◆ ~TSpscQueue()

template<typename T , typename AllocatorType = FMemory>
TSpscQueue< T, AllocatorType >::~TSpscQueue ( )
inline

Member Function Documentation

◆ begin()

template<typename T , typename AllocatorType = FMemory>
FIterator TSpscQueue< T, AllocatorType >::begin ( ) const
inline

◆ Dequeue() [1/2]

template<typename T , typename AllocatorType = FMemory>
TOptional< ElementType > TSpscQueue< T, AllocatorType >::Dequeue ( )
inline

◆ Dequeue() [2/2]

template<typename T , typename AllocatorType = FMemory>
bool TSpscQueue< T, AllocatorType >::Dequeue ( ElementType OutElem)
inline

◆ end()

template<typename T , typename AllocatorType = FMemory>
std::nullptr_t TSpscQueue< T, AllocatorType >::end ( ) const
inline

◆ Enqueue()

template<typename T , typename AllocatorType = FMemory>
template<typename... ArgTypes>
void TSpscQueue< T, AllocatorType >::Enqueue ( ArgTypes &&...  Args)
inline

◆ IsEmpty()

template<typename T , typename AllocatorType = FMemory>
bool TSpscQueue< T, AllocatorType >::IsEmpty ( ) const
inline

◆ Num()

template<typename T , typename AllocatorType = FMemory>
int32 TSpscQueue< T, AllocatorType >::Num ( ) const
inline

◆ Peek()

template<typename T , typename AllocatorType = FMemory>
ElementType * TSpscQueue< T, AllocatorType >::Peek ( ) const
inline

◆ UE_NONCOPYABLE()

template<typename T , typename AllocatorType = FMemory>
TSpscQueue< T, AllocatorType >::UE_NONCOPYABLE ( TSpscQueue< T, AllocatorType >  )

The documentation for this class was generated from the following file: