Skip to main content

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 143

min()

Bar& min(double value)

lower bound (default 0)

Declared in ClikaRT/progress/progress.h, line 144

width()

Bar& width(int cells)

bar cells; 0 = auto-fit (default)

Declared in ClikaRT/progress/progress.h, line 145

prefix()

Bar& prefix(std::string_view text)

text before the bar

Declared in ClikaRT/progress/progress.h, line 146

postfix()

Bar& postfix(std::string_view text)

text after the bar

Declared in ClikaRT/progress/progress.h, line 147

color()

Bar& color(Color c)

bar color

Declared in ClikaRT/progress/progress.h, line 148

unit()

Bar& unit(std::string_view u)

rate/count unit (default "it")

Declared in ClikaRT/progress/progress.h, line 149

as_bytes()

Bar& as_bytes(bool on = true)

humanize counts/rate as bytes

Declared in ClikaRT/progress/progress.h, line 150

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 153

block()

Bar& block(bool on = true)

smooth sub-cell (block-eighth) fill

Declared in ClikaRT/progress/progress.h, line 154

show_percent()

Bar& show_percent(bool on = true)

show percent complete

Declared in ClikaRT/progress/progress.h, line 155

show_count()

Bar& show_count(bool on = true)

show n/total

Declared in ClikaRT/progress/progress.h, line 156

show_eta()

Bar& show_eta(bool on = true)

show time remaining

Declared in ClikaRT/progress/progress.h, line 157

show_rate()

Bar& show_rate(bool on = true)

show rate (unit/s)

Declared in ClikaRT/progress/progress.h, line 158

set_progress()

void set_progress(double value)

absolute progress, clamped to [min, total]

Declared in ClikaRT/progress/progress.h, line 161

tick()

void tick(double n = 1.0)

advance by n

Declared in ClikaRT/progress/progress.h, line 162

set_postfix()

void set_postfix(std::string_view text)

update the postfix mid-run

Declared in ClikaRT/progress/progress.h, line 163

mark_completed()

void mark_completed()

jump to 100%

Declared in ClikaRT/progress/progress.h, line 164

value()

double value() const

current progress value

Declared in ClikaRT/progress/progress.h, line 166

completed()

bool completed() const

whether the bar finished

Declared in ClikaRT/progress/progress.h, line 167