PC Stable Documentation
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Loading...
Searching...
No Matches
SimpleCircularBuffer< Class T > Class Reference

Private Member Functions

void SimpleCircularBuffer (int pSize, T pDefaultValue=0)
 Initialize Simple Circular Buffer Cyclic Buffer.
 
void Add (T newSample)
 Add new value to buffer.
 
Get (T pIndex)
 Returns value from given index.
 
array< T > GetValues ()
 Returns array of values stored in buffer.
 

Private Attributes

private int m_Pointer = 0
 
private int m_Size = 0
 
private ref array< T > m_Samples = new array<T>()
 

Constructor & Destructor Documentation

◆ SimpleCircularBuffer()

void SimpleCircularBuffer ( int  pSize,
pDefaultValue = 0 
)
inlineprivate

Initialize Simple Circular Buffer Cyclic Buffer.

Parameters
pSizesize of the buffer
pDefaultValueinitial value stored in buffer

Member Function Documentation

◆ Add()

void Add ( newSample)
inlineprivate

Add new value to buffer.

Parameters
newSamplevalue that will be added to buffer
Returns
average value from the buffer
ref SimpleCircularBuffer<float> m_Buffer = SimpleCircularBuffer<float>(2, -1);
m_Buffer.Add(0.1);

◆ Get()

T Get ( pIndex)
inlineprivate

Returns value from given index.

Parameters
pIndexsize of the buffer

◆ GetValues()

array< T > GetValues ( )
inlineprivate

Returns array of values stored in buffer.

Parameters
pIndexsize of the buffer

Field Documentation

◆ m_Pointer

private int m_Pointer = 0
private

◆ m_Samples

private ref array<T> m_Samples = new array<T>()
private

◆ m_Size

private int m_Size = 0
private

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