FE 0.17.1
Fast, Effecient 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 ()=default
Access
T & front ()
const T & front () const
T & operator[] (size_t i)
const T & operator[] (size_t i) const
Modifiers
void reset ()
T put (T item)
 Puts item into buffer.

Friends

void swap (Ring &r1, Ring &r2)

Detailed Description

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

A ring buffer with N elements.

Definition at line 15 of file ring.h.

Constructor & Destructor Documentation

◆ Ring() [1/2]

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

Definition at line 19 of file ring.h.

Referenced by swap.

◆ Ring() [2/2]

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

Member Function Documentation

◆ front() [1/2]

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

Definition at line 28 of file ring.h.

◆ front() [2/2]

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

Definition at line 29 of file ring.h.

◆ operator[]() [1/2]

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

Definition at line 30 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 34 of file ring.h.

◆ put()

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

Puts item into buffer.

Returns
item that falls out.

Definition at line 46 of file ring.h.

◆ reset()

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

Definition at line 42 of file ring.h.

◆ swap

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

Definition at line 54 of file ring.h.

References Ring(), and swap.

Referenced by swap.


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