![]() |
aimsdata
4.7.0
Neuroimaging data handling
|
The template class used to display progression in text mode. More...
#include <aims/utility/progress.h>

Public Member Functions | |
Constructor and Destructor | |
| ProgressInfo (const T1 min, const T1 max, const T2 progressmin=(T2) 0, const T2 progressmax=(T2) 100, const std::string unit="%", const int width=3) | |
| Constructor of the class. More... | |
| ProgressInfo (const T1 max) | |
| Constructor of the class. More... | |
Methods | |
| T1 & | current () |
| Current value. More... | |
| void | reset () |
| Reset the progession to minimum value. More... | |
| const double & | scale () const |
| Scale that is used between displayed progession range and values. More... | |
| double | rescale (const T1 &value) const |
| Rescale value to its progression value. More... | |
| double | progression () const |
| Current progression value. More... | |
| virtual std::string | erase () const |
| Erase the last displayed value. More... | |
| virtual std::string | render (const bool force=false) |
| Render the current progression value if changed or forced. More... | |
| virtual std::string | toString () const |
| Convert progression to the display string. More... | |
| virtual void | print (const bool force=false) |
| Print to cout if value changed or forced. More... | |
| ProgressInfo< T1, T2 > & | operator++ () |
| Prefix operator to increment internal value. More... | |
| ProgressInfo< T1, T2 > | operator++ (int) |
| Postfix operator to increment internal value. More... | |
| ProgressInfo< T1, T2 > & | operator+= (const T1 &r) |
| Compound assignement operator to increment internal value. More... | |
Protected Attributes | |
| int | _displayed |
| int | _width |
| double | _scale |
| T1 | _current |
| T1 | _min |
| T1 | _max |
| T2 | _progressprec |
| T2 | _progressmin |
| T2 | _progressmax |
| std::string | _unit |
The template class used to display progression in text mode.
/ Here is an example of how to use the Progression class: / /
Definition at line 65 of file progress.h.
| aims::ProgressInfo< T1, T2 >::ProgressInfo | ( | const T1 | min, |
| const T1 | max, | ||
| const T2 | progressmin = (T2) 0, |
||
| const T2 | progressmax = (T2) 100, |
||
| const std::string | unit = "%", |
||
| const int | width = 3 |
||
| ) |
Constructor of the class.
| min | minimum value of the progression |
| max | maximum value of the progression |
| progressmin | minimum displayed value [default=0] |
| progressmax | maximum displayed value [default=100] |
| unit | unit of the displayed value |
| width | number of charecters used to display the value |
| aims::ProgressInfo< T1, T2 >::ProgressInfo | ( | const T1 | max | ) |
Constructor of the class.
| max | maximum value of the progression |
| T1& aims::ProgressInfo< T1, T2 >::current | ( | ) |
Current value.
|
virtual |
Erase the last displayed value.
| ProgressInfo<T1, T2>& aims::ProgressInfo< T1, T2 >::operator++ | ( | ) |
Prefix operator to increment internal value.
| ProgressInfo<T1, T2> aims::ProgressInfo< T1, T2 >::operator++ | ( | int | ) |
Postfix operator to increment internal value.
| ProgressInfo<T1, T2>& aims::ProgressInfo< T1, T2 >::operator+= | ( | const T1 & | r | ) |
Compound assignement operator to increment internal value.
|
virtual |
Print to cout if value changed or forced.
| double aims::ProgressInfo< T1, T2 >::progression | ( | ) | const |
Current progression value.
|
virtual |
Render the current progression value if changed or forced.
| force | force to render even the displayed value has not changed |
Referenced by aims::operator<<().
| double aims::ProgressInfo< T1, T2 >::rescale | ( | const T1 & | value | ) | const |
Rescale value to its progression value.
| void aims::ProgressInfo< T1, T2 >::reset | ( | ) |
Reset the progession to minimum value.
| const double& aims::ProgressInfo< T1, T2 >::scale | ( | ) | const |
Scale that is used between displayed progession range and values.
|
virtual |
Convert progression to the display string.
|
protected |
Definition at line 123 of file progress.h.
|
protected |
Definition at line 121 of file progress.h.
|
protected |
Definition at line 123 of file progress.h.
|
protected |
Definition at line 123 of file progress.h.
|
protected |
Definition at line 124 of file progress.h.
|
protected |
Definition at line 124 of file progress.h.
|
protected |
Definition at line 124 of file progress.h.
|
protected |
Definition at line 122 of file progress.h.
|
protected |
Definition at line 125 of file progress.h.
|
protected |
Definition at line 121 of file progress.h.