Belle II Software development
ProgressBarModule.h
1#pragma once
2/**************************************************************************
3 * basf2 (Belle II Analysis Software Framework) *
4 * Author: The Belle II Collaboration *
5 * *
6 * See git log for contributors and copyright holders. *
7 * This file is licensed under LGPL-3.0, see LICENSE.md. *
8 **************************************************************************/
9
10#include <framework/core/Module.h>
11
12namespace Belle2 {
21 class ProgressBarModule : public Module {
22
23 public:
24
27
29 virtual void initialize() override;
31 virtual void event() override;
33 virtual void terminate() override;
34
35 protected:
37 long m_evtNr;
45 int m_progress{0};
47 bool m_isTTY;
48 };
50} // end namespace Belle2
Base class for Modules.
Definition: Module.h:72
Display a progress bar and an estimate of remaining time when number of events is known (e....
long m_nTotal
Total number of events.
virtual void initialize() override
Init the module.
virtual void event() override
Show progress.
virtual void terminate() override
Don't break the terminal.
int m_progress
progress in percent since we last printed
double m_lastPrint
Timestamp when we last printed something (ns).
double m_startTime
Start time (ns).
long m_evtNr
Number of processed events.
bool m_isTTY
If true we don't show the interactive progress bar but just print a new one every time the progress a...
Abstract base class for different kinds of events.