34 #ifndef AIMS_UTILITY_PROGRESS_H
35 #define AIMS_UTILITY_PROGRESS_H
64 template <
class T1 =
double,
class T2 =
double>
79 const T2 progressmin = (T2)0,
80 const T2 progressmax = (T2)100,
81 const std::string unit =
"%",
83 std::ostream & stream = std::cout );
88 std::ostream & stream = std::cout );
110 virtual std::string
render(
const bool force =
false);
114 virtual void print(
const bool force =
false );
135 template <
class T1,
class T2>
139 std::string p = progression.
render();
151 template <
class T1,
class T2>
154 template <
class T1,
class T2>
157 template <
class T1,
class T2>
160 template <
class T1,
class T2>
163 template <
class T1,
class T2>
166 template <
class T1,
class T2>
169 template <
class T1,
class T2>
172 template <
class T1,
class T2>
The template class used to display progression in text mode.
virtual std::string endline() const
End of line (none for stdout, "\\n" otherwise)
virtual void print(const bool force=false)
Print to the output stream if value changed or forced.
T1 & current()
Current value.
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, std::ostream &stream=std::cout)
Constructor of the class.
double rescale(const T1 &value) const
Rescale value to its progression value.
ProgressInfo(const T1 max, std::ostream &stream=std::cout)
Constructor of the class.
void reset()
Reset the progession to minimum value.
virtual std::string toString() const
Convert progression to the display string.
ProgressInfo< T1, T2 > & operator+=(const T1 &r)
Compound assignement operator to increment internal value.
virtual std::string render(const bool force=false)
Render the current progression value if changed or forced.
const double & scale() const
Scale that is used between displayed progession range and values.
double progression() const
Current progression value.
virtual std::string erase() const
Erase the last displayed value.
ProgressInfo< T1, T2 > & operator++()
Prefix operator to increment internal value.
ProgressInfo< T1, T2 > operator++(int)
Postfix operator to increment internal value.
The class for EcatSino data write operation.
ProgressInfo< double, double > Progression
MotionWriter & operator<<(MotionWriter &writer, const AffineTransformation3d &thing) __attribute__((__deprecated__("OBSOLETE")))
— OBSOLETE —
bool operator>(const aims::ProgressInfo< T1, T2 > &l, const T1 &r)
bool operator<=(const aims::ProgressInfo< T1, T2 > &l, const T1 &r)
bool operator>=(const aims::ProgressInfo< T1, T2 > &l, const T1 &r)
bool operator<(const aims::ProgressInfo< T1, T2 > &l, const T1 &r)