Ghidra Decompiler Analysis Engine
|
A circular buffer template. More...
#include <prettyprint.hh>
Public Member Functions | |
circularqueue (int4 sz) | |
Construct queue of a given size. More... | |
~circularqueue (void) | |
Destructor. | |
void | setMax (int4 sz) |
Establish a new maximum queue size. More... | |
void | expand (int4 amount) |
Expand the (maximum) size of the queue. More... | |
A circular buffer template.
A circular buffer implementation that can act as a stack: push(), pop(). Or it can act as a queue: push(), popbottom(). The size of the buffer can be expanded on the fly using expand(). The object being buffered must support a void constructor and the assignment operator. Objects can also be looked up via an integer reference.
circularqueue< _type >::circularqueue | ( | int4 | sz | ) |
Construct queue of a given size.
sz | is the maximum number of objects the queue will hold |
void circularqueue< _type >::expand | ( | int4 | amount | ) |
Expand the (maximum) size of the queue.
Expand the maximum size of this queue. Objects currently in the queue are preserved, which involves copying the objects. This routine invalidates references referring to objects currently in the queue, although the references can be systematically adjusted to be valid again.
amount | is the number of additional objects the resized queue will support |
void circularqueue< _type >::setMax | ( | int4 | sz | ) |
Establish a new maximum queue size.
This destroys the old queue and reallocates a new queue with the given maximum size
sz | the maximum size of the new queue |