ComPWA
Common Partial-Wave-Analysis Framework
ProgressBar.hpp
Go to the documentation of this file.
1 // Copyright (c) 2014 The ComPWA Team.
2 // This file is part of the ComPWA framework, check
3 // https://github.com/ComPWA/ComPWA/license.txt for details.
4 
5 #ifndef PROGRESSBAR_HPP_
6 #define PROGRESSBAR_HPP_
7 
8 #include <ctime>
9 
10 namespace ComPWA {
11 
12 class ProgressBar {
13 public:
14  ProgressBar();
15 
16  ProgressBar(std::size_t size, int update = 1);
17 
18  ~ProgressBar();
19 
21  void next(size_t increment = 1);
22 
23 protected:
24  double timeRemaining();
25  double timePassed();
26  time_t endTime();
27  void update();
28 
29  std::size_t numEvents;
31  bool hasStarted;
32  time_t startTime;
33 
35  unsigned int currentEvent;
36  double lastUpdate;
37 };
38 
39 } // namespace ComPWA
40 
41 #endif
std::size_t numEvents
Definition: ProgressBar.hpp:29
void next(size_t increment=1)
indicate the next step in process
Definition: ProgressBar.cpp:23
unsigned int currentEvent
Definition: ProgressBar.hpp:35