KDStateMachineEditor
1.0.0
A framework for creating Qt State Machine metacode using a graphical user interface
|
#include <ringbuffer.h>
Public Member Functions | |
RingBuffer (int capacity=10) | |
void | setCapacity (int capacity) |
void | enqueue (T t) |
void | clear () |
const T & | at (int i) const |
int | size () const |
T | head () const |
T | last () const |
QList< T > | entries () const |
This class is similar to a QQueue but provides circular semantics. For example, appending to an already "full" queue will overwrite the oldest item, i.e. it forms a kind of LRU cache.
Or, in other words, RingBuffer is a QQueue with limited capacity.
The API is essentially simplified version of QVector, which additional methods such as enqueue(),
|
inline |
Construct a ring buffer with initial capacity capacity
|
inline |
Clear the buffer
|
inline |
Adds value t
to the tail of the queue.
|
inline |
Returns a reference to the queue's head item. This function assumes that the queue isn't empty.
|
inline |
Returns a reference to the last item in the list. The list must not be empty.
|
inline |
(Re-)set the capacity of this ring buffer to capacity