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 18 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 ()=default
 Default constructor - creates an empty queue.
 
 queue (const Container &container)
 Construct queue with a copy of the given container.
 
 queue (const queue &other)=default
 Copy constructor.
 
 queue (Container &&container)
 Construct queue by moving the given container.
 
 queue (queue &&other)=default
 Move constructor.
 
 ~queue ()=default
 Destructor.
 
reference back ()
 Access the last element (back of queue)
 
const_reference back () const
 Access the last element (back of queue) - const version.
 
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)
 
queueoperator= (const queue &other)=default
 Copy assignment operator.
 
queueoperator= (queue &&other)=default
 Move assignment operator.
 
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: