ICircularBuffer
Common interface for circular buffers.
Implements: IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable
Properties
public int Capacity { get; set; }
value = iCircularBuffer.Capacity
iCircularBuffer.Capacity = value
Maximum capacity of the buffer.
Methods
public T Back()
result = iCircularBuffer.Back()
Element at the back of the buffer - this[Size - 1].
Returns: The value of the element of type T at the back of the buffer.
public T Front()
result = iCircularBuffer.Front()
Element at the front of the buffer - this[0].
Returns: The value of the element of type T at the front of the buffer.
public void PopBack()
iCircularBuffer.PopBack()
Removes the element at the back of the buffer. Decreasing the Buffer size by 1.
public void PopFront()
iCircularBuffer.PopFront()
Removes the element at the front of the buffer. Decreasing the Buffer size by 1.
public void PushBack(T item)
iCircularBuffer.PushBack(item)
Pushes a new element to the back of the buffer. Back()/this[Size-1] will now return this element. When the buffer is full, the element at Front()/this[0] will be popped to allow for this new element to fit.
- item
- Item to push to the back of the buffer
public void PushFront(T item)
iCircularBuffer.PushFront(item)
Pushes a new element to the front of the buffer. Front()/this[0] will now return this element. When the buffer is full, the element at Back()/this[Size-1] will be popped to allow for this new element to fit.
- item
- Item to push to the front of the buffer