Thread-safe progress tracker with visual progress bar.
More...
#include <progresstracker.hpp>
|
| struct | Config |
| | Configuration settings for progress bar display. More...
|
| |
|
| static auto | clear_line () noexcept -> void |
| | Clears the current progress line. More...
|
| |
| static auto | format_duration (std::chrono::seconds duration) noexcept -> std::string |
| | Formats a duration given in seconds into a human-readable string. More...
|
| |
Thread-safe progress tracker with visual progress bar.
Definition at line 37 of file progresstracker.hpp.
◆ ProgressTracker() [1/3]
| ProgressTracker::ProgressTracker |
( |
std::size_t |
total, |
|
|
Config |
config = {} |
|
) |
| |
|
inlineexplicit |
Constructs a progress tracker.
- Parameters
-
| total | Total number of items to track |
| config | Display configuration |
- Exceptions
-
| std::invalid_argument | if total is 0 |
Definition at line 210 of file progresstracker.hpp.
◆ ~ProgressTracker()
| ProgressTracker::~ProgressTracker |
( |
| ) |
|
|
inlinenoexcept |
◆ ProgressTracker() [2/3]
◆ ProgressTracker() [3/3]
◆ add()
| auto ProgressTracker::add |
( |
std::size_t |
count | ) |
-> void |
|
inlinenoexcept |
Adds multiple items to progress (thread-safe, no immediate display update).
Definition at line 247 of file progresstracker.hpp.
◆ clear_line()
| auto ProgressTracker::clear_line |
( |
| ) |
-> void |
|
inlinestaticnoexcept |
◆ finish()
| auto ProgressTracker::finish |
( |
| ) |
-> void |
|
inlinenoexcept |
Stops the update thread and displays final completion message.
Definition at line 500 of file progresstracker.hpp.
◆ format_duration()
| auto ProgressTracker::format_duration |
( |
std::chrono::seconds |
duration | ) |
-> std::string |
|
inlinestaticnoexcept |
Formats a duration given in seconds into a human-readable string.
Converts the provided std::chrono::seconds duration into a string representation, typically in the format "HH:MM:SS" or similar, for display purposes.
- Parameters
-
| duration | The duration to format, expressed as std::chrono::seconds. |
- Returns
- A std::string containing the formatted duration.
- Note
- This function does not throw exceptions.
Definition at line 278 of file progresstracker.hpp.
◆ get_processed()
| auto ProgressTracker::get_processed |
( |
| ) |
const -> std::size_t |
|
inlinenoexcept |
◆ get_progress()
| auto ProgressTracker::get_progress |
( |
| ) |
const -> double |
|
inlinenoexcept |
◆ get_total()
| auto ProgressTracker::get_total |
( |
| ) |
const -> std::size_t |
|
inlinenoexcept |
◆ increment()
| auto ProgressTracker::increment |
( |
| ) |
-> void |
|
inlinenoexcept |
Increments the progress counter (thread-safe, no immediate display update).
Definition at line 243 of file progresstracker.hpp.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ start()
| auto ProgressTracker::start |
( |
| ) |
-> void |
|
inlinenoexcept |
Starts the background update thread and shows initial display.
Definition at line 485 of file progresstracker.hpp.
The documentation for this class was generated from the following file: