RADLib
RADical C++ application framework
RADData::RADQueue< T, Alloc > Class Template Reference

FIFO queue adapter backed by RADRingBuffer. More...

#include <RADDataStructures.h>

Public Member Functions

 RADQueue (size_t capacity=16)
 Creates a queue with initial ring capacity. More...
 
bool empty () const noexcept
 Returns true when the queue is empty. More...
 
size_t size () const noexcept
 Returns number of queued elements. More...
 
T & front () noexcept
 Returns the front element. More...
 
const T & front () const noexcept
 Returns the front element. More...
 
void push (const T &value)
 Pushes a copy at the back. More...
 
void push (T &&value)
 Pushes a moved value at the back. More...
 
template<typename... Args>
T & emplace (Args &&... args)
 Constructs an element at the back. More...
 
void pop ()
 Removes the front element. More...
 
void clear ()
 Removes all queued elements. More...
 

Detailed Description

template<typename T, typename Alloc = std::allocator<T>>
class RADData::RADQueue< T, Alloc >

FIFO queue adapter backed by RADRingBuffer.

Constructor & Destructor Documentation

◆ RADQueue()

template<typename T , typename Alloc = std::allocator<T>>
RADData::RADQueue< T, Alloc >::RADQueue ( size_t  capacity = 16)
inlineexplicit

Creates a queue with initial ring capacity.

Member Function Documentation

◆ clear()

template<typename T , typename Alloc = std::allocator<T>>
void RADData::RADQueue< T, Alloc >::clear ( )
inline

Removes all queued elements.

◆ emplace()

template<typename T , typename Alloc = std::allocator<T>>
template<typename... Args>
T& RADData::RADQueue< T, Alloc >::emplace ( Args &&...  args)
inline

Constructs an element at the back.

◆ empty()

template<typename T , typename Alloc = std::allocator<T>>
bool RADData::RADQueue< T, Alloc >::empty ( ) const
inlinenoexcept

Returns true when the queue is empty.

◆ front() [1/2]

template<typename T , typename Alloc = std::allocator<T>>
const T& RADData::RADQueue< T, Alloc >::front ( ) const
inlinenoexcept

Returns the front element.

◆ front() [2/2]

template<typename T , typename Alloc = std::allocator<T>>
T& RADData::RADQueue< T, Alloc >::front ( )
inlinenoexcept

Returns the front element.

◆ pop()

template<typename T , typename Alloc = std::allocator<T>>
void RADData::RADQueue< T, Alloc >::pop ( )
inline

Removes the front element.

◆ push() [1/2]

template<typename T , typename Alloc = std::allocator<T>>
void RADData::RADQueue< T, Alloc >::push ( const T &  value)
inline

Pushes a copy at the back.

◆ push() [2/2]

template<typename T , typename Alloc = std::allocator<T>>
void RADData::RADQueue< T, Alloc >::push ( T &&  value)
inline

Pushes a moved value at the back.

◆ size()

template<typename T , typename Alloc = std::allocator<T>>
size_t RADData::RADQueue< T, Alloc >::size ( ) const
inlinenoexcept

Returns number of queued elements.


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