Program Listing for File progress-bar.h

Return to documentation for file (common/maplab-common/include/maplab-common/progress-bar.h)

#ifndef MAPLAB_COMMON_PROGRESS_BAR_H_
#define MAPLAB_COMMON_PROGRESS_BAR_H_

#include <stdio.h>

namespace common {

class ProgressBar {
 public:
  explicit ProgressBar(const size_t num_elements);
  ProgressBar(const size_t verbosity_level, const size_t num_elements);
  virtual ~ProgressBar() {}

  void update(size_t num_elements_processed);
  void increment();
  void reset(size_t num_elements);

 private:
  void print();

  size_t num_elements_;
  size_t num_elements_processed_;
  size_t verbosity_level_;
};

}  // namespace common

#endif  // MAPLAB_COMMON_PROGRESS_BAR_H_