Ghidra Decompiler Analysis Engine
Public Member Functions | List of all members
circularqueue< _type > Class Template Reference

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...
 

Detailed Description

template<typename _type>
class circularqueue< _type >

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.

Constructor & Destructor Documentation

◆ circularqueue()

template<typename _type >
circularqueue< _type >::circularqueue ( int4  sz)

Construct queue of a given size.

Parameters
szis the maximum number of objects the queue will hold

Member Function Documentation

◆ expand()

template<typename _type >
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.

Parameters
amountis the number of additional objects the resized queue will support

◆ setMax()

template<typename _type >
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

Parameters
szthe maximum size of the new queue

The documentation for this class was generated from the following file: