UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TCircularHistoryBuffer< ElementType > Class Template Reference

#include <MotionDelayBuffer.h>

Public Member Functions

 TCircularHistoryBuffer (uint32 InitialCapacity=0)
 
ElementType & Add (const ElementType &Element)
 
void Resize (uint32 NewCapacity)
 
ElementType & operator[] (uint32 Index)
 
const ElementType & operator[] (uint32 Index) const
 
void InsertAt (uint32 Index, const ElementType &Element)
 
uint32 Capacity () const
 
int32 Num () const
 
void Empty ()
 
bool IsEmpty () const
 
bool IsFull () const
 

Detailed Description

template<typename ElementType>
class TCircularHistoryBuffer< ElementType >

Modeled after TCircularBuffer/Queue, but resizable with it's own stack-style way of indexing (0 = most recent value added)

Constructor & Destructor Documentation

◆ TCircularHistoryBuffer()

template<typename ElementType >
TCircularHistoryBuffer< ElementType >::TCircularHistoryBuffer ( uint32  InitialCapacity = 0)

Member Function Documentation

◆ Add()

template<typename ElementType >
ElementType & TCircularHistoryBuffer< ElementType >::Add ( const ElementType &  Element)

◆ Capacity()

template<typename ElementType >
uint32 TCircularHistoryBuffer< ElementType >::Capacity ( ) const
inline

◆ Empty()

template<typename ElementType >
void TCircularHistoryBuffer< ElementType >::Empty ( )
inline

◆ InsertAt()

template<typename ElementType >
void TCircularHistoryBuffer< ElementType >::InsertAt ( uint32  Index,
const ElementType &  Element 
)

◆ IsEmpty()

template<typename ElementType >
bool TCircularHistoryBuffer< ElementType >::IsEmpty ( ) const
inline

◆ IsFull()

template<typename ElementType >
bool TCircularHistoryBuffer< ElementType >::IsFull ( ) const
inline

◆ Num()

template<typename ElementType >
int32 TCircularHistoryBuffer< ElementType >::Num ( ) const
inline

◆ operator[]() [1/2]

template<typename ElementType >
ElementType & TCircularHistoryBuffer< ElementType >::operator[] ( uint32  Index)
inline

NOTE: Will clamp to the oldest value available if the buffer isn't full and the index is larger than the number of values buffered.

Parameters
IndexStack-esque indexing: 0 => the most recent value added, 1+n => Older entries, 1+n back from the newest.

◆ operator[]() [2/2]

template<typename ElementType >
const ElementType & TCircularHistoryBuffer< ElementType >::operator[] ( uint32  Index) const
inline

◆ Resize()

template<typename ElementType >
void TCircularHistoryBuffer< ElementType >::Resize ( uint32  NewCapacity)

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