ProgressBar.h
1 /* -*- C++ -*-.***************************************************************************************************
2  Author: Ben Strutt
3  Email: b.strutt.12@ucl.ac.uk
4 
5  Description:
6  Just a bit of fun while waiting for jobs to run.
7 *************************************************************************************************************** */
8 
9 
10 
11 #ifndef PROGRESSBAR_H
12 #define PROGRESSBAR_H
13 
14 #include "TObject.h"
15 #include "TStopwatch.h"
16 #include <iostream>
17 #include <signal.h>
18 
19 namespace Acclaim
20 {
21 
25  class ProgressBar{
26 
27  public:
28  ProgressBar();
29  ProgressBar(Long64_t maxEntry);
30 
31  void operator++(int);
32  void status();
33 
34  void inc(Long64_t& entry, Long64_t numEntries=-1);
35  void inc(UInt_t& entry, Long64_t numEntries=-1);
36  void inc(Int_t& entry, Long64_t numEntries=-1);
37 
38  static void mainLoopSigintHandle(int param);
39  static int progState;
40 
41  private:
42  Long64_t fMaxEntry;
43  Long64_t fCounter;
44  UInt_t fPercentage;
45  TStopwatch fWatch;
46  Int_t fSetHandler;
47  Int_t fNumBreakTries;
48  Int_t fLastProgState;
49  };
50 }
51 
52 #endif //PROGRESSBAR_H
ProgressBar()
Default constructor - don&#39;t use this.
Definition: ProgressBar.cxx:19
void status()
For debugging, prints state of internal variables.
static void mainLoopSigintHandle(int param)
Custom handler, sets variable when signal is received.
void inc(Long64_t &entry, Long64_t numEntries=-1)
New primary function to move through main for loop in analysis program.
Namespace which wraps everything in the library.
Prints a progress bar and timer to stderr.
Definition: ProgressBar.h:25
void operator++(int)
Increment operator, use when you have completed one iteration of the main loop.
Definition: ProgressBar.cxx:59