67 [[nodiscard]]
bool empty() const noexcept;
70 [[nodiscard]] std::
size_t size() const noexcept;
73 [[nodiscard]] std::
size_t capacity() const noexcept;
76 [[nodiscard]] std::
size_t cursor() const noexcept;
bool empty() const noexcept
Returns true when buffer has no entries.
HistoryBuffer(const HistoryBuffer &)=delete
Copy construction is disabled.
HistoryBuffer(HistoryBuffer &&) noexcept
Move-constructs buffer state.
Result< void > seekForward(std::size_t step)
Moves cursor forward by N entries.
std::size_t capacity() const noexcept
Returns configured capacity.
void moveToLatest() noexcept
Moves cursor to latest entry when history is non-empty.
std::unique_ptr< Impl > impl_
Result< void > append(TuiHistoryEntry entry)
Appends a snapshot entry and moves cursor to newest entry.
std::optional< std::reference_wrapper< const TuiHistoryEntry > > current() const noexcept
Returns current cursor entry.
HistoryBuffer & operator=(const HistoryBuffer &)=delete
Copy assignment is disabled.
std::optional< std::reference_wrapper< const TuiHistoryEntry > > latest() const noexcept
Returns latest entry.
std::size_t size() const noexcept
Returns number of retained entries.
HistoryBuffer(std::size_t capacity)
Constructs history buffer with bounded capacity.
Result< void > seekBackward(std::size_t step)
Moves cursor backward by N entries.
~HistoryBuffer()
Destroys history buffer.
std::size_t cursor() const noexcept
Returns current cursor index in [0, size-1], or 0 when empty.
A result type that holds either a success value of type T or an ErrorCode.
Error codes and Result<T> type for fallible operations.
Single history entry stored by the UI history buffer.
Immutable DTO contracts for the external TUI MVC model layer.