GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Gw::XtermProgressBar Class Reference

Class to display a progress bar on the command line. More...

#include <XtermProgressBar.h>

Public Member Functions

virtual Double_t GetCurrentPosition () const
 to get the current event number More...
 
virtual bool IsFinished () const
 to get the current event number More...
 
virtual XtermProgressBar operator++ ()
 Add one event and change the display if needed. More...
 
virtual XtermProgressBar operator++ (int)
 Add one event and change the display if needed. More...
 
virtual XtermProgressBar operator+= (int i)
 Add one event and change the display if needed. More...
 
virtual void SetRange (Double_t min, Double_t max)
 
virtual void Start ()
 Re-initialised the counters. More...
 
virtual void UpdateCurrentStatus ()
 Display current status on the standard output. More...
 
 XtermProgressBar (Double_t min, Double_t max)
 Defines a ProgressBar that counts events from min to max. More...
 
virtual ~XtermProgressBar ()
 

Detailed Description

Class to display a progress bar on the command line.

This class implements a progress bar that is shown on the command line (so that it could be called in a programs that has not graphical interface). You must provide a starting value and an ending value through the constructor. Once it is done call the Start member before the loop . It will display an empty bar:
[               ]
Inside the loop call the operator ++. It increments the counter by one and if needed update the progress bar
[-----—       ]
IsFinished returns true if the process must be stopped. Here it a example how to use an XtermProgressBar in a loop:

XtermProgressBar progress(0,MaxEvents);
while( ) { // loop on events
progress++;
...
...
...
...
if ( progress.IsFinished() ) break;
}

See FisrtTracking.C for a copmlete example

Author
Olivier Stezowski

Definition at line 34 of file XtermProgressBar.h.


The documentation for this class was generated from the following files: