BioDynaMo  v1.03.61-fe34ced0
progress_bar.h
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 //
3 // Copyright (C) 2021 CERN & University of Surrey for the benefit of the
4 // BioDynaMo collaboration. All Rights Reserved.
5 //
6 // Licensed under the Apache License, Version 2.0 (the "License");
7 // you may not use this file except in compliance with the License.
8 //
9 // See the LICENSE file distributed with this work for details.
10 // See the NOTICE file distributed with this work for additional information
11 // regarding copyright ownership.
12 //
13 // -----------------------------------------------------------------------------
14 
15 #ifndef PROGRESS_BAR_H_
16 #define PROGRESS_BAR_H_
17 
18 #include <cstdint>
19 #include <iostream>
20 
21 namespace bdm {
22 
23 class ProgressBar {
24  private:
26  uint64_t total_steps_;
28  uint64_t executed_steps_;
30  int64_t start_time_;
40 
41  public:
42  ProgressBar();
43  ProgressBar(int total_steps);
44 
46  void Step(uint64_t steps = 1);
47 
49  void PrintProgressBar(std::ostream &out = std::cout);
50 };
51 
52 } // namespace bdm
53 
54 #endif // PROGRESS_BAR_H_
bdm::ProgressBar::start_time_
int64_t start_time_
Timestamp when to when the progress bar was initialized.
Definition: progress_bar.h:30
bdm
Definition: agent.cc:39
bdm::ProgressBar::total_steps_
uint64_t total_steps_
Total number of steps to be executed.
Definition: progress_bar.h:26
bdm::ProgressBar::PrintProgressBar
void PrintProgressBar(std::ostream &out=std::cout)
Prints the progress bar.
Definition: progress_bar.cc:36
bdm::ProgressBar::n_digits_time_
int n_digits_time_
Definition: progress_bar.h:36
bdm::ProgressBar::first_iter_
bool first_iter_
Definition: progress_bar.h:33
bdm::ProgressBar::Step
void Step(uint64_t steps=1)
Inceases the counter executed_steps_ by steps.
Definition: progress_bar.cc:34
bdm::ProgressBar::write_to_file_
bool write_to_file_
Definition: progress_bar.h:39
bdm::ProgressBar::ProgressBar
ProgressBar()
Definition: progress_bar.cc:24
bdm::ProgressBar::executed_steps_
uint64_t executed_steps_
Number of steps that have already been executed.
Definition: progress_bar.h:28
bdm::ProgressBar
Definition: progress_bar.h:23