Bounded history buffer used for UI-only playback navigation.
More...
#include <history_buffer.h>
|
| std::unique_ptr< Impl > | impl_ |
Bounded history buffer used for UI-only playback navigation.
Definition at line 18 of file history_buffer.h.
◆ HistoryBuffer() [1/3]
| contur::HistoryBuffer::HistoryBuffer |
( |
std::size_t | capacity | ) |
|
|
explicit |
◆ ~HistoryBuffer()
| contur::HistoryBuffer::~HistoryBuffer |
( |
| ) |
|
◆ HistoryBuffer() [2/3]
| contur::HistoryBuffer::HistoryBuffer |
( |
const HistoryBuffer & | | ) |
|
|
delete |
◆ HistoryBuffer() [3/3]
| contur::HistoryBuffer::HistoryBuffer |
( |
HistoryBuffer && | | ) |
|
|
noexcept |
◆ append()
Appends a snapshot entry and moves cursor to newest entry.
- Parameters
-
- Returns
- Ok on success.
References append().
Referenced by append().
◆ capacity()
| std::size_t contur::HistoryBuffer::capacity |
( |
| ) |
const |
|
nodiscardnoexcept |
◆ current()
| std::optional< std::reference_wrapper< const TuiHistoryEntry > > contur::HistoryBuffer::current |
( |
| ) |
const |
|
nodiscardnoexcept |
Returns current cursor entry.
- Returns
- Entry reference when available, std::nullopt when buffer is empty.
References current().
Referenced by current().
◆ cursor()
| std::size_t contur::HistoryBuffer::cursor |
( |
| ) |
const |
|
nodiscardnoexcept |
Returns current cursor index in [0, size-1], or 0 when empty.
References cursor().
Referenced by cursor().
◆ empty()
| bool contur::HistoryBuffer::empty |
( |
| ) |
const |
|
nodiscardnoexcept |
Returns true when buffer has no entries.
References empty().
Referenced by empty().
◆ latest()
| std::optional< std::reference_wrapper< const TuiHistoryEntry > > contur::HistoryBuffer::latest |
( |
| ) |
const |
|
nodiscardnoexcept |
Returns latest entry.
- Returns
- Entry reference when available, std::nullopt when buffer is empty.
References latest().
Referenced by latest().
◆ moveToLatest()
| void contur::HistoryBuffer::moveToLatest |
( |
| ) |
|
|
noexcept |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ seekBackward()
| Result< void > contur::HistoryBuffer::seekBackward |
( |
std::size_t | step | ) |
|
|
nodiscard |
Moves cursor backward by N entries.
- Parameters
-
| step | Number of entries to move backward. |
- Returns
- Ok on success, NotFound if movement exceeds available history.
References seekBackward().
Referenced by seekBackward().
◆ seekForward()
| Result< void > contur::HistoryBuffer::seekForward |
( |
std::size_t | step | ) |
|
|
nodiscard |
Moves cursor forward by N entries.
- Parameters
-
| step | Number of entries to move forward. |
- Returns
- Ok on success, NotFound if movement exceeds available history.
References seekForward().
Referenced by seekForward().
◆ size()
| std::size_t contur::HistoryBuffer::size |
( |
| ) |
const |
|
nodiscardnoexcept |
Returns number of retained entries.
References size().
Referenced by size().
◆ impl_
| std::unique_ptr<Impl> contur::HistoryBuffer::impl_ |
|
private |
The documentation for this class was generated from the following file: