FE 0.5.0
A header-only C++ library for writing frontends
Loading...
Searching...
No Matches
fe::Ring< T, N > Class Template Reference

A ring buffer with N elements. More...

#include <fe/ring.h>

Inheritance diagram for fe::Ring< T, N >:
[legend]

Public Member Functions

Construction
 Ring (std::initializer_list< T > list)
 
 Ring () noexcept=default
 
 Ring (const Ring &)=default
 
 Ring (Ring &&other) noexcept
 
Ringoperator= (Ring other) noexcept
 
Access
T & front ()
 
const T & front () const
 
T & operator[] (size_t i)
 
const T & operator[] (size_t i) const
 
Modifiers
void reset ()
 
put (T item)
 Puts item into buffer.
 

Friends

void swap (Ring &r1, Ring &r2) noexcept
 

Detailed Description

template<class T, size_t N>
class fe::Ring< T, N >

A ring buffer with N elements.

Definition at line 14 of file ring.h.

Constructor & Destructor Documentation

◆ Ring() [1/4]

template<class T , size_t N>
fe::Ring< T, N >::Ring ( std::initializer_list< T >  list)
inline

Definition at line 18 of file ring.h.

◆ Ring() [2/4]

template<class T , size_t N>
fe::Ring< T, N >::Ring ( )
defaultnoexcept

◆ Ring() [3/4]

template<class T , size_t N>
fe::Ring< T, N >::Ring ( const Ring< T, N > &  )
default

◆ Ring() [4/4]

template<class T , size_t N>
fe::Ring< T, N >::Ring ( Ring< T, N > &&  other)
inlinenoexcept

Definition at line 21 of file ring.h.

References fe::Ring< T, N >::swap.

Member Function Documentation

◆ front() [1/2]

template<class T , size_t N>
T & fe::Ring< T, N >::front ( )
inline

Definition at line 30 of file ring.h.

Referenced by fe::Lexer< K, S >::next().

◆ front() [2/2]

template<class T , size_t N>
const T & fe::Ring< T, N >::front ( ) const
inline

Definition at line 31 of file ring.h.

◆ operator=()

template<class T , size_t N>
Ring & fe::Ring< T, N >::operator= ( Ring< T, N >  other)
inlinenoexcept

Definition at line 25 of file ring.h.

References fe::Ring< T, N >::swap.

◆ operator[]() [1/2]

template<class T , size_t N>
T & fe::Ring< T, N >::operator[] ( size_t  i)
inline

Definition at line 32 of file ring.h.

◆ operator[]() [2/2]

template<class T , size_t N>
const T & fe::Ring< T, N >::operator[] ( size_t  i) const
inline

Definition at line 36 of file ring.h.

◆ put()

template<class T , size_t N>
T fe::Ring< T, N >::put ( item)
inline

Puts item into buffer.

Returns
item that falls out.

Definition at line 48 of file ring.h.

Referenced by fe::Lexer< K, S >::next().

◆ reset()

template<class T , size_t N>
void fe::Ring< T, N >::reset ( )
inline

Definition at line 44 of file ring.h.

Friends And Related Symbol Documentation

◆ swap

template<class T , size_t N>
void swap ( Ring< T, N > &  r1,
Ring< T, N > &  r2 
)
friend

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