KDStateMachineEditor API Documentation 2.1
|
#include <ringbuffer.h>
Public Member Functions | |
RingBuffer (int capacity=10) | |
const T & | at (int i) const |
void | clear () |
void | enqueue (T t) |
QList< T > | entries () const |
T | head () const |
T | last () const |
void | setCapacity (int capacity) |
int | size () 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(), setCapacity()
Definition at line 38 of file ringbuffer.h.
|
inlineexplicit |
Construct a ring buffer with initial capacity capacity
Definition at line 44 of file ringbuffer.h.
|
inline |
Definition at line 79 of file ringbuffer.h.
|
inline |
Clear the buffer
Definition at line 74 of file ringbuffer.h.
|
inline |
Adds value t
to the tail of the queue.
Definition at line 65 of file ringbuffer.h.
|
inline |
Definition at line 103 of file ringbuffer.h.
|
inline |
Returns a reference to the queue's head item. This function assumes that the queue isn't empty.
Definition at line 91 of file ringbuffer.h.
|
inline |
Returns a reference to the last item in the list. The list must not be empty.
Definition at line 99 of file ringbuffer.h.
|
inline |
(Re-)set the capacity of this ring buffer to capacity
Definition at line 55 of file ringbuffer.h.
|
inline |
Definition at line 83 of file ringbuffer.h.