ESLA

Embeddable Scriting LAnguage

frantz@pangea.stanford.edu

Stanford University, Rock Fracture Project research group

© 2003

ProgressBar Class Reference


Detailed Description

Class to display a progress bar in a console

Definition at line 40 of file progress_bar.h.

Public Methods

 ProgressBar (const std::string title, double lower, double upper, int nbr)
void start ()
void stop ()
void advance ()
void advance_to (double value)


Constructor & Destructor Documentation

ProgressBar::ProgressBar const std::string    title,
double    lower,
double    upper,
int    nbr
 

Ctor

Parameters:
title the title of the progress bar
lower the lower bound of the progress, usually it is 0
upper the upper bound of the progress
nbr the number of tickers to display
    Example: <pre>
      int begin = 0 ;
      int end   = 100 ;
      ProgressBar p("Progress:", begin, end, 30) ;
      p.start() ;
      for (int i = begin; i < end; i++) {
        // your stuff here
        p.advance() ;
      }
      p.stop() ;

      p.start() ;
      for (int i = begin; i < end; i++) {
        // your stuff here
        p.advance_to(i) ; // do the same thing
      }
      p.stop() ;
  </PRE>


Member Function Documentation

void ProgressBar::advance  
 

Call this method every time you increment your loop

void ProgressBar::advance_to double    value
 

void ProgressBar::start  
 

Start the progress. Display the title and the initial empty bar

void ProgressBar::stop  
 


Generated on Wed May 14 11:42:34 2003 for Esla-lib by doxygen1.3-rc1