Prusa MINI Firmware overview
|
Go to the documentation of this file.
30 template<
typename T, u
int8_t N>
56 buffer.count = buffer.head = buffer.tail = 0;
71 if (++buffer.head == buffer.size)
74 return buffer.queue[index];
85 if (
isFull())
return false;
87 buffer.queue[buffer.tail] = item;
90 if (++buffer.tail == buffer.size)
108 bool isFull() {
return buffer.count == buffer.size; }
123 T
peek() {
return buffer.queue[buffer.head]; }
bool isFull()
Checks if the queue is full.
Definition: circularqueue.h:108
bool isEmpty()
Checks if the queue has no items.
Definition: circularqueue.h:101
GCodeQueue queue
Definition: queue.cpp:28
T peek()
Gets the next item from the queue without removing it.
Definition: circularqueue.h:123
uint8_t size()
Gets the queue size.
Definition: circularqueue.h:115
T dequeue()
Removes and returns a item from the queue.
Definition: circularqueue.h:65
uint8_t count()
Gets the number of items on the queue.
Definition: circularqueue.h:130
const uint8_t[]
Definition: 404_html.c:3
Circular Queue class.
Definition: circularqueue.h:31
bool enqueue(T const &item)
Adds an item to the queue.
Definition: circularqueue.h:84