A fixed-capacity FIFO queue (circular buffer).
More...
|
|
using | size_type = usize |
|
using | value_type = T |
|
|
constexpr auto | capacity () const noexcept -> size_type |
| | Returns the capacity of the queue.
|
|
constexpr auto | clear () noexcept -> void |
| | Clears the queue.
|
|
constexpr auto | empty () const noexcept -> bool |
| | Returns true if the queue is empty.
|
|
constexpr auto | front () const noexcept -> std::optional< const T & > |
| | Returns the first element of the queue (const).
|
|
constexpr auto | front () noexcept -> std::optional< T & > |
| | Returns the first element of the queue.
|
|
constexpr auto | full () const noexcept -> bool |
| | Returns true if the queue is full.
|
| constexpr auto | pop () noexcept -> bool |
| | Removes the first element from the queue.
|
| constexpr auto | push (const T &value) noexcept -> bool |
| | Adds an element to the end of the queue.
|
| constexpr auto | push (T &&value) noexcept -> bool |
| | Adds an element to the end of the queue (move).
|
|
constexpr auto | size () const noexcept -> size_type |
| | Returns the number of elements in the queue.
|
template<typename T, usize N>
class lib::static_queue< T, N >
A fixed-capacity FIFO queue (circular buffer).
- Template Parameters
-
| T | Type of the elements. |
| N | Capacity of the queue. |
◆ pop()
template<typename T, usize N>
|
|
inlineconstexprexportnoexcept |
Removes the first element from the queue.
- Returns
- true if successful, false if empty.
◆ push() [1/2]
template<typename T, usize N>
|
|
inlineconstexprexportnoexcept |
Adds an element to the end of the queue.
- Parameters
-
| [in] | value | The value to add. |
- Returns
- true if successful, false if full.
◆ push() [2/2]
template<typename T, usize N>
|
|
inlineconstexprexportnoexcept |
Adds an element to the end of the queue (move).
- Parameters
-
| [in] | value | The value to add. |
- Returns
- true if successful, false if full.
The documentation for this class was generated from the following file: