folly::FixedCapacityRingQueue

A simple fixed-capacity ring buffer queue backed by a power-of-two sized array. Not thread-safe.

Synopsis

Declared in <folly/container/FixedCapacityRingQueue.h>

template<typename T>
class FixedCapacityRingQueue;

Member Functions

NameDescription
FixedCapacityRingQueue [constructor]Constructors
~FixedCapacityRingQueue [destructor]Destroys the queue and releases its buffer.
operator= Assignment operators
capacity Returns the number of elements the queue can hold.
empty Returns whether the queue holds no elements.
max_size Returns the maximum capacity the queue can have.
pop Removes and returns the element at the front of the queue.
push Appends an element to the back of the queue if space remains.
size Returns the number of elements currently stored in the queue.

Static Data Members

NameDescription
kMaxCapacity The maximum capacity the queue can have.