Belle II Software  release-05-02-19
ProgressBarModule.h
1 #pragma once
2 /**************************************************************************
3  * BASF2 (Belle Analysis Framework 2) *
4  * Copyright(C) 2013 Belle II Collaboration *
5  * *
6  * Author: The Belle II Collaboration *
7  * Contributors: Christian Pulvermacher *
8  * *
9  **************************************************************************/
10 
11 #include <framework/core/Module.h>
12 
13 namespace Belle2 {
25  class ProgressBarModule : public Module {
26 
27  public:
28 
31 
33  virtual void initialize() override;
35  virtual void event() override;
37  virtual void terminate() override;
38 
39  protected:
41  long m_evtNr;
43  long m_nTotal;
45  double m_startTime;
47  double m_lastPrint;
49  int m_progress{0};
51  bool m_isTTY;
52  };
54 } // end namespace Belle2
Belle2::ProgressBarModule::m_lastPrint
double m_lastPrint
Timestamp when we last printed something (ns).
Definition: ProgressBarModule.h:54
Belle2::ProgressBarModule::initialize
virtual void initialize() override
Init the module.
Definition: ProgressBarModule.cc:42
Belle2::ProgressBarModule::event
virtual void event() override
Show progress.
Definition: ProgressBarModule.cc:54
Belle2::ProgressBarModule::m_nTotal
long m_nTotal
Total number of events.
Definition: ProgressBarModule.h:50
Belle2::ProgressBarModule::m_progress
int m_progress
progress in percent since we last printed
Definition: ProgressBarModule.h:56
Belle2::ProgressBarModule::terminate
virtual void terminate() override
Don't break the terminal.
Definition: ProgressBarModule.cc:119
Belle2::ProgressBarModule::m_isTTY
bool m_isTTY
If true we don't show the interactive progress bar but just print a new one every time the progress a...
Definition: ProgressBarModule.h:58
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ProgressBarModule::ProgressBarModule
ProgressBarModule()
Constructor.
Definition: ProgressBarModule.cc:25
Belle2::ProgressBarModule::m_evtNr
long m_evtNr
Number of processed events.
Definition: ProgressBarModule.h:48
Belle2::ProgressBarModule::m_startTime
double m_startTime
Start time (ns).
Definition: ProgressBarModule.h:52