Fixed-size ring buffer of T, not thread-safe.
More...
#include <Fifo.hh>
Inherited by Pds::FifoW< Buffer >.
|
| | Fifo (size_t size) |
| | Allocate size slots and start empty.
|
| |
| void | clear () |
| | Make the FIFO empty (the slots are not cleared).
|
| |
| bool | push (const T &item) |
| | Copy item to the back; returns true, without storing, if the FIFO is full, else false.
|
| |
| bool | pop (T &item) |
| | Move the front element into item; returns true, without changing item, if the FIFO is empty, else false.
|
| |
| T & | front () |
| | Return a reference to the front slot (not checked for emptiness).
|
| |
| const T & | front () const |
| | Return a const reference to the front slot (not checked for emptiness).
|
| |
| const T & | peek (size_t offset) const |
| | Return the slot offset positions after the front (wrapping; not checked against count()).
|
| |
| T & | back () |
| | Return a reference to the most recently pushed slot.
|
| |
| const T & | back () const |
| | Return a const reference to the most recently pushed slot.
|
| |
| bool | empty () const |
| | Return true if the FIFO holds no elements.
|
| |
| size_t | size () const |
| | Return the capacity.
|
| |
| const size_t & | count () const |
| | Return a reference to the number of elements held.
|
| |
template<class T>
class Pds::Fifo< T >
Fixed-size ring buffer of T, not thread-safe.
push() and pop() return true when they fail (full or empty).
◆ Fifo()
Allocate size slots and start empty.
◆ back() [1/2]
Return a reference to the most recently pushed slot.
◆ back() [2/2]
Return a const reference to the most recently pushed slot.
◆ clear()
Make the FIFO empty (the slots are not cleared).
◆ count()
template<class T >
| const size_t & Pds::Fifo< T >::count |
( |
| ) |
const |
|
inline |
Return a reference to the number of elements held.
◆ empty()
Return true if the FIFO holds no elements.
◆ front() [1/2]
Return a reference to the front slot (not checked for emptiness).
◆ front() [2/2]
Return a const reference to the front slot (not checked for emptiness).
◆ peek()
template<class T >
| const T & Pds::Fifo< T >::peek |
( |
size_t |
offset | ) |
const |
|
inline |
Return the slot offset positions after the front (wrapping; not checked against count()).
◆ pop()
Move the front element into item; returns true, without changing item, if the FIFO is empty, else false.
◆ push()
Copy item to the back; returns true, without storing, if the FIFO is full, else false.
◆ size()
The documentation for this class was generated from the following file: