|
Momentum
A library for solving nonlinear optimization problems related to human body kinematics
|
A terminal progress bar rendered as Name [===> ] 60%. More...
#include <progress_bar.h>
Public Member Functions | |
| ProgressBar (const std::string &prefix, size_t numOperations) | |
| Constructs the progress bar and renders its initial (zero-progress) state. | |
| void | increment (size_t count=1) |
| Advances progress by count (default 1) and redraws the bar. | |
| void | set (size_t count) |
| Sets progress to the absolute value count and redraws the bar. | |
| size_t | getCurrentProgress () |
| Returns the current absolute progress count (not a percentage). | |
A terminal progress bar rendered as Name [===> ] 60%.
Wraps indicators::ProgressBar with a fixed visual style (bold, percentage shown). All mutating operations write to the terminal (stdout) as a side effect. Not thread-safe.
Definition at line 21 of file progress_bar.h.
| momentum::ProgressBar::ProgressBar | ( | const std::string & | prefix, |
| size_t | numOperations ) |
Constructs the progress bar and renders its initial (zero-progress) state.
| prefix | Text shown before the bar. |
| numOperations | Total operation count corresponding to 100%. |
| std::invalid_argument | if prefix.size() + 9 >= kMaxWidth, since the bar width would otherwise underflow size_t. |
Definition at line 15 of file progress_bar.cpp.
|
nodiscard |
Returns the current absolute progress count (not a percentage).
The value is in the range [0, numOperations] as supplied to the constructor.
Definition at line 50 of file progress_bar.cpp.
| void momentum::ProgressBar::increment | ( | size_t | count = 1 | ) |
Advances progress by count (default 1) and redraws the bar.
Definition at line 42 of file progress_bar.cpp.
Referenced by momentum::trackPosesForFrames().
| void momentum::ProgressBar::set | ( | size_t | count | ) |
Sets progress to the absolute value count and redraws the bar.
Definition at line 46 of file progress_bar.cpp.