Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sese::RingQueue< T, N > Class Template Reference

Ring queue. More...

#include <RingQueue.h>

Public Member Functions

T & front ()
 
void pop ()
 
void push (const T &data)
 
bool empty () const
 Is the queue empty.
 
bool full () const
 Is the queue full.
 
size_t size () const
 Get queue size.
 

Private Attributes

_data [N]
 
size_t _head {}
 
size_t _tail {}
 
size_t _size {}
 

Detailed Description

template<typename T, int N>
class sese::RingQueue< T, N >

Ring queue.

Template Parameters
TElement type
NQueue size

Member Function Documentation

◆ empty()

template<typename T , int N>
bool sese::RingQueue< T, N >::empty ( ) const
inlinenodiscard

◆ front()

template<typename T , int N>
T & sese::RingQueue< T, N >::front ( )
inline
Exceptions
std::out_of_rangequeue is empty

References sese::RingQueue< T, N >::_data, sese::RingQueue< T, N >::_head, and sese::RingQueue< T, N >::empty().

◆ full()

template<typename T , int N>
bool sese::RingQueue< T, N >::full ( ) const
inlinenodiscard

Is the queue full.

References sese::RingQueue< T, N >::_size.

Referenced by sese::RingQueue< T, N >::push().

◆ pop()

template<typename T , int N>
void sese::RingQueue< T, N >::pop ( )
inline
Exceptions
std::out_of_rangequeue is empty

References sese::RingQueue< T, N >::_head, sese::RingQueue< T, N >::_size, and sese::RingQueue< T, N >::empty().

◆ push()

template<typename T , int N>
void sese::RingQueue< T, N >::push ( const T & data)
inline

◆ size()

template<typename T , int N>
size_t sese::RingQueue< T, N >::size ( ) const
inlinenodiscard

Get queue size.

References sese::RingQueue< T, N >::_size.

Member Data Documentation

◆ _data

template<typename T , int N>
T sese::RingQueue< T, N >::_data[N]
private

◆ _head

template<typename T , int N>
size_t sese::RingQueue< T, N >::_head {}
private

◆ _size

◆ _tail

template<typename T , int N>
size_t sese::RingQueue< T, N >::_tail {}
private

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