|
Grok 20.3.2
|
Queue limited to maximum size. More...
#include <PacketParser.h>
Public Member Functions | |
| LimitedQueue (std::size_t maxSize) | |
| Constructs a LimitedQueue. | |
| ~LimitedQueue ()=default | |
| Destroys a LimitedQueue. | |
| bool | push (T *ptr) |
| Pushes an element into the queue. | |
| std::optional< T * > | pop () |
| Pops an element from the queue. | |
Private Attributes | |
| std::unique_ptr< T *[]> | elements |
| array of queue elements | |
| size_t | currentSize |
| current size of queue | |
| std::size_t | maxSize |
| maximum size of queue | |
| std::atomic< int32_t > | popIndex |
| pop index | |
Queue limited to maximum size.
| type | of element in queue |
|
inline |
Constructs a LimitedQueue.
| maxSize | maximum size of queue |
References currentSize, elements, maxSize, and popIndex.
|
default |
Destroys a LimitedQueue.
|
inline |
Pops an element from the queue.
There may be no element to pop
References currentSize, elements, and popIndex.
|
inline |
Pushes an element into the queue.
| ptr | pointer to push into queue |
References currentSize, elements, and maxSize.
|
private |
current size of queue
Referenced by LimitedQueue(), pop(), and push().
|
private |
array of queue elements
Referenced by LimitedQueue(), pop(), and push().
|
private |
maximum size of queue
Referenced by LimitedQueue(), and push().
|
private |
pop index
Referenced by LimitedQueue(), and pop().