Generic fixed-size circular buffer with contiguous read and write helpers.
More...
|
| | CircularBuffer () |
| | Initializes a new empty CircularBuffer<T> with size 0. Call SetSize(int) before using it.
|
| |
| | CircularBuffer (int bufCount) |
| | Initializes a new CircularBuffer<T> with the given capacity.
|
| |
| void | Dispose () |
| | Releases the buffer by setting its size to 0.
|
| |
| void | Reset () |
| | Resets read/write cursors to the beginning without changing capacity.
|
| |
| void | SetSize (int newSize) |
| | Sets the buffer capacity. Resets indices and discards previous data.
|
| |
| void | Clear () |
| | Fills the underlying array with default(T ) values.
|
| |
Generic fixed-size circular buffer with contiguous read and write helpers.
- Template Parameters
-
| T | Element type stored in the buffer. |
◆ CircularBuffer() [1/2]
| Backbone::CircularBuffer< T >::CircularBuffer |
( |
| ) |
|
◆ CircularBuffer() [2/2]
| Backbone::CircularBuffer< T >::CircularBuffer |
( |
int | bufCount | ) |
|
Initializes a new CircularBuffer<T> with the given capacity.
- Parameters
-
| bufCount | Number of elements in the buffer capacity. Must be >= 0. |
◆ Clear()
| void Backbone::CircularBuffer< T >::Clear |
( |
| ) |
|
Fills the underlying array with default(T ) values.
Safe to call when size is 0; it is a no-op.
◆ Dispose()
| void Backbone::CircularBuffer< T >::Dispose |
( |
| ) |
|
Releases the buffer by setting its size to 0.
◆ Reset()
| void Backbone::CircularBuffer< T >::Reset |
( |
| ) |
|
Resets read/write cursors to the beginning without changing capacity.
This does not clear data; it only resets indices and counters.
◆ SetSize()
| void Backbone::CircularBuffer< T >::SetSize |
( |
int | newSize | ) |
|
Sets the buffer capacity. Resets indices and discards previous data.
- Parameters
-
| newSize | New capacity in elements. Use 0 to release memory. |
◆ m_availBuf
| int Backbone::CircularBuffer< T >::m_availBuf |
|
private |
◆ m_begBufOffset
| int Backbone::CircularBuffer< T >::m_begBufOffset |
|
private |
◆ m_buffer
| T [] Backbone::CircularBuffer< T >::m_buffer |
|
private |
◆ m_bufSize
| int Backbone::CircularBuffer< T >::m_bufSize |
|
private |
◆ m_startPos
| long Backbone::CircularBuffer< T >::m_startPos |
|
private |
The documentation for this class was generated from the following file: