24 #ifndef _TPIE_PROGRESS_INDICATOR_BASE_H
25 #define _TPIE_PROGRESS_INDICATOR_BASE_H
34 enum description_importance {
93 if (
step >= m_remainingSteps) {
96 m_remainingSteps -=
step;
120 virtual void init(stream_size_type range=0) {
159 void set_time_predictor(execution_time_predictor * p) {m_predictor = p;}
161 std::string estimated_remaining_time() {
162 if (
m_range == 0 || m_predictor == 0)
return "";
163 return m_predictor->estimate_remaining_time(
double(
m_current) /
double(
m_range) );
166 virtual void push_breadcrumb(
const char *, description_importance) {}
167 virtual void pop_breadcrumb() {}
176 stream_size_type m_remainingSteps;
183 refresh_impl * m_refreshImpl;
192 #endif // _TPIE_PROGRESS_INDICATOR_BASE
progress_indicator_base()=delete
Deleted default constructor.
The base class for indicating the progress of some task.
virtual void refresh()=0
Display the indicator.
stream_size_type get_range()
Get the maximum value of the current range.
virtual ~progress_indicator_base()
Destructor.
Execution time predictor used by fractional progress.
virtual void done()
Advance the indicator to the end.
stream_size_type m_current
The current progress count [m_minRange...m_maxRange].
This file contains a few deprecated definitions for legacy code.
Logging functionality and log_level codes for different priorities of log messages.
stream_size_type m_range
The upper bound of the counting range.
virtual void set_range(stream_size_type range)
Set the upper bound of the counting range.
void step(stream_size_type step=1)
Record an increment to the indicator and advance the indicator.
stream_size_type get_current()
Get the current value of the step counter.
void raw_step(stream_size_type step)
Internal method used in fractional progress.
virtual void init(stream_size_type range=0)
Initialize progress indicator.