27 void SetTotal(int64_t total) { total_ = total; }
29 if (!update_progress_)
return true;
34 percent =
count * 100.0 / total_;
39 return CallUpdate(percent);
46 bool CallUpdate(
double percent) {
47 if (update_progress_) {
48 return update_progress_(percent);
52 std::function<bool(
double)> update_progress_;
54 int64_t last_count_ = -1;
61 : progress_bar_(100, progress_info, active) {}
63 while (last_pct_ < pct) {
Definition: ProgressReporters.h:22
void SetTotal(int64_t total)
Definition: ProgressReporters.h:27
void operator++()
Definition: ProgressReporters.h:43
bool Update(int64_t count)
Definition: ProgressReporters.h:28
CountingProgressReporter(std::function< bool(double)> f)
Definition: ProgressReporters.h:24
void Finish()
Definition: ProgressReporters.h:41
Definition: ProgressBar.h:15
Definition: PinholeCameraIntrinsic.cpp:16
update_progress(double percent) functor for ProgressBar
Definition: ProgressReporters.h:58
bool operator()(double pct)
Definition: ProgressReporters.h:62
ConsoleProgressUpdater(const std::string &progress_info, bool active=false)
Definition: ProgressReporters.h:59