ClikaRT::progress::Bar
class
Header: ClikaRT/progress/progress.h
A lightweight handle to a bar owned by a ProgressGroup. Returned by ProgressGroup::add_bar(); copyable and non-owning (valid while its group lives). Configure it with the fluent setters, then drive it; a bar may be added, configured, and driven at ANY time, including after the group has started rendering other bars (each bar materializes on its own first drive). Driving is safe at every point in the bar's life: a completed bar accepts further set_progress/total/postfix calls.
Member functions
total()
Bar& total(double max)
Upper bound. Also applies MID-RUN: calling total() after the bar is live updates the live bar (a download whose size becomes known after the first bytes).
Declared in ClikaRT/progress/progress.h, line 147
min()
Bar& min(double value)
lower bound (default 0)
Declared in ClikaRT/progress/progress.h, line 148
width()
Bar& width(int cells)
bar cells; 0 = auto-fit (default)
Declared in ClikaRT/progress/progress.h, line 149
prefix()
Bar& prefix(std::string_view text)
text before the bar
Declared in ClikaRT/progress/progress.h, line 150
postfix()
Bar& postfix(std::string_view text)
text after the bar
Declared in ClikaRT/progress/progress.h, line 151
color()
Bar& color(Color c)
bar color
Declared in ClikaRT/progress/progress.h, line 152
unit()
Bar& unit(std::string_view u)
rate/count unit (default "it")
Declared in ClikaRT/progress/progress.h, line 153
as_bytes()
Bar& as_bytes(bool on = true)
humanize counts/rate as bytes
Declared in ClikaRT/progress/progress.h, line 154
smoothing_window()
Bar& smoothing_window(std::size_t n)
Average the rate/ETA over the last n updates (a sliding window) so the displayed speed doesn't jump each tick; n == 0 keeps EMA smoothing.
Declared in ClikaRT/progress/progress.h, line 157
block()
Bar& block(bool on = true)
smooth sub-cell (block-eighth) fill
Declared in ClikaRT/progress/progress.h, line 158
show_percent()
Bar& show_percent(bool on = true)
show percent complete
Declared in ClikaRT/progress/progress.h, line 159
show_count()
Bar& show_count(bool on = true)
show n/total
Declared in ClikaRT/progress/progress.h, line 160
show_eta()
Bar& show_eta(bool on = true)
show time remaining
Declared in ClikaRT/progress/progress.h, line 161
show_rate()
Bar& show_rate(bool on = true)
show rate (unit/s)
Declared in ClikaRT/progress/progress.h, line 162
set_progress()
void set_progress(double value)
absolute progress, clamped to [min, total]
Declared in ClikaRT/progress/progress.h, line 165
tick()
void tick(double n = 1.0)
advance by n
Declared in ClikaRT/progress/progress.h, line 166
set_postfix()
void set_postfix(std::string_view text)
update the postfix mid-run
Declared in ClikaRT/progress/progress.h, line 167
mark_completed()
void mark_completed()
jump to 100%
Declared in ClikaRT/progress/progress.h, line 168
value()
double value() const
current progress value
Declared in ClikaRT/progress/progress.h, line 170
completed()
bool completed() const
whether the bar finished
Declared in ClikaRT/progress/progress.h, line 171