engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
TCircularBuffer< ElementType > 模板类 参考

Template for circular buffers. 更多...

#include <CircularBuffer.h>

Public 成员函数

FORCEINLINE uint32 Capacity () const
 Returns the number of elements that the buffer can hold. 更多...
 
FORCEINLINE uint32 GetNextIndex (uint32 CurrentIndex) const
 Calculates the index that follows the given index. 更多...
 
FORCEINLINE uint32 GetPreviousIndex (uint32 CurrentIndex) const
 Calculates the index previous to the given index. 更多...
 
FORCEINLINE ElementType & operator[] (uint32 Index)
 Returns the mutable element at the specified index. 更多...
 
FORCEINLINE const ElementType & operator[] (uint32 Index) const
 Returns the immutable element at the specified index. 更多...
 
 TCircularBuffer (uint32 Capacity)
 Creates and initializes a new instance of the TCircularBuffer class. 更多...
 
 TCircularBuffer (uint32 Capacity, const ElementType &InitialValue)
 Creates and initializes a new instance of the TCircularBuffer class. 更多...
 

详细描述

template<typename ElementType>
class TCircularBuffer< ElementType >

Template for circular buffers.

The size of the buffer is rounded up to the next power of two in order speed up indexing operations using a simple bit mask instead of the commonly used modulus operator that may be slow on some platforms.

构造及析构函数说明

◆ TCircularBuffer() [1/2]

template<typename ElementType >
TCircularBuffer< ElementType >::TCircularBuffer ( uint32  Capacity)
inlineexplicit

Creates and initializes a new instance of the TCircularBuffer class.

参数
CapacityThe number of elements that the buffer can store (will be rounded up to the next power of 2).

◆ TCircularBuffer() [2/2]

template<typename ElementType >
TCircularBuffer< ElementType >::TCircularBuffer ( uint32  Capacity,
const ElementType &  InitialValue 
)
inline

Creates and initializes a new instance of the TCircularBuffer class.

参数
CapacityThe number of elements that the buffer can store (will be rounded up to the next power of 2).
InitialValueThe initial value for the buffer's elements.

成员函数说明

◆ Capacity()

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

Returns the number of elements that the buffer can hold.

返回
Buffer capacity.

◆ GetNextIndex()

template<typename ElementType >
FORCEINLINE uint32 TCircularBuffer< ElementType >::GetNextIndex ( uint32  CurrentIndex) const
inline

Calculates the index that follows the given index.

参数
CurrentIndexThe current index.
返回
The next index.

◆ GetPreviousIndex()

template<typename ElementType >
FORCEINLINE uint32 TCircularBuffer< ElementType >::GetPreviousIndex ( uint32  CurrentIndex) const
inline

Calculates the index previous to the given index.

参数
CurrentIndexThe current index.
返回
The previous index.

◆ operator[]() [1/2]

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

Returns the mutable element at the specified index.

参数
IndexThe index of the element to return.

◆ operator[]() [2/2]

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

Returns the immutable element at the specified index.

参数
IndexThe index of the element to return.

该类的文档由以下文件生成: