24 void SetTotal(int64_t total) { total_ = total; }
26 if (!update_progress_)
return true;
31 percent =
count * 100.0 / total_;
36 return CallUpdate(percent);
43 bool CallUpdate(
double percent) {
44 if (update_progress_) {
45 return update_progress_(percent);
49 std::function<bool(
double)> update_progress_;
51 int64_t last_count_ = -1;
54 using utility::ConsoleProgressBar;
61 while (last_pct_ < pct) {
utility::CountingProgressReporter * progress_bar_
void SetTotal(int64_t total)
CountingProgressReporter(std::function< bool(double)> f)
bool Update(int64_t count)
Generic file read and write utility for python interface.
update_progress(double percent) functor for ConsoleProgressBar
bool operator()(double pct)
ConsoleProgressUpdater(const std::string &progress_info, bool active=false)