template <typename T>
class RingQueue
Defined at line 20 of file ../../src/connectivity/network/drivers/network-device/device/data_structs.h
A ring buffer implementation that can store trivially-constructable types, whose capacity is
informed on creation.
This container is not thread-safe.
Public Methods
void ~RingQueue<T> ()
Defined at line 22 of file ../../src/connectivity/network/drivers/network-device/device/data_structs.h
zx::result<std::unique_ptr<RingQueue<T>>> Create (uint32_t capacity)
Creates a new queue with the given capacity and stores it in `out`.
Returns an error if the provided capacity is invalid, or it failed to allocate the required
memory.
Defined at line 27 of file ../../src/connectivity/network/drivers/network-device/device/data_structs.h
void Push (T value)
Pushes a new value onto the queue.
It is invalid to push into a full queue.
Defined at line 45 of file ../../src/connectivity/network/drivers/network-device/device/data_structs.h
T Pop ()
Pops a value from the queue.
It is invalid to pop from an empty queue.
Defined at line 54 of file ../../src/connectivity/network/drivers/network-device/device/data_structs.h
const T & Peek ()
Peeks the next value from the queue, without popping.
It is invalid to peek into an empty queue.
Defined at line 64 of file ../../src/connectivity/network/drivers/network-device/device/data_structs.h
uint32_t count ()
Returns the number of elements currently queued.
Defined at line 70 of file ../../src/connectivity/network/drivers/network-device/device/data_structs.h