![]() |
SynAPSE
0.6.0
Synergistic Analysis of Phase Space Evolution
|
Provides a progess bar to be included in a for loop. More...
#include <ProgressBar.hh>
Public Member Functions | |
| ProgressBar (Pitch::errorLevel level=Pitch::info) | |
| Default constructor, sets the output to Pitch::info. More... | |
| ProgressBar (const ProgressBar &pbar) | |
| Copy constructor. More... | |
| ProgressBar & | operator= (const ProgressBar &pbar) |
| Equality operator. More... | |
| ~ProgressBar () | |
| Destructor. More... | |
| void | SetStartTime (time_stamp start) |
| Sets the start of execution time. More... | |
| const time_stamp & | GetStartTime () |
| Gets the start of execution time. More... | |
| void | SetCurrentTime (time_stamp current) |
| Sets the current time. More... | |
| const time_stamp & | GetCurrentTime () |
| Gets the current time. More... | |
| void | SetTerminalWidth (size_t twidth) |
| Sets the width of the terminal. More... | |
| const size_t & | GetTerminalWidth () |
| Gets the width of the terminal. More... | |
| void | SetVerbosityLevel (Pitch::errorLevel level) |
| Sets the verbosity level. More... | |
| const Pitch::errorLevel & | GetVerbosityLevel () |
| Gets the verbosity level. More... | |
| void | GetProgress (const size_t n, const size_t N) |
| Prints the current progress in the terminal. More... | |
Private Member Functions | |
| void | FetchTerminalWidth () |
| Fetch the terminal width from the OS. More... | |
| void | PrintProgress (const size_t pc, const size_t n) |
| Prints the bar for a given percentage of progress. More... | |
Private Attributes | |
| time_stamp | _start |
| Start time. More... | |
| time_stamp | _current |
| Current time. More... | |
| size_t | _twidth |
| Terminal width. More... | |
| Pitch::errorLevel | _level |
| Verbosity level. More... | |
Provides a progess bar to be included in a for loop.
It defines a progress bar for that adapts to the terminal width, prints the rate of progress and the estimated time of arrival.
| ProgressBar::ProgressBar | ( | Pitch::errorLevel | level = Pitch::info | ) |
Default constructor, sets the output to Pitch::info.
| ProgressBar::ProgressBar | ( | const ProgressBar & | pbar | ) |
Copy constructor.
| ProgressBar::~ProgressBar | ( | ) |
Destructor.
|
private |
Fetch the terminal width from the OS.
|
inline |
Gets the current time.
| void ProgressBar::GetProgress | ( | const size_t | n, |
| const size_t | N | ||
| ) |
Prints the current progress in the terminal.
| n | Current entry being processed (0->(N-1)) |
| N | Total number of entries to process |
|
inline |
Gets the start of execution time.
|
inline |
Gets the width of the terminal.
|
inline |
Gets the verbosity level.
| ProgressBar & ProgressBar::operator= | ( | const ProgressBar & | pbar | ) |
Equality operator.
|
private |
Prints the bar for a given percentage of progress.
| pc | Percentage of progress |
| n | Number of entries processed |
|
inline |
Sets the current time.
|
inline |
Sets the start of execution time.
|
inline |
Sets the width of the terminal.
|
inline |
Sets the verbosity level.
|
private |
Current time.
|
private |
Verbosity level.
|
private |
Start time.
|
private |
Terminal width.
1.8.6