FastLED 3.9.15
Loading...
Searching...
No Matches
fl::queue< T, Container > Class Template Reference

Detailed Description

template<typename T, typename Container = fl::deque<T>>
class fl::queue< T, Container >

A first-in, first-out (FIFO) queue container adapter.

This queue is implemented as a container adapter that uses fl::deque as the underlying container by default. It provides standard queue operations: push elements to the back and pop elements from the front.

Template Parameters
TThe type of elements stored in the queue
ContainerThe underlying container type (defaults to fl::deque<T>)

Definition at line 17 of file queue.h.

#include <queue.h>

Public Types

using const_reference = const T&
 
using container_type = Container
 
using reference = T&
 
using size_type = fl::size
 
using value_type = T
 

Public Member Functions

 queue () FL_NOEXCEPT=default
 Default constructor - creates an empty queue.
 
 queue (const Container &container)
 Construct queue with a copy of the given container.
 
 queue (const queue &other) FL_NOEXCEPT=default
 Copy constructor.
 
 queue (Container &&container)
 Construct queue by moving the given container.
 
 queue (queue &&other) FL_NOEXCEPT=default
 Move constructor.
 
 ~queue () FL_NOEXCEPT=default
 Destructor.
 
reference back ()
 Access the last element (back of queue)
 
const_reference back () const
 Access the last element (back of queue) - const version.
 
void clear ()
 Remove all elements from the queue.
 
template<typename... Args>
void emplace (Args &&... args)
 Construct and add an element to the back of the queue.
 
bool empty () const
 Check if the queue is empty.
 
reference front ()
 Access the first element (front of queue)
 
const_reference front () const
 Access the first element (front of queue) - const version.
 
Container & get_container ()
 Get access to the underlying container (for advanced use)
 
const Container & get_container () const
 Get access to the underlying container (const version)
 
bool operator!= (const queue &other) const
 Inequality comparison.
 
bool operator< (const queue &other) const
 Less-than comparison (lexicographic)
 
bool operator<= (const queue &other) const
 Less-than-or-equal comparison.
 
queueoperator= (const queue &other) FL_NOEXCEPT=default
 Copy assignment operator.
 
queueoperator= (queue &&other) FL_NOEXCEPT=default
 Move assignment operator.
 
bool operator== (const queue &other) const
 Equality comparison.
 
bool operator> (const queue &other) const
 Greater-than comparison.
 
bool operator>= (const queue &other) const
 Greater-than-or-equal comparison.
 
void pop ()
 Remove the front element from the queue.
 
void push (const value_type &value)
 Add an element to the back of the queue.
 
void push (value_type &&value)
 Add an element to the back of the queue (move version)
 
size_type size () const
 Get the number of elements in the queue.
 
void swap (queue &other)
 Swap the contents with another queue.
 

Private Attributes

Container mContainer
 

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